├── src ├── __init__.py ├── secret.py ├── msequence.py ├── ber.py ├── ccc.py ├── video.py ├── psnr.py ├── dct.py ├── image.py └── watermarking.py ├── .gitignore ├── html ├── _static │ ├── custom.css │ ├── up.png │ ├── down.png │ ├── file.png │ ├── minus.png │ ├── plus.png │ ├── comment.png │ ├── ajax-loader.gif │ ├── up-pressed.png │ ├── comment-close.png │ ├── down-pressed.png │ ├── comment-bright.png │ ├── pygments.css │ ├── doctools.js │ ├── underscore.js │ ├── basic.css │ └── alabaster.css ├── _sources │ ├── modules.txt │ ├── index.txt │ └── src.txt ├── objects.inv ├── .doctrees │ ├── index.doctree │ ├── src.doctree │ ├── modules.doctree │ └── environment.pickle ├── .buildinfo ├── searchindex.js ├── search.html ├── index.html ├── modules.html ├── py-modindex.html └── genindex.html ├── .gitattributes ├── docs ├── _build │ ├── html │ │ ├── _static │ │ │ ├── custom.css │ │ │ ├── down.png │ │ │ ├── file.png │ │ │ ├── plus.png │ │ │ ├── up.png │ │ │ ├── minus.png │ │ │ ├── comment.png │ │ │ ├── ajax-loader.gif │ │ │ ├── up-pressed.png │ │ │ ├── comment-bright.png │ │ │ ├── comment-close.png │ │ │ ├── down-pressed.png │ │ │ ├── pygments.css │ │ │ ├── doctools.js │ │ │ ├── underscore.js │ │ │ └── basic.css │ │ ├── objects.inv │ │ ├── .buildinfo │ │ ├── searchindex.js │ │ ├── _sources │ │ │ ├── index.txt │ │ │ └── src.txt │ │ ├── genindex.html │ │ ├── search.html │ │ ├── index.html │ │ └── src.html │ └── doctrees │ │ ├── src.doctree │ │ ├── index.doctree │ │ └── environment.pickle ├── modules.rst ├── index.rst ├── src.rst ├── Makefile ├── make.bat └── conf.py ├── samples ├── 1.bmp ├── 2.bmp ├── 3.bmp ├── 4.bmp ├── test.bmp ├── divide_video.py ├── BER.py ├── readme.txt ├── correlate.py ├── divide_image_into_blocks.py ├── extract_from_time.py ├── embed_ccc.py ├── PSNR.py ├── embed_in_time.py ├── extract_m_time.py ├── extract_from_freq.py ├── extract_m_freq.py ├── embed_m_time.py ├── embed_in_freq.py └── embed_m_freq.py ├── __init__.py └── LICENSE /src/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | __pycache__/* 3 | src/__pycache__/* 4 | -------------------------------------------------------------------------------- /html/_static/custom.css: -------------------------------------------------------------------------------- 1 | /* This file intentionally left blank. */ 2 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | docs/* linguist-documentation 2 | html/* linguist-documentation -------------------------------------------------------------------------------- /docs/_build/html/_static/custom.css: -------------------------------------------------------------------------------- 1 | /* This file intentionally left blank. */ 2 | -------------------------------------------------------------------------------- /docs/modules.rst: -------------------------------------------------------------------------------- 1 | src 2 | === 3 | 4 | .. toctree:: 5 | :maxdepth: 4 6 | 7 | src 8 | -------------------------------------------------------------------------------- /samples/1.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piraaa/VideoDigitalWatermarking/HEAD/samples/1.bmp -------------------------------------------------------------------------------- /samples/2.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piraaa/VideoDigitalWatermarking/HEAD/samples/2.bmp -------------------------------------------------------------------------------- /samples/3.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piraaa/VideoDigitalWatermarking/HEAD/samples/3.bmp -------------------------------------------------------------------------------- /samples/4.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piraaa/VideoDigitalWatermarking/HEAD/samples/4.bmp -------------------------------------------------------------------------------- /html/_sources/modules.txt: -------------------------------------------------------------------------------- 1 | src 2 | === 3 | 4 | .. toctree:: 5 | :maxdepth: 4 6 | 7 | src 8 | -------------------------------------------------------------------------------- /html/objects.inv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piraaa/VideoDigitalWatermarking/HEAD/html/objects.inv -------------------------------------------------------------------------------- /samples/test.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piraaa/VideoDigitalWatermarking/HEAD/samples/test.bmp -------------------------------------------------------------------------------- /html/_static/up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piraaa/VideoDigitalWatermarking/HEAD/html/_static/up.png -------------------------------------------------------------------------------- /html/_static/down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piraaa/VideoDigitalWatermarking/HEAD/html/_static/down.png -------------------------------------------------------------------------------- /html/_static/file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piraaa/VideoDigitalWatermarking/HEAD/html/_static/file.png -------------------------------------------------------------------------------- /html/_static/minus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piraaa/VideoDigitalWatermarking/HEAD/html/_static/minus.png -------------------------------------------------------------------------------- /html/_static/plus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piraaa/VideoDigitalWatermarking/HEAD/html/_static/plus.png -------------------------------------------------------------------------------- /html/_static/comment.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piraaa/VideoDigitalWatermarking/HEAD/html/_static/comment.png -------------------------------------------------------------------------------- /docs/_build/html/objects.inv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piraaa/VideoDigitalWatermarking/HEAD/docs/_build/html/objects.inv -------------------------------------------------------------------------------- /html/.doctrees/index.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piraaa/VideoDigitalWatermarking/HEAD/html/.doctrees/index.doctree -------------------------------------------------------------------------------- /html/.doctrees/src.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piraaa/VideoDigitalWatermarking/HEAD/html/.doctrees/src.doctree -------------------------------------------------------------------------------- /html/_static/ajax-loader.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piraaa/VideoDigitalWatermarking/HEAD/html/_static/ajax-loader.gif -------------------------------------------------------------------------------- /html/_static/up-pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piraaa/VideoDigitalWatermarking/HEAD/html/_static/up-pressed.png -------------------------------------------------------------------------------- /html/.doctrees/modules.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piraaa/VideoDigitalWatermarking/HEAD/html/.doctrees/modules.doctree -------------------------------------------------------------------------------- /html/_static/comment-close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piraaa/VideoDigitalWatermarking/HEAD/html/_static/comment-close.png -------------------------------------------------------------------------------- /html/_static/down-pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piraaa/VideoDigitalWatermarking/HEAD/html/_static/down-pressed.png -------------------------------------------------------------------------------- /docs/_build/doctrees/src.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piraaa/VideoDigitalWatermarking/HEAD/docs/_build/doctrees/src.doctree -------------------------------------------------------------------------------- /docs/_build/html/_static/down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piraaa/VideoDigitalWatermarking/HEAD/docs/_build/html/_static/down.png -------------------------------------------------------------------------------- /docs/_build/html/_static/file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piraaa/VideoDigitalWatermarking/HEAD/docs/_build/html/_static/file.png -------------------------------------------------------------------------------- /docs/_build/html/_static/plus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piraaa/VideoDigitalWatermarking/HEAD/docs/_build/html/_static/plus.png -------------------------------------------------------------------------------- /docs/_build/html/_static/up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piraaa/VideoDigitalWatermarking/HEAD/docs/_build/html/_static/up.png -------------------------------------------------------------------------------- /html/.doctrees/environment.pickle: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piraaa/VideoDigitalWatermarking/HEAD/html/.doctrees/environment.pickle -------------------------------------------------------------------------------- /html/_static/comment-bright.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piraaa/VideoDigitalWatermarking/HEAD/html/_static/comment-bright.png -------------------------------------------------------------------------------- /docs/_build/doctrees/index.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piraaa/VideoDigitalWatermarking/HEAD/docs/_build/doctrees/index.doctree -------------------------------------------------------------------------------- /docs/_build/html/_static/minus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piraaa/VideoDigitalWatermarking/HEAD/docs/_build/html/_static/minus.png -------------------------------------------------------------------------------- /docs/_build/html/_static/comment.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piraaa/VideoDigitalWatermarking/HEAD/docs/_build/html/_static/comment.png -------------------------------------------------------------------------------- /docs/_build/doctrees/environment.pickle: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piraaa/VideoDigitalWatermarking/HEAD/docs/_build/doctrees/environment.pickle -------------------------------------------------------------------------------- /docs/_build/html/_static/ajax-loader.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piraaa/VideoDigitalWatermarking/HEAD/docs/_build/html/_static/ajax-loader.gif -------------------------------------------------------------------------------- /docs/_build/html/_static/up-pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piraaa/VideoDigitalWatermarking/HEAD/docs/_build/html/_static/up-pressed.png -------------------------------------------------------------------------------- /docs/_build/html/_static/comment-bright.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piraaa/VideoDigitalWatermarking/HEAD/docs/_build/html/_static/comment-bright.png -------------------------------------------------------------------------------- /docs/_build/html/_static/comment-close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piraaa/VideoDigitalWatermarking/HEAD/docs/_build/html/_static/comment-close.png -------------------------------------------------------------------------------- /docs/_build/html/_static/down-pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piraaa/VideoDigitalWatermarking/HEAD/docs/_build/html/_static/down-pressed.png -------------------------------------------------------------------------------- /html/.buildinfo: -------------------------------------------------------------------------------- 1 | # Sphinx build info version 1 2 | # This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. 3 | config: 4 | tags: 5 | -------------------------------------------------------------------------------- /samples/divide_video.py: -------------------------------------------------------------------------------- 1 | # 2 | # divide_video.py 3 | # Created by pira on 2017/08/07. 4 | # 5 | 6 | #coding: utf-8 7 | 8 | from VideoDigitalWatermarking import * 9 | 10 | filename = 'test.mp4' 11 | video2image(filename, n=5) -------------------------------------------------------------------------------- /docs/_build/html/.buildinfo: -------------------------------------------------------------------------------- 1 | # Sphinx build info version 1 2 | # This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. 3 | config: 896f75e0df310f5f0ec05c22662a773f 4 | tags: 645f666f9bcd5a90fca523b33c5a78b7 5 | -------------------------------------------------------------------------------- /samples/BER.py: -------------------------------------------------------------------------------- 1 | # 2 | # BER.py 3 | # Created by pira on 2017/08/15. 4 | # 5 | 6 | #coding: utf-8 7 | 8 | from VideoDigitalWatermarking import * 9 | 10 | data1 = [1,0,1,0,1,0,1,0] 11 | data2 = [1,1,1,1,0,0,0,0] 12 | ber = calcBER(data1, data2) 13 | print('BER =', ber, '[%]') -------------------------------------------------------------------------------- /samples/readme.txt: -------------------------------------------------------------------------------- 1 | These sample programs can not be executed in this folder. 2 | Please move to the same directory as the VideoDigitalWatermarking library before running these programs. 3 | 4 | これらのサンプルプログラムはこのフォルダでは実行できません. 5 | プログラムを実行する前に,VideoDigitalWatermarkingライブラリと同じディレクトリに移動してください. 6 | 7 | by. pira 2017/08/07 -------------------------------------------------------------------------------- /samples/correlate.py: -------------------------------------------------------------------------------- 1 | # 2 | # correlate.py 3 | # Created by pira on 2017/08/15. 4 | # 5 | 6 | #coding: utf-8 7 | 8 | from VideoDigitalWatermarking import * 9 | 10 | #test 11 | x=[1,-1,1] 12 | y=[1,-1,1] 13 | 14 | cycle = correlate(x, y, CYCLE) 15 | noncylcle = correlate(x, y, NON_CYCLE) 16 | 17 | print('CYCLE =', cycle) 18 | print('NON CYCLE =', noncylcle) -------------------------------------------------------------------------------- /src/secret.py: -------------------------------------------------------------------------------- 1 | # 2 | # secret.py 3 | # Created by pira on 2017/08/09. 4 | # 5 | 6 | #coding: utf-8 7 | u"""For Secret informations.""" 8 | 9 | import random 10 | import numpy as np 11 | 12 | def generateSecret(n): 13 | u"""Generate 0 or 1 random secret information for simulation. 14 | @param n : length 15 | @return secret : secret information list 16 | """ 17 | secret = np.random.randint(2, size =n) 18 | return secret 19 | -------------------------------------------------------------------------------- /docs/_build/html/searchindex.js: -------------------------------------------------------------------------------- 1 | Search.setIndex({envversion:50,filenames:["index","src"],objects:{},objnames:{},objtypes:{},terms:{content:[],index:0,modul:[],page:0,search:0},titles:["Welcome to VideoDigitalWatermarking’s documentation!","src package"],titleterms:{avi:1,ber:1,ccc:1,content:1,dct:1,document:0,esequ:1,imag:1,indice:0,modul:1,msequenc:1,packag:1,psnr:1,src:1,submodul:1,tabl:0,video:1,videodigitalwatermark:[0,1],watermark:1,welcom:0}}) -------------------------------------------------------------------------------- /__init__.py: -------------------------------------------------------------------------------- 1 | from VideoDigitalWatermarking.src.ber import * 2 | from VideoDigitalWatermarking.src.ccc import * 3 | from VideoDigitalWatermarking.src.dct import * 4 | from VideoDigitalWatermarking.src.image import * 5 | from VideoDigitalWatermarking.src.msequence import * 6 | from VideoDigitalWatermarking.src.psnr import * 7 | from VideoDigitalWatermarking.src.secret import * 8 | from VideoDigitalWatermarking.src.video import * 9 | from VideoDigitalWatermarking.src.watermarking import * -------------------------------------------------------------------------------- /samples/divide_image_into_blocks.py: -------------------------------------------------------------------------------- 1 | # 2 | # divide_image_into_blocks.py 3 | # Created by pira on 2017/08/15. 4 | # 5 | 6 | #coding: utf-8 7 | 8 | from VideoDigitalWatermarking import * 9 | 10 | filename = 'test.bmp' 11 | image = readColorImage(filename) 12 | 13 | blocks = colorimage2block(image, [128,128]) 14 | #print(blocks.shape) 15 | 16 | for i in np.arange(blocks.shape[0]): 17 | for j in np.arange(blocks.shape[1]): 18 | writeImage(str(i*blocks.shape[1]+j+1) + '.bmp', blocks[i][j]) -------------------------------------------------------------------------------- /samples/extract_from_time.py: -------------------------------------------------------------------------------- 1 | # 2 | # extract_from_time.py 3 | # Created by pira on 2017/08/09. 4 | # 5 | 6 | #coding: utf-8 7 | 8 | from VideoDigitalWatermarking import * 9 | 10 | fn_cover = 'test.bmp' 11 | fn_stego = 'test_embeded.bmp' 12 | 13 | rgb_cover = readColorImage(fn_cover) 14 | rgb_stego = readColorImage(fn_stego) 15 | 16 | red_cover = getRgbLayer(rgb_cover, rgb=RED) 17 | red_stego = getRgbLayer(rgb_stego, rgb=RED) 18 | 19 | secret_data = extractBitReplace(red_cover, red_stego, 8, bit=1, interval=0) 20 | print(secret_data) -------------------------------------------------------------------------------- /docs/index.rst: -------------------------------------------------------------------------------- 1 | .. VideoDigitalWatermarking documentation master file, created by 2 | sphinx-quickstart on Sun Aug 6 17:09:04 2017. 3 | You can adapt this file completely to your liking, but it should at least 4 | contain the root `toctree` directive. 5 | 6 | Welcome to VideoDigitalWatermarking's documentation! 7 | ==================================================== 8 | 9 | Contents: 10 | 11 | .. toctree:: 12 | :maxdepth: 2 13 | 14 | 15 | 16 | Indices and tables 17 | ================== 18 | 19 | * :ref:`genindex` 20 | * :ref:`modindex` 21 | * :ref:`search` 22 | 23 | -------------------------------------------------------------------------------- /html/_sources/index.txt: -------------------------------------------------------------------------------- 1 | .. VideoDigitalWatermarking documentation master file, created by 2 | sphinx-quickstart on Sun Aug 6 17:09:04 2017. 3 | You can adapt this file completely to your liking, but it should at least 4 | contain the root `toctree` directive. 5 | 6 | Welcome to VideoDigitalWatermarking's documentation! 7 | ==================================================== 8 | 9 | Contents: 10 | 11 | .. toctree:: 12 | :maxdepth: 2 13 | 14 | 15 | 16 | Indices and tables 17 | ================== 18 | 19 | * :ref:`genindex` 20 | * :ref:`modindex` 21 | * :ref:`search` 22 | 23 | -------------------------------------------------------------------------------- /docs/_build/html/_sources/index.txt: -------------------------------------------------------------------------------- 1 | .. VideoDigitalWatermarking documentation master file, created by 2 | sphinx-quickstart on Sun Aug 6 17:09:04 2017. 3 | You can adapt this file completely to your liking, but it should at least 4 | contain the root `toctree` directive. 5 | 6 | Welcome to VideoDigitalWatermarking's documentation! 7 | ==================================================== 8 | 9 | Contents: 10 | 11 | .. toctree:: 12 | :maxdepth: 2 13 | 14 | 15 | 16 | Indices and tables 17 | ================== 18 | 19 | * :ref:`genindex` 20 | * :ref:`modindex` 21 | * :ref:`search` 22 | 23 | -------------------------------------------------------------------------------- /samples/embed_ccc.py: -------------------------------------------------------------------------------- 1 | # 2 | # embed_ccc.py 3 | # Created by pira on 2017/08/14. 4 | # 5 | 6 | #coding: utf-8 7 | 8 | from VideoDigitalWatermarking import * 9 | 10 | secret_data = [1,1,1,1,0,0,0,0] 11 | secret_length = len(secret_data) 12 | 13 | print('CCC') 14 | ccc = generateCCC(2) 15 | print(ccc, '\n') 16 | 17 | #Embed 18 | basic = createBasicSeq(ccc, secret_length, tau=1, ch=1) 19 | print('basic = ', basic, '\n') 20 | 21 | es = createEmbedSeq(basic, secret_data, a=1, tau=1) 22 | print('Embed Sequence =', es, '\n') 23 | 24 | #Extract 25 | secret = extractCCC(ccc, es, secret_length, tau=1, ch=1) 26 | print('secret =', secret) -------------------------------------------------------------------------------- /samples/PSNR.py: -------------------------------------------------------------------------------- 1 | # 2 | # PSNR.py 3 | # Created by pira on 2017/08/15. 4 | # 5 | 6 | #coding: utf-8 7 | 8 | from VideoDigitalWatermarking import * 9 | import numpy as np 10 | 11 | a = np.array([[[11,10,10],[20,20,20],[30,30,30]],[[10,10,10],[20,20,20],[30,30,30]],[[10,10,10],[20,20,20],[30,30,30]]]) 12 | b = np.array([[[10,10,10],[20,20,20],[30,30,30]],[[10,10,10],[20,20,20],[30,30,30]],[[10,10,10],[20,20,20],[30,30,30]]]) 13 | c = np.array([[[10,10,10],[20,20,20],[30,30,30]],[[10,10,10],[20,20,20],[30,30,30]],[[10,10,10],[20,20,20],[30,30,30]]]) 14 | 15 | psnr = calcPSNR(a, b) 16 | print('PSNR =', psnr, '[dB]') 17 | 18 | psnr = calcPSNR(b, c) 19 | print('PSNR =', psnr, '[dB]') -------------------------------------------------------------------------------- /samples/embed_in_time.py: -------------------------------------------------------------------------------- 1 | # 2 | # embed_in_time.py 3 | # Created by pira on 2017/08/09. 4 | # 5 | 6 | #coding: utf-8 7 | 8 | from VideoDigitalWatermarking import * 9 | 10 | fnin = 'test.bmp' 11 | fnout = 'test_embeded.bmp' 12 | 13 | secret_data = [1,1,1,1,0,0,0,0] 14 | 15 | rgb_data = readColorImage(fnin) 16 | red_data = getRgbLayer(rgb_data, rgb=RED) 17 | embeded_red_data = embedBitReplace(red_data, secret_data, bit=1, interval=0) 18 | 19 | #replace red_data to embeded_red_data 20 | height = red_data.shape[0] 21 | width = red_data.shape[1] 22 | for i in np.arange(height): 23 | for j in np.arange(width): 24 | rgb_data[i][j][RED] = embeded_red_data[i][j] 25 | 26 | writeImage(fnout, rgb_data) 27 | -------------------------------------------------------------------------------- /samples/extract_m_time.py: -------------------------------------------------------------------------------- 1 | # 2 | # extract_m_time.py 3 | # Created by pira on 2017/08/15. 4 | # 5 | 6 | #coding: utf-8 7 | 8 | from VideoDigitalWatermarking import * 9 | import math 10 | 11 | fn_cover = 'test.bmp' 12 | fn_stego = 'test_embeded.bmp' 13 | 14 | secret_length = 7 #secret infomation length 15 | N = math.ceil(math.log2(secret_length+1)) 16 | m = generateM(N) 17 | 18 | print('m =', m, '\n') 19 | 20 | rgb_cover = readColorImage(fn_cover) 21 | rgb_stego = readColorImage(fn_stego) 22 | 23 | red_cover = getRgbLayer(rgb_cover, rgb=RED) 24 | red_stego = getRgbLayer(rgb_stego, rgb=RED) 25 | 26 | secret_data = extractMseq(red_cover, red_stego, secret_length, m, tau=1) 27 | print(secret_data) 28 | -------------------------------------------------------------------------------- /samples/extract_from_freq.py: -------------------------------------------------------------------------------- 1 | # 2 | # extract_from_freq.py 3 | # Created by pira on 2017/08/04. 4 | # 5 | 6 | #coding: utf-8 7 | 8 | from VideoDigitalWatermarking import * 9 | 10 | fn_cover = 'test.bmp' 11 | fn_stego = 'test_embeded.bmp' 12 | 13 | rgb_cover = readColorImage(fn_cover) 14 | rgb_stego = readColorImage(fn_stego) 15 | 16 | #print(rgb_cover[0][0], rgb_stego[0][0]) 17 | 18 | ycc_cover = rgb2ycc(rgb_cover) 19 | ycc_stego = rgb2ycc(rgb_stego) 20 | y_cover = get_y(ycc_cover) 21 | y_stego = get_y(ycc_stego) 22 | dct_cover = dct_dim2(y_cover) 23 | dct_stego = dct_dim2(y_stego) 24 | 25 | #print(dct_cover[0][0], dct_stego[0][0]) 26 | 27 | secret_data = extractBitReplace(dct_cover, dct_stego, 8, bit=5, interval=100) 28 | print(secret_data) -------------------------------------------------------------------------------- /src/msequence.py: -------------------------------------------------------------------------------- 1 | # 2 | # msequence.py 3 | # Created by pira on 2017/07/28. 4 | # 5 | 6 | #coding: utf-8 7 | u"""For M-Sequence.""" 8 | 9 | import numpy as np 10 | 11 | def generateM(N): 12 | u"""Create M-Sequence. 13 | @param N : length 2**N-1 14 | @return m : M-Sequence 15 | """ 16 | 17 | p = pow(2, N) 18 | m = [0] * (p-1) 19 | 20 | for i in np.arange(1,p,2): 21 | f = p^i 22 | a = p 23 | #i = int() 24 | for j in np.arange(N, p): 25 | if (a&p) == p: 26 | a ^= f 27 | if a == 1: 28 | break 29 | a <<= 1 30 | if j == p-1: 31 | init = 1 32 | lfsr = init & (p-1) 33 | f >>= 1 34 | for k in np.arange(0, p-1): 35 | lfsr = (lfsr>>1)^(-(int)(lfsr&1) & f) 36 | m[k] = (lfsr&1) * 2-1 37 | return m 38 | 39 | #test 40 | #m = generateM(3) 41 | #print(m) -------------------------------------------------------------------------------- /samples/extract_m_freq.py: -------------------------------------------------------------------------------- 1 | # 2 | # extract_m_freq.py 3 | # Created by pira on 2017/08/16. 4 | # 5 | 6 | #coding: utf-8 7 | 8 | from VideoDigitalWatermarking import * 9 | import math 10 | 11 | 12 | fn_cover = 'test.bmp' 13 | fn_stego = 'test_embeded.bmp' 14 | 15 | secret_length = 7 #secret infomation length 16 | 17 | N = math.ceil(math.log2(secret_length+1)) 18 | m = generateM(N) 19 | 20 | print('m =', m, '\n') 21 | 22 | rgb_cover = readColorImage(fn_cover) 23 | rgb_stego = readColorImage(fn_stego) 24 | 25 | ycc_cover = rgb2ycc(rgb_cover) 26 | ycc_stego = rgb2ycc(rgb_stego) 27 | y_cover = get_y(ycc_cover) 28 | y_stego = get_y(ycc_stego) 29 | dct_cover = dct_dim2(y_cover) 30 | dct_stego = dct_dim2(y_stego) 31 | 32 | secret_data = extractMseq(dct_cover, dct_stego, secret_length, m, tau=1) 33 | print(secret_data) 34 | -------------------------------------------------------------------------------- /src/ber.py: -------------------------------------------------------------------------------- 1 | # 2 | # ber.py 3 | # Created by pira on 2017/08/05. 4 | # 5 | 6 | #coding: utf-8 7 | u"""Calculate BER(Bit Error Rate).""" 8 | 9 | import sys 10 | 11 | def calcBER(data1, data2): 12 | u"""Calculate Bit Error Rate. 13 | @param data1 : result data 14 | @param data2 : answer data 15 | @return ber : bit error rate [%] 16 | """ 17 | if len(data1) != len(data2): 18 | print('The input data have different length.') 19 | print('Please give data with the same length.') 20 | sys.exit() 21 | 22 | error_bits = 0 23 | for (d1,d2) in zip(data1,data2): 24 | if d1 != d2: 25 | error_bits += 1 26 | 27 | data_len = len(data1) 28 | ber = (error_bits / data_len) * 100 29 | 30 | return ber 31 | 32 | #test 33 | #data1 = [1,0,1,0,1,0,1,0] 34 | #data2 = [1,1,1,1,0,0,0,0] 35 | #ber = calcBER(data1, data2) 36 | #print('BER =', ber, '[%]') 37 | -------------------------------------------------------------------------------- /samples/embed_m_time.py: -------------------------------------------------------------------------------- 1 | # 2 | # embed_m_time.py 3 | # Created by pira on 2017/08/15. 4 | # 5 | 6 | #coding: utf-8 7 | 8 | from VideoDigitalWatermarking import * 9 | import numpy as np 10 | import math 11 | 12 | fnin = 'test.bmp' 13 | fnout = 'test_embeded.bmp' 14 | 15 | secret_data = [1,1,1,1,0,0,0] 16 | 17 | secret_length = len(secret_data) 18 | N = math.ceil(math.log2(secret_length+1)) 19 | m = generateM(N) 20 | 21 | print('m =', m, '\n') 22 | 23 | rgb_data = readColorImage(fnin) 24 | red_data = getRgbLayer(rgb_data, rgb=RED) 25 | embeded_red_data = embedMseq(red_data, secret_data, m, a=1, tau=1) 26 | 27 | #replace red_data to embeded red_data 28 | height = red_data.shape[0] 29 | width = red_data.shape[1] 30 | for i in np.arange(height): 31 | for j in np.arange(width): 32 | rgb_data[i][j][RED] = embeded_red_data[i][j] 33 | 34 | writeImage(fnout, rgb_data) 35 | -------------------------------------------------------------------------------- /samples/embed_in_freq.py: -------------------------------------------------------------------------------- 1 | # 2 | # embed_in_freq.py 3 | # Created by pira on 2017/08/01. 4 | # 5 | 6 | #coding: utf-8 7 | 8 | from VideoDigitalWatermarking import * 9 | 10 | fnin = 'test.bmp' 11 | fnout = 'test_embeded.bmp' 12 | 13 | secret_data = [1,1,1,1,0,0,0,0] 14 | 15 | rgb_data = readColorImage(fnin) 16 | ycc_data = rgb2ycc(rgb_data) 17 | y_data = get_y(ycc_data) 18 | dct_data = dct_dim2(y_data) 19 | embeded_dct_y_data = embedBitReplace(dct_data, secret_data, bit=5, interval=100) 20 | embeded_y_data = idct_dim2(embeded_dct_y_data) 21 | 22 | #replace y_data to embeded_y_data 23 | height = ycc_data.shape[0] 24 | width = ycc_data.shape[1] 25 | for i in np.arange(height): 26 | for j in np.arange(width): 27 | ycc_data[i][j][0] = embeded_y_data[i][j] 28 | 29 | embeded_rgb_data = ycc2rgb(ycc_data) 30 | 31 | #print(rgb_data[0][0], embeded_rgb_data[0][0]) 32 | 33 | writeImage(fnout, embeded_rgb_data) 34 | -------------------------------------------------------------------------------- /samples/embed_m_freq.py: -------------------------------------------------------------------------------- 1 | # 2 | # embed_m_freq.py 3 | # Created by pira on 2017/08/16. 4 | # 5 | 6 | #coding: utf-8 7 | 8 | from VideoDigitalWatermarking import * 9 | import numpy as np 10 | import math 11 | 12 | fnin = 'test.bmp' 13 | fnout = 'test_embeded.bmp' 14 | 15 | secret_data = [1,1,1,1,0,0,0] 16 | 17 | secret_length = len(secret_data) 18 | 19 | N = math.ceil(math.log2(secret_length+1)) 20 | m = generateM(N) 21 | 22 | print('m =', m, '\n') 23 | 24 | rgb_data = readColorImage(fnin) 25 | ycc_data = rgb2ycc(rgb_data) 26 | y_data = get_y(ycc_data) 27 | dct_data = dct_dim2(y_data) 28 | embeded_dct_y_data = embedMseq(dct_data, secret_data, m, a=100, tau=1) 29 | embeded_y_data = idct_dim2(embeded_dct_y_data) 30 | 31 | #replace y_data to embeded_y_data 32 | height = ycc_data.shape[0] 33 | width = ycc_data.shape[1] 34 | for i in np.arange(height): 35 | for j in np.arange(width): 36 | ycc_data[i][j][0] = embeded_y_data[i][j] 37 | 38 | embeded_rgb_data = ycc2rgb(ycc_data) 39 | 40 | writeImage(fnout, embeded_rgb_data) 41 | -------------------------------------------------------------------------------- /src/ccc.py: -------------------------------------------------------------------------------- 1 | # 2 | # ccc.py 3 | # Created by pira on 2017/07/28. 4 | # 5 | 6 | #coding: utf-8 7 | u"""For Complete Complementary Code.""" 8 | 9 | import numpy as np 10 | from numpy import random 11 | from numpy import diag 12 | import sys 13 | 14 | #CCC(N,N,N**2)を生成 15 | def generateCCC(N): 16 | u"""Create CCC. 17 | @param N : CCC size 18 | @return CCC : CCC(N,N,N**2) 19 | """ 20 | 21 | #対角成分 22 | random.seed(N) 23 | r = np.array(random.choice([1,-1],N)) 24 | if sum(r) == N or sum(r) == -N: 25 | sys.stderr.write('ERROR: invalid seed number.') 26 | sys.exit(-1) 27 | 28 | #アダマール行列を生成 29 | H = np.array([[(-1)**bin(i&j).count('1') for i in np.arange(N)] for j in np.arange(N)]) 30 | 31 | #CCCを生成 32 | CCC = np.empty((N,N,N*N)) 33 | A = np.dot(H,diag(r)) 34 | B = np.dot(diag(r),H) 35 | for i in np.arange(N): 36 | for j in np.arange(N): 37 | for k in np.arange(N): 38 | a = A[i,k] 39 | for l in np.arange(N): 40 | CCC[i,j,N*k+l] = a*H[k,l]*B[j,l] 41 | return CCC 42 | 43 | #test 44 | #ccc = generateCCC(2) 45 | #print(ccc) -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 pira 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /src/video.py: -------------------------------------------------------------------------------- 1 | # 2 | # video.py 3 | # Created by pira on 2017/07/31. 4 | # 5 | 6 | #coding: utf-8 7 | u"""For video processing.""" 8 | 9 | import numpy as np 10 | import cv2 11 | 12 | def video2image(filename, n=0): 13 | u"""Read mpeg video and divide into jpeg images. 14 | @param filename : video filename 15 | @param n : number of export images (if n=0, this function exports all images in video.) 16 | @return count : number of exported images 17 | """ 18 | count = 1 19 | fnin = filename[:filename.rfind('.')] #拡張子をとったファイル名を取得 20 | 21 | cap = cv2.VideoCapture(filename) 22 | 23 | if n == 0: 24 | n = int(cap.get(7)) #CV_CAP_PROP_FRAME_COUNT 25 | fps = round(cap.get(5)) #CV_CAP_PROP_FPS 26 | height = int(cap.get(4)) #CV_CAP_PROP_FRAME_HEIGHT 27 | width = int(cap.get(3)) #CV_CAP_PROP_FRAME_WIDTH 28 | 29 | print('frame num =', n) 30 | print('fps =', fps) 31 | print('hright =', height) 32 | print('width =', width, '\n') 33 | 34 | for i in np.arange(n): 35 | count = i+1 36 | fnout = '%06d' % count 37 | fnout = fnin + fnout + '.jpg' 38 | ret, frame = cap.read() 39 | cv2.imwrite(fnout, frame) 40 | 41 | print('Export', count, 'jpeg Images.') 42 | return count 43 | 44 | #filename = 'test.mov' 45 | #n = video2image(filename, ) 46 | #print(n) -------------------------------------------------------------------------------- /docs/src.rst: -------------------------------------------------------------------------------- 1 | src package 2 | =========== 3 | 4 | Submodules 5 | ---------- 6 | 7 | src.ber module 8 | -------------- 9 | 10 | .. automodule:: src.ber 11 | :members: 12 | :undoc-members: 13 | :show-inheritance: 14 | 15 | src.ccc module 16 | -------------- 17 | 18 | .. automodule:: src.ccc 19 | :members: 20 | :undoc-members: 21 | :show-inheritance: 22 | 23 | src.dct module 24 | -------------- 25 | 26 | .. automodule:: src.dct 27 | :members: 28 | :undoc-members: 29 | :show-inheritance: 30 | 31 | src.image module 32 | ---------------- 33 | 34 | .. automodule:: src.image 35 | :members: 36 | :undoc-members: 37 | :show-inheritance: 38 | 39 | src.msequence module 40 | -------------------- 41 | 42 | .. automodule:: src.msequence 43 | :members: 44 | :undoc-members: 45 | :show-inheritance: 46 | 47 | src.psnr module 48 | --------------- 49 | 50 | .. automodule:: src.psnr 51 | :members: 52 | :undoc-members: 53 | :show-inheritance: 54 | 55 | src.secret module 56 | ----------------- 57 | 58 | .. automodule:: src.secret 59 | :members: 60 | :undoc-members: 61 | :show-inheritance: 62 | 63 | src.video module 64 | ---------------- 65 | 66 | .. automodule:: src.video 67 | :members: 68 | :undoc-members: 69 | :show-inheritance: 70 | 71 | src.watermarking module 72 | ----------------------- 73 | 74 | .. automodule:: src.watermarking 75 | :members: 76 | :undoc-members: 77 | :show-inheritance: 78 | 79 | 80 | Module contents 81 | --------------- 82 | 83 | .. automodule:: src 84 | :members: 85 | :undoc-members: 86 | :show-inheritance: 87 | -------------------------------------------------------------------------------- /html/_sources/src.txt: -------------------------------------------------------------------------------- 1 | src package 2 | =========== 3 | 4 | Submodules 5 | ---------- 6 | 7 | src.ber module 8 | -------------- 9 | 10 | .. automodule:: src.ber 11 | :members: 12 | :undoc-members: 13 | :show-inheritance: 14 | 15 | src.ccc module 16 | -------------- 17 | 18 | .. automodule:: src.ccc 19 | :members: 20 | :undoc-members: 21 | :show-inheritance: 22 | 23 | src.dct module 24 | -------------- 25 | 26 | .. automodule:: src.dct 27 | :members: 28 | :undoc-members: 29 | :show-inheritance: 30 | 31 | src.image module 32 | ---------------- 33 | 34 | .. automodule:: src.image 35 | :members: 36 | :undoc-members: 37 | :show-inheritance: 38 | 39 | src.msequence module 40 | -------------------- 41 | 42 | .. automodule:: src.msequence 43 | :members: 44 | :undoc-members: 45 | :show-inheritance: 46 | 47 | src.psnr module 48 | --------------- 49 | 50 | .. automodule:: src.psnr 51 | :members: 52 | :undoc-members: 53 | :show-inheritance: 54 | 55 | src.secret module 56 | ----------------- 57 | 58 | .. automodule:: src.secret 59 | :members: 60 | :undoc-members: 61 | :show-inheritance: 62 | 63 | src.video module 64 | ---------------- 65 | 66 | .. automodule:: src.video 67 | :members: 68 | :undoc-members: 69 | :show-inheritance: 70 | 71 | src.watermarking module 72 | ----------------------- 73 | 74 | .. automodule:: src.watermarking 75 | :members: 76 | :undoc-members: 77 | :show-inheritance: 78 | 79 | 80 | Module contents 81 | --------------- 82 | 83 | .. automodule:: src 84 | :members: 85 | :undoc-members: 86 | :show-inheritance: 87 | -------------------------------------------------------------------------------- /docs/_build/html/_sources/src.txt: -------------------------------------------------------------------------------- 1 | src package 2 | =========== 3 | 4 | Submodules 5 | ---------- 6 | 7 | VideoDigitalWatermarking.src.avi module 8 | -------------- 9 | 10 | .. automodule:: src.avi 11 | :members: 12 | :undoc-members: 13 | :show-inheritance: 14 | 15 | src.ber module 16 | -------------- 17 | 18 | .. automodule:: src.ber 19 | :members: 20 | :undoc-members: 21 | :show-inheritance: 22 | 23 | src.ccc module 24 | -------------- 25 | 26 | .. automodule:: src.ccc 27 | :members: 28 | :undoc-members: 29 | :show-inheritance: 30 | 31 | src.dct module 32 | -------------- 33 | 34 | .. automodule:: src.dct 35 | :members: 36 | :undoc-members: 37 | :show-inheritance: 38 | 39 | src.esequence module 40 | -------------------- 41 | 42 | .. automodule:: src.esequence 43 | :members: 44 | :undoc-members: 45 | :show-inheritance: 46 | 47 | src.image module 48 | ---------------- 49 | 50 | .. automodule:: src.image 51 | :members: 52 | :undoc-members: 53 | :show-inheritance: 54 | 55 | src.msequence module 56 | -------------------- 57 | 58 | .. automodule:: src.msequence 59 | :members: 60 | :undoc-members: 61 | :show-inheritance: 62 | 63 | src.psnr module 64 | --------------- 65 | 66 | .. automodule:: src.psnr 67 | :members: 68 | :undoc-members: 69 | :show-inheritance: 70 | 71 | src.video module 72 | ---------------- 73 | 74 | .. automodule:: src.video 75 | :members: 76 | :undoc-members: 77 | :show-inheritance: 78 | 79 | src.watermarking module 80 | ----------------------- 81 | 82 | .. automodule:: src.watermarking 83 | :members: 84 | :undoc-members: 85 | :show-inheritance: 86 | 87 | 88 | Module contents 89 | --------------- 90 | 91 | .. automodule:: src 92 | :members: 93 | :undoc-members: 94 | :show-inheritance: 95 | -------------------------------------------------------------------------------- /src/psnr.py: -------------------------------------------------------------------------------- 1 | # 2 | # psnr.py 3 | # Created by pira on 2017/08/05. 4 | # 5 | 6 | #coding: utf-8 7 | u"""For calculate PSNR(Peak Signal to Noise Ratio).""" 8 | 9 | import math 10 | import sys 11 | import numpy as np 12 | 13 | from VideoDigitalWatermarking.src.image import getRgbLayer 14 | 15 | def calcPSNR(cover, stego): 16 | u"""Calculate PSNR. 17 | @param cover : cover image 18 | @param stego : stego image 19 | @return psnr : PSNR [dB] 20 | """ 21 | 22 | #if cover and stego are RGB color images: 23 | if np.ndim(cover) == np.ndim(stego) == 3: 24 | layer_num = 3 25 | #elif cover and stego are gray images: 26 | elif np.ndim(cover) == np.ndim(stego) == 2: 27 | layer_num = 1 28 | else: 29 | print('Please give an appropriate images.') 30 | print('You can use only 3 dimensoin RGB image or 2 dimension gray image.') 31 | sys.exit() 32 | 33 | p = 255 #maximum value of RGB 34 | mse = 0 35 | 36 | for i in np.arange(layer_num): 37 | mse += _calcMSE(getRgbLayer(cover,i), getRgbLayer(stego,i)) 38 | 39 | mse = mse/layer_num 40 | 41 | if mse == 0: 42 | return float('-inf') 43 | 44 | psnr = 10 * (math.log10(p**2) - math.log10(mse)) 45 | 46 | return psnr 47 | 48 | def _calcMSE(cover, stego): 49 | if cover.shape[0] == stego.shape[0] and cover.shape[1] == stego.shape[1]: 50 | height = cover.shape[0] 51 | width = cover.shape[1] 52 | else: 53 | print('Please give an appropriate images.') 54 | print('Cover image and stego image are not the same size.') 55 | sys.exit() 56 | 57 | mse = 0 58 | for i in np.arange(height): 59 | for j in np.arange(width): 60 | mse += (cover[i][j] - stego[i][j])**2 61 | mse = (1/(height*width)) * mse 62 | return mse 63 | 64 | #test 65 | #a = np.array([[[11,10,10],[20,20,20],[30,30,30]],[[10,10,10],[20,20,20],[30,30,30]],[[10,10,10],[20,20,20],[30,30,30]]]) 66 | #b = np.array([[[10,10,10],[20,20,20],[30,30,30]],[[10,10,10],[20,20,20],[30,30,30]],[[10,10,10],[20,20,20],[30,30,30]]]) 67 | #psnr = calcPSNR(a, b) 68 | #print('psnr =', psnr) 69 | -------------------------------------------------------------------------------- /src/dct.py: -------------------------------------------------------------------------------- 1 | # 2 | # dct.py 3 | # Created by pira on 2017/07/31. 4 | # 5 | 6 | #coding: utf-8 7 | u"""For Discrete Cosine Transform.""" 8 | 9 | import numpy as np 10 | import math 11 | 12 | def dct_dim1(data): 13 | u"""1 dimension DCT. 14 | @param data : 1 dimension data 15 | @return data : 1 dimension data conversion by DCT 16 | """ 17 | N = len(data) 18 | data = data.reshape(N,1) 19 | dct_matrix = _get_dctMatrix(N) 20 | dct_data = dct_matrix.dot(data) 21 | dct_data = dct_data.reshape(N) 22 | return dct_data 23 | 24 | def idct_dim1(data): 25 | u"""1 dimension IDCT. 26 | @param data : 1 dimension data 27 | @return data : 1 dimension data conversion by IDCT 28 | """ 29 | N = len(data) 30 | data = data.reshape(N,1) 31 | idct_matrix = _get_dctMatrix(N).T 32 | idct_data = idct_matrix.dot(data) 33 | idct_data = idct_data.reshape(N) 34 | return idct_data 35 | 36 | def dct_dim2(data): 37 | u"""2 dimension DCT. 38 | @param data : 2 dimension data 39 | @return data : 2 dimension data conversion by DCT 40 | """ 41 | height = data.shape[0] 42 | width = data.shape[1] 43 | dct_data = np.empty((height,width)) 44 | dct_matrix = _get_dctMatrix(height) 45 | dct_data = dct_matrix.dot(data) 46 | dct_matrix = _get_dctMatrix(width).T 47 | dct_data = dct_data.dot(dct_matrix) 48 | return dct_data 49 | 50 | def idct_dim2(data): 51 | u"""2 dimension IDCT. 52 | @param data : 2 dimension data 53 | @return data : 2 dimension data conversion by IDCT 54 | """ 55 | height = data.shape[0] 56 | width = data.shape[1] 57 | idct_data = np.empty((height,width)) 58 | idct_matrix = _get_dctMatrix(height).T 59 | idct_data = idct_matrix.dot(data) 60 | idct_matrix = _get_dctMatrix(width) 61 | idct_data = idct_data.dot(idct_matrix) 62 | return idct_data 63 | 64 | 65 | def _get_dctMatrix(N): 66 | dct_matrix = np.empty((N,N)) 67 | for k in np.arange(N): 68 | for n in np.arange(N): 69 | if k==0: 70 | dct_matrix[k][n] = 1/np.sqrt(N) 71 | else: 72 | dct_matrix[k][n] = math.sqrt(2/N)*np.cos((2*n+1)*k*np.pi/(2*N)) 73 | return dct_matrix 74 | -------------------------------------------------------------------------------- /docs/_build/html/genindex.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | Index — VideoDigitalWatermarking 1.0 documentation 11 | 12 | 13 | 14 | 15 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 |
39 |
40 |
41 |
42 | 43 | 44 |

Index

45 | 46 |
47 | 48 |
49 | 50 | 51 |
52 |
53 |
54 | 77 |
78 |
79 | 87 | 88 | 89 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /html/searchindex.js: -------------------------------------------------------------------------------- 1 | Search.setIndex({envversion:50,filenames:["index","modules","src"],objects:{"":{src:[2,0,0,"-"]},"src.ber":{calcBER:[2,1,1,""]},"src.ccc":{generateCCC:[2,1,1,""]},"src.dct":{dct_dim1:[2,1,1,""],dct_dim2:[2,1,1,""],idct_dim1:[2,1,1,""],idct_dim2:[2,1,1,""]},"src.image":{colorimage2block:[2,1,1,""],getRgbLayer:[2,1,1,""],get_y:[2,1,1,""],grayimage2block:[2,1,1,""],readColorImage:[2,1,1,""],readGrayImage:[2,1,1,""],rgb2ycc:[2,1,1,""],showImage:[2,1,1,""],writeImage:[2,1,1,""],ycc2rgb:[2,1,1,""]},"src.msequence":{generateM:[2,1,1,""]},"src.psnr":{calcPSNR:[2,1,1,""]},"src.secret":{generateSecret:[2,1,1,""]},"src.video":{video2image:[2,1,1,""]},"src.watermarking":{correlate:[2,1,1,""],createBasicSeq:[2,1,1,""],createEmbedSeq:[2,1,1,""],embedBitReplace:[2,1,1,""],embedMseq:[2,1,1,""],extractBitReplace:[2,1,1,""],extractCCC:[2,1,1,""],extractMseq:[2,1,1,""],minus2zero:[2,1,1,""],zero2minus:[2,1,1,""]},src:{ber:[2,0,0,"-"],ccc:[2,0,0,"-"],dct:[2,0,0,"-"],image:[2,0,0,"-"],msequence:[2,0,0,"-"],psnr:[2,0,0,"-"],secret:[2,0,0,"-"],video:[2,0,0,"-"],watermarking:[2,0,0,"-"]}},objnames:{"0":["py","module","Python module"],"1":["py","function","Python function"]},objtypes:{"0":"py:module","1":"py:function"},terms:{"default":2,"export":2,"function":2,"return":2,all:2,also:2,answer:2,arrai:2,basic:2,bgr:2,bit:2,block:2,block_height:2,block_width:2,blue:2,calcber:2,calcpsnr:2,calcul:2,can:2,chack:2,chang:2,channel:2,close:2,code:2,color:2,colorimage2block:2,colornam:2,complementari:2,complet:2,content:[],convers:2,convert:2,correl:2,cosin:2,count:2,cover:2,creat:2,createbasicseq:2,createembedseq:2,cycl:2,cycle:2,data1:2,data2:2,data:2,dct_dim1:2,dct_dim2:2,dimens:2,dimension:2,discret:2,divid:2,docstr:[],ebm:2,emb:2,embed:2,embedbitreplac:2,embedccc:[],embedmseq:2,error:2,even:[],excract:2,extract:2,extractbitreplac:2,extractccc:2,extractmseq:2,filenam:2,from:2,gener:2,generateccc:2,generatee:[],generatem:2,generatesecret:2,get:2,get_i:2,getrgblay:2,give:2,grai:2,grayimage2block:2,grayscal:2,green:2,height:2,idct:2,idct_dim1:2,idct_dim2:2,image2video:[],img:2,imsg:2,inag:[],include:2,index:0,inform:2,interv:2,jpeg:2,layer:2,length:2,like:2,list:2,lsb:2,markdown:[],minus2zero:2,minus_data:2,modul:[],mpeg:2,ndarrai:2,nois:2,non_cycle:2,non_sycle:2,notic:2,number:2,numpi:2,onli:2,orthogon:[],page:0,param:2,peak:2,pixel:2,process:2,random:2,rate:2,ratio:2,read:2,readcolorimag:2,readgrayimag:2,recommend:2,red:2,replac:2,repres:2,result:2,rgb2ycc:2,rgb:2,rgb_data:2,search:0,secret:[],secret_data:2,secret_length:2,sequenc:2,shift:2,show:2,showimag:2,showvideo:[],signal:2,simul:2,size:2,spectrum:2,spread:2,srego:2,stego:2,stlength:2,strength:2,tau:2,thi:2,transform:2,treat:2,valu:2,video2imag:2,width:2,writeimag:2,y_data:2,ycbcr:2,ycc2rgb:2,ycc:2,ycc_data:2,you:2,zero2minu:2,zero_data:2},titles:["Welcome to VideoDigitalWatermarking’s documentation!","src","src package"],titleterms:{avi:[],ber:2,ccc:2,content:2,dct:2,docstr:[],document:0,esequ:[],imag:2,indice:0,modul:2,msequenc:2,packag:2,psnr:2,secret:2,src:[1,2],submodul:2,tabl:0,video:2,videodigitalwatermark:0,watermark:2,welcom:0}}) -------------------------------------------------------------------------------- /html/search.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Search — VideoDigitalWatermarking 1.0 documentation 10 | 11 | 12 | 13 | 14 | 23 | 24 | 25 | 26 | 27 | 28 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 |
46 |
47 |
48 |
49 | 50 |

Search

51 |
52 | 53 |

54 | Please activate JavaScript to enable the search 55 | functionality. 56 |

57 |
58 |

59 | From here you can search these documents. Enter your search 60 | words into the box below and click "search". Note that the search 61 | function will automatically search for all of the words. Pages 62 | containing fewer words won't appear in the result list. 63 |

64 |
65 | 66 | 67 | 68 |
69 | 70 |
71 | 72 |
73 | 74 |
75 |
76 |
77 | 87 |
88 |
89 | 97 | 98 | 99 | 100 | 101 | 102 | -------------------------------------------------------------------------------- /docs/_build/html/search.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Search — VideoDigitalWatermarking 1.0 documentation 10 | 11 | 12 | 13 | 14 | 23 | 24 | 25 | 26 | 27 | 28 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 |
46 |
47 |
48 |
49 | 50 |

Search

51 |
52 | 53 |

54 | Please activate JavaScript to enable the search 55 | functionality. 56 |

57 |
58 |

59 | From here you can search these documents. Enter your search 60 | words into the box below and click "search". Note that the search 61 | function will automatically search for all of the words. Pages 62 | containing fewer words won't appear in the result list. 63 |

64 |
65 | 66 | 67 | 68 |
69 | 70 |
71 | 72 |
73 | 74 |
75 |
76 |
77 | 87 |
88 |
89 | 97 | 98 | 99 | 100 | 101 | 102 | -------------------------------------------------------------------------------- /html/_static/pygments.css: -------------------------------------------------------------------------------- 1 | .highlight .hll { background-color: #ffffcc } 2 | .highlight { background: #eeffcc; } 3 | .highlight .c { color: #408090; font-style: italic } /* Comment */ 4 | .highlight .err { border: 1px solid #FF0000 } /* Error */ 5 | .highlight .k { color: #007020; font-weight: bold } /* Keyword */ 6 | .highlight .o { color: #666666 } /* Operator */ 7 | .highlight .ch { color: #408090; font-style: italic } /* Comment.Hashbang */ 8 | .highlight .cm { color: #408090; font-style: italic } /* Comment.Multiline */ 9 | .highlight .cp { color: #007020 } /* Comment.Preproc */ 10 | .highlight .cpf { color: #408090; font-style: italic } /* Comment.PreprocFile */ 11 | .highlight .c1 { color: #408090; font-style: italic } /* Comment.Single */ 12 | .highlight .cs { color: #408090; background-color: #fff0f0 } /* Comment.Special */ 13 | .highlight .gd { color: #A00000 } /* Generic.Deleted */ 14 | .highlight .ge { font-style: italic } /* Generic.Emph */ 15 | .highlight .gr { color: #FF0000 } /* Generic.Error */ 16 | .highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */ 17 | .highlight .gi { color: #00A000 } /* Generic.Inserted */ 18 | .highlight .go { color: #333333 } /* Generic.Output */ 19 | .highlight .gp { color: #c65d09; font-weight: bold } /* Generic.Prompt */ 20 | .highlight .gs { font-weight: bold } /* Generic.Strong */ 21 | .highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */ 22 | .highlight .gt { color: #0044DD } /* Generic.Traceback */ 23 | .highlight .kc { color: #007020; font-weight: bold } /* Keyword.Constant */ 24 | .highlight .kd { color: #007020; font-weight: bold } /* Keyword.Declaration */ 25 | .highlight .kn { color: #007020; font-weight: bold } /* Keyword.Namespace */ 26 | .highlight .kp { color: #007020 } /* Keyword.Pseudo */ 27 | .highlight .kr { color: #007020; font-weight: bold } /* Keyword.Reserved */ 28 | .highlight .kt { color: #902000 } /* Keyword.Type */ 29 | .highlight .m { color: #208050 } /* Literal.Number */ 30 | .highlight .s { color: #4070a0 } /* Literal.String */ 31 | .highlight .na { color: #4070a0 } /* Name.Attribute */ 32 | .highlight .nb { color: #007020 } /* Name.Builtin */ 33 | .highlight .nc { color: #0e84b5; font-weight: bold } /* Name.Class */ 34 | .highlight .no { color: #60add5 } /* Name.Constant */ 35 | .highlight .nd { color: #555555; font-weight: bold } /* Name.Decorator */ 36 | .highlight .ni { color: #d55537; font-weight: bold } /* Name.Entity */ 37 | .highlight .ne { color: #007020 } /* Name.Exception */ 38 | .highlight .nf { color: #06287e } /* Name.Function */ 39 | .highlight .nl { color: #002070; font-weight: bold } /* Name.Label */ 40 | .highlight .nn { color: #0e84b5; font-weight: bold } /* Name.Namespace */ 41 | .highlight .nt { color: #062873; font-weight: bold } /* Name.Tag */ 42 | .highlight .nv { color: #bb60d5 } /* Name.Variable */ 43 | .highlight .ow { color: #007020; font-weight: bold } /* Operator.Word */ 44 | .highlight .w { color: #bbbbbb } /* Text.Whitespace */ 45 | .highlight .mb { color: #208050 } /* Literal.Number.Bin */ 46 | .highlight .mf { color: #208050 } /* Literal.Number.Float */ 47 | .highlight .mh { color: #208050 } /* Literal.Number.Hex */ 48 | .highlight .mi { color: #208050 } /* Literal.Number.Integer */ 49 | .highlight .mo { color: #208050 } /* Literal.Number.Oct */ 50 | .highlight .sb { color: #4070a0 } /* Literal.String.Backtick */ 51 | .highlight .sc { color: #4070a0 } /* Literal.String.Char */ 52 | .highlight .sd { color: #4070a0; font-style: italic } /* Literal.String.Doc */ 53 | .highlight .s2 { color: #4070a0 } /* Literal.String.Double */ 54 | .highlight .se { color: #4070a0; font-weight: bold } /* Literal.String.Escape */ 55 | .highlight .sh { color: #4070a0 } /* Literal.String.Heredoc */ 56 | .highlight .si { color: #70a0d0; font-style: italic } /* Literal.String.Interpol */ 57 | .highlight .sx { color: #c65d09 } /* Literal.String.Other */ 58 | .highlight .sr { color: #235388 } /* Literal.String.Regex */ 59 | .highlight .s1 { color: #4070a0 } /* Literal.String.Single */ 60 | .highlight .ss { color: #517918 } /* Literal.String.Symbol */ 61 | .highlight .bp { color: #007020 } /* Name.Builtin.Pseudo */ 62 | .highlight .vc { color: #bb60d5 } /* Name.Variable.Class */ 63 | .highlight .vg { color: #bb60d5 } /* Name.Variable.Global */ 64 | .highlight .vi { color: #bb60d5 } /* Name.Variable.Instance */ 65 | .highlight .il { color: #208050 } /* Literal.Number.Integer.Long */ -------------------------------------------------------------------------------- /docs/_build/html/_static/pygments.css: -------------------------------------------------------------------------------- 1 | .highlight .hll { background-color: #ffffcc } 2 | .highlight { background: #eeffcc; } 3 | .highlight .c { color: #408090; font-style: italic } /* Comment */ 4 | .highlight .err { border: 1px solid #FF0000 } /* Error */ 5 | .highlight .k { color: #007020; font-weight: bold } /* Keyword */ 6 | .highlight .o { color: #666666 } /* Operator */ 7 | .highlight .ch { color: #408090; font-style: italic } /* Comment.Hashbang */ 8 | .highlight .cm { color: #408090; font-style: italic } /* Comment.Multiline */ 9 | .highlight .cp { color: #007020 } /* Comment.Preproc */ 10 | .highlight .cpf { color: #408090; font-style: italic } /* Comment.PreprocFile */ 11 | .highlight .c1 { color: #408090; font-style: italic } /* Comment.Single */ 12 | .highlight .cs { color: #408090; background-color: #fff0f0 } /* Comment.Special */ 13 | .highlight .gd { color: #A00000 } /* Generic.Deleted */ 14 | .highlight .ge { font-style: italic } /* Generic.Emph */ 15 | .highlight .gr { color: #FF0000 } /* Generic.Error */ 16 | .highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */ 17 | .highlight .gi { color: #00A000 } /* Generic.Inserted */ 18 | .highlight .go { color: #333333 } /* Generic.Output */ 19 | .highlight .gp { color: #c65d09; font-weight: bold } /* Generic.Prompt */ 20 | .highlight .gs { font-weight: bold } /* Generic.Strong */ 21 | .highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */ 22 | .highlight .gt { color: #0044DD } /* Generic.Traceback */ 23 | .highlight .kc { color: #007020; font-weight: bold } /* Keyword.Constant */ 24 | .highlight .kd { color: #007020; font-weight: bold } /* Keyword.Declaration */ 25 | .highlight .kn { color: #007020; font-weight: bold } /* Keyword.Namespace */ 26 | .highlight .kp { color: #007020 } /* Keyword.Pseudo */ 27 | .highlight .kr { color: #007020; font-weight: bold } /* Keyword.Reserved */ 28 | .highlight .kt { color: #902000 } /* Keyword.Type */ 29 | .highlight .m { color: #208050 } /* Literal.Number */ 30 | .highlight .s { color: #4070a0 } /* Literal.String */ 31 | .highlight .na { color: #4070a0 } /* Name.Attribute */ 32 | .highlight .nb { color: #007020 } /* Name.Builtin */ 33 | .highlight .nc { color: #0e84b5; font-weight: bold } /* Name.Class */ 34 | .highlight .no { color: #60add5 } /* Name.Constant */ 35 | .highlight .nd { color: #555555; font-weight: bold } /* Name.Decorator */ 36 | .highlight .ni { color: #d55537; font-weight: bold } /* Name.Entity */ 37 | .highlight .ne { color: #007020 } /* Name.Exception */ 38 | .highlight .nf { color: #06287e } /* Name.Function */ 39 | .highlight .nl { color: #002070; font-weight: bold } /* Name.Label */ 40 | .highlight .nn { color: #0e84b5; font-weight: bold } /* Name.Namespace */ 41 | .highlight .nt { color: #062873; font-weight: bold } /* Name.Tag */ 42 | .highlight .nv { color: #bb60d5 } /* Name.Variable */ 43 | .highlight .ow { color: #007020; font-weight: bold } /* Operator.Word */ 44 | .highlight .w { color: #bbbbbb } /* Text.Whitespace */ 45 | .highlight .mb { color: #208050 } /* Literal.Number.Bin */ 46 | .highlight .mf { color: #208050 } /* Literal.Number.Float */ 47 | .highlight .mh { color: #208050 } /* Literal.Number.Hex */ 48 | .highlight .mi { color: #208050 } /* Literal.Number.Integer */ 49 | .highlight .mo { color: #208050 } /* Literal.Number.Oct */ 50 | .highlight .sb { color: #4070a0 } /* Literal.String.Backtick */ 51 | .highlight .sc { color: #4070a0 } /* Literal.String.Char */ 52 | .highlight .sd { color: #4070a0; font-style: italic } /* Literal.String.Doc */ 53 | .highlight .s2 { color: #4070a0 } /* Literal.String.Double */ 54 | .highlight .se { color: #4070a0; font-weight: bold } /* Literal.String.Escape */ 55 | .highlight .sh { color: #4070a0 } /* Literal.String.Heredoc */ 56 | .highlight .si { color: #70a0d0; font-style: italic } /* Literal.String.Interpol */ 57 | .highlight .sx { color: #c65d09 } /* Literal.String.Other */ 58 | .highlight .sr { color: #235388 } /* Literal.String.Regex */ 59 | .highlight .s1 { color: #4070a0 } /* Literal.String.Single */ 60 | .highlight .ss { color: #517918 } /* Literal.String.Symbol */ 61 | .highlight .bp { color: #007020 } /* Name.Builtin.Pseudo */ 62 | .highlight .vc { color: #bb60d5 } /* Name.Variable.Class */ 63 | .highlight .vg { color: #bb60d5 } /* Name.Variable.Global */ 64 | .highlight .vi { color: #bb60d5 } /* Name.Variable.Instance */ 65 | .highlight .il { color: #208050 } /* Literal.Number.Integer.Long */ -------------------------------------------------------------------------------- /html/index.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Welcome to VideoDigitalWatermarking’s documentation! — VideoDigitalWatermarking 1.0 documentation 10 | 11 | 12 | 13 | 14 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 |
38 |
39 |
40 |
41 | 42 |
43 |

Welcome to VideoDigitalWatermarking’s documentation!

44 |

Contents:

45 |
46 |
47 |
48 |
49 |

Indices and tables

50 | 55 |
56 | 57 | 58 |
59 |
60 |
61 | 94 |
95 |
96 | 107 | 108 | 109 | 110 | 111 | 112 | -------------------------------------------------------------------------------- /docs/_build/html/index.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Welcome to VideoDigitalWatermarking’s documentation! — VideoDigitalWatermarking 1.0 documentation 10 | 11 | 12 | 13 | 14 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 |
38 |
39 |
40 |
41 | 42 |
43 |

Welcome to VideoDigitalWatermarking’s documentation!

44 |

Contents:

45 |
46 |
47 |
48 |
49 |

Indices and tables

50 | 55 |
56 | 57 | 58 |
59 |
60 |
61 | 94 |
95 |
96 | 107 | 108 | 109 | 110 | 111 | 112 | -------------------------------------------------------------------------------- /html/modules.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | src — VideoDigitalWatermarking 1.0 documentation 10 | 11 | 12 | 13 | 14 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 |
38 |
39 |
40 |
41 | 42 | 63 | 64 | 65 |
66 |
67 |
68 | 95 |
96 |
97 | 108 | 109 | 110 | 111 | 112 | 113 | -------------------------------------------------------------------------------- /html/py-modindex.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Python Module Index — VideoDigitalWatermarking 1.0 documentation 10 | 11 | 12 | 13 | 14 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 |
41 |
42 |
43 |
44 | 45 | 46 |

Python Module Index

47 | 48 |
49 | s 50 |
51 | 52 | 53 | 54 | 56 | 57 | 59 | 62 | 63 | 64 | 67 | 68 | 69 | 72 | 73 | 74 | 77 | 78 | 79 | 82 | 83 | 84 | 87 | 88 | 89 | 92 | 93 | 94 | 97 | 98 | 99 | 102 | 103 | 104 | 107 |
 
55 | s
60 | src 61 |
    65 | src.ber 66 |
    70 | src.ccc 71 |
    75 | src.dct 76 |
    80 | src.image 81 |
    85 | src.msequence 86 |
    90 | src.psnr 91 |
    95 | src.secret 96 |
    100 | src.video 101 |
    105 | src.watermarking 106 |
108 | 109 | 110 |
111 |
112 |
113 | 133 |
134 |
135 | 143 | 144 | 145 | 146 | 147 | 148 | -------------------------------------------------------------------------------- /docs/_build/html/src.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | src package — VideoDigitalWatermarking 1.0 documentation 10 | 11 | 12 | 13 | 14 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 |
38 |
39 |
40 |
41 | 42 |
43 |

src package

44 |
45 |

Submodules

46 |
47 |
48 |

VideoDigitalWatermarking.src.avi module

49 |
50 |
51 |

src.ber module

52 |
53 |
54 |

src.ccc module

55 |
56 |
57 |

src.dct module

58 |
59 |
60 |

src.esequence module

61 |
62 |
63 |

src.image module

64 |
65 |
66 |

src.msequence module

67 |
68 |
69 |

src.psnr module

70 |
71 |
72 |

src.video module

73 |
74 |
75 |

src.watermarking module

76 |
77 |
78 |

Module contents

79 |
80 |
81 | 82 | 83 |
84 |
85 |
86 | 132 |
133 |
134 | 145 | 146 | 147 | 148 | 149 | 150 | -------------------------------------------------------------------------------- /src/image.py: -------------------------------------------------------------------------------- 1 | # 2 | # image.py 3 | # Created by pira on 2017/07/28. 4 | # 5 | 6 | #coding: utf-8 7 | u"""For image processing.""" 8 | 9 | import sys 10 | import numpy as np 11 | import cv2 12 | 13 | RED = 2 14 | GREEN = 1 15 | BLUE = 0 16 | 17 | def readGrayImage(filename): 18 | u"""Read grayscale image. 19 | @param filename : filename 20 | @return img : 2 dimension np.ndarray[Height][Width] 21 | """ 22 | #imread flags=0(cv2.IMREAD_GRAYSCALE):GrayScale 23 | img = cv2.imread(filename, cv2.IMREAD_GRAYSCALE) 24 | print('Read "' + filename + '".') 25 | return img 26 | 27 | def readColorImage(filename): 28 | u"""Read color image. [notice] Grayscale images are treated as RGB image. (ex. if pixel value is 100, it's treated [100][100][100] RGB image.) 29 | @param filename : filename 30 | @return img : 3 dimension np.ndarray[Height][Width][BGR] 31 | """ 32 | #imread flags>0(cv2.IMREAD_COLOR):3ChannelColors 33 | #白黒画像でも強制的にRGBで扱ってしまう. 34 | img = cv2.imread(filename, cv2.IMREAD_COLOR) 35 | print('Read "' + filename + '".') 36 | return img 37 | 38 | def getRgbLayer(img, rgb=RED): 39 | u"""Read grayscale image. 40 | @param img : a 3 dimension color image like np.ndarray[Height][Width][BGR] 41 | @param rgb : a returned layer number. Blue is 0, Green is 1 and Red is 2. You can also give a colorname like RED. 42 | @return layer : a color layer of image, only red, green or blue. 43 | """ 44 | height = img.shape[0] 45 | width = img.shape[1] 46 | layer = np.empty([height, width]) 47 | 48 | for i in np.arange(height): 49 | for j in np.arange(width): 50 | layer[i][j] = img[i][j][rgb] 51 | 52 | return layer 53 | 54 | def writeImage(filename, img): 55 | u"""Export image data. 56 | @param filename : filename for export image data 57 | @param img : 2 or 3 dimension image array 58 | """ 59 | cv2.imwrite(filename, img) 60 | print('Write "'+filename+'".') 61 | 62 | def showImage(img): 63 | u"""Show imsge data. 64 | @param img : image array 65 | """ 66 | cv2.imshow('Image', img) 67 | cv2.waitKey(0) 68 | cv2.destroyAllWindows() 69 | 70 | def grayimage2block(img, size): 71 | u"""Divide gray image into blocks. 72 | @param img : a 2 dimension gray image like a np.array[height][width] 73 | @param size : block size list like a [height, width] 74 | @return blocks : a 4 dimension blocks like a np.ndarray[block_height][block_width][height][width] 75 | """ 76 | image_height = int(img.shape[0]) 77 | image_width = int(img.shape[1]) 78 | block_height = int(size[0]) 79 | block_width = int(size[1]) 80 | 81 | #print(image_height, image_width, block_height, block_width) 82 | 83 | if image_height%block_height != 0 or image_width%block_width != 0: 84 | print('Please give an appropriate bloxk size.') 85 | print('You can use only numbers that are divisors of image height and width as block size.') 86 | sys.exit() 87 | 88 | row = int(image_height / block_height) 89 | col = int(image_width / block_width) 90 | blocks = np.empty([row, col, block_height, block_width]) 91 | #print('blocks shape =', blocks.shape) 92 | 93 | for i in np.arange(row): 94 | for j in np.arange(col): 95 | for k in np.arange(block_height): 96 | for l in np.arange(block_width): 97 | blocks[i][j][k][l] = img[i*block_height+k][j*block_width+l] 98 | 99 | return blocks 100 | 101 | def grayblock2image(blocks): 102 | u"""Convert the blocks to a gray image.. 103 | @param blocks : a 4 dimension gray image such as np.ndarray[block_y][block_x][block_height][block_width] 104 | @return image : an image array. 105 | """ 106 | block_y, block_x, block_height, block_width = blocks.shape 107 | 108 | image = np.empty((0,block_x*block_width), int) 109 | 110 | for x in blocks: 111 | col_block = np.empty((block_height,0), int) 112 | for block in x: 113 | col_block = np.concatenate([col_block, block], axis=1) 114 | image = np.concatenate([image, col_block], axis=0) 115 | 116 | return image 117 | 118 | def colorimage2block(img, size): 119 | u"""Divide color image into blocks. 120 | @param img : a 3 dimension image like a np.array[height][width][BGR] 121 | @param size : block size list like a [height, width] 122 | @return blocks : a 5 dimension blocks like a np.ndarray[block_height][block_width][height][width][BGR] 123 | """ 124 | image_height = int(img.shape[0]) 125 | image_width = int(img.shape[1]) 126 | block_height = int(size[0]) 127 | block_width = int(size[1]) 128 | color_num = int(img.shape[2]) 129 | 130 | #print(image_height, image_width, block_height, block_width) 131 | 132 | if image_height%block_height != 0 or image_width%block_width != 0: 133 | print('Please give an appropriate bloxk size.') 134 | print('You can use only numbers that are divisors of image height and width as block size.') 135 | sys.exit() 136 | 137 | row = int(image_height / block_height) 138 | col = int(image_width / block_width) 139 | blocks = np.empty([row, col, block_height, block_width, color_num]) 140 | 141 | #print('blocks shape =', blocks.shape) 142 | 143 | for i in np.arange(row): 144 | for j in np.arange(col): 145 | for k in np.arange(block_height): 146 | for l in np.arange(block_width): 147 | for rgb in np.arange(color_num): 148 | blocks[i][j][k][l][rgb] = img[i*block_height+k][j*block_width+l][rgb] 149 | 150 | return blocks 151 | 152 | def rgb2ycc(img): 153 | u"""RGB to YCbCr. 154 | @param img : 3 dimension np.ndarray[Height][Width][RGB] 155 | @return ycc_data : 3 dimension np.ndarray[Height][Width][YCC] 156 | """ 157 | height = img.shape[0] 158 | width = img.shape[1] 159 | ycc_data = np.empty([height,width,3]) 160 | for i in np.arange(height): 161 | for j in np.arange(width): 162 | ycc_data[i][j][0] = 0.299*img[i][j][2] + 0.587*img[i][j][1] + 0.114*img[i][j][0] #Y 163 | ycc_data[i][j][1] = -0.169*img[i][j][2] - 0.331*img[i][j][1] + 0.500*img[i][j][0] #Cb 164 | ycc_data[i][j][2] = 0.500*img[i][j][2] - 0.419*img[i][j][1] - 0.081*img[i][j][0] #Cr 165 | return ycc_data 166 | 167 | def ycc2rgb(img): 168 | u"""YCbCr to BGR. 169 | @param img : 3 dimension np.ndarray[Height][Width][YCC] 170 | @return rgb_data : 3 dimension np.ndarray[Height][Width][BGR] 171 | """ 172 | height = img.shape[0] 173 | width = img.shape[1] 174 | rgb_data = np.empty([height,width,3]) 175 | for i in np.arange(height): 176 | for j in np.arange(width): 177 | rgb_data[i][j][0] = img[i][j][0] + 1.772*img[i][j][1] #B 178 | rgb_data[i][j][1] = img[i][j][0] - 0.344*img[i][j][1] - 0.714*img[i][j][2] #G 179 | rgb_data[i][j][2] = img[i][j][0] + 1.402*img[i][j][2] #R 180 | return rgb_data 181 | 182 | def get_y(img): 183 | u"""Get only Y from YCC image. 184 | @param img : 3 dimension np.ndarray[Height][Width][YCC] 185 | @return y_data : 2 dimension np.ndarray[Height][Width]. Including only Y. 186 | """ 187 | height = img.shape[0] 188 | width = img.shape[1] 189 | y_data = np.empty([height,width]) 190 | for i in np.arange(height): 191 | for j in np.arange(width): 192 | y_data[i][j] = img[i][j][0] 193 | return y_data 194 | 195 | -------------------------------------------------------------------------------- /docs/Makefile: -------------------------------------------------------------------------------- 1 | # Makefile for Sphinx documentation 2 | # 3 | 4 | # You can set these variables from the command line. 5 | SPHINXOPTS = 6 | SPHINXBUILD = sphinx-build 7 | PAPER = 8 | BUILDDIR = _build 9 | 10 | # Internal variables. 11 | PAPEROPT_a4 = -D latex_paper_size=a4 12 | PAPEROPT_letter = -D latex_paper_size=letter 13 | ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . 14 | # the i18n builder cannot share the environment and doctrees with the others 15 | I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . 16 | 17 | .PHONY: help 18 | help: 19 | @echo "Please use \`make ' where is one of" 20 | @echo " html to make standalone HTML files" 21 | @echo " dirhtml to make HTML files named index.html in directories" 22 | @echo " singlehtml to make a single large HTML file" 23 | @echo " pickle to make pickle files" 24 | @echo " json to make JSON files" 25 | @echo " htmlhelp to make HTML files and a HTML help project" 26 | @echo " qthelp to make HTML files and a qthelp project" 27 | @echo " applehelp to make an Apple Help Book" 28 | @echo " devhelp to make HTML files and a Devhelp project" 29 | @echo " epub to make an epub" 30 | @echo " epub3 to make an epub3" 31 | @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" 32 | @echo " latexpdf to make LaTeX files and run them through pdflatex" 33 | @echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx" 34 | @echo " text to make text files" 35 | @echo " man to make manual pages" 36 | @echo " texinfo to make Texinfo files" 37 | @echo " info to make Texinfo files and run them through makeinfo" 38 | @echo " gettext to make PO message catalogs" 39 | @echo " changes to make an overview of all changed/added/deprecated items" 40 | @echo " xml to make Docutils-native XML files" 41 | @echo " pseudoxml to make pseudoxml-XML files for display purposes" 42 | @echo " linkcheck to check all external links for integrity" 43 | @echo " doctest to run all doctests embedded in the documentation (if enabled)" 44 | @echo " coverage to run coverage check of the documentation (if enabled)" 45 | @echo " dummy to check syntax errors of document sources" 46 | 47 | .PHONY: clean 48 | clean: 49 | rm -rf $(BUILDDIR)/* 50 | 51 | .PHONY: html 52 | html: 53 | $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html 54 | @echo 55 | @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." 56 | 57 | .PHONY: dirhtml 58 | dirhtml: 59 | $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml 60 | @echo 61 | @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." 62 | 63 | .PHONY: singlehtml 64 | singlehtml: 65 | $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml 66 | @echo 67 | @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." 68 | 69 | .PHONY: pickle 70 | pickle: 71 | $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle 72 | @echo 73 | @echo "Build finished; now you can process the pickle files." 74 | 75 | .PHONY: json 76 | json: 77 | $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json 78 | @echo 79 | @echo "Build finished; now you can process the JSON files." 80 | 81 | .PHONY: htmlhelp 82 | htmlhelp: 83 | $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp 84 | @echo 85 | @echo "Build finished; now you can run HTML Help Workshop with the" \ 86 | ".hhp project file in $(BUILDDIR)/htmlhelp." 87 | 88 | .PHONY: qthelp 89 | qthelp: 90 | $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp 91 | @echo 92 | @echo "Build finished; now you can run "qcollectiongenerator" with the" \ 93 | ".qhcp project file in $(BUILDDIR)/qthelp, like this:" 94 | @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/VideoDigitalWatermarking.qhcp" 95 | @echo "To view the help file:" 96 | @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/VideoDigitalWatermarking.qhc" 97 | 98 | .PHONY: applehelp 99 | applehelp: 100 | $(SPHINXBUILD) -b applehelp $(ALLSPHINXOPTS) $(BUILDDIR)/applehelp 101 | @echo 102 | @echo "Build finished. The help book is in $(BUILDDIR)/applehelp." 103 | @echo "N.B. You won't be able to view it unless you put it in" \ 104 | "~/Library/Documentation/Help or install it in your application" \ 105 | "bundle." 106 | 107 | .PHONY: devhelp 108 | devhelp: 109 | $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp 110 | @echo 111 | @echo "Build finished." 112 | @echo "To view the help file:" 113 | @echo "# mkdir -p $$HOME/.local/share/devhelp/VideoDigitalWatermarking" 114 | @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/VideoDigitalWatermarking" 115 | @echo "# devhelp" 116 | 117 | .PHONY: epub 118 | epub: 119 | $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub 120 | @echo 121 | @echo "Build finished. The epub file is in $(BUILDDIR)/epub." 122 | 123 | .PHONY: epub3 124 | epub3: 125 | $(SPHINXBUILD) -b epub3 $(ALLSPHINXOPTS) $(BUILDDIR)/epub3 126 | @echo 127 | @echo "Build finished. The epub3 file is in $(BUILDDIR)/epub3." 128 | 129 | .PHONY: latex 130 | latex: 131 | $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex 132 | @echo 133 | @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." 134 | @echo "Run \`make' in that directory to run these through (pdf)latex" \ 135 | "(use \`make latexpdf' here to do that automatically)." 136 | 137 | .PHONY: latexpdf 138 | latexpdf: 139 | $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex 140 | @echo "Running LaTeX files through pdflatex..." 141 | $(MAKE) -C $(BUILDDIR)/latex all-pdf 142 | @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." 143 | 144 | .PHONY: latexpdfja 145 | latexpdfja: 146 | $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex 147 | @echo "Running LaTeX files through platex and dvipdfmx..." 148 | $(MAKE) -C $(BUILDDIR)/latex all-pdf-ja 149 | @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." 150 | 151 | .PHONY: text 152 | text: 153 | $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text 154 | @echo 155 | @echo "Build finished. The text files are in $(BUILDDIR)/text." 156 | 157 | .PHONY: man 158 | man: 159 | $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man 160 | @echo 161 | @echo "Build finished. The manual pages are in $(BUILDDIR)/man." 162 | 163 | .PHONY: texinfo 164 | texinfo: 165 | $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo 166 | @echo 167 | @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." 168 | @echo "Run \`make' in that directory to run these through makeinfo" \ 169 | "(use \`make info' here to do that automatically)." 170 | 171 | .PHONY: info 172 | info: 173 | $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo 174 | @echo "Running Texinfo files through makeinfo..." 175 | make -C $(BUILDDIR)/texinfo info 176 | @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." 177 | 178 | .PHONY: gettext 179 | gettext: 180 | $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale 181 | @echo 182 | @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale." 183 | 184 | .PHONY: changes 185 | changes: 186 | $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes 187 | @echo 188 | @echo "The overview file is in $(BUILDDIR)/changes." 189 | 190 | .PHONY: linkcheck 191 | linkcheck: 192 | $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck 193 | @echo 194 | @echo "Link check complete; look for any errors in the above output " \ 195 | "or in $(BUILDDIR)/linkcheck/output.txt." 196 | 197 | .PHONY: doctest 198 | doctest: 199 | $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest 200 | @echo "Testing of doctests in the sources finished, look at the " \ 201 | "results in $(BUILDDIR)/doctest/output.txt." 202 | 203 | .PHONY: coverage 204 | coverage: 205 | $(SPHINXBUILD) -b coverage $(ALLSPHINXOPTS) $(BUILDDIR)/coverage 206 | @echo "Testing of coverage in the sources finished, look at the " \ 207 | "results in $(BUILDDIR)/coverage/python.txt." 208 | 209 | .PHONY: xml 210 | xml: 211 | $(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml 212 | @echo 213 | @echo "Build finished. The XML files are in $(BUILDDIR)/xml." 214 | 215 | .PHONY: pseudoxml 216 | pseudoxml: 217 | $(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml 218 | @echo 219 | @echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml." 220 | 221 | .PHONY: dummy 222 | dummy: 223 | $(SPHINXBUILD) -b dummy $(ALLSPHINXOPTS) $(BUILDDIR)/dummy 224 | @echo 225 | @echo "Build finished. Dummy builder generates no files." 226 | -------------------------------------------------------------------------------- /docs/make.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | REM Command file for Sphinx documentation 4 | 5 | if "%SPHINXBUILD%" == "" ( 6 | set SPHINXBUILD=sphinx-build 7 | ) 8 | set BUILDDIR=_build 9 | set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% . 10 | set I18NSPHINXOPTS=%SPHINXOPTS% . 11 | if NOT "%PAPER%" == "" ( 12 | set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS% 13 | set I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS% 14 | ) 15 | 16 | if "%1" == "" goto help 17 | 18 | if "%1" == "help" ( 19 | :help 20 | echo.Please use `make ^` where ^ is one of 21 | echo. html to make standalone HTML files 22 | echo. dirhtml to make HTML files named index.html in directories 23 | echo. singlehtml to make a single large HTML file 24 | echo. pickle to make pickle files 25 | echo. json to make JSON files 26 | echo. htmlhelp to make HTML files and a HTML help project 27 | echo. qthelp to make HTML files and a qthelp project 28 | echo. devhelp to make HTML files and a Devhelp project 29 | echo. epub to make an epub 30 | echo. epub3 to make an epub3 31 | echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter 32 | echo. text to make text files 33 | echo. man to make manual pages 34 | echo. texinfo to make Texinfo files 35 | echo. gettext to make PO message catalogs 36 | echo. changes to make an overview over all changed/added/deprecated items 37 | echo. xml to make Docutils-native XML files 38 | echo. pseudoxml to make pseudoxml-XML files for display purposes 39 | echo. linkcheck to check all external links for integrity 40 | echo. doctest to run all doctests embedded in the documentation if enabled 41 | echo. coverage to run coverage check of the documentation if enabled 42 | echo. dummy to check syntax errors of document sources 43 | goto end 44 | ) 45 | 46 | if "%1" == "clean" ( 47 | for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i 48 | del /q /s %BUILDDIR%\* 49 | goto end 50 | ) 51 | 52 | 53 | REM Check if sphinx-build is available and fallback to Python version if any 54 | %SPHINXBUILD% 1>NUL 2>NUL 55 | if errorlevel 9009 goto sphinx_python 56 | goto sphinx_ok 57 | 58 | :sphinx_python 59 | 60 | set SPHINXBUILD=python -m sphinx.__init__ 61 | %SPHINXBUILD% 2> nul 62 | if errorlevel 9009 ( 63 | echo. 64 | echo.The 'sphinx-build' command was not found. Make sure you have Sphinx 65 | echo.installed, then set the SPHINXBUILD environment variable to point 66 | echo.to the full path of the 'sphinx-build' executable. Alternatively you 67 | echo.may add the Sphinx directory to PATH. 68 | echo. 69 | echo.If you don't have Sphinx installed, grab it from 70 | echo.http://sphinx-doc.org/ 71 | exit /b 1 72 | ) 73 | 74 | :sphinx_ok 75 | 76 | 77 | if "%1" == "html" ( 78 | %SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html 79 | if errorlevel 1 exit /b 1 80 | echo. 81 | echo.Build finished. The HTML pages are in %BUILDDIR%/html. 82 | goto end 83 | ) 84 | 85 | if "%1" == "dirhtml" ( 86 | %SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml 87 | if errorlevel 1 exit /b 1 88 | echo. 89 | echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml. 90 | goto end 91 | ) 92 | 93 | if "%1" == "singlehtml" ( 94 | %SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml 95 | if errorlevel 1 exit /b 1 96 | echo. 97 | echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml. 98 | goto end 99 | ) 100 | 101 | if "%1" == "pickle" ( 102 | %SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle 103 | if errorlevel 1 exit /b 1 104 | echo. 105 | echo.Build finished; now you can process the pickle files. 106 | goto end 107 | ) 108 | 109 | if "%1" == "json" ( 110 | %SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json 111 | if errorlevel 1 exit /b 1 112 | echo. 113 | echo.Build finished; now you can process the JSON files. 114 | goto end 115 | ) 116 | 117 | if "%1" == "htmlhelp" ( 118 | %SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp 119 | if errorlevel 1 exit /b 1 120 | echo. 121 | echo.Build finished; now you can run HTML Help Workshop with the ^ 122 | .hhp project file in %BUILDDIR%/htmlhelp. 123 | goto end 124 | ) 125 | 126 | if "%1" == "qthelp" ( 127 | %SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp 128 | if errorlevel 1 exit /b 1 129 | echo. 130 | echo.Build finished; now you can run "qcollectiongenerator" with the ^ 131 | .qhcp project file in %BUILDDIR%/qthelp, like this: 132 | echo.^> qcollectiongenerator %BUILDDIR%\qthelp\VideoDigitalWatermarking.qhcp 133 | echo.To view the help file: 134 | echo.^> assistant -collectionFile %BUILDDIR%\qthelp\VideoDigitalWatermarking.ghc 135 | goto end 136 | ) 137 | 138 | if "%1" == "devhelp" ( 139 | %SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp 140 | if errorlevel 1 exit /b 1 141 | echo. 142 | echo.Build finished. 143 | goto end 144 | ) 145 | 146 | if "%1" == "epub" ( 147 | %SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub 148 | if errorlevel 1 exit /b 1 149 | echo. 150 | echo.Build finished. The epub file is in %BUILDDIR%/epub. 151 | goto end 152 | ) 153 | 154 | if "%1" == "epub3" ( 155 | %SPHINXBUILD% -b epub3 %ALLSPHINXOPTS% %BUILDDIR%/epub3 156 | if errorlevel 1 exit /b 1 157 | echo. 158 | echo.Build finished. The epub3 file is in %BUILDDIR%/epub3. 159 | goto end 160 | ) 161 | 162 | if "%1" == "latex" ( 163 | %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex 164 | if errorlevel 1 exit /b 1 165 | echo. 166 | echo.Build finished; the LaTeX files are in %BUILDDIR%/latex. 167 | goto end 168 | ) 169 | 170 | if "%1" == "latexpdf" ( 171 | %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex 172 | cd %BUILDDIR%/latex 173 | make all-pdf 174 | cd %~dp0 175 | echo. 176 | echo.Build finished; the PDF files are in %BUILDDIR%/latex. 177 | goto end 178 | ) 179 | 180 | if "%1" == "latexpdfja" ( 181 | %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex 182 | cd %BUILDDIR%/latex 183 | make all-pdf-ja 184 | cd %~dp0 185 | echo. 186 | echo.Build finished; the PDF files are in %BUILDDIR%/latex. 187 | goto end 188 | ) 189 | 190 | if "%1" == "text" ( 191 | %SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text 192 | if errorlevel 1 exit /b 1 193 | echo. 194 | echo.Build finished. The text files are in %BUILDDIR%/text. 195 | goto end 196 | ) 197 | 198 | if "%1" == "man" ( 199 | %SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man 200 | if errorlevel 1 exit /b 1 201 | echo. 202 | echo.Build finished. The manual pages are in %BUILDDIR%/man. 203 | goto end 204 | ) 205 | 206 | if "%1" == "texinfo" ( 207 | %SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo 208 | if errorlevel 1 exit /b 1 209 | echo. 210 | echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo. 211 | goto end 212 | ) 213 | 214 | if "%1" == "gettext" ( 215 | %SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale 216 | if errorlevel 1 exit /b 1 217 | echo. 218 | echo.Build finished. The message catalogs are in %BUILDDIR%/locale. 219 | goto end 220 | ) 221 | 222 | if "%1" == "changes" ( 223 | %SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes 224 | if errorlevel 1 exit /b 1 225 | echo. 226 | echo.The overview file is in %BUILDDIR%/changes. 227 | goto end 228 | ) 229 | 230 | if "%1" == "linkcheck" ( 231 | %SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck 232 | if errorlevel 1 exit /b 1 233 | echo. 234 | echo.Link check complete; look for any errors in the above output ^ 235 | or in %BUILDDIR%/linkcheck/output.txt. 236 | goto end 237 | ) 238 | 239 | if "%1" == "doctest" ( 240 | %SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest 241 | if errorlevel 1 exit /b 1 242 | echo. 243 | echo.Testing of doctests in the sources finished, look at the ^ 244 | results in %BUILDDIR%/doctest/output.txt. 245 | goto end 246 | ) 247 | 248 | if "%1" == "coverage" ( 249 | %SPHINXBUILD% -b coverage %ALLSPHINXOPTS% %BUILDDIR%/coverage 250 | if errorlevel 1 exit /b 1 251 | echo. 252 | echo.Testing of coverage in the sources finished, look at the ^ 253 | results in %BUILDDIR%/coverage/python.txt. 254 | goto end 255 | ) 256 | 257 | if "%1" == "xml" ( 258 | %SPHINXBUILD% -b xml %ALLSPHINXOPTS% %BUILDDIR%/xml 259 | if errorlevel 1 exit /b 1 260 | echo. 261 | echo.Build finished. The XML files are in %BUILDDIR%/xml. 262 | goto end 263 | ) 264 | 265 | if "%1" == "pseudoxml" ( 266 | %SPHINXBUILD% -b pseudoxml %ALLSPHINXOPTS% %BUILDDIR%/pseudoxml 267 | if errorlevel 1 exit /b 1 268 | echo. 269 | echo.Build finished. The pseudo-XML files are in %BUILDDIR%/pseudoxml. 270 | goto end 271 | ) 272 | 273 | if "%1" == "dummy" ( 274 | %SPHINXBUILD% -b dummy %ALLSPHINXOPTS% %BUILDDIR%/dummy 275 | if errorlevel 1 exit /b 1 276 | echo. 277 | echo.Build finished. Dummy builder generates no files. 278 | goto end 279 | ) 280 | 281 | :end 282 | -------------------------------------------------------------------------------- /html/_static/doctools.js: -------------------------------------------------------------------------------- 1 | /* 2 | * doctools.js 3 | * ~~~~~~~~~~~ 4 | * 5 | * Sphinx JavaScript utilities for all documentation. 6 | * 7 | * :copyright: Copyright 2007-2016 by the Sphinx team, see AUTHORS. 8 | * :license: BSD, see LICENSE for details. 9 | * 10 | */ 11 | 12 | /** 13 | * select a different prefix for underscore 14 | */ 15 | $u = _.noConflict(); 16 | 17 | /** 18 | * make the code below compatible with browsers without 19 | * an installed firebug like debugger 20 | if (!window.console || !console.firebug) { 21 | var names = ["log", "debug", "info", "warn", "error", "assert", "dir", 22 | "dirxml", "group", "groupEnd", "time", "timeEnd", "count", "trace", 23 | "profile", "profileEnd"]; 24 | window.console = {}; 25 | for (var i = 0; i < names.length; ++i) 26 | window.console[names[i]] = function() {}; 27 | } 28 | */ 29 | 30 | /** 31 | * small helper function to urldecode strings 32 | */ 33 | jQuery.urldecode = function(x) { 34 | return decodeURIComponent(x).replace(/\+/g, ' '); 35 | }; 36 | 37 | /** 38 | * small helper function to urlencode strings 39 | */ 40 | jQuery.urlencode = encodeURIComponent; 41 | 42 | /** 43 | * This function returns the parsed url parameters of the 44 | * current request. Multiple values per key are supported, 45 | * it will always return arrays of strings for the value parts. 46 | */ 47 | jQuery.getQueryParameters = function(s) { 48 | if (typeof s == 'undefined') 49 | s = document.location.search; 50 | var parts = s.substr(s.indexOf('?') + 1).split('&'); 51 | var result = {}; 52 | for (var i = 0; i < parts.length; i++) { 53 | var tmp = parts[i].split('=', 2); 54 | var key = jQuery.urldecode(tmp[0]); 55 | var value = jQuery.urldecode(tmp[1]); 56 | if (key in result) 57 | result[key].push(value); 58 | else 59 | result[key] = [value]; 60 | } 61 | return result; 62 | }; 63 | 64 | /** 65 | * highlight a given string on a jquery object by wrapping it in 66 | * span elements with the given class name. 67 | */ 68 | jQuery.fn.highlightText = function(text, className) { 69 | function highlight(node) { 70 | if (node.nodeType == 3) { 71 | var val = node.nodeValue; 72 | var pos = val.toLowerCase().indexOf(text); 73 | if (pos >= 0 && !jQuery(node.parentNode).hasClass(className)) { 74 | var span = document.createElement("span"); 75 | span.className = className; 76 | span.appendChild(document.createTextNode(val.substr(pos, text.length))); 77 | node.parentNode.insertBefore(span, node.parentNode.insertBefore( 78 | document.createTextNode(val.substr(pos + text.length)), 79 | node.nextSibling)); 80 | node.nodeValue = val.substr(0, pos); 81 | } 82 | } 83 | else if (!jQuery(node).is("button, select, textarea")) { 84 | jQuery.each(node.childNodes, function() { 85 | highlight(this); 86 | }); 87 | } 88 | } 89 | return this.each(function() { 90 | highlight(this); 91 | }); 92 | }; 93 | 94 | /* 95 | * backward compatibility for jQuery.browser 96 | * This will be supported until firefox bug is fixed. 97 | */ 98 | if (!jQuery.browser) { 99 | jQuery.uaMatch = function(ua) { 100 | ua = ua.toLowerCase(); 101 | 102 | var match = /(chrome)[ \/]([\w.]+)/.exec(ua) || 103 | /(webkit)[ \/]([\w.]+)/.exec(ua) || 104 | /(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ua) || 105 | /(msie) ([\w.]+)/.exec(ua) || 106 | ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua) || 107 | []; 108 | 109 | return { 110 | browser: match[ 1 ] || "", 111 | version: match[ 2 ] || "0" 112 | }; 113 | }; 114 | jQuery.browser = {}; 115 | jQuery.browser[jQuery.uaMatch(navigator.userAgent).browser] = true; 116 | } 117 | 118 | /** 119 | * Small JavaScript module for the documentation. 120 | */ 121 | var Documentation = { 122 | 123 | init : function() { 124 | this.fixFirefoxAnchorBug(); 125 | this.highlightSearchWords(); 126 | this.initIndexTable(); 127 | 128 | }, 129 | 130 | /** 131 | * i18n support 132 | */ 133 | TRANSLATIONS : {}, 134 | PLURAL_EXPR : function(n) { return n == 1 ? 0 : 1; }, 135 | LOCALE : 'unknown', 136 | 137 | // gettext and ngettext don't access this so that the functions 138 | // can safely bound to a different name (_ = Documentation.gettext) 139 | gettext : function(string) { 140 | var translated = Documentation.TRANSLATIONS[string]; 141 | if (typeof translated == 'undefined') 142 | return string; 143 | return (typeof translated == 'string') ? translated : translated[0]; 144 | }, 145 | 146 | ngettext : function(singular, plural, n) { 147 | var translated = Documentation.TRANSLATIONS[singular]; 148 | if (typeof translated == 'undefined') 149 | return (n == 1) ? singular : plural; 150 | return translated[Documentation.PLURALEXPR(n)]; 151 | }, 152 | 153 | addTranslations : function(catalog) { 154 | for (var key in catalog.messages) 155 | this.TRANSLATIONS[key] = catalog.messages[key]; 156 | this.PLURAL_EXPR = new Function('n', 'return +(' + catalog.plural_expr + ')'); 157 | this.LOCALE = catalog.locale; 158 | }, 159 | 160 | /** 161 | * add context elements like header anchor links 162 | */ 163 | addContextElements : function() { 164 | $('div[id] > :header:first').each(function() { 165 | $('\u00B6'). 166 | attr('href', '#' + this.id). 167 | attr('title', _('Permalink to this headline')). 168 | appendTo(this); 169 | }); 170 | $('dt[id]').each(function() { 171 | $('\u00B6'). 172 | attr('href', '#' + this.id). 173 | attr('title', _('Permalink to this definition')). 174 | appendTo(this); 175 | }); 176 | }, 177 | 178 | /** 179 | * workaround a firefox stupidity 180 | * see: https://bugzilla.mozilla.org/show_bug.cgi?id=645075 181 | */ 182 | fixFirefoxAnchorBug : function() { 183 | if (document.location.hash) 184 | window.setTimeout(function() { 185 | document.location.href += ''; 186 | }, 10); 187 | }, 188 | 189 | /** 190 | * highlight the search words provided in the url in the text 191 | */ 192 | highlightSearchWords : function() { 193 | var params = $.getQueryParameters(); 194 | var terms = (params.highlight) ? params.highlight[0].split(/\s+/) : []; 195 | if (terms.length) { 196 | var body = $('div.body'); 197 | if (!body.length) { 198 | body = $('body'); 199 | } 200 | window.setTimeout(function() { 201 | $.each(terms, function() { 202 | body.highlightText(this.toLowerCase(), 'highlighted'); 203 | }); 204 | }, 10); 205 | $('') 207 | .appendTo($('#searchbox')); 208 | } 209 | }, 210 | 211 | /** 212 | * init the domain index toggle buttons 213 | */ 214 | initIndexTable : function() { 215 | var togglers = $('img.toggler').click(function() { 216 | var src = $(this).attr('src'); 217 | var idnum = $(this).attr('id').substr(7); 218 | $('tr.cg-' + idnum).toggle(); 219 | if (src.substr(-9) == 'minus.png') 220 | $(this).attr('src', src.substr(0, src.length-9) + 'plus.png'); 221 | else 222 | $(this).attr('src', src.substr(0, src.length-8) + 'minus.png'); 223 | }).css('display', ''); 224 | if (DOCUMENTATION_OPTIONS.COLLAPSE_INDEX) { 225 | togglers.click(); 226 | } 227 | }, 228 | 229 | /** 230 | * helper function to hide the search marks again 231 | */ 232 | hideSearchWords : function() { 233 | $('#searchbox .highlight-link').fadeOut(300); 234 | $('span.highlighted').removeClass('highlighted'); 235 | }, 236 | 237 | /** 238 | * make the url absolute 239 | */ 240 | makeURL : function(relativeURL) { 241 | return DOCUMENTATION_OPTIONS.URL_ROOT + '/' + relativeURL; 242 | }, 243 | 244 | /** 245 | * get the current relative url 246 | */ 247 | getCurrentURL : function() { 248 | var path = document.location.pathname; 249 | var parts = path.split(/\//); 250 | $.each(DOCUMENTATION_OPTIONS.URL_ROOT.split(/\//), function() { 251 | if (this == '..') 252 | parts.pop(); 253 | }); 254 | var url = parts.join('/'); 255 | return path.substring(url.lastIndexOf('/') + 1, path.length - 1); 256 | }, 257 | 258 | initOnKeyListeners: function() { 259 | $(document).keyup(function(event) { 260 | var activeElementType = document.activeElement.tagName; 261 | // don't navigate when in search box or textarea 262 | if (activeElementType !== 'TEXTAREA' && activeElementType !== 'INPUT' && activeElementType !== 'SELECT') { 263 | switch (event.keyCode) { 264 | case 37: // left 265 | var prevHref = $('link[rel="prev"]').prop('href'); 266 | if (prevHref) { 267 | window.location.href = prevHref; 268 | return false; 269 | } 270 | case 39: // right 271 | var nextHref = $('link[rel="next"]').prop('href'); 272 | if (nextHref) { 273 | window.location.href = nextHref; 274 | return false; 275 | } 276 | } 277 | } 278 | }); 279 | } 280 | }; 281 | 282 | // quick alias for translations 283 | _ = Documentation.gettext; 284 | 285 | $(document).ready(function() { 286 | Documentation.init(); 287 | }); -------------------------------------------------------------------------------- /src/watermarking.py: -------------------------------------------------------------------------------- 1 | # 2 | # watermarking.py 3 | # Created by pira on 2017/07/26. 4 | # 5 | 6 | #coding: utf-8 7 | u"""For image watermarking.""" 8 | 9 | import sys 10 | import numpy as np 11 | 12 | TIME_DOMAIN = 1 13 | DCT_DOMAIN = 0 14 | 15 | NON_CYCLE = 0 16 | CYCLE = 1 17 | 18 | def embedBitReplace(cover, secret, bit=1, interval=0): 19 | u"""Embed secret informations by changing bit. 20 | @param cover : cover data (2 dimension np.ndarray) 21 | @param secret : 0 or 1 secret information list 22 | @param bit : number of replaced bit (It's recommended to be close to the LSB.) 23 | @param interval: ebmed interval 24 | @return stego : srego data (2 dimension np.ndarray) 25 | """ 26 | height = cover.shape[0] 27 | width = cover.shape[1] 28 | es_length = len(secret) * (1+interval) #Embeded Sequence length 29 | 30 | if height*width < es_length: 31 | print('Secret information is over the limit of embeded.') 32 | print('Please review the cover image, secret information or interval.') 33 | sys.exit() 34 | 35 | #create embeded sequence 36 | es = np.zeros(es_length) 37 | for i, secret_bit in enumerate(secret): 38 | es[i*(interval+1)] = secret_bit 39 | 40 | cover = _image2vrctor(cover) 41 | stego = cover 42 | 43 | for i, secret_bit in enumerate(es): 44 | stego[i] = _addBitReplace(cover[i], secret_bit, bit) 45 | 46 | stego = _vector2image(stego, height, width) 47 | 48 | return stego 49 | 50 | def extractBitReplace(cover, stego, secret_length, bit=1, interval=0): 51 | u"""Extract secret informations by chacking LSB. 52 | @param cover : cover data (2 dimension np.ndarray) 53 | @param stego : stego data (2 dimension np.ndarray) 54 | @param secret_length : length of secret information 55 | @param bit : number of replaced bit 56 | @param interval : embed interval 57 | @return secret : extracted secret information 58 | """ 59 | secret_data = np.zeros(secret_length) 60 | 61 | cover = _image2vrctor(cover) 62 | stego = _image2vrctor(stego) 63 | #data = stego - cover 64 | 65 | for i in np.arange(secret_length): 66 | #print(stego[i*(interval+1)]) 67 | secret_data[i] = _checkBitReplace(stego[i*(interval+1)], bit) 68 | 69 | return secret_data 70 | 71 | def _addBitReplace(cover, secret, bit=1): 72 | stego = int(round(cover)) 73 | stego = format(stego, '08b') 74 | stego = stego[::-1] 75 | 76 | if secret == 0: 77 | if stego[bit-1] == '0': 78 | pass 79 | elif stego[bit-1] == '1': 80 | stego = stego[:(bit-1)] + '0' + stego[bit:] 81 | elif secret == 1: 82 | if stego[bit-1] == '0': 83 | stego = stego[:(bit-1)] + '1' + stego[bit:] 84 | elif stego[bit-1] == '1': 85 | pass 86 | 87 | stego = stego[::-1] 88 | stego = int(stego, 2) 89 | return stego 90 | 91 | def _checkBitReplace(data, bit=1): 92 | data = int(round(data)) 93 | data = format(data, '08b') 94 | data = data[::-1] 95 | 96 | if data[bit-1] == '0': 97 | return 0 98 | elif data[bit-1] == '1': 99 | return 1 100 | 101 | def embedMseq(cover, secret, m, a=1, tau=1): 102 | u"""Embed secret informations by spread spectrum using m-sequence. 103 | @param cover : cover data (2 dimensional np.ndarray) 104 | @param secret : 0 or 1 secret information 105 | @param m : M-Sequence 106 | @param a : embed stlength 107 | @param tau : embed shift interval 108 | @return stego : srego data (2 dimension np.ndarray) 109 | """ 110 | height = cover.shape[0] 111 | width = cover.shape[1] 112 | N = len(secret) 113 | secret = zero2minus(secret) 114 | secret = np.array(secret) 115 | 116 | M = list() 117 | for i in np.arange(N): 118 | M.append(np.roll(m,i)) 119 | M = np.array(M) 120 | 121 | es = secret.dot(M) 122 | es *= a 123 | 124 | stego = _image2vrctor(cover) 125 | 126 | for i, secret_bit in enumerate(es): 127 | stego[i] += secret_bit 128 | 129 | stego = _vector2image(stego, height, width) 130 | 131 | return stego 132 | 133 | def extractMseq(cover, stego, secret_length, m, tau=1): 134 | u"""Extract secret informations by spread spectrum using m-sequence. 135 | @param cover : cover data (2 dimensional np.ndarray) 136 | @param stego : stego data (2 dimension np.ndarray) 137 | @param secret_length : length of secret information 138 | @param m : M-Sequence 139 | @param tau : embed shift interval 140 | @return secret : extracted secret information 141 | """ 142 | 143 | cover = _image2vrctor(cover) 144 | stego = _image2vrctor(stego) 145 | 146 | m_length = len(m) 147 | 148 | data = stego - cover 149 | data = data[:m_length:tau] 150 | 151 | secret_data = correlate(m, data, cycle=CYCLE) 152 | center = ((m_length-1)*2+1)//2 153 | secret_data = secret_data[center:center+secret_length] 154 | secret_data = list(map(_checkData, secret_data)) 155 | 156 | return secret_data 157 | 158 | def createBasicSeq(ccc, secret_length, tau=1, ch=1): 159 | u"""Create Basic-Sequence using CCC. 160 | @param ccc : (N,N,N**2)CCC 161 | @param secret_length : length of secret information 162 | @param tau : shift interval 163 | @param ch : channel of CCC 164 | @return basic : basic sequence 165 | """ 166 | N = len(ccc) 167 | T = N**2 + tau*(secret_length-1) 168 | basic = list() 169 | 170 | for i in np.arange(N): 171 | for j in np.arange(T): 172 | if j < N**2: 173 | basic.append(ccc[ch-1][i][j]) 174 | else: 175 | basic.append(0) 176 | 177 | basic = np.array(basic) 178 | return basic 179 | 180 | def createEmbedSeq(basic, secret, a=1, tau=1): 181 | u"""Create Embed-Sequence using CCC. 182 | @param ccc : (N,N,N**2)CCC 183 | @param secret : secret information 184 | @param a : embed strength 185 | @param tau : shift interval 186 | @return es : basic sequence 187 | """ 188 | secret = zero2minus(secret) 189 | secret = np.array(secret) 190 | basic_length = len(basic) 191 | secret_length = len(secret) 192 | 193 | ex_basic_length = basic_length + tau * (secret_length-1) 194 | 195 | ex_basic = list() 196 | for d in basic: 197 | ex_basic.append(int(d)) 198 | for i in np.arange(basic_length, ex_basic_length): 199 | ex_basic.append(0) 200 | #print(ex_basic) 201 | 202 | es = list() 203 | for i in np.arange(secret_length): 204 | es.append(np.roll(ex_basic, i*tau)) 205 | 206 | es = secret.dot(es) 207 | es *= a 208 | 209 | return es 210 | 211 | def extractCCC(ccc, es, secret_length, tau=1, ch=1): 212 | u"""Extract secret informations by spread spectrum using CCC. 213 | @param ccc : (N,N,N**2)CCC 214 | @param es : embed sequence (excracted from stego data) 215 | @param secret_length : length of secret information 216 | @param tau : shift interval 217 | @param ch : channel of CCC 218 | @return secret_data : extracted secret information 219 | """ 220 | 221 | basic = createBasicSeq(ccc, secret_length, tau, ch) 222 | 223 | basic_length = len(basic) 224 | ex_basic_length = es_length = basic_length + tau * (secret_length-1) 225 | 226 | ex_basic = list() 227 | for d in basic: 228 | ex_basic.append(int(d)) 229 | for i in np.arange(basic_length, ex_basic_length): 230 | ex_basic.append(0) 231 | 232 | secret_data = list() 233 | for i in np.arange(secret_length): 234 | ex = np.roll(ex_basic, i*tau) 235 | secret_data.append((es*ex).sum()) 236 | 237 | secret_data = list(map(_checkData, secret_data)) 238 | 239 | return secret_data 240 | 241 | def _checkData(data): 242 | if data > 0: 243 | return 1 244 | elif data < 0: 245 | return 0 246 | 247 | def _image2vrctor(img): 248 | height = img.shape[0] 249 | width = img.shape[1] 250 | len = height * width 251 | vector = np.empty(len) 252 | for i in np.arange(height): 253 | for j in np.arange(width): 254 | vector[i*height+j] = img[i][j] 255 | return vector 256 | 257 | def _vector2image(vector, height, width): 258 | image = np.empty([height, width]) 259 | for i in np.arange(height): 260 | for j in np.arange(width): 261 | image[i][j] = vector[i*height+j] 262 | return image 263 | 264 | def zero2minus(zero_data): 265 | u"""Convert 0 to -1. 266 | @param zero_data : secret information represented by 0 and 1 267 | @return minus_data : secret information represented by -1 and 1 268 | """ 269 | minus_data = list() 270 | for data in zero_data: 271 | minus_data.append(2*data-1) 272 | return minus_data 273 | 274 | def minus2zero(minus_data): 275 | u"""Convert -1 to 0. 276 | @param minus_data : secret information represented by -1 and 1 277 | @return zero_data : secret information represented by 0 and 1 278 | """ 279 | zero_data = minus_data 280 | for i,data in enumerate(minus_data): 281 | if data == -1: 282 | zero_data[i] = 0 283 | return zero_data 284 | 285 | def correlate(data1, data2, cycle=NON_CYCLE): 286 | u"""Calculate correlate function. 287 | @param data1 : data1 288 | @param data2 : data2 289 | @param cycle : CYCLE or NON_CYCLE (Default is NON_CYCLE) 290 | @return correlate : correlate list 291 | """ 292 | if cycle == NON_CYCLE: 293 | correlate = np.correlate(data1, data2, 'full') 294 | 295 | elif cycle == CYCLE: 296 | N = len(data1) 297 | correlate = list() 298 | 299 | for i in np.arange(-N+1, N): 300 | ans = 0 301 | data1_shifted = np.roll(data1,i) 302 | for j in range(0,N): 303 | ans += data1_shifted[j]*data2[j] 304 | correlate.append(ans) 305 | 306 | correlate = np.array(correlate) 307 | 308 | else: 309 | print('Invalid argument.') 310 | print('Please review parameter in correlate function.') 311 | sys.exit() 312 | 313 | return correlate 314 | -------------------------------------------------------------------------------- /docs/_build/html/_static/doctools.js: -------------------------------------------------------------------------------- 1 | /* 2 | * doctools.js 3 | * ~~~~~~~~~~~ 4 | * 5 | * Sphinx JavaScript utilities for all documentation. 6 | * 7 | * :copyright: Copyright 2007-2016 by the Sphinx team, see AUTHORS. 8 | * :license: BSD, see LICENSE for details. 9 | * 10 | */ 11 | 12 | /** 13 | * select a different prefix for underscore 14 | */ 15 | $u = _.noConflict(); 16 | 17 | /** 18 | * make the code below compatible with browsers without 19 | * an installed firebug like debugger 20 | if (!window.console || !console.firebug) { 21 | var names = ["log", "debug", "info", "warn", "error", "assert", "dir", 22 | "dirxml", "group", "groupEnd", "time", "timeEnd", "count", "trace", 23 | "profile", "profileEnd"]; 24 | window.console = {}; 25 | for (var i = 0; i < names.length; ++i) 26 | window.console[names[i]] = function() {}; 27 | } 28 | */ 29 | 30 | /** 31 | * small helper function to urldecode strings 32 | */ 33 | jQuery.urldecode = function(x) { 34 | return decodeURIComponent(x).replace(/\+/g, ' '); 35 | }; 36 | 37 | /** 38 | * small helper function to urlencode strings 39 | */ 40 | jQuery.urlencode = encodeURIComponent; 41 | 42 | /** 43 | * This function returns the parsed url parameters of the 44 | * current request. Multiple values per key are supported, 45 | * it will always return arrays of strings for the value parts. 46 | */ 47 | jQuery.getQueryParameters = function(s) { 48 | if (typeof s == 'undefined') 49 | s = document.location.search; 50 | var parts = s.substr(s.indexOf('?') + 1).split('&'); 51 | var result = {}; 52 | for (var i = 0; i < parts.length; i++) { 53 | var tmp = parts[i].split('=', 2); 54 | var key = jQuery.urldecode(tmp[0]); 55 | var value = jQuery.urldecode(tmp[1]); 56 | if (key in result) 57 | result[key].push(value); 58 | else 59 | result[key] = [value]; 60 | } 61 | return result; 62 | }; 63 | 64 | /** 65 | * highlight a given string on a jquery object by wrapping it in 66 | * span elements with the given class name. 67 | */ 68 | jQuery.fn.highlightText = function(text, className) { 69 | function highlight(node) { 70 | if (node.nodeType == 3) { 71 | var val = node.nodeValue; 72 | var pos = val.toLowerCase().indexOf(text); 73 | if (pos >= 0 && !jQuery(node.parentNode).hasClass(className)) { 74 | var span = document.createElement("span"); 75 | span.className = className; 76 | span.appendChild(document.createTextNode(val.substr(pos, text.length))); 77 | node.parentNode.insertBefore(span, node.parentNode.insertBefore( 78 | document.createTextNode(val.substr(pos + text.length)), 79 | node.nextSibling)); 80 | node.nodeValue = val.substr(0, pos); 81 | } 82 | } 83 | else if (!jQuery(node).is("button, select, textarea")) { 84 | jQuery.each(node.childNodes, function() { 85 | highlight(this); 86 | }); 87 | } 88 | } 89 | return this.each(function() { 90 | highlight(this); 91 | }); 92 | }; 93 | 94 | /* 95 | * backward compatibility for jQuery.browser 96 | * This will be supported until firefox bug is fixed. 97 | */ 98 | if (!jQuery.browser) { 99 | jQuery.uaMatch = function(ua) { 100 | ua = ua.toLowerCase(); 101 | 102 | var match = /(chrome)[ \/]([\w.]+)/.exec(ua) || 103 | /(webkit)[ \/]([\w.]+)/.exec(ua) || 104 | /(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ua) || 105 | /(msie) ([\w.]+)/.exec(ua) || 106 | ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua) || 107 | []; 108 | 109 | return { 110 | browser: match[ 1 ] || "", 111 | version: match[ 2 ] || "0" 112 | }; 113 | }; 114 | jQuery.browser = {}; 115 | jQuery.browser[jQuery.uaMatch(navigator.userAgent).browser] = true; 116 | } 117 | 118 | /** 119 | * Small JavaScript module for the documentation. 120 | */ 121 | var Documentation = { 122 | 123 | init : function() { 124 | this.fixFirefoxAnchorBug(); 125 | this.highlightSearchWords(); 126 | this.initIndexTable(); 127 | 128 | }, 129 | 130 | /** 131 | * i18n support 132 | */ 133 | TRANSLATIONS : {}, 134 | PLURAL_EXPR : function(n) { return n == 1 ? 0 : 1; }, 135 | LOCALE : 'unknown', 136 | 137 | // gettext and ngettext don't access this so that the functions 138 | // can safely bound to a different name (_ = Documentation.gettext) 139 | gettext : function(string) { 140 | var translated = Documentation.TRANSLATIONS[string]; 141 | if (typeof translated == 'undefined') 142 | return string; 143 | return (typeof translated == 'string') ? translated : translated[0]; 144 | }, 145 | 146 | ngettext : function(singular, plural, n) { 147 | var translated = Documentation.TRANSLATIONS[singular]; 148 | if (typeof translated == 'undefined') 149 | return (n == 1) ? singular : plural; 150 | return translated[Documentation.PLURALEXPR(n)]; 151 | }, 152 | 153 | addTranslations : function(catalog) { 154 | for (var key in catalog.messages) 155 | this.TRANSLATIONS[key] = catalog.messages[key]; 156 | this.PLURAL_EXPR = new Function('n', 'return +(' + catalog.plural_expr + ')'); 157 | this.LOCALE = catalog.locale; 158 | }, 159 | 160 | /** 161 | * add context elements like header anchor links 162 | */ 163 | addContextElements : function() { 164 | $('div[id] > :header:first').each(function() { 165 | $('\u00B6'). 166 | attr('href', '#' + this.id). 167 | attr('title', _('Permalink to this headline')). 168 | appendTo(this); 169 | }); 170 | $('dt[id]').each(function() { 171 | $('\u00B6'). 172 | attr('href', '#' + this.id). 173 | attr('title', _('Permalink to this definition')). 174 | appendTo(this); 175 | }); 176 | }, 177 | 178 | /** 179 | * workaround a firefox stupidity 180 | * see: https://bugzilla.mozilla.org/show_bug.cgi?id=645075 181 | */ 182 | fixFirefoxAnchorBug : function() { 183 | if (document.location.hash) 184 | window.setTimeout(function() { 185 | document.location.href += ''; 186 | }, 10); 187 | }, 188 | 189 | /** 190 | * highlight the search words provided in the url in the text 191 | */ 192 | highlightSearchWords : function() { 193 | var params = $.getQueryParameters(); 194 | var terms = (params.highlight) ? params.highlight[0].split(/\s+/) : []; 195 | if (terms.length) { 196 | var body = $('div.body'); 197 | if (!body.length) { 198 | body = $('body'); 199 | } 200 | window.setTimeout(function() { 201 | $.each(terms, function() { 202 | body.highlightText(this.toLowerCase(), 'highlighted'); 203 | }); 204 | }, 10); 205 | $('') 207 | .appendTo($('#searchbox')); 208 | } 209 | }, 210 | 211 | /** 212 | * init the domain index toggle buttons 213 | */ 214 | initIndexTable : function() { 215 | var togglers = $('img.toggler').click(function() { 216 | var src = $(this).attr('src'); 217 | var idnum = $(this).attr('id').substr(7); 218 | $('tr.cg-' + idnum).toggle(); 219 | if (src.substr(-9) == 'minus.png') 220 | $(this).attr('src', src.substr(0, src.length-9) + 'plus.png'); 221 | else 222 | $(this).attr('src', src.substr(0, src.length-8) + 'minus.png'); 223 | }).css('display', ''); 224 | if (DOCUMENTATION_OPTIONS.COLLAPSE_INDEX) { 225 | togglers.click(); 226 | } 227 | }, 228 | 229 | /** 230 | * helper function to hide the search marks again 231 | */ 232 | hideSearchWords : function() { 233 | $('#searchbox .highlight-link').fadeOut(300); 234 | $('span.highlighted').removeClass('highlighted'); 235 | }, 236 | 237 | /** 238 | * make the url absolute 239 | */ 240 | makeURL : function(relativeURL) { 241 | return DOCUMENTATION_OPTIONS.URL_ROOT + '/' + relativeURL; 242 | }, 243 | 244 | /** 245 | * get the current relative url 246 | */ 247 | getCurrentURL : function() { 248 | var path = document.location.pathname; 249 | var parts = path.split(/\//); 250 | $.each(DOCUMENTATION_OPTIONS.URL_ROOT.split(/\//), function() { 251 | if (this == '..') 252 | parts.pop(); 253 | }); 254 | var url = parts.join('/'); 255 | return path.substring(url.lastIndexOf('/') + 1, path.length - 1); 256 | }, 257 | 258 | initOnKeyListeners: function() { 259 | $(document).keyup(function(event) { 260 | var activeElementType = document.activeElement.tagName; 261 | // don't navigate when in search box or textarea 262 | if (activeElementType !== 'TEXTAREA' && activeElementType !== 'INPUT' && activeElementType !== 'SELECT') { 263 | switch (event.keyCode) { 264 | case 37: // left 265 | var prevHref = $('link[rel="prev"]').prop('href'); 266 | if (prevHref) { 267 | window.location.href = prevHref; 268 | return false; 269 | } 270 | case 39: // right 271 | var nextHref = $('link[rel="next"]').prop('href'); 272 | if (nextHref) { 273 | window.location.href = nextHref; 274 | return false; 275 | } 276 | } 277 | } 278 | }); 279 | } 280 | }; 281 | 282 | // quick alias for translations 283 | _ = Documentation.gettext; 284 | 285 | $(document).ready(function() { 286 | Documentation.init(); 287 | }); -------------------------------------------------------------------------------- /html/genindex.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | Index — VideoDigitalWatermarking 1.0 documentation 11 | 12 | 13 | 14 | 15 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 |
39 |
40 |
41 |
42 | 43 | 44 |

Index

45 | 46 |
47 | C 48 | | D 49 | | E 50 | | G 51 | | I 52 | | M 53 | | R 54 | | S 55 | | V 56 | | W 57 | | Y 58 | | Z 59 | 60 |
61 |

C

62 | 63 | 77 | 91 |
64 | 65 |
calcBER() (in module src.ber) 66 |
67 | 68 | 69 |
calcPSNR() (in module src.psnr) 70 |
71 | 72 | 73 |
colorimage2block() (in module src.image) 74 |
75 | 76 |
78 | 79 |
correlate() (in module src.watermarking) 80 |
81 | 82 | 83 |
createBasicSeq() (in module src.watermarking) 84 |
85 | 86 | 87 |
createEmbedSeq() (in module src.watermarking) 88 |
89 | 90 |
92 | 93 |

D

94 | 95 | 101 | 107 |
96 | 97 |
dct_dim1() (in module src.dct) 98 |
99 | 100 |
102 | 103 |
dct_dim2() (in module src.dct) 104 |
105 | 106 |
108 | 109 |

E

110 | 111 | 125 | 135 |
112 | 113 |
embedBitReplace() (in module src.watermarking) 114 |
115 | 116 | 117 |
embedMseq() (in module src.watermarking) 118 |
119 | 120 | 121 |
extractBitReplace() (in module src.watermarking) 122 |
123 | 124 |
126 | 127 |
extractCCC() (in module src.watermarking) 128 |
129 | 130 | 131 |
extractMseq() (in module src.watermarking) 132 |
133 | 134 |
136 | 137 |

G

138 | 139 | 153 | 167 |
140 | 141 |
generateCCC() (in module src.ccc) 142 |
143 | 144 | 145 |
generateM() (in module src.msequence) 146 |
147 | 148 | 149 |
generateSecret() (in module src.secret) 150 |
151 | 152 |
154 | 155 |
get_y() (in module src.image) 156 |
157 | 158 | 159 |
getRgbLayer() (in module src.image) 160 |
161 | 162 | 163 |
grayimage2block() (in module src.image) 164 |
165 | 166 |
168 | 169 |

I

170 | 171 | 177 | 183 |
172 | 173 |
idct_dim1() (in module src.dct) 174 |
175 | 176 |
178 | 179 |
idct_dim2() (in module src.dct) 180 |
181 | 182 |
184 | 185 |

M

186 | 187 | 193 |
188 | 189 |
minus2zero() (in module src.watermarking) 190 |
191 | 192 |
194 | 195 |

R

196 | 197 | 207 | 213 |
198 | 199 |
readColorImage() (in module src.image) 200 |
201 | 202 | 203 |
readGrayImage() (in module src.image) 204 |
205 | 206 |
208 | 209 |
rgb2ycc() (in module src.image) 210 |
211 | 212 |
214 | 215 |

S

216 | 217 | 243 | 265 |
218 | 219 |
showImage() (in module src.image) 220 |
221 | 222 | 223 |
src (module) 224 |
225 | 226 | 227 |
src.ber (module) 228 |
229 | 230 | 231 |
src.ccc (module) 232 |
233 | 234 | 235 |
src.dct (module) 236 |
237 | 238 | 239 |
src.image (module) 240 |
241 | 242 |
244 | 245 |
src.msequence (module) 246 |
247 | 248 | 249 |
src.psnr (module) 250 |
251 | 252 | 253 |
src.secret (module) 254 |
255 | 256 | 257 |
src.video (module) 258 |
259 | 260 | 261 |
src.watermarking (module) 262 |
263 | 264 |
266 | 267 |

V

268 | 269 | 275 |
270 | 271 |
video2image() (in module src.video) 272 |
273 | 274 |
276 | 277 |

W

278 | 279 | 285 |
280 | 281 |
writeImage() (in module src.image) 282 |
283 | 284 |
286 | 287 |

Y

288 | 289 | 295 |
290 | 291 |
ycc2rgb() (in module src.image) 292 |
293 | 294 |
296 | 297 |

Z

298 | 299 | 305 |
300 | 301 |
zero2minus() (in module src.watermarking) 302 |
303 | 304 |
306 | 307 | 308 | 309 |
310 |
311 |
312 | 335 |
336 |
337 | 345 | 346 | 347 | 348 | 349 | 350 | -------------------------------------------------------------------------------- /docs/conf.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | # 4 | # VideoDigitalWatermarking documentation build configuration file, created by 5 | # sphinx-quickstart on Sun Aug 6 17:09:04 2017. 6 | # 7 | # This file is execfile()d with the current directory set to its 8 | # containing dir. 9 | # 10 | # Note that not all possible configuration values are present in this 11 | # autogenerated file. 12 | # 13 | # All configuration values have a default; values that are commented out 14 | # serve to show the default. 15 | 16 | # If extensions (or modules to document with autodoc) are in another directory, 17 | # add these directories to sys.path here. If the directory is relative to the 18 | # documentation root, use os.path.abspath to make it absolute, like shown here. 19 | # 20 | import os 21 | import sys 22 | sys.path.insert(0, os.path.abspath('../')) 23 | sys.path.insert(0, os.path.abspath('../src/')) 24 | 25 | # -- General configuration ------------------------------------------------ 26 | 27 | # If your documentation needs a minimal Sphinx version, state it here. 28 | # 29 | # needs_sphinx = '1.0' 30 | 31 | # Add any Sphinx extension module names here, as strings. They can be 32 | # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom 33 | # ones. 34 | extensions = ['sphinx.ext.autodoc'] 35 | 36 | # Add any paths that contain templates here, relative to this directory. 37 | templates_path = ['_templates'] 38 | 39 | # The suffix(es) of source filenames. 40 | # You can specify multiple suffix as a list of string: 41 | # 42 | # source_suffix = ['.rst', '.md'] 43 | source_suffix = '.rst' 44 | 45 | # The encoding of source files. 46 | # 47 | # source_encoding = 'utf-8-sig' 48 | 49 | # The master toctree document. 50 | master_doc = 'index' 51 | 52 | # General information about the project. 53 | project = 'VideoDigitalWatermarking' 54 | copyright = '2017, pira' 55 | author = 'pira' 56 | 57 | # The version info for the project you're documenting, acts as replacement for 58 | # |version| and |release|, also used in various other places throughout the 59 | # built documents. 60 | # 61 | # The short X.Y version. 62 | version = '1.0' 63 | # The full version, including alpha/beta/rc tags. 64 | release = '1.0' 65 | 66 | # The language for content autogenerated by Sphinx. Refer to documentation 67 | # for a list of supported languages. 68 | # 69 | # This is also used if you do content translation via gettext catalogs. 70 | # Usually you set "language" from the command line for these cases. 71 | language = None 72 | 73 | # There are two options for replacing |today|: either, you set today to some 74 | # non-false value, then it is used: 75 | # 76 | # today = '' 77 | # 78 | # Else, today_fmt is used as the format for a strftime call. 79 | # 80 | # today_fmt = '%B %d, %Y' 81 | 82 | # List of patterns, relative to source directory, that match files and 83 | # directories to ignore when looking for source files. 84 | # This patterns also effect to html_static_path and html_extra_path 85 | exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] 86 | 87 | # The reST default role (used for this markup: `text`) to use for all 88 | # documents. 89 | # 90 | # default_role = None 91 | 92 | # If true, '()' will be appended to :func: etc. cross-reference text. 93 | # 94 | # add_function_parentheses = True 95 | 96 | # If true, the current module name will be prepended to all description 97 | # unit titles (such as .. function::). 98 | # 99 | # add_module_names = True 100 | 101 | # If true, sectionauthor and moduleauthor directives will be shown in the 102 | # output. They are ignored by default. 103 | # 104 | # show_authors = False 105 | 106 | # The name of the Pygments (syntax highlighting) style to use. 107 | pygments_style = 'sphinx' 108 | 109 | # A list of ignored prefixes for module index sorting. 110 | # modindex_common_prefix = [] 111 | 112 | # If true, keep warnings as "system message" paragraphs in the built documents. 113 | # keep_warnings = False 114 | 115 | # If true, `todo` and `todoList` produce output, else they produce nothing. 116 | todo_include_todos = False 117 | 118 | 119 | # -- Options for HTML output ---------------------------------------------- 120 | 121 | # The theme to use for HTML and HTML Help pages. See the documentation for 122 | # a list of builtin themes. 123 | # 124 | html_theme = 'alabaster' 125 | 126 | # Theme options are theme-specific and customize the look and feel of a theme 127 | # further. For a list of options available for each theme, see the 128 | # documentation. 129 | # 130 | # html_theme_options = {} 131 | 132 | # Add any paths that contain custom themes here, relative to this directory. 133 | # html_theme_path = [] 134 | 135 | # The name for this set of Sphinx documents. 136 | # " v documentation" by default. 137 | # 138 | # html_title = 'VideoDigitalWatermarking v1.0' 139 | 140 | # A shorter title for the navigation bar. Default is the same as html_title. 141 | # 142 | # html_short_title = None 143 | 144 | # The name of an image file (relative to this directory) to place at the top 145 | # of the sidebar. 146 | # 147 | # html_logo = None 148 | 149 | # The name of an image file (relative to this directory) to use as a favicon of 150 | # the docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 151 | # pixels large. 152 | # 153 | # html_favicon = None 154 | 155 | # Add any paths that contain custom static files (such as style sheets) here, 156 | # relative to this directory. They are copied after the builtin static files, 157 | # so a file named "default.css" will overwrite the builtin "default.css". 158 | html_static_path = ['_static'] 159 | 160 | # Add any extra paths that contain custom files (such as robots.txt or 161 | # .htaccess) here, relative to this directory. These files are copied 162 | # directly to the root of the documentation. 163 | # 164 | # html_extra_path = [] 165 | 166 | # If not None, a 'Last updated on:' timestamp is inserted at every page 167 | # bottom, using the given strftime format. 168 | # The empty string is equivalent to '%b %d, %Y'. 169 | # 170 | # html_last_updated_fmt = None 171 | 172 | # If true, SmartyPants will be used to convert quotes and dashes to 173 | # typographically correct entities. 174 | # 175 | # html_use_smartypants = True 176 | 177 | # Custom sidebar templates, maps document names to template names. 178 | # 179 | # html_sidebars = {} 180 | 181 | # Additional templates that should be rendered to pages, maps page names to 182 | # template names. 183 | # 184 | # html_additional_pages = {} 185 | 186 | # If false, no module index is generated. 187 | # 188 | # html_domain_indices = True 189 | 190 | # If false, no index is generated. 191 | # 192 | # html_use_index = True 193 | 194 | # If true, the index is split into individual pages for each letter. 195 | # 196 | # html_split_index = False 197 | 198 | # If true, links to the reST sources are added to the pages. 199 | # 200 | # html_show_sourcelink = True 201 | 202 | # If true, "Created using Sphinx" is shown in the HTML footer. Default is True. 203 | # 204 | # html_show_sphinx = True 205 | 206 | # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. 207 | # 208 | # html_show_copyright = True 209 | 210 | # If true, an OpenSearch description file will be output, and all pages will 211 | # contain a tag referring to it. The value of this option must be the 212 | # base URL from which the finished HTML is served. 213 | # 214 | # html_use_opensearch = '' 215 | 216 | # This is the file name suffix for HTML files (e.g. ".xhtml"). 217 | # html_file_suffix = None 218 | 219 | # Language to be used for generating the HTML full-text search index. 220 | # Sphinx supports the following languages: 221 | # 'da', 'de', 'en', 'es', 'fi', 'fr', 'h', 'it', 'ja' 222 | # 'nl', 'no', 'pt', 'ro', 'r', 'sv', 'tr', 'zh' 223 | # 224 | # html_search_language = 'en' 225 | 226 | # A dictionary with options for the search language support, empty by default. 227 | # 'ja' uses this config value. 228 | # 'zh' user can custom change `jieba` dictionary path. 229 | # 230 | # html_search_options = {'type': 'default'} 231 | 232 | # The name of a javascript file (relative to the configuration directory) that 233 | # implements a search results scorer. If empty, the default will be used. 234 | # 235 | # html_search_scorer = 'scorer.js' 236 | 237 | # Output file base name for HTML help builder. 238 | htmlhelp_basename = 'VideoDigitalWatermarkingdoc' 239 | 240 | # -- Options for LaTeX output --------------------------------------------- 241 | 242 | latex_elements = { 243 | # The paper size ('letterpaper' or 'a4paper'). 244 | # 245 | # 'papersize': 'letterpaper', 246 | 247 | # The font size ('10pt', '11pt' or '12pt'). 248 | # 249 | # 'pointsize': '10pt', 250 | 251 | # Additional stuff for the LaTeX preamble. 252 | # 253 | # 'preamble': '', 254 | 255 | # Latex figure (float) alignment 256 | # 257 | # 'figure_align': 'htbp', 258 | } 259 | 260 | # Grouping the document tree into LaTeX files. List of tuples 261 | # (source start file, target name, title, 262 | # author, documentclass [howto, manual, or own class]). 263 | latex_documents = [ 264 | (master_doc, 'VideoDigitalWatermarking.tex', 'VideoDigitalWatermarking Documentation', 265 | 'pira', 'manual'), 266 | ] 267 | 268 | # The name of an image file (relative to this directory) to place at the top of 269 | # the title page. 270 | # 271 | # latex_logo = None 272 | 273 | # For "manual" documents, if this is true, then toplevel headings are parts, 274 | # not chapters. 275 | # 276 | # latex_use_parts = False 277 | 278 | # If true, show page references after internal links. 279 | # 280 | # latex_show_pagerefs = False 281 | 282 | # If true, show URL addresses after external links. 283 | # 284 | # latex_show_urls = False 285 | 286 | # Documents to append as an appendix to all manuals. 287 | # 288 | # latex_appendices = [] 289 | 290 | # It false, will not define \strong, \code, itleref, \crossref ... but only 291 | # \sphinxstrong, ..., \sphinxtitleref, ... To help avoid clash with user added 292 | # packages. 293 | # 294 | # latex_keep_old_macro_names = True 295 | 296 | # If false, no module index is generated. 297 | # 298 | # latex_domain_indices = True 299 | 300 | 301 | # -- Options for manual page output --------------------------------------- 302 | 303 | # One entry per manual page. List of tuples 304 | # (source start file, name, description, authors, manual section). 305 | man_pages = [ 306 | (master_doc, 'videodigitalwatermarking', 'VideoDigitalWatermarking Documentation', 307 | [author], 1) 308 | ] 309 | 310 | # If true, show URL addresses after external links. 311 | # 312 | # man_show_urls = False 313 | 314 | 315 | # -- Options for Texinfo output ------------------------------------------- 316 | 317 | # Grouping the document tree into Texinfo files. List of tuples 318 | # (source start file, target name, title, author, 319 | # dir menu entry, description, category) 320 | texinfo_documents = [ 321 | (master_doc, 'VideoDigitalWatermarking', 'VideoDigitalWatermarking Documentation', 322 | author, 'VideoDigitalWatermarking', 'One line description of project.', 323 | 'Miscellaneous'), 324 | ] 325 | 326 | # Documents to append as an appendix to all manuals. 327 | # 328 | # texinfo_appendices = [] 329 | 330 | # If false, no module index is generated. 331 | # 332 | # texinfo_domain_indices = True 333 | 334 | # How to display URL addresses: 'footnote', 'no', or 'inline'. 335 | # 336 | # texinfo_show_urls = 'footnote' 337 | 338 | # If true, do not generate a @detailmenu in the "Top" node's menu. 339 | # 340 | # texinfo_no_detailmenu = False 341 | -------------------------------------------------------------------------------- /html/_static/underscore.js: -------------------------------------------------------------------------------- 1 | // Underscore.js 1.3.1 2 | // (c) 2009-2012 Jeremy Ashkenas, DocumentCloud Inc. 3 | // Underscore is freely distributable under the MIT license. 4 | // Portions of Underscore are inspired or borrowed from Prototype, 5 | // Oliver Steele's Functional, and John Resig's Micro-Templating. 6 | // For all details and documentation: 7 | // http://documentcloud.github.com/underscore 8 | (function(){function q(a,c,d){if(a===c)return a!==0||1/a==1/c;if(a==null||c==null)return a===c;if(a._chain)a=a._wrapped;if(c._chain)c=c._wrapped;if(a.isEqual&&b.isFunction(a.isEqual))return a.isEqual(c);if(c.isEqual&&b.isFunction(c.isEqual))return c.isEqual(a);var e=l.call(a);if(e!=l.call(c))return false;switch(e){case "[object String]":return a==String(c);case "[object Number]":return a!=+a?c!=+c:a==0?1/a==1/c:a==+c;case "[object Date]":case "[object Boolean]":return+a==+c;case "[object RegExp]":return a.source== 9 | c.source&&a.global==c.global&&a.multiline==c.multiline&&a.ignoreCase==c.ignoreCase}if(typeof a!="object"||typeof c!="object")return false;for(var f=d.length;f--;)if(d[f]==a)return true;d.push(a);var f=0,g=true;if(e=="[object Array]"){if(f=a.length,g=f==c.length)for(;f--;)if(!(g=f in a==f in c&&q(a[f],c[f],d)))break}else{if("constructor"in a!="constructor"in c||a.constructor!=c.constructor)return false;for(var h in a)if(b.has(a,h)&&(f++,!(g=b.has(c,h)&&q(a[h],c[h],d))))break;if(g){for(h in c)if(b.has(c, 10 | h)&&!f--)break;g=!f}}d.pop();return g}var r=this,G=r._,n={},k=Array.prototype,o=Object.prototype,i=k.slice,H=k.unshift,l=o.toString,I=o.hasOwnProperty,w=k.forEach,x=k.map,y=k.reduce,z=k.reduceRight,A=k.filter,B=k.every,C=k.some,p=k.indexOf,D=k.lastIndexOf,o=Array.isArray,J=Object.keys,s=Function.prototype.bind,b=function(a){return new m(a)};if(typeof exports!=="undefined"){if(typeof module!=="undefined"&&module.exports)exports=module.exports=b;exports._=b}else r._=b;b.VERSION="1.3.1";var j=b.each= 11 | b.forEach=function(a,c,d){if(a!=null)if(w&&a.forEach===w)a.forEach(c,d);else if(a.length===+a.length)for(var e=0,f=a.length;e2;a== 12 | null&&(a=[]);if(y&&a.reduce===y)return e&&(c=b.bind(c,e)),f?a.reduce(c,d):a.reduce(c);j(a,function(a,b,i){f?d=c.call(e,d,a,b,i):(d=a,f=true)});if(!f)throw new TypeError("Reduce of empty array with no initial value");return d};b.reduceRight=b.foldr=function(a,c,d,e){var f=arguments.length>2;a==null&&(a=[]);if(z&&a.reduceRight===z)return e&&(c=b.bind(c,e)),f?a.reduceRight(c,d):a.reduceRight(c);var g=b.toArray(a).reverse();e&&!f&&(c=b.bind(c,e));return f?b.reduce(g,c,d,e):b.reduce(g,c)};b.find=b.detect= 13 | function(a,c,b){var e;E(a,function(a,g,h){if(c.call(b,a,g,h))return e=a,true});return e};b.filter=b.select=function(a,c,b){var e=[];if(a==null)return e;if(A&&a.filter===A)return a.filter(c,b);j(a,function(a,g,h){c.call(b,a,g,h)&&(e[e.length]=a)});return e};b.reject=function(a,c,b){var e=[];if(a==null)return e;j(a,function(a,g,h){c.call(b,a,g,h)||(e[e.length]=a)});return e};b.every=b.all=function(a,c,b){var e=true;if(a==null)return e;if(B&&a.every===B)return a.every(c,b);j(a,function(a,g,h){if(!(e= 14 | e&&c.call(b,a,g,h)))return n});return e};var E=b.some=b.any=function(a,c,d){c||(c=b.identity);var e=false;if(a==null)return e;if(C&&a.some===C)return a.some(c,d);j(a,function(a,b,h){if(e||(e=c.call(d,a,b,h)))return n});return!!e};b.include=b.contains=function(a,c){var b=false;if(a==null)return b;return p&&a.indexOf===p?a.indexOf(c)!=-1:b=E(a,function(a){return a===c})};b.invoke=function(a,c){var d=i.call(arguments,2);return b.map(a,function(a){return(b.isFunction(c)?c||a:a[c]).apply(a,d)})};b.pluck= 15 | function(a,c){return b.map(a,function(a){return a[c]})};b.max=function(a,c,d){if(!c&&b.isArray(a))return Math.max.apply(Math,a);if(!c&&b.isEmpty(a))return-Infinity;var e={computed:-Infinity};j(a,function(a,b,h){b=c?c.call(d,a,b,h):a;b>=e.computed&&(e={value:a,computed:b})});return e.value};b.min=function(a,c,d){if(!c&&b.isArray(a))return Math.min.apply(Math,a);if(!c&&b.isEmpty(a))return Infinity;var e={computed:Infinity};j(a,function(a,b,h){b=c?c.call(d,a,b,h):a;bd?1:0}),"value")};b.groupBy=function(a,c){var d={},e=b.isFunction(c)?c:function(a){return a[c]};j(a,function(a,b){var c=e(a,b);(d[c]||(d[c]=[])).push(a)});return d};b.sortedIndex=function(a, 17 | c,d){d||(d=b.identity);for(var e=0,f=a.length;e>1;d(a[g])=0})})};b.difference=function(a){var c=b.flatten(i.call(arguments,1));return b.filter(a,function(a){return!b.include(c,a)})};b.zip=function(){for(var a=i.call(arguments),c=b.max(b.pluck(a,"length")),d=Array(c),e=0;e=0;d--)b=[a[d].apply(this,b)];return b[0]}}; 24 | b.after=function(a,b){return a<=0?b():function(){if(--a<1)return b.apply(this,arguments)}};b.keys=J||function(a){if(a!==Object(a))throw new TypeError("Invalid object");var c=[],d;for(d in a)b.has(a,d)&&(c[c.length]=d);return c};b.values=function(a){return b.map(a,b.identity)};b.functions=b.methods=function(a){var c=[],d;for(d in a)b.isFunction(a[d])&&c.push(d);return c.sort()};b.extend=function(a){j(i.call(arguments,1),function(b){for(var d in b)a[d]=b[d]});return a};b.defaults=function(a){j(i.call(arguments, 25 | 1),function(b){for(var d in b)a[d]==null&&(a[d]=b[d])});return a};b.clone=function(a){return!b.isObject(a)?a:b.isArray(a)?a.slice():b.extend({},a)};b.tap=function(a,b){b(a);return a};b.isEqual=function(a,b){return q(a,b,[])};b.isEmpty=function(a){if(b.isArray(a)||b.isString(a))return a.length===0;for(var c in a)if(b.has(a,c))return false;return true};b.isElement=function(a){return!!(a&&a.nodeType==1)};b.isArray=o||function(a){return l.call(a)=="[object Array]"};b.isObject=function(a){return a===Object(a)}; 26 | b.isArguments=function(a){return l.call(a)=="[object Arguments]"};if(!b.isArguments(arguments))b.isArguments=function(a){return!(!a||!b.has(a,"callee"))};b.isFunction=function(a){return l.call(a)=="[object Function]"};b.isString=function(a){return l.call(a)=="[object String]"};b.isNumber=function(a){return l.call(a)=="[object Number]"};b.isNaN=function(a){return a!==a};b.isBoolean=function(a){return a===true||a===false||l.call(a)=="[object Boolean]"};b.isDate=function(a){return l.call(a)=="[object Date]"}; 27 | b.isRegExp=function(a){return l.call(a)=="[object RegExp]"};b.isNull=function(a){return a===null};b.isUndefined=function(a){return a===void 0};b.has=function(a,b){return I.call(a,b)};b.noConflict=function(){r._=G;return this};b.identity=function(a){return a};b.times=function(a,b,d){for(var e=0;e/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/")};b.mixin=function(a){j(b.functions(a), 28 | function(c){K(c,b[c]=a[c])})};var L=0;b.uniqueId=function(a){var b=L++;return a?a+b:b};b.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var t=/.^/,u=function(a){return a.replace(/\\\\/g,"\\").replace(/\\'/g,"'")};b.template=function(a,c){var d=b.templateSettings,d="var __p=[],print=function(){__p.push.apply(__p,arguments);};with(obj||{}){__p.push('"+a.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(d.escape||t,function(a,b){return"',_.escape("+ 29 | u(b)+"),'"}).replace(d.interpolate||t,function(a,b){return"',"+u(b)+",'"}).replace(d.evaluate||t,function(a,b){return"');"+u(b).replace(/[\r\n\t]/g," ")+";__p.push('"}).replace(/\r/g,"\\r").replace(/\n/g,"\\n").replace(/\t/g,"\\t")+"');}return __p.join('');",e=new Function("obj","_",d);return c?e(c,b):function(a){return e.call(this,a,b)}};b.chain=function(a){return b(a).chain()};var m=function(a){this._wrapped=a};b.prototype=m.prototype;var v=function(a,c){return c?b(a).chain():a},K=function(a,c){m.prototype[a]= 30 | function(){var a=i.call(arguments);H.call(a,this._wrapped);return v(c.apply(b,a),this._chain)}};b.mixin(b);j("pop,push,reverse,shift,sort,splice,unshift".split(","),function(a){var b=k[a];m.prototype[a]=function(){var d=this._wrapped;b.apply(d,arguments);var e=d.length;(a=="shift"||a=="splice")&&e===0&&delete d[0];return v(d,this._chain)}});j(["concat","join","slice"],function(a){var b=k[a];m.prototype[a]=function(){return v(b.apply(this._wrapped,arguments),this._chain)}});m.prototype.chain=function(){this._chain= 31 | true;return this};m.prototype.value=function(){return this._wrapped}}).call(this); 32 | -------------------------------------------------------------------------------- /docs/_build/html/_static/underscore.js: -------------------------------------------------------------------------------- 1 | // Underscore.js 1.3.1 2 | // (c) 2009-2012 Jeremy Ashkenas, DocumentCloud Inc. 3 | // Underscore is freely distributable under the MIT license. 4 | // Portions of Underscore are inspired or borrowed from Prototype, 5 | // Oliver Steele's Functional, and John Resig's Micro-Templating. 6 | // For all details and documentation: 7 | // http://documentcloud.github.com/underscore 8 | (function(){function q(a,c,d){if(a===c)return a!==0||1/a==1/c;if(a==null||c==null)return a===c;if(a._chain)a=a._wrapped;if(c._chain)c=c._wrapped;if(a.isEqual&&b.isFunction(a.isEqual))return a.isEqual(c);if(c.isEqual&&b.isFunction(c.isEqual))return c.isEqual(a);var e=l.call(a);if(e!=l.call(c))return false;switch(e){case "[object String]":return a==String(c);case "[object Number]":return a!=+a?c!=+c:a==0?1/a==1/c:a==+c;case "[object Date]":case "[object Boolean]":return+a==+c;case "[object RegExp]":return a.source== 9 | c.source&&a.global==c.global&&a.multiline==c.multiline&&a.ignoreCase==c.ignoreCase}if(typeof a!="object"||typeof c!="object")return false;for(var f=d.length;f--;)if(d[f]==a)return true;d.push(a);var f=0,g=true;if(e=="[object Array]"){if(f=a.length,g=f==c.length)for(;f--;)if(!(g=f in a==f in c&&q(a[f],c[f],d)))break}else{if("constructor"in a!="constructor"in c||a.constructor!=c.constructor)return false;for(var h in a)if(b.has(a,h)&&(f++,!(g=b.has(c,h)&&q(a[h],c[h],d))))break;if(g){for(h in c)if(b.has(c, 10 | h)&&!f--)break;g=!f}}d.pop();return g}var r=this,G=r._,n={},k=Array.prototype,o=Object.prototype,i=k.slice,H=k.unshift,l=o.toString,I=o.hasOwnProperty,w=k.forEach,x=k.map,y=k.reduce,z=k.reduceRight,A=k.filter,B=k.every,C=k.some,p=k.indexOf,D=k.lastIndexOf,o=Array.isArray,J=Object.keys,s=Function.prototype.bind,b=function(a){return new m(a)};if(typeof exports!=="undefined"){if(typeof module!=="undefined"&&module.exports)exports=module.exports=b;exports._=b}else r._=b;b.VERSION="1.3.1";var j=b.each= 11 | b.forEach=function(a,c,d){if(a!=null)if(w&&a.forEach===w)a.forEach(c,d);else if(a.length===+a.length)for(var e=0,f=a.length;e2;a== 12 | null&&(a=[]);if(y&&a.reduce===y)return e&&(c=b.bind(c,e)),f?a.reduce(c,d):a.reduce(c);j(a,function(a,b,i){f?d=c.call(e,d,a,b,i):(d=a,f=true)});if(!f)throw new TypeError("Reduce of empty array with no initial value");return d};b.reduceRight=b.foldr=function(a,c,d,e){var f=arguments.length>2;a==null&&(a=[]);if(z&&a.reduceRight===z)return e&&(c=b.bind(c,e)),f?a.reduceRight(c,d):a.reduceRight(c);var g=b.toArray(a).reverse();e&&!f&&(c=b.bind(c,e));return f?b.reduce(g,c,d,e):b.reduce(g,c)};b.find=b.detect= 13 | function(a,c,b){var e;E(a,function(a,g,h){if(c.call(b,a,g,h))return e=a,true});return e};b.filter=b.select=function(a,c,b){var e=[];if(a==null)return e;if(A&&a.filter===A)return a.filter(c,b);j(a,function(a,g,h){c.call(b,a,g,h)&&(e[e.length]=a)});return e};b.reject=function(a,c,b){var e=[];if(a==null)return e;j(a,function(a,g,h){c.call(b,a,g,h)||(e[e.length]=a)});return e};b.every=b.all=function(a,c,b){var e=true;if(a==null)return e;if(B&&a.every===B)return a.every(c,b);j(a,function(a,g,h){if(!(e= 14 | e&&c.call(b,a,g,h)))return n});return e};var E=b.some=b.any=function(a,c,d){c||(c=b.identity);var e=false;if(a==null)return e;if(C&&a.some===C)return a.some(c,d);j(a,function(a,b,h){if(e||(e=c.call(d,a,b,h)))return n});return!!e};b.include=b.contains=function(a,c){var b=false;if(a==null)return b;return p&&a.indexOf===p?a.indexOf(c)!=-1:b=E(a,function(a){return a===c})};b.invoke=function(a,c){var d=i.call(arguments,2);return b.map(a,function(a){return(b.isFunction(c)?c||a:a[c]).apply(a,d)})};b.pluck= 15 | function(a,c){return b.map(a,function(a){return a[c]})};b.max=function(a,c,d){if(!c&&b.isArray(a))return Math.max.apply(Math,a);if(!c&&b.isEmpty(a))return-Infinity;var e={computed:-Infinity};j(a,function(a,b,h){b=c?c.call(d,a,b,h):a;b>=e.computed&&(e={value:a,computed:b})});return e.value};b.min=function(a,c,d){if(!c&&b.isArray(a))return Math.min.apply(Math,a);if(!c&&b.isEmpty(a))return Infinity;var e={computed:Infinity};j(a,function(a,b,h){b=c?c.call(d,a,b,h):a;bd?1:0}),"value")};b.groupBy=function(a,c){var d={},e=b.isFunction(c)?c:function(a){return a[c]};j(a,function(a,b){var c=e(a,b);(d[c]||(d[c]=[])).push(a)});return d};b.sortedIndex=function(a, 17 | c,d){d||(d=b.identity);for(var e=0,f=a.length;e>1;d(a[g])=0})})};b.difference=function(a){var c=b.flatten(i.call(arguments,1));return b.filter(a,function(a){return!b.include(c,a)})};b.zip=function(){for(var a=i.call(arguments),c=b.max(b.pluck(a,"length")),d=Array(c),e=0;e=0;d--)b=[a[d].apply(this,b)];return b[0]}}; 24 | b.after=function(a,b){return a<=0?b():function(){if(--a<1)return b.apply(this,arguments)}};b.keys=J||function(a){if(a!==Object(a))throw new TypeError("Invalid object");var c=[],d;for(d in a)b.has(a,d)&&(c[c.length]=d);return c};b.values=function(a){return b.map(a,b.identity)};b.functions=b.methods=function(a){var c=[],d;for(d in a)b.isFunction(a[d])&&c.push(d);return c.sort()};b.extend=function(a){j(i.call(arguments,1),function(b){for(var d in b)a[d]=b[d]});return a};b.defaults=function(a){j(i.call(arguments, 25 | 1),function(b){for(var d in b)a[d]==null&&(a[d]=b[d])});return a};b.clone=function(a){return!b.isObject(a)?a:b.isArray(a)?a.slice():b.extend({},a)};b.tap=function(a,b){b(a);return a};b.isEqual=function(a,b){return q(a,b,[])};b.isEmpty=function(a){if(b.isArray(a)||b.isString(a))return a.length===0;for(var c in a)if(b.has(a,c))return false;return true};b.isElement=function(a){return!!(a&&a.nodeType==1)};b.isArray=o||function(a){return l.call(a)=="[object Array]"};b.isObject=function(a){return a===Object(a)}; 26 | b.isArguments=function(a){return l.call(a)=="[object Arguments]"};if(!b.isArguments(arguments))b.isArguments=function(a){return!(!a||!b.has(a,"callee"))};b.isFunction=function(a){return l.call(a)=="[object Function]"};b.isString=function(a){return l.call(a)=="[object String]"};b.isNumber=function(a){return l.call(a)=="[object Number]"};b.isNaN=function(a){return a!==a};b.isBoolean=function(a){return a===true||a===false||l.call(a)=="[object Boolean]"};b.isDate=function(a){return l.call(a)=="[object Date]"}; 27 | b.isRegExp=function(a){return l.call(a)=="[object RegExp]"};b.isNull=function(a){return a===null};b.isUndefined=function(a){return a===void 0};b.has=function(a,b){return I.call(a,b)};b.noConflict=function(){r._=G;return this};b.identity=function(a){return a};b.times=function(a,b,d){for(var e=0;e/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/")};b.mixin=function(a){j(b.functions(a), 28 | function(c){K(c,b[c]=a[c])})};var L=0;b.uniqueId=function(a){var b=L++;return a?a+b:b};b.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var t=/.^/,u=function(a){return a.replace(/\\\\/g,"\\").replace(/\\'/g,"'")};b.template=function(a,c){var d=b.templateSettings,d="var __p=[],print=function(){__p.push.apply(__p,arguments);};with(obj||{}){__p.push('"+a.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(d.escape||t,function(a,b){return"',_.escape("+ 29 | u(b)+"),'"}).replace(d.interpolate||t,function(a,b){return"',"+u(b)+",'"}).replace(d.evaluate||t,function(a,b){return"');"+u(b).replace(/[\r\n\t]/g," ")+";__p.push('"}).replace(/\r/g,"\\r").replace(/\n/g,"\\n").replace(/\t/g,"\\t")+"');}return __p.join('');",e=new Function("obj","_",d);return c?e(c,b):function(a){return e.call(this,a,b)}};b.chain=function(a){return b(a).chain()};var m=function(a){this._wrapped=a};b.prototype=m.prototype;var v=function(a,c){return c?b(a).chain():a},K=function(a,c){m.prototype[a]= 30 | function(){var a=i.call(arguments);H.call(a,this._wrapped);return v(c.apply(b,a),this._chain)}};b.mixin(b);j("pop,push,reverse,shift,sort,splice,unshift".split(","),function(a){var b=k[a];m.prototype[a]=function(){var d=this._wrapped;b.apply(d,arguments);var e=d.length;(a=="shift"||a=="splice")&&e===0&&delete d[0];return v(d,this._chain)}});j(["concat","join","slice"],function(a){var b=k[a];m.prototype[a]=function(){return v(b.apply(this._wrapped,arguments),this._chain)}});m.prototype.chain=function(){this._chain= 31 | true;return this};m.prototype.value=function(){return this._wrapped}}).call(this); 32 | -------------------------------------------------------------------------------- /html/_static/basic.css: -------------------------------------------------------------------------------- 1 | /* 2 | * basic.css 3 | * ~~~~~~~~~ 4 | * 5 | * Sphinx stylesheet -- basic theme. 6 | * 7 | * :copyright: Copyright 2007-2016 by the Sphinx team, see AUTHORS. 8 | * :license: BSD, see LICENSE for details. 9 | * 10 | */ 11 | 12 | /* -- main layout ----------------------------------------------------------- */ 13 | 14 | div.clearer { 15 | clear: both; 16 | } 17 | 18 | /* -- relbar ---------------------------------------------------------------- */ 19 | 20 | div.related { 21 | width: 100%; 22 | font-size: 90%; 23 | } 24 | 25 | div.related h3 { 26 | display: none; 27 | } 28 | 29 | div.related ul { 30 | margin: 0; 31 | padding: 0 0 0 10px; 32 | list-style: none; 33 | } 34 | 35 | div.related li { 36 | display: inline; 37 | } 38 | 39 | div.related li.right { 40 | float: right; 41 | margin-right: 5px; 42 | } 43 | 44 | /* -- sidebar --------------------------------------------------------------- */ 45 | 46 | div.sphinxsidebarwrapper { 47 | padding: 10px 5px 0 10px; 48 | } 49 | 50 | div.sphinxsidebar { 51 | float: left; 52 | width: 230px; 53 | margin-left: -100%; 54 | font-size: 90%; 55 | word-wrap: break-word; 56 | overflow-wrap : break-word; 57 | } 58 | 59 | div.sphinxsidebar ul { 60 | list-style: none; 61 | } 62 | 63 | div.sphinxsidebar ul ul, 64 | div.sphinxsidebar ul.want-points { 65 | margin-left: 20px; 66 | list-style: square; 67 | } 68 | 69 | div.sphinxsidebar ul ul { 70 | margin-top: 0; 71 | margin-bottom: 0; 72 | } 73 | 74 | div.sphinxsidebar form { 75 | margin-top: 10px; 76 | } 77 | 78 | div.sphinxsidebar input { 79 | border: 1px solid #98dbcc; 80 | font-family: sans-serif; 81 | font-size: 1em; 82 | } 83 | 84 | div.sphinxsidebar #searchbox input[type="text"] { 85 | width: 170px; 86 | } 87 | 88 | img { 89 | border: 0; 90 | max-width: 100%; 91 | } 92 | 93 | /* -- search page ----------------------------------------------------------- */ 94 | 95 | ul.search { 96 | margin: 10px 0 0 20px; 97 | padding: 0; 98 | } 99 | 100 | ul.search li { 101 | padding: 5px 0 5px 20px; 102 | background-image: url(file.png); 103 | background-repeat: no-repeat; 104 | background-position: 0 7px; 105 | } 106 | 107 | ul.search li a { 108 | font-weight: bold; 109 | } 110 | 111 | ul.search li div.context { 112 | color: #888; 113 | margin: 2px 0 0 30px; 114 | text-align: left; 115 | } 116 | 117 | ul.keywordmatches li.goodmatch a { 118 | font-weight: bold; 119 | } 120 | 121 | /* -- index page ------------------------------------------------------------ */ 122 | 123 | table.contentstable { 124 | width: 90%; 125 | } 126 | 127 | table.contentstable p.biglink { 128 | line-height: 150%; 129 | } 130 | 131 | a.biglink { 132 | font-size: 1.3em; 133 | } 134 | 135 | span.linkdescr { 136 | font-style: italic; 137 | padding-top: 5px; 138 | font-size: 90%; 139 | } 140 | 141 | /* -- general index --------------------------------------------------------- */ 142 | 143 | table.indextable { 144 | width: 100%; 145 | } 146 | 147 | table.indextable td { 148 | text-align: left; 149 | vertical-align: top; 150 | } 151 | 152 | table.indextable dl, table.indextable dd { 153 | margin-top: 0; 154 | margin-bottom: 0; 155 | } 156 | 157 | table.indextable tr.pcap { 158 | height: 10px; 159 | } 160 | 161 | table.indextable tr.cap { 162 | margin-top: 10px; 163 | background-color: #f2f2f2; 164 | } 165 | 166 | img.toggler { 167 | margin-right: 3px; 168 | margin-top: 3px; 169 | cursor: pointer; 170 | } 171 | 172 | div.modindex-jumpbox { 173 | border-top: 1px solid #ddd; 174 | border-bottom: 1px solid #ddd; 175 | margin: 1em 0 1em 0; 176 | padding: 0.4em; 177 | } 178 | 179 | div.genindex-jumpbox { 180 | border-top: 1px solid #ddd; 181 | border-bottom: 1px solid #ddd; 182 | margin: 1em 0 1em 0; 183 | padding: 0.4em; 184 | } 185 | 186 | /* -- general body styles --------------------------------------------------- */ 187 | 188 | div.body p, div.body dd, div.body li, div.body blockquote { 189 | -moz-hyphens: auto; 190 | -ms-hyphens: auto; 191 | -webkit-hyphens: auto; 192 | hyphens: auto; 193 | } 194 | 195 | a.headerlink { 196 | visibility: hidden; 197 | } 198 | 199 | h1:hover > a.headerlink, 200 | h2:hover > a.headerlink, 201 | h3:hover > a.headerlink, 202 | h4:hover > a.headerlink, 203 | h5:hover > a.headerlink, 204 | h6:hover > a.headerlink, 205 | dt:hover > a.headerlink, 206 | caption:hover > a.headerlink, 207 | p.caption:hover > a.headerlink, 208 | div.code-block-caption:hover > a.headerlink { 209 | visibility: visible; 210 | } 211 | 212 | div.body p.caption { 213 | text-align: inherit; 214 | } 215 | 216 | div.body td { 217 | text-align: left; 218 | } 219 | 220 | .field-list ul { 221 | padding-left: 1em; 222 | } 223 | 224 | .first { 225 | margin-top: 0 !important; 226 | } 227 | 228 | p.rubric { 229 | margin-top: 30px; 230 | font-weight: bold; 231 | } 232 | 233 | img.align-left, .figure.align-left, object.align-left { 234 | clear: left; 235 | float: left; 236 | margin-right: 1em; 237 | } 238 | 239 | img.align-right, .figure.align-right, object.align-right { 240 | clear: right; 241 | float: right; 242 | margin-left: 1em; 243 | } 244 | 245 | img.align-center, .figure.align-center, object.align-center { 246 | display: block; 247 | margin-left: auto; 248 | margin-right: auto; 249 | } 250 | 251 | .align-left { 252 | text-align: left; 253 | } 254 | 255 | .align-center { 256 | text-align: center; 257 | } 258 | 259 | .align-right { 260 | text-align: right; 261 | } 262 | 263 | /* -- sidebars -------------------------------------------------------------- */ 264 | 265 | div.sidebar { 266 | margin: 0 0 0.5em 1em; 267 | border: 1px solid #ddb; 268 | padding: 7px 7px 0 7px; 269 | background-color: #ffe; 270 | width: 40%; 271 | float: right; 272 | } 273 | 274 | p.sidebar-title { 275 | font-weight: bold; 276 | } 277 | 278 | /* -- topics ---------------------------------------------------------------- */ 279 | 280 | div.topic { 281 | border: 1px solid #ccc; 282 | padding: 7px 7px 0 7px; 283 | margin: 10px 0 10px 0; 284 | } 285 | 286 | p.topic-title { 287 | font-size: 1.1em; 288 | font-weight: bold; 289 | margin-top: 10px; 290 | } 291 | 292 | /* -- admonitions ----------------------------------------------------------- */ 293 | 294 | div.admonition { 295 | margin-top: 10px; 296 | margin-bottom: 10px; 297 | padding: 7px; 298 | } 299 | 300 | div.admonition dt { 301 | font-weight: bold; 302 | } 303 | 304 | div.admonition dl { 305 | margin-bottom: 0; 306 | } 307 | 308 | p.admonition-title { 309 | margin: 0px 10px 5px 0px; 310 | font-weight: bold; 311 | } 312 | 313 | div.body p.centered { 314 | text-align: center; 315 | margin-top: 25px; 316 | } 317 | 318 | /* -- tables ---------------------------------------------------------------- */ 319 | 320 | table.docutils { 321 | border: 0; 322 | border-collapse: collapse; 323 | } 324 | 325 | table caption span.caption-number { 326 | font-style: italic; 327 | } 328 | 329 | table caption span.caption-text { 330 | } 331 | 332 | table.docutils td, table.docutils th { 333 | padding: 1px 8px 1px 5px; 334 | border-top: 0; 335 | border-left: 0; 336 | border-right: 0; 337 | border-bottom: 1px solid #aaa; 338 | } 339 | 340 | table.field-list td, table.field-list th { 341 | border: 0 !important; 342 | } 343 | 344 | table.footnote td, table.footnote th { 345 | border: 0 !important; 346 | } 347 | 348 | th { 349 | text-align: left; 350 | padding-right: 5px; 351 | } 352 | 353 | table.citation { 354 | border-left: solid 1px gray; 355 | margin-left: 1px; 356 | } 357 | 358 | table.citation td { 359 | border-bottom: none; 360 | } 361 | 362 | /* -- figures --------------------------------------------------------------- */ 363 | 364 | div.figure { 365 | margin: 0.5em; 366 | padding: 0.5em; 367 | } 368 | 369 | div.figure p.caption { 370 | padding: 0.3em; 371 | } 372 | 373 | div.figure p.caption span.caption-number { 374 | font-style: italic; 375 | } 376 | 377 | div.figure p.caption span.caption-text { 378 | } 379 | 380 | 381 | /* -- other body styles ----------------------------------------------------- */ 382 | 383 | ol.arabic { 384 | list-style: decimal; 385 | } 386 | 387 | ol.loweralpha { 388 | list-style: lower-alpha; 389 | } 390 | 391 | ol.upperalpha { 392 | list-style: upper-alpha; 393 | } 394 | 395 | ol.lowerroman { 396 | list-style: lower-roman; 397 | } 398 | 399 | ol.upperroman { 400 | list-style: upper-roman; 401 | } 402 | 403 | dl { 404 | margin-bottom: 15px; 405 | } 406 | 407 | dd p { 408 | margin-top: 0px; 409 | } 410 | 411 | dd ul, dd table { 412 | margin-bottom: 10px; 413 | } 414 | 415 | dd { 416 | margin-top: 3px; 417 | margin-bottom: 10px; 418 | margin-left: 30px; 419 | } 420 | 421 | dt:target, .highlighted { 422 | background-color: #fbe54e; 423 | } 424 | 425 | dl.glossary dt { 426 | font-weight: bold; 427 | font-size: 1.1em; 428 | } 429 | 430 | .field-list ul { 431 | margin: 0; 432 | padding-left: 1em; 433 | } 434 | 435 | .field-list p { 436 | margin: 0; 437 | } 438 | 439 | .optional { 440 | font-size: 1.3em; 441 | } 442 | 443 | .sig-paren { 444 | font-size: larger; 445 | } 446 | 447 | .versionmodified { 448 | font-style: italic; 449 | } 450 | 451 | .system-message { 452 | background-color: #fda; 453 | padding: 5px; 454 | border: 3px solid red; 455 | } 456 | 457 | .footnote:target { 458 | background-color: #ffa; 459 | } 460 | 461 | .line-block { 462 | display: block; 463 | margin-top: 1em; 464 | margin-bottom: 1em; 465 | } 466 | 467 | .line-block .line-block { 468 | margin-top: 0; 469 | margin-bottom: 0; 470 | margin-left: 1.5em; 471 | } 472 | 473 | .guilabel, .menuselection { 474 | font-family: sans-serif; 475 | } 476 | 477 | .accelerator { 478 | text-decoration: underline; 479 | } 480 | 481 | .classifier { 482 | font-style: oblique; 483 | } 484 | 485 | abbr, acronym { 486 | border-bottom: dotted 1px; 487 | cursor: help; 488 | } 489 | 490 | /* -- code displays --------------------------------------------------------- */ 491 | 492 | pre { 493 | overflow: auto; 494 | overflow-y: hidden; /* fixes display issues on Chrome browsers */ 495 | } 496 | 497 | td.linenos pre { 498 | padding: 5px 0px; 499 | border: 0; 500 | background-color: transparent; 501 | color: #aaa; 502 | } 503 | 504 | table.highlighttable { 505 | margin-left: 0.5em; 506 | } 507 | 508 | table.highlighttable td { 509 | padding: 0 0.5em 0 0.5em; 510 | } 511 | 512 | div.code-block-caption { 513 | padding: 2px 5px; 514 | font-size: small; 515 | } 516 | 517 | div.code-block-caption code { 518 | background-color: transparent; 519 | } 520 | 521 | div.code-block-caption + div > div.highlight > pre { 522 | margin-top: 0; 523 | } 524 | 525 | div.code-block-caption span.caption-number { 526 | padding: 0.1em 0.3em; 527 | font-style: italic; 528 | } 529 | 530 | div.code-block-caption span.caption-text { 531 | } 532 | 533 | div.literal-block-wrapper { 534 | padding: 1em 1em 0; 535 | } 536 | 537 | div.literal-block-wrapper div.highlight { 538 | margin: 0; 539 | } 540 | 541 | code.descname { 542 | background-color: transparent; 543 | font-weight: bold; 544 | font-size: 1.2em; 545 | } 546 | 547 | code.descclassname { 548 | background-color: transparent; 549 | } 550 | 551 | code.xref, a code { 552 | background-color: transparent; 553 | font-weight: bold; 554 | } 555 | 556 | h1 code, h2 code, h3 code, h4 code, h5 code, h6 code { 557 | background-color: transparent; 558 | } 559 | 560 | .viewcode-link { 561 | float: right; 562 | } 563 | 564 | .viewcode-back { 565 | float: right; 566 | font-family: sans-serif; 567 | } 568 | 569 | div.viewcode-block:target { 570 | margin: -1px -10px; 571 | padding: 0 10px; 572 | } 573 | 574 | /* -- math display ---------------------------------------------------------- */ 575 | 576 | img.math { 577 | vertical-align: middle; 578 | } 579 | 580 | div.body div.math p { 581 | text-align: center; 582 | } 583 | 584 | span.eqno { 585 | float: right; 586 | } 587 | 588 | /* -- printout stylesheet --------------------------------------------------- */ 589 | 590 | @media print { 591 | div.document, 592 | div.documentwrapper, 593 | div.bodywrapper { 594 | margin: 0 !important; 595 | width: 100%; 596 | } 597 | 598 | div.sphinxsidebar, 599 | div.related, 600 | div.footer, 601 | #top-link { 602 | display: none; 603 | } 604 | } -------------------------------------------------------------------------------- /docs/_build/html/_static/basic.css: -------------------------------------------------------------------------------- 1 | /* 2 | * basic.css 3 | * ~~~~~~~~~ 4 | * 5 | * Sphinx stylesheet -- basic theme. 6 | * 7 | * :copyright: Copyright 2007-2016 by the Sphinx team, see AUTHORS. 8 | * :license: BSD, see LICENSE for details. 9 | * 10 | */ 11 | 12 | /* -- main layout ----------------------------------------------------------- */ 13 | 14 | div.clearer { 15 | clear: both; 16 | } 17 | 18 | /* -- relbar ---------------------------------------------------------------- */ 19 | 20 | div.related { 21 | width: 100%; 22 | font-size: 90%; 23 | } 24 | 25 | div.related h3 { 26 | display: none; 27 | } 28 | 29 | div.related ul { 30 | margin: 0; 31 | padding: 0 0 0 10px; 32 | list-style: none; 33 | } 34 | 35 | div.related li { 36 | display: inline; 37 | } 38 | 39 | div.related li.right { 40 | float: right; 41 | margin-right: 5px; 42 | } 43 | 44 | /* -- sidebar --------------------------------------------------------------- */ 45 | 46 | div.sphinxsidebarwrapper { 47 | padding: 10px 5px 0 10px; 48 | } 49 | 50 | div.sphinxsidebar { 51 | float: left; 52 | width: 230px; 53 | margin-left: -100%; 54 | font-size: 90%; 55 | word-wrap: break-word; 56 | overflow-wrap : break-word; 57 | } 58 | 59 | div.sphinxsidebar ul { 60 | list-style: none; 61 | } 62 | 63 | div.sphinxsidebar ul ul, 64 | div.sphinxsidebar ul.want-points { 65 | margin-left: 20px; 66 | list-style: square; 67 | } 68 | 69 | div.sphinxsidebar ul ul { 70 | margin-top: 0; 71 | margin-bottom: 0; 72 | } 73 | 74 | div.sphinxsidebar form { 75 | margin-top: 10px; 76 | } 77 | 78 | div.sphinxsidebar input { 79 | border: 1px solid #98dbcc; 80 | font-family: sans-serif; 81 | font-size: 1em; 82 | } 83 | 84 | div.sphinxsidebar #searchbox input[type="text"] { 85 | width: 170px; 86 | } 87 | 88 | img { 89 | border: 0; 90 | max-width: 100%; 91 | } 92 | 93 | /* -- search page ----------------------------------------------------------- */ 94 | 95 | ul.search { 96 | margin: 10px 0 0 20px; 97 | padding: 0; 98 | } 99 | 100 | ul.search li { 101 | padding: 5px 0 5px 20px; 102 | background-image: url(file.png); 103 | background-repeat: no-repeat; 104 | background-position: 0 7px; 105 | } 106 | 107 | ul.search li a { 108 | font-weight: bold; 109 | } 110 | 111 | ul.search li div.context { 112 | color: #888; 113 | margin: 2px 0 0 30px; 114 | text-align: left; 115 | } 116 | 117 | ul.keywordmatches li.goodmatch a { 118 | font-weight: bold; 119 | } 120 | 121 | /* -- index page ------------------------------------------------------------ */ 122 | 123 | table.contentstable { 124 | width: 90%; 125 | } 126 | 127 | table.contentstable p.biglink { 128 | line-height: 150%; 129 | } 130 | 131 | a.biglink { 132 | font-size: 1.3em; 133 | } 134 | 135 | span.linkdescr { 136 | font-style: italic; 137 | padding-top: 5px; 138 | font-size: 90%; 139 | } 140 | 141 | /* -- general index --------------------------------------------------------- */ 142 | 143 | table.indextable { 144 | width: 100%; 145 | } 146 | 147 | table.indextable td { 148 | text-align: left; 149 | vertical-align: top; 150 | } 151 | 152 | table.indextable dl, table.indextable dd { 153 | margin-top: 0; 154 | margin-bottom: 0; 155 | } 156 | 157 | table.indextable tr.pcap { 158 | height: 10px; 159 | } 160 | 161 | table.indextable tr.cap { 162 | margin-top: 10px; 163 | background-color: #f2f2f2; 164 | } 165 | 166 | img.toggler { 167 | margin-right: 3px; 168 | margin-top: 3px; 169 | cursor: pointer; 170 | } 171 | 172 | div.modindex-jumpbox { 173 | border-top: 1px solid #ddd; 174 | border-bottom: 1px solid #ddd; 175 | margin: 1em 0 1em 0; 176 | padding: 0.4em; 177 | } 178 | 179 | div.genindex-jumpbox { 180 | border-top: 1px solid #ddd; 181 | border-bottom: 1px solid #ddd; 182 | margin: 1em 0 1em 0; 183 | padding: 0.4em; 184 | } 185 | 186 | /* -- general body styles --------------------------------------------------- */ 187 | 188 | div.body p, div.body dd, div.body li, div.body blockquote { 189 | -moz-hyphens: auto; 190 | -ms-hyphens: auto; 191 | -webkit-hyphens: auto; 192 | hyphens: auto; 193 | } 194 | 195 | a.headerlink { 196 | visibility: hidden; 197 | } 198 | 199 | h1:hover > a.headerlink, 200 | h2:hover > a.headerlink, 201 | h3:hover > a.headerlink, 202 | h4:hover > a.headerlink, 203 | h5:hover > a.headerlink, 204 | h6:hover > a.headerlink, 205 | dt:hover > a.headerlink, 206 | caption:hover > a.headerlink, 207 | p.caption:hover > a.headerlink, 208 | div.code-block-caption:hover > a.headerlink { 209 | visibility: visible; 210 | } 211 | 212 | div.body p.caption { 213 | text-align: inherit; 214 | } 215 | 216 | div.body td { 217 | text-align: left; 218 | } 219 | 220 | .field-list ul { 221 | padding-left: 1em; 222 | } 223 | 224 | .first { 225 | margin-top: 0 !important; 226 | } 227 | 228 | p.rubric { 229 | margin-top: 30px; 230 | font-weight: bold; 231 | } 232 | 233 | img.align-left, .figure.align-left, object.align-left { 234 | clear: left; 235 | float: left; 236 | margin-right: 1em; 237 | } 238 | 239 | img.align-right, .figure.align-right, object.align-right { 240 | clear: right; 241 | float: right; 242 | margin-left: 1em; 243 | } 244 | 245 | img.align-center, .figure.align-center, object.align-center { 246 | display: block; 247 | margin-left: auto; 248 | margin-right: auto; 249 | } 250 | 251 | .align-left { 252 | text-align: left; 253 | } 254 | 255 | .align-center { 256 | text-align: center; 257 | } 258 | 259 | .align-right { 260 | text-align: right; 261 | } 262 | 263 | /* -- sidebars -------------------------------------------------------------- */ 264 | 265 | div.sidebar { 266 | margin: 0 0 0.5em 1em; 267 | border: 1px solid #ddb; 268 | padding: 7px 7px 0 7px; 269 | background-color: #ffe; 270 | width: 40%; 271 | float: right; 272 | } 273 | 274 | p.sidebar-title { 275 | font-weight: bold; 276 | } 277 | 278 | /* -- topics ---------------------------------------------------------------- */ 279 | 280 | div.topic { 281 | border: 1px solid #ccc; 282 | padding: 7px 7px 0 7px; 283 | margin: 10px 0 10px 0; 284 | } 285 | 286 | p.topic-title { 287 | font-size: 1.1em; 288 | font-weight: bold; 289 | margin-top: 10px; 290 | } 291 | 292 | /* -- admonitions ----------------------------------------------------------- */ 293 | 294 | div.admonition { 295 | margin-top: 10px; 296 | margin-bottom: 10px; 297 | padding: 7px; 298 | } 299 | 300 | div.admonition dt { 301 | font-weight: bold; 302 | } 303 | 304 | div.admonition dl { 305 | margin-bottom: 0; 306 | } 307 | 308 | p.admonition-title { 309 | margin: 0px 10px 5px 0px; 310 | font-weight: bold; 311 | } 312 | 313 | div.body p.centered { 314 | text-align: center; 315 | margin-top: 25px; 316 | } 317 | 318 | /* -- tables ---------------------------------------------------------------- */ 319 | 320 | table.docutils { 321 | border: 0; 322 | border-collapse: collapse; 323 | } 324 | 325 | table caption span.caption-number { 326 | font-style: italic; 327 | } 328 | 329 | table caption span.caption-text { 330 | } 331 | 332 | table.docutils td, table.docutils th { 333 | padding: 1px 8px 1px 5px; 334 | border-top: 0; 335 | border-left: 0; 336 | border-right: 0; 337 | border-bottom: 1px solid #aaa; 338 | } 339 | 340 | table.field-list td, table.field-list th { 341 | border: 0 !important; 342 | } 343 | 344 | table.footnote td, table.footnote th { 345 | border: 0 !important; 346 | } 347 | 348 | th { 349 | text-align: left; 350 | padding-right: 5px; 351 | } 352 | 353 | table.citation { 354 | border-left: solid 1px gray; 355 | margin-left: 1px; 356 | } 357 | 358 | table.citation td { 359 | border-bottom: none; 360 | } 361 | 362 | /* -- figures --------------------------------------------------------------- */ 363 | 364 | div.figure { 365 | margin: 0.5em; 366 | padding: 0.5em; 367 | } 368 | 369 | div.figure p.caption { 370 | padding: 0.3em; 371 | } 372 | 373 | div.figure p.caption span.caption-number { 374 | font-style: italic; 375 | } 376 | 377 | div.figure p.caption span.caption-text { 378 | } 379 | 380 | 381 | /* -- other body styles ----------------------------------------------------- */ 382 | 383 | ol.arabic { 384 | list-style: decimal; 385 | } 386 | 387 | ol.loweralpha { 388 | list-style: lower-alpha; 389 | } 390 | 391 | ol.upperalpha { 392 | list-style: upper-alpha; 393 | } 394 | 395 | ol.lowerroman { 396 | list-style: lower-roman; 397 | } 398 | 399 | ol.upperroman { 400 | list-style: upper-roman; 401 | } 402 | 403 | dl { 404 | margin-bottom: 15px; 405 | } 406 | 407 | dd p { 408 | margin-top: 0px; 409 | } 410 | 411 | dd ul, dd table { 412 | margin-bottom: 10px; 413 | } 414 | 415 | dd { 416 | margin-top: 3px; 417 | margin-bottom: 10px; 418 | margin-left: 30px; 419 | } 420 | 421 | dt:target, .highlighted { 422 | background-color: #fbe54e; 423 | } 424 | 425 | dl.glossary dt { 426 | font-weight: bold; 427 | font-size: 1.1em; 428 | } 429 | 430 | .field-list ul { 431 | margin: 0; 432 | padding-left: 1em; 433 | } 434 | 435 | .field-list p { 436 | margin: 0; 437 | } 438 | 439 | .optional { 440 | font-size: 1.3em; 441 | } 442 | 443 | .sig-paren { 444 | font-size: larger; 445 | } 446 | 447 | .versionmodified { 448 | font-style: italic; 449 | } 450 | 451 | .system-message { 452 | background-color: #fda; 453 | padding: 5px; 454 | border: 3px solid red; 455 | } 456 | 457 | .footnote:target { 458 | background-color: #ffa; 459 | } 460 | 461 | .line-block { 462 | display: block; 463 | margin-top: 1em; 464 | margin-bottom: 1em; 465 | } 466 | 467 | .line-block .line-block { 468 | margin-top: 0; 469 | margin-bottom: 0; 470 | margin-left: 1.5em; 471 | } 472 | 473 | .guilabel, .menuselection { 474 | font-family: sans-serif; 475 | } 476 | 477 | .accelerator { 478 | text-decoration: underline; 479 | } 480 | 481 | .classifier { 482 | font-style: oblique; 483 | } 484 | 485 | abbr, acronym { 486 | border-bottom: dotted 1px; 487 | cursor: help; 488 | } 489 | 490 | /* -- code displays --------------------------------------------------------- */ 491 | 492 | pre { 493 | overflow: auto; 494 | overflow-y: hidden; /* fixes display issues on Chrome browsers */ 495 | } 496 | 497 | td.linenos pre { 498 | padding: 5px 0px; 499 | border: 0; 500 | background-color: transparent; 501 | color: #aaa; 502 | } 503 | 504 | table.highlighttable { 505 | margin-left: 0.5em; 506 | } 507 | 508 | table.highlighttable td { 509 | padding: 0 0.5em 0 0.5em; 510 | } 511 | 512 | div.code-block-caption { 513 | padding: 2px 5px; 514 | font-size: small; 515 | } 516 | 517 | div.code-block-caption code { 518 | background-color: transparent; 519 | } 520 | 521 | div.code-block-caption + div > div.highlight > pre { 522 | margin-top: 0; 523 | } 524 | 525 | div.code-block-caption span.caption-number { 526 | padding: 0.1em 0.3em; 527 | font-style: italic; 528 | } 529 | 530 | div.code-block-caption span.caption-text { 531 | } 532 | 533 | div.literal-block-wrapper { 534 | padding: 1em 1em 0; 535 | } 536 | 537 | div.literal-block-wrapper div.highlight { 538 | margin: 0; 539 | } 540 | 541 | code.descname { 542 | background-color: transparent; 543 | font-weight: bold; 544 | font-size: 1.2em; 545 | } 546 | 547 | code.descclassname { 548 | background-color: transparent; 549 | } 550 | 551 | code.xref, a code { 552 | background-color: transparent; 553 | font-weight: bold; 554 | } 555 | 556 | h1 code, h2 code, h3 code, h4 code, h5 code, h6 code { 557 | background-color: transparent; 558 | } 559 | 560 | .viewcode-link { 561 | float: right; 562 | } 563 | 564 | .viewcode-back { 565 | float: right; 566 | font-family: sans-serif; 567 | } 568 | 569 | div.viewcode-block:target { 570 | margin: -1px -10px; 571 | padding: 0 10px; 572 | } 573 | 574 | /* -- math display ---------------------------------------------------------- */ 575 | 576 | img.math { 577 | vertical-align: middle; 578 | } 579 | 580 | div.body div.math p { 581 | text-align: center; 582 | } 583 | 584 | span.eqno { 585 | float: right; 586 | } 587 | 588 | /* -- printout stylesheet --------------------------------------------------- */ 589 | 590 | @media print { 591 | div.document, 592 | div.documentwrapper, 593 | div.bodywrapper { 594 | margin: 0 !important; 595 | width: 100%; 596 | } 597 | 598 | div.sphinxsidebar, 599 | div.related, 600 | div.footer, 601 | #top-link { 602 | display: none; 603 | } 604 | } -------------------------------------------------------------------------------- /html/_static/alabaster.css: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | @import url("basic.css"); 54 | 55 | /* -- page layout ----------------------------------------------------------- */ 56 | 57 | body { 58 | font-family: 'goudy old style', 'minion pro', 'bell mt', Georgia, 'Hiragino Mincho Pro', serif; 59 | font-size: 17px; 60 | background-color: #fff; 61 | color: #000; 62 | margin: 0; 63 | padding: 0; 64 | } 65 | 66 | 67 | div.document { 68 | width: 940px; 69 | margin: 30px auto 0 auto; 70 | } 71 | 72 | div.documentwrapper { 73 | float: left; 74 | width: 100%; 75 | } 76 | 77 | div.bodywrapper { 78 | margin: 0 0 0 220px; 79 | } 80 | 81 | div.sphinxsidebar { 82 | width: 220px; 83 | font-size: 14px; 84 | line-height: 1.5; 85 | } 86 | 87 | hr { 88 | border: 1px solid #B1B4B6; 89 | } 90 | 91 | div.body { 92 | background-color: #fff; 93 | color: #3E4349; 94 | padding: 0 30px 0 30px; 95 | } 96 | 97 | div.body > .section { 98 | text-align: left; 99 | } 100 | 101 | div.footer { 102 | width: 940px; 103 | margin: 20px auto 30px auto; 104 | font-size: 14px; 105 | color: #888; 106 | text-align: right; 107 | } 108 | 109 | div.footer a { 110 | color: #888; 111 | } 112 | 113 | p.caption { 114 | font-family: inherit; 115 | font-size: inherit; 116 | } 117 | 118 | 119 | div.relations { 120 | display: none; 121 | } 122 | 123 | 124 | div.sphinxsidebar a { 125 | color: #444; 126 | text-decoration: none; 127 | border-bottom: 1px dotted #999; 128 | } 129 | 130 | div.sphinxsidebar a:hover { 131 | border-bottom: 1px solid #999; 132 | } 133 | 134 | div.sphinxsidebarwrapper { 135 | padding: 18px 10px; 136 | } 137 | 138 | div.sphinxsidebarwrapper p.logo { 139 | padding: 0; 140 | margin: -10px 0 0 0px; 141 | text-align: center; 142 | } 143 | 144 | div.sphinxsidebarwrapper h1.logo { 145 | margin-top: -10px; 146 | text-align: center; 147 | margin-bottom: 5px; 148 | text-align: left; 149 | } 150 | 151 | div.sphinxsidebarwrapper h1.logo-name { 152 | margin-top: 0px; 153 | } 154 | 155 | div.sphinxsidebarwrapper p.blurb { 156 | margin-top: 0; 157 | font-style: normal; 158 | } 159 | 160 | div.sphinxsidebar h3, 161 | div.sphinxsidebar h4 { 162 | font-family: 'Garamond', 'Georgia', serif; 163 | color: #444; 164 | font-size: 24px; 165 | font-weight: normal; 166 | margin: 0 0 5px 0; 167 | padding: 0; 168 | } 169 | 170 | div.sphinxsidebar h4 { 171 | font-size: 20px; 172 | } 173 | 174 | div.sphinxsidebar h3 a { 175 | color: #444; 176 | } 177 | 178 | div.sphinxsidebar p.logo a, 179 | div.sphinxsidebar h3 a, 180 | div.sphinxsidebar p.logo a:hover, 181 | div.sphinxsidebar h3 a:hover { 182 | border: none; 183 | } 184 | 185 | div.sphinxsidebar p { 186 | color: #555; 187 | margin: 10px 0; 188 | } 189 | 190 | div.sphinxsidebar ul { 191 | margin: 10px 0; 192 | padding: 0; 193 | color: #000; 194 | } 195 | 196 | div.sphinxsidebar ul li.toctree-l1 > a { 197 | font-size: 120%; 198 | } 199 | 200 | div.sphinxsidebar ul li.toctree-l2 > a { 201 | font-size: 110%; 202 | } 203 | 204 | div.sphinxsidebar input { 205 | border: 1px solid #CCC; 206 | font-family: 'goudy old style', 'minion pro', 'bell mt', Georgia, 'Hiragino Mincho Pro', serif; 207 | font-size: 1em; 208 | } 209 | 210 | div.sphinxsidebar hr { 211 | border: none; 212 | height: 1px; 213 | color: #AAA; 214 | background: #AAA; 215 | 216 | text-align: left; 217 | margin-left: 0; 218 | width: 50%; 219 | } 220 | 221 | /* -- body styles ----------------------------------------------------------- */ 222 | 223 | a { 224 | color: #004B6B; 225 | text-decoration: underline; 226 | } 227 | 228 | a:hover { 229 | color: #6D4100; 230 | text-decoration: underline; 231 | } 232 | 233 | div.body h1, 234 | div.body h2, 235 | div.body h3, 236 | div.body h4, 237 | div.body h5, 238 | div.body h6 { 239 | font-family: 'Garamond', 'Georgia', serif; 240 | font-weight: normal; 241 | margin: 30px 0px 10px 0px; 242 | padding: 0; 243 | } 244 | 245 | div.body h1 { margin-top: 0; padding-top: 0; font-size: 240%; } 246 | div.body h2 { font-size: 180%; } 247 | div.body h3 { font-size: 150%; } 248 | div.body h4 { font-size: 130%; } 249 | div.body h5 { font-size: 100%; } 250 | div.body h6 { font-size: 100%; } 251 | 252 | a.headerlink { 253 | color: #DDD; 254 | padding: 0 4px; 255 | text-decoration: none; 256 | } 257 | 258 | a.headerlink:hover { 259 | color: #444; 260 | background: #EAEAEA; 261 | } 262 | 263 | div.body p, div.body dd, div.body li { 264 | line-height: 1.4em; 265 | } 266 | 267 | div.admonition { 268 | margin: 20px 0px; 269 | padding: 10px 30px; 270 | background-color: #EEE; 271 | border: 1px solid #CCC; 272 | } 273 | 274 | div.admonition tt.xref, div.admonition code.xref, div.admonition a tt { 275 | background-color: ; 276 | border-bottom: 1px solid #fafafa; 277 | } 278 | 279 | dd div.admonition { 280 | margin-left: -60px; 281 | padding-left: 60px; 282 | } 283 | 284 | div.admonition p.admonition-title { 285 | font-family: 'Garamond', 'Georgia', serif; 286 | font-weight: normal; 287 | font-size: 24px; 288 | margin: 0 0 10px 0; 289 | padding: 0; 290 | line-height: 1; 291 | } 292 | 293 | div.admonition p.last { 294 | margin-bottom: 0; 295 | } 296 | 297 | div.highlight { 298 | background-color: #fff; 299 | } 300 | 301 | dt:target, .highlight { 302 | background: #FAF3E8; 303 | } 304 | 305 | div.warning { 306 | background-color: #FCC; 307 | border: 1px solid #FAA; 308 | } 309 | 310 | div.danger { 311 | background-color: #FCC; 312 | border: 1px solid #FAA; 313 | -moz-box-shadow: 2px 2px 4px #D52C2C; 314 | -webkit-box-shadow: 2px 2px 4px #D52C2C; 315 | box-shadow: 2px 2px 4px #D52C2C; 316 | } 317 | 318 | div.error { 319 | background-color: #FCC; 320 | border: 1px solid #FAA; 321 | -moz-box-shadow: 2px 2px 4px #D52C2C; 322 | -webkit-box-shadow: 2px 2px 4px #D52C2C; 323 | box-shadow: 2px 2px 4px #D52C2C; 324 | } 325 | 326 | div.caution { 327 | background-color: #FCC; 328 | border: 1px solid #FAA; 329 | } 330 | 331 | div.attention { 332 | background-color: #FCC; 333 | border: 1px solid #FAA; 334 | } 335 | 336 | div.important { 337 | background-color: #EEE; 338 | border: 1px solid #CCC; 339 | } 340 | 341 | div.note { 342 | background-color: #EEE; 343 | border: 1px solid #CCC; 344 | } 345 | 346 | div.tip { 347 | background-color: #EEE; 348 | border: 1px solid #CCC; 349 | } 350 | 351 | div.hint { 352 | background-color: #EEE; 353 | border: 1px solid #CCC; 354 | } 355 | 356 | div.seealso { 357 | background-color: #EEE; 358 | border: 1px solid #CCC; 359 | } 360 | 361 | div.topic { 362 | background-color: #EEE; 363 | } 364 | 365 | p.admonition-title { 366 | display: inline; 367 | } 368 | 369 | p.admonition-title:after { 370 | content: ":"; 371 | } 372 | 373 | pre, tt, code { 374 | font-family: 'Consolas', 'Menlo', 'Deja Vu Sans Mono', 'Bitstream Vera Sans Mono', monospace; 375 | font-size: 0.9em; 376 | } 377 | 378 | .hll { 379 | background-color: #FFC; 380 | margin: 0 -12px; 381 | padding: 0 12px; 382 | display: block; 383 | } 384 | 385 | img.screenshot { 386 | } 387 | 388 | tt.descname, tt.descclassname, code.descname, code.descclassname { 389 | font-size: 0.95em; 390 | } 391 | 392 | tt.descname, code.descname { 393 | padding-right: 0.08em; 394 | } 395 | 396 | img.screenshot { 397 | -moz-box-shadow: 2px 2px 4px #EEE; 398 | -webkit-box-shadow: 2px 2px 4px #EEE; 399 | box-shadow: 2px 2px 4px #EEE; 400 | } 401 | 402 | table.docutils { 403 | border: 1px solid #888; 404 | -moz-box-shadow: 2px 2px 4px #EEE; 405 | -webkit-box-shadow: 2px 2px 4px #EEE; 406 | box-shadow: 2px 2px 4px #EEE; 407 | } 408 | 409 | table.docutils td, table.docutils th { 410 | border: 1px solid #888; 411 | padding: 0.25em 0.7em; 412 | } 413 | 414 | table.field-list, table.footnote { 415 | border: none; 416 | -moz-box-shadow: none; 417 | -webkit-box-shadow: none; 418 | box-shadow: none; 419 | } 420 | 421 | table.footnote { 422 | margin: 15px 0; 423 | width: 100%; 424 | border: 1px solid #EEE; 425 | background: #FDFDFD; 426 | font-size: 0.9em; 427 | } 428 | 429 | table.footnote + table.footnote { 430 | margin-top: -15px; 431 | border-top: none; 432 | } 433 | 434 | table.field-list th { 435 | padding: 0 0.8em 0 0; 436 | } 437 | 438 | table.field-list td { 439 | padding: 0; 440 | } 441 | 442 | table.field-list p { 443 | margin-bottom: 0.8em; 444 | } 445 | 446 | table.footnote td.label { 447 | width: .1px; 448 | padding: 0.3em 0 0.3em 0.5em; 449 | } 450 | 451 | table.footnote td { 452 | padding: 0.3em 0.5em; 453 | } 454 | 455 | dl { 456 | margin: 0; 457 | padding: 0; 458 | } 459 | 460 | dl dd { 461 | margin-left: 30px; 462 | } 463 | 464 | blockquote { 465 | margin: 0 0 0 30px; 466 | padding: 0; 467 | } 468 | 469 | ul, ol { 470 | /* Matches the 30px from the narrow-screen "li > ul" selector below */ 471 | margin: 10px 0 10px 30px; 472 | padding: 0; 473 | } 474 | 475 | pre { 476 | background: #EEE; 477 | padding: 7px 30px; 478 | margin: 15px 0px; 479 | line-height: 1.3em; 480 | } 481 | 482 | div.viewcode-block:target { 483 | background: #ffd; 484 | } 485 | 486 | dl pre, blockquote pre, li pre { 487 | margin-left: 0; 488 | padding-left: 30px; 489 | } 490 | 491 | dl dl pre { 492 | margin-left: -90px; 493 | padding-left: 90px; 494 | } 495 | 496 | tt, code { 497 | background-color: #ecf0f3; 498 | color: #222; 499 | /* padding: 1px 2px; */ 500 | } 501 | 502 | tt.xref, code.xref, a tt { 503 | background-color: #FBFBFB; 504 | border-bottom: 1px solid #fff; 505 | } 506 | 507 | a.reference { 508 | text-decoration: none; 509 | border-bottom: 1px dotted #004B6B; 510 | } 511 | 512 | /* Don't put an underline on images */ 513 | a.image-reference, a.image-reference:hover { 514 | border-bottom: none; 515 | } 516 | 517 | a.reference:hover { 518 | border-bottom: 1px solid #6D4100; 519 | } 520 | 521 | a.footnote-reference { 522 | text-decoration: none; 523 | font-size: 0.7em; 524 | vertical-align: top; 525 | border-bottom: 1px dotted #004B6B; 526 | } 527 | 528 | a.footnote-reference:hover { 529 | border-bottom: 1px solid #6D4100; 530 | } 531 | 532 | a:hover tt, a:hover code { 533 | background: #EEE; 534 | } 535 | 536 | 537 | @media screen and (max-width: 870px) { 538 | 539 | div.sphinxsidebar { 540 | display: none; 541 | } 542 | 543 | div.document { 544 | width: 100%; 545 | 546 | } 547 | 548 | div.documentwrapper { 549 | margin-left: 0; 550 | margin-top: 0; 551 | margin-right: 0; 552 | margin-bottom: 0; 553 | } 554 | 555 | div.bodywrapper { 556 | margin-top: 0; 557 | margin-right: 0; 558 | margin-bottom: 0; 559 | margin-left: 0; 560 | } 561 | 562 | ul { 563 | margin-left: 0; 564 | } 565 | 566 | li > ul { 567 | /* Matches the 30px from the "ul, ol" selector above */ 568 | margin-left: 30px; 569 | } 570 | 571 | .document { 572 | width: auto; 573 | } 574 | 575 | .footer { 576 | width: auto; 577 | } 578 | 579 | .bodywrapper { 580 | margin: 0; 581 | } 582 | 583 | .footer { 584 | width: auto; 585 | } 586 | 587 | .github { 588 | display: none; 589 | } 590 | 591 | 592 | 593 | } 594 | 595 | 596 | 597 | @media screen and (max-width: 875px) { 598 | 599 | body { 600 | margin: 0; 601 | padding: 20px 30px; 602 | } 603 | 604 | div.documentwrapper { 605 | float: none; 606 | background: #fff; 607 | } 608 | 609 | div.sphinxsidebar { 610 | display: block; 611 | float: none; 612 | width: 102.5%; 613 | margin: 50px -30px -20px -30px; 614 | padding: 10px 20px; 615 | background: #333; 616 | color: #FFF; 617 | } 618 | 619 | div.sphinxsidebar h3, div.sphinxsidebar h4, div.sphinxsidebar p, 620 | div.sphinxsidebar h3 a { 621 | color: #fff; 622 | } 623 | 624 | div.sphinxsidebar a { 625 | color: #AAA; 626 | } 627 | 628 | div.sphinxsidebar p.logo { 629 | display: none; 630 | } 631 | 632 | div.document { 633 | width: 100%; 634 | margin: 0; 635 | } 636 | 637 | div.footer { 638 | display: none; 639 | } 640 | 641 | div.bodywrapper { 642 | margin: 0; 643 | } 644 | 645 | div.body { 646 | min-height: 0; 647 | padding: 0; 648 | } 649 | 650 | .rtd_doc_footer { 651 | display: none; 652 | } 653 | 654 | .document { 655 | width: auto; 656 | } 657 | 658 | .footer { 659 | width: auto; 660 | } 661 | 662 | .footer { 663 | width: auto; 664 | } 665 | 666 | .github { 667 | display: none; 668 | } 669 | } 670 | 671 | 672 | /* misc. */ 673 | 674 | .revsys-inline { 675 | display: none!important; 676 | } 677 | 678 | /* Make nested-list/multi-paragraph items look better in Releases changelog 679 | * pages. Without this, docutils' magical list fuckery causes inconsistent 680 | * formatting between different release sub-lists. 681 | */ 682 | div#changelog > div.section > ul > li > p:only-child { 683 | margin-bottom: 0; 684 | } 685 | 686 | /* Hide fugly table cell borders in ..bibliography:: directive output */ 687 | table.docutils.citation, table.docutils.citation td, table.docutils.citation th { 688 | border: none; 689 | /* Below needed in some edge cases; if not applied, bottom shadows appear */ 690 | -moz-box-shadow: none; 691 | -webkit-box-shadow: none; 692 | box-shadow: none; 693 | } --------------------------------------------------------------------------------