├── .gitignore
├── CryptImage_Dev
├── .gitignore
└── src
│ ├── com
│ └── ib
│ │ └── cryptimage
│ │ ├── core
│ │ ├── Application.java
│ │ ├── CosSinus.java
│ │ ├── CryptPhoto.java
│ │ ├── CryptVideo.java
│ │ ├── Device.java
│ │ ├── Discret.java
│ │ ├── Discret11ComputePixels.java
│ │ ├── Discret11Dec.java
│ │ ├── Discret11DecFindKey.java
│ │ ├── Discret11Enc.java
│ │ ├── Discret11EncMaskedBorder.java
│ │ ├── Discret11FindKey.java
│ │ ├── DiscretDecCorrel.java
│ │ ├── FilterPixels.java
│ │ ├── FramesPlayer.java
│ │ ├── GenDelayArray.java
│ │ ├── ImageSnapListener.java
│ │ ├── JobConfig.java
│ │ ├── KeyboardCode.java
│ │ ├── PalDecoder.java
│ │ ├── PalEncoder.java
│ │ ├── PalEngine.java
│ │ ├── RangeSlider.java
│ │ ├── RangeSliderUI.java
│ │ ├── RunGenDelayArray.java
│ │ ├── SecamEngine.java
│ │ ├── Shift.java
│ │ ├── SimpleDiscret11.java
│ │ ├── SimpleDiscret11Black.java
│ │ ├── SimpleDiscret11MaskedBorder.java
│ │ ├── SoundCrypt.java
│ │ ├── SplitFrames.java
│ │ ├── StreamTrack.java
│ │ ├── StreamsFinder.java
│ │ ├── Syster.java
│ │ ├── SysterDec.java
│ │ ├── SysterDecReverse.java
│ │ ├── SysterEnc.java
│ │ ├── Transcode.java
│ │ ├── Utils.java
│ │ ├── VideoRecorder.java
│ │ ├── Videocrypt.java
│ │ ├── VideocryptDec.java
│ │ ├── VideocryptEnc.java
│ │ ├── YuvCalc.java
│ │ ├── systems
│ │ │ └── eurocrypt
│ │ │ │ ├── EurocryptConf.java
│ │ │ │ ├── EurocryptCore.java
│ │ │ │ ├── EurocryptGui.java
│ │ │ │ └── EurocryptListener.java
│ │ └── types
│ │ │ ├── AudioCodecType.java
│ │ │ ├── ColorType.java
│ │ │ ├── ExtensionType.java
│ │ │ ├── SystemType.java
│ │ │ └── VideoCodecType.java
│ │ └── gui
│ │ ├── GenEncFile.java
│ │ ├── MainGui.java
│ │ ├── MainGui_ActionListener.java
│ │ ├── MultiCode_DocumentListener.java
│ │ ├── ShowLicense.java
│ │ ├── TrackSelector.java
│ │ └── VideoPlayer.java
│ ├── icons
│ ├── apply.png
│ ├── cancel.png
│ ├── de.png
│ ├── documentation.png
│ ├── encrypted.png
│ ├── es.png
│ ├── exit.png
│ ├── filenew.png
│ ├── fileopen.png
│ ├── filesave.png
│ ├── fr.png
│ ├── gb.png
│ ├── help.png
│ ├── it.png
│ ├── logo_jframe.png
│ └── pl.png
│ └── ressources
│ ├── PAL_subcarrier_ori.png
│ ├── burst_14.75_phase_1_bot.bmp
│ ├── burst_14.75_phase_1_top.bmp
│ ├── burst_14.75_phase_2_bot.bmp
│ ├── burst_14.75_phase_2_top.bmp
│ ├── burst_14.75_phase_3_bot.bmp
│ ├── burst_14.75_phase_3_top.bmp
│ ├── burst_14.75_phase_4_bot.bmp
│ ├── burst_14.75_phase_4_top.bmp
│ ├── burst_1_fix_c2.png
│ ├── burst_2_fix_c2.png
│ ├── burst_bot_phase_1.bmp
│ ├── burst_bot_phase_2.bmp
│ ├── burst_bot_phase_3.bmp
│ ├── burst_bot_phase_4.bmp
│ ├── burst_top_phase_1.bmp
│ ├── burst_top_phase_2.bmp
│ ├── burst_top_phase_3.bmp
│ ├── burst_top_phase_4.bmp
│ ├── cryptimage_en.pdf
│ ├── cryptimage_fr.pdf
│ ├── delarray.zip
│ ├── delarray_special.zip
│ ├── grid_14.75_phase_1_new.bmp
│ ├── grid_14.75_phase_2_new.bmp
│ ├── grid_14.75_phase_3_new.bmp
│ ├── grid_14.75_phase_4_new.bmp
│ ├── level1_KEY.TXT
│ ├── level2_KEY.TXT
│ ├── license.txt
│ ├── mainGui.properties
│ ├── mainGui_de.properties
│ ├── mainGui_en.properties
│ ├── mainGui_es.properties
│ ├── mainGui_fr.properties
│ ├── mainGui_it.properties
│ ├── mainGui_pl.properties
│ ├── subcarrier_2.png
│ ├── subcarrier_phase_1.bmp
│ ├── subcarrier_phase_1_.bmp
│ ├── subcarrier_phase_1__.bmp
│ ├── subcarrier_phase_2.bmp
│ ├── subcarrier_phase_2_.bmp
│ ├── subcarrier_phase_3.bmp
│ ├── subcarrier_phase_3_.bmp
│ ├── subcarrier_phase_4.bmp
│ └── subcarrier_phase_4_.bmp
├── README.md
├── changelog.txt
├── install.txt
├── license.txt
└── pom.xml
/.gitignore:
--------------------------------------------------------------------------------
1 | target/
2 | CryptImage_Dev/.classpath
3 | CryptImage_Dev/.project
4 | CryptImage_Dev/.settings/
5 |
--------------------------------------------------------------------------------
/CryptImage_Dev/.gitignore:
--------------------------------------------------------------------------------
1 | /bin/
2 |
--------------------------------------------------------------------------------
/CryptImage_Dev/src/com/ib/cryptimage/core/Application.java:
--------------------------------------------------------------------------------
1 | /**
2 | * This file is part of CryptImage.
3 | *
4 | * CryptImage is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * CryptImage is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with CryptImage. If not, see
16 | *
17 | * 29 sept. 2014 Author Mannix54
18 | * http://ibsoftware.free.fr/cryptimage.php
19 | */
20 |
21 |
22 |
23 | package com.ib.cryptimage.core;
24 |
25 |
26 |
27 | import com.ib.cryptimage.gui.MainGui;
28 |
29 |
30 | public class Application {
31 |
32 | public static void main(String[] args) {
33 | JobConfig.setHasGUI(true);
34 | MainGui mainUI = new MainGui();
35 | mainUI.showUI();
36 | }
37 |
38 | }
39 |
--------------------------------------------------------------------------------
/CryptImage_Dev/src/com/ib/cryptimage/core/CosSinus.java:
--------------------------------------------------------------------------------
1 | /**
2 | * This file is part of CryptImage.
3 | *
4 | * CryptImage is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * CryptImage is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with CryptImage. If not, see
16 | *
17 | * 24 juil. 2016 Author Mannix54
18 | */
19 |
20 |
21 |
22 | package com.ib.cryptimage.core;
23 |
24 | /**
25 | * @author Mannix54
26 | *
27 | */
28 | public class CosSinus {
29 |
30 | private float[] tabCos = new float[361];
31 | private float[] tabSin = new float[361];
32 |
33 | /**
34 | *
35 | */
36 | public CosSinus() {
37 | for (int angle = 0; angle <= 360; angle++) {
38 | tabCos[angle] = (float) Math.cos( angle * Math.PI/180d);
39 | tabSin[angle] = (float) Math.sin(angle * Math.PI/180d);
40 | }
41 |
42 |
43 |
44 | }
45 |
46 | public float getCos(int angle) {
47 | if(angle < 0){
48 | angle = angle * -1;
49 | }
50 | return tabCos[angle];
51 | }
52 |
53 | public float getSin(int angle) {
54 | float val;
55 | if(angle<0){
56 | val = tabSin[angle*-1] * -1;
57 | }
58 | else {
59 | val = tabSin[angle];
60 | }
61 | return val;
62 | }
63 |
64 | }
65 |
--------------------------------------------------------------------------------
/CryptImage_Dev/src/com/ib/cryptimage/core/Device.java:
--------------------------------------------------------------------------------
1 | /**
2 | * This file is part of CryptImage.
3 | *
4 | * CryptImage is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * CryptImage is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with CryptImage. If not, see
16 | *
17 | * 23 nov. 2015 Author Mannix54
18 | */
19 |
20 |
21 |
22 | package com.ib.cryptimage.core;
23 |
24 | import java.awt.image.BufferedImage;
25 |
26 | /**
27 | * @author Mannix54
28 | *
29 | */
30 | public abstract class Device {
31 | public abstract BufferedImage transform(BufferedImage img);
32 | public abstract boolean isEnable();
33 | public abstract int getAudienceLevel();
34 | public abstract int getKey11bits();
35 | public abstract void closeFileData();
36 | public abstract void skipFrame();
37 | public abstract int getKey();
38 | public abstract String getDeviceName();
39 | public abstract boolean isInsideRangeSliderFrames();
40 |
41 | }
42 |
--------------------------------------------------------------------------------
/CryptImage_Dev/src/com/ib/cryptimage/core/Discret.java:
--------------------------------------------------------------------------------
1 | /**
2 | * This file is part of CryptImage.
3 | *
4 | * CryptImage is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * CryptImage is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with CryptImage. If not, see
16 | *
17 | * 9 janv. 2015 Author Mannix54
18 | * http://ibsoftware.free.fr/cryptimage.php
19 | */
20 |
21 |
22 |
23 | package com.ib.cryptimage.core;
24 |
25 | import java.awt.image.BufferedImage;
26 |
27 | /**
28 | * @author Mannix54
29 | *
30 | */
31 | public abstract class Discret extends Device {
32 |
33 | public abstract BufferedImage transform(BufferedImage img);
34 | public abstract boolean isEnable();
35 | public abstract int getAudienceLevel();
36 | public abstract int getKey11bits();
37 |
38 | protected int shiftX;
39 | protected int shiftY;
40 |
41 | protected Shift shift;
42 |
43 | protected PalEncoder palEncoder;
44 | protected PalDecoder palDecoder;
45 |
46 | public Discret() {
47 | int typeGrid = 0;
48 | int freq = 0;
49 | if(JobConfig.getGui().getCmbPalFreq().getSelectedIndex() == 0) {
50 | typeGrid = 0;
51 | freq = 14750000;
52 | }
53 | else {
54 | typeGrid = 1;
55 | freq = 17750000;
56 | }
57 |
58 | JobConfig.setCurrentPalFrameDec(JobConfig.getGui().getCmbPalFrameStart().getSelectedIndex());
59 | JobConfig.setCurrentPalFrame(0);
60 | palEncoder = new PalEncoder(false, typeGrid);
61 | palDecoder = new PalDecoder(freq);
62 | JobConfig.setPalDecoder(palDecoder);
63 | JobConfig.setPalEncoder(palEncoder);
64 | }
65 |
66 | public BufferedImage decodePal(BufferedImage img) {
67 | //decode pal image composite
68 | if (JobConfig.getColorMode() == 3 || JobConfig.getColorMode() == 5 ) {
69 | palDecoder.setImage(img);
70 | return palDecoder.decode();
71 | }
72 | else return img;
73 | }
74 |
75 | public BufferedImage encodePal(BufferedImage img) {
76 | //decode pal image composite
77 | if (JobConfig.getColorMode() == 3 || JobConfig.getColorMode() == 4 ) {
78 | palEncoder.setImage(img);
79 | return palEncoder.encode(false);
80 | }
81 | else return img;
82 | }
83 |
84 | public String getDeviceName() {
85 | return "Discret11";
86 | }
87 |
88 | }
89 |
--------------------------------------------------------------------------------
/CryptImage_Dev/src/com/ib/cryptimage/core/Discret11EncMaskedBorder.java:
--------------------------------------------------------------------------------
1 | /**
2 | * This file is part of CryptImage.
3 | *
4 | * CryptImage is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * CryptImage is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with CryptImage. If not, see
16 | *
17 | * 16 oct. 2015 Author Mannix54
18 | */
19 |
20 |
21 |
22 | package com.ib.cryptimage.core;
23 |
24 | /**
25 | * @author Mannix54
26 | *
27 | */
28 | public class Discret11EncMaskedBorder extends Discret11Enc {
29 |
30 | public Discret11EncMaskedBorder(int key16bits, String audienceList, int cycle) {
31 | super(key16bits, audienceList, cycle);
32 | }
33 |
34 | public Discret11EncMaskedBorder(int key16bits, String audienceList, int cycle, double perc1, double perc2) {
35 | super(key16bits, audienceList, cycle, perc1, perc2);
36 | }
37 |
38 | protected void drawLine(int delay, int y){
39 | //draw black line at start of delay
40 | int lineSizePixels = JobConfig.getDelay2() * 3;;
41 | int[] tabPixels = new int[lineSizePixels];
42 |
43 | raster.setPixels(0, y, JobConfig.getDelay2(), 1, tabPixels);
44 | }
45 |
46 | }
47 |
--------------------------------------------------------------------------------
/CryptImage_Dev/src/com/ib/cryptimage/core/Discret11FindKey.java:
--------------------------------------------------------------------------------
1 | /**
2 | * This file is part of CryptImage.
3 | *
4 | * CryptImage is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * CryptImage is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with CryptImage. If not, see
16 | *
17 | * 9 févr. 2019 Author Mannix54
18 | */
19 |
20 |
21 |
22 | package com.ib.cryptimage.core;
23 |
24 | /**
25 | * @author Mannix54
26 | *
27 | */
28 | public class Discret11FindKey {
29 |
30 | String audience1 = "11111111111";
31 | String audience2 = "11111111111";
32 | String audience3 = "11111111111";
33 | String audience4 = "11111111111";
34 | String audience5 = "11111111111";
35 | String audience6 = "11111111111";
36 | String key16bits = "0000000000000000";
37 |
38 |
39 | /**
40 | * store the 7 11 bit words according to the audience level
41 | */
42 | private int[] key11BitsTab = new int[7];
43 |
44 | /**
45 | *
46 | */
47 | public Discret11FindKey() {
48 | initTabKey11bits();
49 | }
50 |
51 | private void initTabKey11bits() {
52 | key11BitsTab[0] = Integer.parseInt(audience1,2);
53 | key11BitsTab[1] = Integer.parseInt(audience2,2);
54 | key11BitsTab[2] = Integer.parseInt(audience3,2);
55 | key11BitsTab[3] = Integer.parseInt(audience4,2);
56 | key11BitsTab[4] = Integer.parseInt(audience5,2);
57 | key11BitsTab[5] = Integer.parseInt(audience6,2);
58 | key11BitsTab[6] = 1337;
59 | }
60 |
61 | private void rebuildKey16bitsFromAudience(int audience) {
62 | switch (audience) {
63 | case 1:
64 | key16bits = audience1 + key16bits.substring(11, 16);
65 | break;
66 | case 2:
67 | key16bits = key16bits.substring(0, 3) + audience2 + key16bits.substring(14, 16);;
68 | break;
69 | case 3:
70 | key16bits = audience3.charAt(10) + key16bits.substring(1, 6) + audience3.substring(0,10);
71 | break;
72 | case 4:
73 | key16bits = audience4.substring(7,11) + key16bits.substring(4, 9) + audience4.substring(0, 7);
74 | break;
75 | case 5:
76 | key16bits = audience5.substring(4, 11) + key16bits.substring(7, 12) + audience5.substring(0, 4);
77 | break;
78 | case 6:
79 | key16bits = audience6.substring(1,11) + key16bits.substring(10, 15) + audience6.charAt(0);
80 | break;
81 | }
82 | rebuildAudiences();
83 | }
84 |
85 | /**
86 | * initialize the key11BitsTab
87 | * @param key16bits the 16 bits keyword
88 | */
89 | private void rebuildAudiences(){
90 |
91 | //audience 1
92 | audience1 = key16bits.substring(0, 11);
93 | this.key11BitsTab[0] = Integer.parseInt(audience1,2);
94 |
95 | //audience 2
96 | audience2 = key16bits.substring(3, 14);
97 | this.key11BitsTab[1] = Integer.parseInt(audience2,2);
98 |
99 | //audience 3
100 | audience3 = key16bits.substring(6, 16) + key16bits.charAt(0);
101 | this.key11BitsTab[2] = Integer.parseInt(audience3,2);
102 |
103 | //audience 4
104 | audience4 = key16bits.substring(9, 16) + key16bits.substring(0, 4);
105 | this.key11BitsTab[3] = Integer.parseInt(audience4,2);
106 |
107 | //audience 5
108 | audience5 = key16bits.substring(12, 16) + key16bits.substring(0, 7);
109 | this.key11BitsTab[4] = Integer.parseInt(audience5,2);
110 |
111 | //audience 6
112 | audience6 = key16bits.charAt(15) + key16bits.substring(0, 10) ;
113 | this.key11BitsTab[5] = Integer.parseInt(audience6,2);
114 |
115 | //audience 7
116 | this.key11BitsTab[6] = 1337;
117 |
118 | }
119 |
120 | public int getAudience1() {
121 | return Integer.parseInt(audience1,2);
122 | }
123 |
124 | public void setAudience1(int val) {
125 | this.audience1 = String.format
126 | ("%11s", Integer.toBinaryString(val)).replace(" ", "0");
127 | rebuildKey16bitsFromAudience(1);
128 | }
129 |
130 | public int getAudience2() {
131 | return Integer.parseInt(audience2,2);
132 | }
133 |
134 | public void setAudience2(int val) {
135 | this.audience2 = String.format
136 | ("%11s", Integer.toBinaryString(val)).replace(" ", "0");
137 | rebuildKey16bitsFromAudience(2);
138 | }
139 |
140 | public int getAudience3() {
141 | return Integer.parseInt(audience3,2);
142 | }
143 |
144 | public void setAudience3(int val) {
145 | this.audience3 = String.format
146 | ("%11s", Integer.toBinaryString(val)).replace(" ", "0");
147 | rebuildKey16bitsFromAudience(3);
148 | }
149 |
150 | public int getAudience4() {
151 | return Integer.parseInt(audience4,2);
152 | }
153 |
154 | public void setAudience4(int val) {
155 | this.audience4 = String.format
156 | ("%11s", Integer.toBinaryString(val)).replace(" ", "0");
157 | rebuildKey16bitsFromAudience(4);
158 | }
159 |
160 | public int getAudience5() {
161 | return Integer.parseInt(audience5,2);
162 | }
163 |
164 | public void setAudience5(int val) {
165 | this.audience5 = String.format
166 | ("%11s", Integer.toBinaryString(val)).replace(" ", "0");
167 | rebuildKey16bitsFromAudience(5);
168 | }
169 |
170 | public int getAudience6() {
171 | return Integer.parseInt(audience6,2);
172 | }
173 |
174 | public int getAudience7() {
175 | return 1337;
176 | }
177 |
178 | public void setAudience6(int val) {
179 | this.audience6 = String.format
180 | ("%11s", Integer.toBinaryString(val)).replace(" ", "0");
181 | rebuildKey16bitsFromAudience(6);
182 | }
183 |
184 | public int getKey16bits() {
185 | return Integer.parseInt(key16bits,2);
186 | }
187 |
188 | public int getKey16bitsReverseInt() {
189 | String word = new StringBuilder(key16bits).reverse().toString();
190 | return Integer.parseInt(word,2);
191 | }
192 |
193 | }
194 |
--------------------------------------------------------------------------------
/CryptImage_Dev/src/com/ib/cryptimage/core/FilterPixels.java:
--------------------------------------------------------------------------------
1 | /**
2 | * This file is part of CryptImage_Dev.
3 | *
4 | * CryptImage_Dev is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * CryptImage_Dev is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with CryptImage_Dev. If not, see
16 | *
17 | * 6 juil. 2018 Author Mannix54
18 | */
19 |
20 |
21 |
22 | package com.ib.cryptimage.core;
23 |
24 | /**
25 | * @author Mannix54
26 | *
27 | */
28 | import java.awt.image.BufferedImage;
29 | import java.awt.image.Raster;
30 | import java.awt.image.WritableRaster;
31 |
32 | public class FilterPixels {
33 |
34 | int filterWidth;
35 | int filterHeight;
36 | double[][] filter;
37 | double factor;
38 | double bias;
39 | WritableRaster outputRaster;
40 | Raster inputRaster;
41 |
42 | public FilterPixels(int filterWidth, int filterHeight, double[][] values, double factor, double bias) {
43 | this.filterWidth = filterWidth;
44 | this.filterHeight = filterHeight;
45 |
46 | filter = values;
47 |
48 | this.factor = factor;
49 | this.bias = bias;
50 | }
51 |
52 |
53 | public BufferedImage transform(BufferedImage img, boolean applyRed, boolean applyGreen, boolean applyBlue) {
54 | int width = img.getWidth();
55 | int height = img.getHeight();
56 |
57 | int imageX, imageY;
58 | int[] pixelTabs = new int[3];
59 | int[] oriPixelsTabs = new int[3];
60 | int res;
61 |
62 |
63 | inputRaster = img.getRaster();
64 |
65 | BufferedImage output = new BufferedImage(width, height, img.getType());
66 | outputRaster = output.getRaster();
67 |
68 | for(int x = 0; x < width; x++) {
69 | for(int y = 0; y < height; y++) {
70 | double red = 0.0, green = 0.0, blue = 0.0;
71 | oriPixelsTabs = inputRaster.getPixel(x, y, new int[3]);
72 | //System.out.println(oriPixelsTabs[0] + " " + oriPixelsTabs[1] + " " + oriPixelsTabs[2]);
73 |
74 | //multiply every value of the filter with corresponding image pixel
75 | for(int filterY = 0; filterY < filterHeight; filterY++) {
76 | for(int filterX = 0; filterX < filterWidth; filterX++) {
77 | imageX = (x - filterWidth / 2 + filterX + width) % width;
78 | imageY = (y - filterHeight / 2 + filterY + height) % height;
79 |
80 | // System.out.println(imageX + " " + imageY);
81 |
82 | pixelTabs = inputRaster.getPixel(imageX, imageY, new int[3]);
83 |
84 | if(applyRed) {
85 | //red
86 | red += pixelTabs[0] * filter[filterY][filterX];
87 | }
88 | if(applyGreen) {
89 | //green
90 | green += pixelTabs[1] * filter[filterY][filterX];
91 | }
92 | if(applyBlue) {
93 | //blue
94 | blue += pixelTabs[2] * filter[filterY][filterX];
95 | }
96 | }
97 | }
98 | //truncate values smaller than zero and larger than 255
99 | if(applyRed) {
100 | res = (int) (factor * red + bias);
101 | pixelTabs[0] = Math.min( Math.max(res, 0), 255);
102 | }
103 | else {
104 | pixelTabs[0] = oriPixelsTabs[0];
105 | }
106 | if(applyGreen) {
107 | res = (int) (factor * green + bias);
108 | pixelTabs[1] = Math.min( Math.max(res, 0), 255);
109 | }
110 | else {
111 | pixelTabs[1] = oriPixelsTabs[1];
112 | }
113 | if(applyBlue) {
114 | res = (int) (factor * blue + bias);
115 | pixelTabs[2] = Math.min( Math.max(res, 0), 255);
116 | }
117 | else {
118 | pixelTabs[2] = oriPixelsTabs[2];
119 | }
120 |
121 | outputRaster.setPixel(x, y, pixelTabs);
122 |
123 | }
124 | //System.exit(0);
125 | }
126 |
127 | return output;
128 |
129 | }
130 |
131 | }
--------------------------------------------------------------------------------
/CryptImage_Dev/src/com/ib/cryptimage/core/FramesPlayer.java:
--------------------------------------------------------------------------------
1 | /**
2 | * This file is part of CryptImage.
3 | *
4 | * CryptImage is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * CryptImage is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with CryptImage. If not, see
16 | *
17 | * 29 sept. 2014 Author Mannix54
18 | * http://ibsoftware.free.fr/cryptimage.php
19 | */
20 |
21 |
22 |
23 | package com.ib.cryptimage.core;
24 |
25 | import java.awt.image.BufferedImage;
26 | import com.xuggle.mediatool.IMediaReader;
27 | import com.xuggle.mediatool.ToolFactory;
28 |
29 | public class FramesPlayer {
30 |
31 |
32 | private ImageSnapListener imgListen;
33 | private IMediaReader mediaReader;
34 |
35 |
36 | /**
37 | * constructor for the frames extractor from a video file
38 | * @param job the JobConfig object who stores all settings
39 | */
40 | public FramesPlayer() {
41 |
42 |
43 | StreamsFinder streamFinder = new StreamsFinder(JobConfig.getInput_file());
44 |
45 | this.mediaReader = ToolFactory.makeReader(JobConfig.getInput_file());
46 |
47 | mediaReader
48 | .setBufferedImageTypeToGenerate(BufferedImage.TYPE_3BYTE_BGR);
49 |
50 |
51 | this.imgListen = new ImageSnapListener(JobConfig.getVideo_frame(), this,
52 | streamFinder.getStreamsVideo()[0], streamFinder.getStreamsAudio()[0]);
53 | mediaReader.addListener(imgListen);
54 |
55 | }
56 |
57 |
58 | public void readFrame(){
59 | try {
60 | while( imgListen.getCount() < JobConfig.getVideo_frame()
61 | && JobConfig.isStop() != true ){
62 | mediaReader.readPacket();
63 | }
64 |
65 |
66 |
67 | if(JobConfig.isStop() && !JobConfig.isWantPlay()){
68 | JobConfig.getGui().getTextInfos().setText(
69 | JobConfig.getGui().getTextInfos().getText()
70 | + "\n\r"
71 | + JobConfig.getRes().getString("framesPlayer.abort"));
72 | imgListen.getCryptVid().closeVideo();
73 | imgListen.getCryptVid().saveDatFileVideo();
74 | imgListen.getCryptVid().getDevice().closeFileData();
75 | JobConfig.getGui().getBtnEnter().setEnabled(true);
76 | JobConfig.getGui().getBtnCancel().setEnabled(false);
77 | JobConfig.getGui().getBtnExit().setEnabled(true);
78 | if(JobConfig.isSearchCode68705()) {
79 | imgListen.getCryptVid().displayKey();
80 | }
81 |
82 | }
83 | else if(JobConfig.isStop() && JobConfig.isSearchCode68705()) {
84 | imgListen.getCryptVid().displayKey();
85 | }
86 | } catch (Exception e) {
87 | e.printStackTrace();
88 | if(JobConfig.isHasGUI()){
89 | JobConfig.getGui().getTextInfos().setText(
90 | JobConfig.getGui().getTextInfos().getText()
91 | + "\n\r"
92 | + e.getMessage());
93 | }
94 | JobConfig.setVideo_frame(imgListen.getCount()-1);
95 | imgListen.getCryptVid().closeVideo();
96 | imgListen.getCryptVid().saveDatFileVideo();
97 |
98 | JobConfig.getGui().getBtnEnter().setEnabled(true);
99 | JobConfig.getGui().getBtnCancel().setEnabled(false);
100 | JobConfig.getGui().getBtnExit().setEnabled(true);
101 | JobConfig.getGui().getBtnInputFile().setEnabled(true);
102 | JobConfig.getGui().getBtnOutputFile().setEnabled(true);
103 | //imgListen.getCryptVid().getDevice().closeFileData();
104 | }
105 | }
106 |
107 | public BufferedImage getBufImage(){
108 | return imgListen.getImg();
109 | }
110 |
111 | public String getVideoFilename() {
112 | return JobConfig.getInput_file();
113 | }
114 |
115 |
116 | public int getNbFrames() {
117 | return JobConfig.getVideo_frame();
118 | }
119 |
120 |
121 | public String getOutputFilename() {
122 | return JobConfig.getOutput_file();
123 | }
124 |
125 |
126 | public String getData_url() {
127 | return JobConfig.getReport_file();
128 | }
129 |
130 |
131 | public int getKeyWord() {
132 | return JobConfig.getDiscret11Word();
133 | }
134 |
135 | public boolean isStrictMode() {
136 | return JobConfig.isStrictMode();
137 | }
138 |
139 |
140 | public boolean isbDec() {
141 | return JobConfig.isWantDec();
142 | }
143 |
144 | public int getPositionSynchro() {
145 | return JobConfig.getPositionSynchro();
146 | }
147 |
148 |
149 | // public JobConfig getJob() {
150 | // return job;
151 | // }
152 |
153 |
154 | public ImageSnapListener getImgListen() {
155 | return imgListen;
156 | }
157 |
158 | }
--------------------------------------------------------------------------------
/CryptImage_Dev/src/com/ib/cryptimage/core/GenDelayArray.java:
--------------------------------------------------------------------------------
1 | /**
2 | * This file is part of CryptImage.
3 | *
4 | * CryptImage is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * CryptImage is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with CryptImage. If not, see
16 | *
17 | * 16 juin 2017 Author Mannix54
18 | */
19 |
20 |
21 |
22 | package com.ib.cryptimage.core;
23 |
24 | import java.io.File;
25 | import java.io.FileNotFoundException;
26 | import java.io.FileOutputStream;
27 | import java.io.IOException;
28 | import java.io.ObjectOutputStream;
29 |
30 |
31 | /**
32 | * @author Mannix54
33 | *
34 | */
35 | public class GenDelayArray {
36 |
37 | /**
38 | * store the 2048 11 bit words
39 | */
40 | private int[] key11BitsTab = new int[2047];
41 |
42 | /**
43 | * array for storing the values of LFSR for each 2048 11 bit words
44 | */
45 | private int[][] poly = new int[2047][1716];
46 |
47 | /**
48 | * store the value for the truth table
49 | * first dimension is z, second is b0, third is b10
50 | * delay[z][b0][b10]
51 | */
52 | private int[][][] truthTable = new int[2][2][2];
53 |
54 | /**
55 | * store the delay
56 | * in 2 dimension array who represents
57 | * the 6 TV frames for the 2047 11 bit words
58 | */
59 | private int[][][] delayArray = new int[2047][6][286];
60 |
61 | /**
62 | * array for storing the delay in pixels
63 | * 3 types of delay
64 | */
65 | private int[] decaPixels = new int[3];
66 |
67 | /**
68 | *
69 | */
70 | public GenDelayArray() {
71 | // TODO Auto-generated constructor stub
72 | initKey11BitsTab();
73 | initTruthTable();
74 | initPolyLFSR();
75 | initDecaPixels();
76 | initDelayArray();
77 | serializeDelayArray();
78 | }
79 |
80 | private void initKey11BitsTab(){
81 | for (int i = 0; i < key11BitsTab.length; i++) {
82 | key11BitsTab[i] = i + 1;
83 | }
84 | }
85 |
86 | /**
87 | * initialize the array of LFSR values
88 | * @param a tab for the 2047 11 bits key words
89 | */
90 | private void initPolyLFSR() {
91 | String word = "";
92 | int key;
93 |
94 | for (int j = 0; j < key11BitsTab.length; j++) {
95 | word = String.format("%11s",
96 | Integer.toBinaryString(key11BitsTab[j])).replace(" ", "0");
97 | word = new StringBuilder(word).reverse().toString();
98 |
99 | key = Integer.parseInt(word, 2);
100 |
101 | poly[j][0] = key;
102 |
103 | for (int i = 1; i < poly[j].length; i++) {
104 | key = getXorPoly(key);
105 | poly[j][i] = key;
106 | }
107 | }
108 | }
109 |
110 | /**
111 | * initialize the delay table,
112 | * we choose the right truth table to be compatible with
113 | * the current operational mode of the Discret11 object
114 | * truthTable[z][b0][b10]
115 | */
116 | private void initTruthTable() {
117 | truthTable[0][0][0] = 0;
118 | truthTable[0][0][1] = 1;
119 | truthTable[0][1][0] = 2;
120 | truthTable[0][1][1] = 2;
121 | truthTable[1][0][0] = 2;
122 | truthTable[1][0][1] = 0;
123 | truthTable[1][1][0] = 0;
124 | truthTable[1][1][1] = 1;
125 | }
126 |
127 | /**
128 | * set the 3 shift pixels value for the decaPixels array
129 | * @param perc1 the percentage value of retard 1
130 | * @param perc2 the percentage value of retard 2
131 | */
132 | private void initDecaPixels(){
133 | decaPixels[0] = 0;
134 | decaPixels[1] = 1;
135 | decaPixels[2] = 2;
136 | }
137 |
138 | /**
139 | * initialize the delay array for the 6 TV frames
140 | */
141 | private void initDelayArray() {
142 | int z;
143 | for (int k = 0; k < key11BitsTab.length; k++) {
144 | z = 0;
145 | for (int i = 0; i < 6; i++) {
146 | for (int j = 0; j < 286; j++) {
147 | if (i == 0 || i == 1 || i == 2) {
148 | z = 0;
149 | } else {
150 | z = 1;
151 | }
152 | delayArray[k][i][j] = decaPixels[getDelay(poly[k][(i * 286)
153 | + j], z)];
154 | }
155 | }
156 | }
157 |
158 | }
159 |
160 | private void serializeDelayArray(){
161 | //serialize delarray
162 | File fichier = new File("delarray.ser") ;
163 | try {
164 | ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream(fichier)) ;
165 | oos.writeObject(delayArray) ;
166 | oos.close();
167 | } catch (FileNotFoundException e) {
168 | // TODO Auto-generated catch block
169 | e.printStackTrace();
170 | } catch (IOException e) {
171 | // TODO Auto-generated catch block
172 | e.printStackTrace();
173 | }
174 | }
175 |
176 | /**
177 | * return the theorical delay according the LFSR value
178 | * and z value
179 | * @param valPoly the LFSR value
180 | * @param z the z value
181 | * @return the delay to apply on a line
182 | */
183 | private int getDelay(int valPoly, int z){
184 | int b0 = this.getLSB(valPoly);
185 | int b10 = this.getMSB(valPoly);
186 | return truthTable[z][b0][b10];
187 | }
188 |
189 | /**
190 | * return the result of the poly P(x) = x11 + x9 + 1
191 | * @param val the value for the poly
192 | * @return the result of the poly
193 | */
194 | private int getXorPoly(int val){
195 | String key = String.format
196 | ("%11s", Integer.toBinaryString(val)).replace(" ", "0");
197 |
198 | int msb = getMSB(val);
199 |
200 | int b09 = Integer.parseInt(Character.toString(key.charAt(2)));
201 |
202 | int res = msb ^ b09;
203 |
204 | key = key.substring(1, 11) + String.valueOf(res);
205 |
206 | return Integer.parseInt(key,2);
207 | }
208 |
209 | /**
210 | * return the LSB value from a binary word
211 | * @param word the binary word
212 | * @return the LSB value
213 | */
214 | private int getLSB(int word){
215 | String key = String.format
216 | ("%11s", Integer.toBinaryString(word)).replace(" ", "0");
217 |
218 | return Integer.parseInt(Character.toString(key.charAt(key.length()-1)));
219 | }
220 |
221 | /**
222 | * return the MSB value from a binary word
223 | * @param word the binary word
224 | * @return the MSB value
225 | */
226 | private int getMSB(int word){
227 | String key = String.format
228 | ("%11s", Integer.toBinaryString(word)).replace(" ", "0");
229 |
230 | return Integer.parseInt(Character.toString(key.charAt(0)));
231 | }
232 |
233 | public int[][][] getDelayArray() {
234 | return delayArray;
235 | }
236 |
237 |
238 | }
239 |
--------------------------------------------------------------------------------
/CryptImage_Dev/src/com/ib/cryptimage/core/ImageSnapListener.java:
--------------------------------------------------------------------------------
1 | /**
2 | * This file is part of CryptImage.
3 | *
4 | * CryptImage is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * CryptImage is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with CryptImage. If not, see
16 | *
17 | * 29 sept. 2014 Author Mannix54
18 | * http://ibsoftware.free.fr/cryptimage.php
19 | */
20 |
21 |
22 |
23 | package com.ib.cryptimage.core;
24 | import java.awt.Graphics;
25 | import java.awt.Image;
26 | import java.awt.image.BufferedImage;
27 | import javax.swing.JOptionPane;
28 |
29 | import com.xuggle.mediatool.MediaListenerAdapter;
30 | import com.xuggle.mediatool.event.IAudioSamplesEvent;
31 | import com.xuggle.mediatool.event.IReadPacketEvent;
32 | import com.xuggle.mediatool.event.IVideoPictureEvent;
33 | import com.xuggle.xuggler.IAudioResampler;
34 | import com.xuggle.xuggler.IAudioSamples;
35 |
36 |
37 | public class ImageSnapListener extends MediaListenerAdapter {
38 |
39 | private int count = 0;
40 | private BufferedImage img;
41 | private CryptVideo cryptVid;
42 | private int posFrame;
43 | private boolean isDec;
44 | private FramesPlayer frmV;
45 | private IAudioResampler audioResampler = null;
46 | private int AUDIORATE;
47 |
48 |
49 | /**
50 | * constructor
51 | * @param nbFrames number of frames to extract from the video
52 | */
53 | public ImageSnapListener(int nbFrames, FramesPlayer frmV,
54 | int videoIndex, int audioIndex) {
55 | super();
56 |
57 | this.AUDIORATE = JobConfig.getAudioRate();
58 | this.frmV = frmV;
59 | this.count = 0;
60 | cryptVid = new CryptVideo();
61 | posFrame = 0;
62 | this.isDec = frmV.isbDec();
63 |
64 | }
65 |
66 | public void onAudioSamples(IAudioSamplesEvent event) {
67 | //System.out.println(event.getStreamIndex() + ", " + JobConfig.getDefaultIdAudioTrack());
68 |
69 | if (event.getStreamIndex() == JobConfig.getDefaultIdAudioTrack() && !JobConfig.isDisableSound()
70 | && JobConfig.isVideoHasAudioTrack() && !JobConfig.isHasMultiAudioChannels()) {
71 | if (event.getAudioSamples().isComplete()) {
72 |
73 | IAudioSamples samples = event.getAudioSamples();
74 |
75 | if (samples.getChannels() > 2) {
76 | JobConfig.setDisableSound(true);
77 | JobConfig.setWantSound(false);
78 |
79 | JobConfig.getGui().getChkSound().setSelected(false);
80 | JobConfig.getGui().getChkSound().setEnabled(false);
81 | JobConfig.getGui().getChkSoundSyster().setSelected(false);
82 | JobConfig.getGui().getChkSoundSyster().setEnabled(false);
83 | JobConfig.getGui().getChkSoundVideocrypt().setSelected(false);
84 | JobConfig.getGui().getChkSoundVideocrypt().setEnabled(false);
85 |
86 | JobConfig.getGui().getChkDisableSound().setSelected(true);
87 | JobConfig.getGui().getChkDisableSoundSyster().setSelected(true);
88 | JobConfig.getGui().getChkDisableSoundVideocrypt().setSelected(true);
89 |
90 | showWarningSound();
91 | } else {
92 |
93 | // IAudioResampler audioResampler = IAudioResampler.make(2,
94 | // samples.getChannels(), 48000, samples.getSampleRate());
95 |
96 | if (audioResampler == null) {
97 | audioResampler = IAudioResampler.make(2,
98 | samples.getChannels(), AUDIORATE,
99 | samples.getSampleRate(),
100 | IAudioSamples.Format.FMT_S16,
101 | samples.getFormat());
102 | }
103 |
104 | // if(audioResampler == null){
105 | // audioResampler = IAudioResampler.make(1,
106 | // samples.getChannels(), AUDIORATE,
107 | // samples.getSampleRate(),
108 | // IAudioSamples.Format.FMT_S16, samples.getFormat(),
109 | // 2048,
110 | // 1024,
111 | // true,
112 | // (double)AUDIORATE/2d
113 | // );
114 | // }
115 |
116 | if (event.getAudioSamples().getNumSamples() > 0) {
117 | IAudioSamples out = IAudioSamples.make(
118 | samples.getNumSamples(), 2); // samples.getNumSamples(),
119 | // 1);
120 | audioResampler.resample(out, samples,
121 | samples.getNumSamples());
122 |
123 | cryptVid.addAudioFrame(out); //out
124 |
125 | out.delete();
126 | }
127 | }
128 | } else {
129 | System.out.println("paquet non complet init");
130 | }
131 | }
132 |
133 | // case of multichannel audio
134 | if (JobConfig.isHasMultiAudioChannels() && event.getStreamIndex() == JobConfig.getDefaultIdAudioTrack() && !JobConfig.isDisableSound()
135 | && JobConfig.isVideoHasAudioTrack() ) {
136 | if (event.getAudioSamples().isComplete()) {
137 | cryptVid.addAudioFrame(event.getAudioSamples());
138 | }
139 | }
140 |
141 | }
142 |
143 | private void showWarningSound(){
144 | JOptionPane
145 | .showMessageDialog(
146 | null,
147 | JobConfig.getRes().getString("imageSnapListener.multicanalSound"),
148 | JobConfig.getRes().getString("imageSnapListener.multicanalSound.title"),
149 | JOptionPane.WARNING_MESSAGE);
150 | }
151 |
152 | public void onReadPacket(IReadPacketEvent event){
153 |
154 | }
155 |
156 |
157 | public void onVideoPicture(IVideoPictureEvent event) {
158 | if(event.getStreamIndex() == JobConfig.getDefaultIdVideoTrack()) {
159 | dumpFrameToBufferedImage(event.getImage());
160 | count = count + 1;
161 |
162 | if(count == cryptVid.getVideoLengthFrames()
163 | && JobConfig.isWantPlay() !=true
164 | ){
165 | cryptVid.closeVideo();
166 | cryptVid.saveDatFileVideo();
167 | cryptVid.getDevice().closeFileData();
168 | if(JobConfig.isSearchCode68705()) {
169 | cryptVid.displayKey();
170 | }
171 |
172 | } else if(count == cryptVid.getVideoLengthFrames()){
173 | if(JobConfig.isSearchCode68705()) {
174 | cryptVid.displayKey();
175 | }
176 | JobConfig.setStop(true);
177 | }
178 | }
179 | }
180 |
181 | public void dumpFrameToBufferedImage(BufferedImage image) {
182 | if(JobConfig.isPanAndScan() && !JobConfig.isWantDec() && !JobConfig.isHasToBeUnsplit()){
183 | image = doPanAndScan(image);
184 | }
185 |
186 | if(JobConfig.isStretch() && !JobConfig.isWantDec() && !JobConfig.isHasToBeUnsplit()){
187 | image = doStretch(image);
188 | }
189 |
190 | // add input frame to JobConfig if device is not ready for transform
191 | if(count < JobConfig.getPositionSynchro()) {
192 | JobConfig.setInputImage(image);
193 | }
194 |
195 |
196 | if (JobConfig.isWantPlay()) {
197 | posFrame++;
198 | if (this.isDec) {
199 | cryptVid.addDisplayFrameDec(image, posFrame, count);
200 | if (frmV.getPositionSynchro() > this.count + 1) {
201 | posFrame = 0;
202 | }
203 | } else {
204 | cryptVid.addDisplayFrameEnc(image, posFrame, count);
205 | }
206 | if (posFrame == 3) {
207 | posFrame = 0;
208 | }
209 | }
210 |
211 | else {
212 | posFrame++;
213 | if (this.isDec) {
214 | cryptVid.addFrameDec(image, posFrame, count);
215 | if (frmV.getPositionSynchro() > this.count + 1) {
216 | posFrame = 0;
217 | }
218 | } else {
219 | cryptVid.addFrameEnc(image, posFrame, count);
220 | }
221 | if (posFrame == 3) {
222 | posFrame = 0;
223 | }
224 | }
225 | }
226 |
227 | private BufferedImage doPanAndScan(BufferedImage ori_img){
228 | int optimal_width = 0;
229 | int optimal_height = 0;
230 | int hori_cropBorders = 0;
231 | int verti_cropBorders = 0;
232 | BufferedImage imgCropped;
233 |
234 | //JobConfig.setHasToBeUnsplit(false);
235 |
236 | if((float) ori_img.getWidth()/ (float)ori_img.getHeight() > 4f/3f){
237 | optimal_height = ori_img.getHeight();
238 | optimal_width = (int) ((4f/3f) * (float) ori_img.getHeight());
239 | hori_cropBorders = ( ori_img.getWidth() - optimal_width ) / 2;
240 |
241 | imgCropped = ori_img.getSubimage(hori_cropBorders, 0, ori_img.getWidth() - (hori_cropBorders * 2), optimal_height);
242 | }
243 | else if ((float) ori_img.getWidth()/ (float)ori_img.getHeight() < 4f/3f){
244 | optimal_width = ori_img.getWidth();
245 | optimal_height = (int)((float)ori_img.getWidth() / (4f/3f));
246 | verti_cropBorders = ( ori_img.getHeight() - optimal_height ) / 2;
247 |
248 | imgCropped = ori_img.getSubimage(0, verti_cropBorders, optimal_width, optimal_height);
249 | }
250 | else {
251 | return ori_img;
252 | }
253 |
254 | BufferedImage copyOfImage = new BufferedImage(imgCropped.getWidth(), imgCropped.getHeight(), imgCropped.getType());
255 | Graphics g = copyOfImage.createGraphics();
256 | g.drawImage(imgCropped, 0, 0, null);
257 |
258 |
259 |
260 | return copyOfImage;
261 | }
262 |
263 | /**
264 | * Stretch image pixels horizontally and vertically to 4/3 ratio
265 | * @param ori_img bufferedimage to stretch
266 | * @return stretch bufferedimage
267 | */
268 | private BufferedImage doStretch(BufferedImage ori_img){
269 | return resize(ori_img, 768, 576, ori_img.getType());
270 | }
271 |
272 | private BufferedImage resize(BufferedImage img, int width, int height, int typeBufferedImage) {
273 | Image tmp = img.getScaledInstance(width, height, Image.SCALE_SMOOTH);
274 | BufferedImage resized = new BufferedImage(width, height, typeBufferedImage);
275 | Graphics g = resized.createGraphics();
276 | g.drawImage(tmp, 0, 0, null);
277 | return resized;
278 | }
279 |
280 | public BufferedImage getImg() {
281 | return img;
282 | }
283 |
284 | public void setImg(BufferedImage img) {
285 | this.img = img;
286 | }
287 |
288 | public int getCount() {
289 | return count;
290 | }
291 |
292 | public void setCount(int count) {
293 | this.count = count;
294 | }
295 |
296 | public CryptVideo getCryptVid() {
297 | return cryptVid;
298 | }
299 |
300 |
301 | }
--------------------------------------------------------------------------------
/CryptImage_Dev/src/com/ib/cryptimage/core/KeyboardCode.java:
--------------------------------------------------------------------------------
1 | /**
2 | * This file is part of CryptImage.
3 | *
4 | * CryptImage is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * CryptImage is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with CryptImage. If not, see
16 | *
17 | * 21 déc. 2014 Author Mannix54
18 | * http://ibsoftware.free.fr/cryptimage.php
19 | */
20 |
21 |
22 |
23 | package com.ib.cryptimage.core;
24 |
25 | /**
26 | * @author Mannix54
27 | *
28 | */
29 | public class KeyboardCode {
30 |
31 | private short[] nu = new short[8];
32 |
33 | private int ret, masq, cletra, codeutil;
34 | private int af, cle;
35 | private boolean[] autorisation = new boolean[6];
36 |
37 | private short j;
38 |
39 | private short[] table1 = { 0x08, 0x02, 0x0c, 0x06, 0x00, 0x0f, 0x0e, 0x04,
40 | 0x03, 0x0d, 0x09, 0x01, 0x05, 0x0a, 0x07, 0x0b };
41 |
42 | /**
43 | * constructor
44 | * @param serial the serial number of the decoder
45 | * @param key16bits the 16 bits keyword
46 | * @param autorisation the array of the 6 autorisation levels
47 | */
48 | public KeyboardCode(int serial, int key16bits, boolean[] autorisation) {
49 |
50 | this.autorisation = autorisation;
51 | this.cle = key16bits;
52 |
53 | String key = String.format("%8s",serial);
54 | key = key.replace(" ","0");
55 |
56 | for (int i = 0; i < 8; i++) {
57 | nu[i] = Short.valueOf(String.valueOf(key.charAt(i)));
58 | }
59 | }
60 |
61 | private void galois() {
62 |
63 | for (int i = 0; i < j; i++) {
64 | ret = (af >> 15) & 0x1;
65 | af = (af << 1) & 0xfffe;
66 | if (ret == 1) {
67 | af = af ^ 0x3000;
68 | }
69 | }
70 | }
71 |
72 | /**
73 | * compute the keyboard code
74 | * @return the 8 digits key code
75 | */
76 | public String getKeyboardCode() {
77 |
78 | int crc, nut, ptn, pte, a, b, d;
79 |
80 | int niv = 0;
81 |
82 | if (this.autorisation[5] == true) {
83 | niv = niv | 0x20;
84 | }
85 | if (this.autorisation[4] == true) {
86 | niv = niv | 0x10;
87 | }
88 | if (this.autorisation[3] == true) {
89 | niv = niv | 0x8;
90 | }
91 | if (this.autorisation[2] == true) {
92 | niv = niv | 0x4;
93 | }
94 | if (this.autorisation[1] == true) {
95 | niv = niv | 0x2;
96 | }
97 | if (this.autorisation[0] == true) {
98 | niv = niv | 0x1;
99 | }
100 |
101 | this.codeutil = (cle << 8) + (niv << 2);
102 |
103 | for (int i = 0; i < 5; i++) {
104 | cletra = codeutil & 0xfffffc;
105 | ptn = 0;
106 |
107 | for (int j = 0; j < 22; j++) {
108 | nut = nu[(ptn & 0x7)];
109 | masq = (1 << (23 - nut)) | 0x800000;
110 | masq = 0xffffff ^ masq;
111 | a = ((cletra >> (23)) & 1);
112 | b = ((cletra >> (23 - nut)) & 1);
113 | cletra = cletra & masq;
114 |
115 | masq = (a << (23 - nut)) | (b << (23));
116 | cletra = cletra | masq;
117 |
118 | pte = (cletra >> 8) & 0xf;
119 | d = (table1[pte]);
120 | masq = 0xfff0fc;
121 | cletra = cletra & masq;
122 | masq = (d << 8);
123 | cletra = cletra | masq;
124 |
125 | cletra = (cletra << 1) | (b << 2);
126 | codeutil = cletra & 0xfffffc;
127 | ptn++;
128 | }
129 | }
130 |
131 | // calcul crc4
132 | af = (cletra >> 8) & 0xffff;
133 | j = 8;
134 | galois();
135 | af = (af & 0xff00) | (cletra & 0xff);
136 | j = 8;
137 | galois();
138 | a = (af >> 8) & 0xff;
139 | af = (a << 8) | a;
140 | j = 2;
141 | galois();
142 | crc = (af >> 12) & 0xf;
143 |
144 | cletra = (codeutil * 4) + crc;
145 |
146 | return String.format("%08d", cletra);
147 | }
148 | }
149 |
--------------------------------------------------------------------------------
/CryptImage_Dev/src/com/ib/cryptimage/core/RangeSlider.java:
--------------------------------------------------------------------------------
1 | //The MIT License
2 | //
3 | //Copyright (c) 2010 Ernest Yu. All rights reserved.
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
13 | //all 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
21 | //THE SOFTWARE.
22 |
23 | package com.ib.cryptimage.core;
24 |
25 | import javax.swing.JSlider;
26 |
27 | /**
28 | * An extension of JSlider to select a range of values using two thumb controls.
29 | * The thumb controls are used to select the lower and upper value of a range
30 | * with predetermined minimum and maximum values.
31 | *
32 | *
Note that RangeSlider makes use of the default BoundedRangeModel, which
33 | * supports an inner range defined by a value and an extent. The upper value
34 | * returned by RangeSlider is simply the lower value plus the extent.
35 | */
36 | public class RangeSlider extends JSlider {
37 |
38 | /**
39 | *
40 | */
41 | private static final long serialVersionUID = 3543204092571360221L;
42 |
43 | /**
44 | * Constructs a RangeSlider with default minimum and maximum values of 0
45 | * and 100.
46 | */
47 | public RangeSlider() {
48 | initSlider();
49 | }
50 |
51 | /**
52 | * Constructs a RangeSlider with the specified default minimum and maximum
53 | * values.
54 | */
55 | public RangeSlider(int min, int max) {
56 | super(min, max);
57 | initSlider();
58 | }
59 |
60 | /**
61 | * Initializes the slider by setting default properties.
62 | */
63 | private void initSlider() {
64 | setOrientation(HORIZONTAL);
65 | }
66 |
67 | /**
68 | * Overrides the superclass method to install the UI delegate to draw two
69 | * thumbs.
70 | */
71 | @Override
72 | public void updateUI() {
73 | setUI(new RangeSliderUI(this));
74 | // Update UI for slider labels. This must be called after updating the
75 | // UI of the slider. Refer to JSlider.updateUI().
76 | updateLabelUIs();
77 | }
78 |
79 | /**
80 | * Returns the lower value in the range.
81 | */
82 | @Override
83 | public int getValue() {
84 | return super.getValue();
85 | }
86 |
87 | /**
88 | * Sets the lower value in the range.
89 | */
90 | @Override
91 | public void setValue(int value) {
92 | int oldValue = getValue();
93 | if (oldValue == value) {
94 | return;
95 | }
96 |
97 | // Compute new value and extent to maintain upper value.
98 | int oldExtent = getExtent();
99 | int newValue = Math.min(Math.max(getMinimum(), value), oldValue + oldExtent);
100 | int newExtent = oldExtent + oldValue - newValue;
101 |
102 | // Set new value and extent, and fire a single change event.
103 | getModel().setRangeProperties(newValue, newExtent, getMinimum(),
104 | getMaximum(), getValueIsAdjusting());
105 | }
106 |
107 | /**
108 | * Returns the upper value in the range.
109 | */
110 | public int getUpperValue() {
111 | return getValue() + getExtent();
112 | }
113 |
114 | /**
115 | * Sets the upper value in the range.
116 | */
117 | public void setUpperValue(int value) {
118 | // Compute new extent.
119 | int lowerValue = getValue();
120 | int newExtent = Math.min(Math.max(0, value - lowerValue), getMaximum() - lowerValue);
121 |
122 | // Set extent to set upper value.
123 | setExtent(newExtent);
124 | }
125 | }
126 |
--------------------------------------------------------------------------------
/CryptImage_Dev/src/com/ib/cryptimage/core/RunGenDelayArray.java:
--------------------------------------------------------------------------------
1 | package com.ib.cryptimage.core;
2 |
3 | import java.io.File;
4 | import java.io.FileInputStream;
5 | import java.io.FileNotFoundException;
6 | import java.io.FileOutputStream;
7 | import java.io.IOException;
8 | import java.io.ObjectInputStream;
9 | import java.io.ObjectOutputStream;
10 |
11 | public class RunGenDelayArray {
12 |
13 | public RunGenDelayArray() {
14 | // TODO Auto-generated constructor stub
15 | }
16 |
17 | public static void main(String[] args) {
18 | System.out.println("step 1, create delay array");
19 |
20 | int[][][] delayArrayFull = new GenDelayArray().getDelayArray();
21 |
22 | int[][] decas = new int[12282][286];
23 |
24 |
25 | for (int i = 0; i < delayArrayFull.length; i++) {
26 | for (int j = 0; j < 6; j++) {
27 | for (int k = 0; k < 286; k++) {
28 | decas[i + 2047 * j][k] = delayArrayFull[i][j][k];
29 | }
30 | }
31 | }
32 |
33 | System.out.println("step 2, suppress duplicated values");
34 |
35 | int[][] comp = new int[12282][12282];
36 | int[] doublon = new int[12282];
37 |
38 | for (int i = 0; i < decas.length; i++) {
39 | for (int j = 0; j < decas.length; j++) {
40 | if(j != i && (comp[j][i] == 0 && comp[i][j] == 0)){
41 | int k = 0;
42 | for (int l = 0; l < 286; l++) {
43 | comp[j][i] = 1;
44 | comp[i][j] = 1;
45 | if(decas[i][l] == decas[j][l]){
46 | k = k + 1;
47 | }
48 | }
49 | if(k == 286 ){
50 | doublon[j] = j;
51 | }
52 | }
53 | }
54 | }
55 |
56 | int count = 0;
57 | for (int i = 0; i < doublon.length; i++) {
58 | if (doublon[i] != 0){
59 | count +=1;
60 | }
61 |
62 | }
63 | System.out.println("unique values : " + count);
64 |
65 | int[][] unique = new int[count][286];
66 |
67 | int cpt = 0;
68 | for (int i = 0; i < doublon.length; i++) {
69 | if (doublon[i] != 0){
70 | for (int j = 0; j < 286; j++) {
71 | unique[cpt][j] = decas[doublon[i]][j];
72 | }
73 | cpt += 1;
74 | }
75 | }
76 |
77 | System.out.println("step 3, save unduplicated values to file 'delarray.bin' ");
78 | serializeDelayArray(unique);
79 |
80 | }
81 |
82 | public static int[][][] loadFullArray(String path){
83 | int[][][] delayArrayFull = null;
84 | ObjectInputStream inputStream = null;
85 | try{
86 | inputStream = new ObjectInputStream(new FileInputStream(path));
87 | }catch(IOException e){
88 | System.out.println("There was a problem opening the file: " + e);
89 | System.exit(1);
90 | }
91 |
92 | try{
93 | delayArrayFull = (int [][][])inputStream.readObject();
94 | inputStream.close();
95 | }catch(Exception e){
96 | System.out.println("There was an issue reading from the file: " + e);
97 | System.exit(1);
98 | }
99 |
100 | return delayArrayFull;
101 |
102 | }
103 |
104 | public static void serializeDelayArray(int[][] delayArray){
105 | //serialize delayArray
106 | File fichier = new File("delarray.bin") ;
107 | try {
108 | ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream(fichier)) ;
109 | oos.writeObject(delayArray) ;
110 | oos.close();
111 | } catch (FileNotFoundException e) {
112 | // TODO Auto-generated catch block
113 | e.printStackTrace();
114 | } catch (IOException e) {
115 | // TODO Auto-generated catch block
116 | e.printStackTrace();
117 | }
118 | }
119 |
120 | }
121 |
--------------------------------------------------------------------------------
/CryptImage_Dev/src/com/ib/cryptimage/core/SecamEngine.java:
--------------------------------------------------------------------------------
1 | /**
2 | * This file is part of CryptImage.
3 | *
4 | * CryptImage is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * CryptImage is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with CryptImage. If not, see
16 | *
17 | * 26 juil. 2016 Author Mannix54
18 | */
19 |
20 |
21 |
22 | package com.ib.cryptimage.core;
23 |
24 | import java.awt.image.BufferedImage;
25 | import java.awt.image.WritableRaster;
26 |
27 | /**
28 | * @author Mannix54
29 | *
30 | */
31 | public class SecamEngine {
32 |
33 | BufferedImage img;
34 | YuvCalc yuvCalc;
35 | WritableRaster raster;
36 | int[] linePixels = new int[768*3];
37 | int[] linePixels2 = new int[768*3];
38 | int[] pixelTab = new int[3];
39 | boolean u = false;
40 | boolean v = false;
41 |
42 | /**
43 | *
44 | */
45 | public SecamEngine() {
46 | yuvCalc = new YuvCalc();
47 | }
48 |
49 | public SecamEngine(BufferedImage img) {
50 | setImg(img);
51 |
52 | yuvCalc = new YuvCalc();
53 | }
54 |
55 | public void setImg(BufferedImage img_){
56 | this.img = img_;
57 | raster = img.getRaster();
58 |
59 | }
60 |
61 | public BufferedImage encode() {
62 | tagLines();
63 | return img;
64 | }
65 |
66 | public BufferedImage decode() {
67 | secamAverageEvenFrame();
68 | secamAverageOddFrame();
69 |
70 | removeTags();
71 |
72 | return img;
73 | }
74 |
75 | private void tagLines(){
76 | // odd field
77 | int pol = 1;
78 | for (int i = 0; i < 576; i++) {
79 | if (pol == 1) { // u
80 | raster.setPixel(0, i, new int[] { 0, 0, 0 });
81 | } else {// v
82 | raster.setPixel(0, i, new int[] { 255, 255, 255 });
83 | }
84 | i++;
85 | pol = pol * -1;
86 | }
87 |
88 | // even field
89 | pol = 1;
90 | for (int i = 1; i < 576; i++) {
91 | if (pol == 1) { // u
92 | raster.setPixel(0, i, new int[] { 0, 0, 0 });
93 | } else {// v
94 | raster.setPixel(0, i, new int[] { 255, 255, 255 });
95 | }
96 | i++;
97 | pol = pol * -1;
98 | }
99 | }
100 |
101 |
102 |
103 | private String getTypeChroma(int[] pixel){
104 | String res = "";
105 |
106 | if(pixel[0] == 0 ){
107 | u = true;
108 | res = "u";
109 | }
110 |
111 | if(pixel[0] == 255 ){
112 | v = true;
113 | res = res + "v";
114 | }
115 |
116 | return res;
117 | }
118 |
119 |
120 | private void removeTags(){
121 | for (int y = 0; y < 576; y++) {
122 | raster.setPixel(0, y, raster.getPixel(1, y, pixelTab));
123 | }
124 | }
125 |
126 | private void secamAverageOddFrame(){
127 | int[] pixelL1 = new int[3];
128 | int[] pixelL2 = new int[3];
129 | String seq = "";
130 |
131 | for (int y = 0; y < 576; y++) { // 2
132 | pixelL1 = raster.getPixel(0, y, pixelL1);
133 | pixelL2 = raster.getPixel(0, y + 2, pixelL2);
134 | seq = getTypeChroma(pixelL1) + getTypeChroma(pixelL2);
135 |
136 | raster.setPixels(0, y, 768, 1, averageLine(raster.getPixels(
137 | 0, y, 768, 1, linePixels),
138 | raster.getPixels(0, y + 2, 768, 1, linePixels2),y, seq));
139 | y += 3;
140 | }
141 |
142 | }
143 |
144 | private void secamAverageEvenFrame(){
145 | int[] pixelL1 = new int[3];
146 | int[] pixelL2 = new int[3];
147 | String seq = "";
148 |
149 | for (int y = 1; y < 574; y++) { // 2
150 | pixelL1 = raster.getPixel(0, y, pixelL1);
151 | pixelL2 = raster.getPixel(0, y + 2, pixelL2);
152 | seq = getTypeChroma(pixelL1) + getTypeChroma(pixelL2);
153 |
154 | raster.setPixels(0, y, 768, 1, averageLine(raster.getPixels(
155 | 0, y, 768, 1, linePixels),
156 | raster.getPixels(0, y + 2, 768, 1, linePixels2),y, seq));
157 | y += 3;
158 | }
159 | }
160 |
161 | public BufferedImage averageSpecial(){
162 | secamAverageEvenFrameVideoCrypt();
163 | secamAverageOddFrameVideoCrypt();
164 | return img;
165 | }
166 |
167 | private void secamAverageOddFrameVideoCrypt(){
168 | int[] pixelL1 = new int[3];
169 | int[] pixelL2 = new int[3];
170 |
171 | for (int y = 0; y < 576; y++) { // 2
172 | pixelL1 = raster.getPixel(0, y, pixelL1);
173 | pixelL2 = raster.getPixel(0, y + 2, pixelL2);
174 |
175 | raster.setPixels(0, y, 768, 1, averageLine(raster.getPixels(
176 | 0, y, 768, 1, linePixels),
177 | raster.getPixels(0, y + 2, 768, 1, linePixels2),y));
178 | y += 3;
179 | }
180 |
181 | }
182 |
183 | private void secamAverageEvenFrameVideoCrypt(){
184 | int[] pixelL1 = new int[3];
185 | int[] pixelL2 = new int[3];
186 |
187 | for (int y = 1; y < 574; y++) { // 2
188 | pixelL1 = raster.getPixel(0, y, pixelL1);
189 | pixelL2 = raster.getPixel(0, y + 2, pixelL2);
190 |
191 | raster.setPixels(0, y, 768, 1, averageLine(raster.getPixels(
192 | 0, y, 768, 1, linePixels),
193 | raster.getPixels(0, y + 2, 768, 1, linePixels2),y));
194 | y += 3;
195 | }
196 | }
197 |
198 | private int[] averageLine(int[] line1, int[] line2, int y) {
199 | int[] tempPix = new int[3];
200 |
201 | for (int i = 1; i < 768; i++) {
202 | tempPix[0] = line1[3 * i ];
203 | tempPix[1] = line1[3 * i + 1];
204 | tempPix[2] = line1[3 * i + 2];
205 |
206 | tempPix = yuvCalc.convertRGBtoYUV(tempPix);
207 |
208 | line1[3 * i ] = tempPix[0];
209 | line1[3 * i + 1] = tempPix[1];
210 | line1[3 * i + 2] = tempPix[2];
211 |
212 | tempPix[0] = line2[3 * i ];
213 | tempPix[1] = line2[3 * i + 1];
214 | tempPix[2] = line2[3 * i + 2];
215 |
216 | tempPix = yuvCalc.convertRGBtoYUV(tempPix);
217 |
218 | line2[3 * i ] = tempPix[0];
219 | line2[3 * i + 1] = tempPix[1];
220 | line2[3 * i + 2] = tempPix[2];
221 |
222 |
223 | line1[3 * i + 1] = line2[3 * i + 1];
224 | line2[3 * i + 2] = line1[3 * i + 2];
225 |
226 | tempPix[0] = line1[3 * i ];
227 | tempPix[1] = line1[3 * i + 1];
228 | tempPix[2] = line1[3 * i + 2];
229 |
230 | tempPix = yuvCalc.convertYUVtoRGB(tempPix);
231 |
232 | line1[3 * i ] = tempPix[0];
233 | line1[3 * i + 1] = tempPix[1];
234 | line1[3 * i + 2] = tempPix[2];
235 |
236 | tempPix[0] = line2[3 * i ];
237 | tempPix[1] = line2[3 * i + 1];
238 | tempPix[2] = line2[3 * i + 2];
239 |
240 | tempPix = yuvCalc.convertYUVtoRGB(tempPix);
241 |
242 | line2[3 * i ] = tempPix[0];
243 | line2[3 * i + 1] = tempPix[1];
244 | line2[3 * i + 2] = tempPix[2];
245 |
246 | }
247 | raster.setPixels(0, y + 2, 768, 1, line2);
248 | return line1;
249 | }
250 |
251 | private int[] averageLine(int[] line1, int[] line2, int y, String seq){
252 |
253 | if(JobConfig.getGui().getComboTableSysterEnc().getSelectedIndex()==1){
254 | int[] tempPix = new int[3];
255 | if (seq.equals("uv")) {
256 |
257 | return line1;
258 | } else {
259 | int valU = 0;
260 | int valV = 0;
261 | if(seq.equals("uu")){
262 | valU = 84;
263 | valV = 255;
264 | }
265 | if (seq.equals("vv")) {
266 | valU = 255;
267 | valV = 107;
268 | }
269 | if (seq.equals("vu")) {
270 | valU = 206;
271 | valV = 253;
272 | }
273 |
274 | for (int i = 0; i < 768; i++) {
275 | tempPix[0] = line1[3 * i ];
276 | tempPix[1] = line1[3 * i + 1];
277 | tempPix[2] = line1[3 * i + 2];
278 |
279 | tempPix = yuvCalc.convertRGBtoYUV(tempPix);
280 | tempPix[1] = valU;
281 | tempPix[2] = valV;
282 |
283 | tempPix = yuvCalc.convertYUVtoRGB(tempPix);
284 |
285 | line1[3 * i ] = tempPix[0];
286 | line1[3 * i + 1] = tempPix[1];
287 | line1[3 * i + 2] = tempPix[2];
288 |
289 | tempPix[0] = line2[3 * i ];
290 | tempPix[1] = line2[3 * i + 1];
291 | tempPix[2] = line2[3 * i + 2];
292 |
293 | tempPix = yuvCalc.convertRGBtoYUV(tempPix);
294 | tempPix[1] = valU;
295 | tempPix[2] = valV;
296 | tempPix = yuvCalc.convertYUVtoRGB(tempPix);
297 |
298 | line2[3 * i ] = tempPix[0];
299 | line2[3 * i + 1] = tempPix[1];
300 | line2[3 * i + 2] = tempPix[2];
301 | }
302 | raster.setPixels(0, y + 2, 768, 1, line2);
303 | return line1;
304 | }
305 | }
306 |
307 | int[] tempPix = new int[3];
308 | if (seq.equals("uv")) {
309 | return line1;
310 | } else {
311 | for (int i = 0; i < 768; i++) {
312 | tempPix[0] = line1[3 * i ];
313 | tempPix[1] = line1[3 * i + 1];
314 | tempPix[2] = line1[3 * i + 2];
315 |
316 | tempPix = setToBlackAndWhite(tempPix);
317 | line1[3 * i ] = tempPix[0];
318 | line1[3 * i + 1] = tempPix[1];
319 | line1[3 * i + 2] = tempPix[2];
320 |
321 | tempPix[0] = line2[3 * i ];
322 | tempPix[1] = line2[3 * i + 1];
323 | tempPix[2] = line2[3 * i + 2];
324 |
325 | tempPix = setToBlackAndWhite(tempPix);
326 | line2[3 * i ] = tempPix[0];
327 | line2[3 * i + 1] = tempPix[1];
328 | line2[3 * i + 2] = tempPix[2];
329 | }
330 | raster.setPixels(0, y + 2, 768, 1, line2);
331 | return line1;
332 | }
333 | }
334 |
335 | private int[] setToBlackAndWhite(int[] line){
336 | int[] pixelBW = new int[3];
337 | pixelBW = yuvCalc.convertRGBtoYUV(line);
338 | pixelBW[1] = 128;
339 | pixelBW[2] = 128;
340 |
341 | return yuvCalc.convertYUVtoRGB(pixelBW);
342 | }
343 |
344 | }
345 |
--------------------------------------------------------------------------------
/CryptImage_Dev/src/com/ib/cryptimage/core/Shift.java:
--------------------------------------------------------------------------------
1 | /**
2 | * This file is part of CryptImage.
3 | *
4 | * CryptImage is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * CryptImage is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with CryptImage. If not, see
16 | *
17 | * 8 juin 2018 Author Mannix54
18 | */
19 |
20 |
21 |
22 | package com.ib.cryptimage.core;
23 |
24 | import java.awt.image.BufferedImage;
25 | import java.awt.image.WritableRaster;
26 |
27 | /**
28 | * @author Mannix54
29 | *
30 | */
31 | public class Shift {
32 |
33 | WritableRaster raster;
34 | WritableRaster raster2;
35 | BufferedImage newImage;
36 |
37 |
38 |
39 | /**
40 | *
41 | */
42 | public Shift() {
43 | // TODO Auto-generated constructor stub
44 | }
45 |
46 |
47 | public BufferedImage transform(BufferedImage image, int shiftX, int shiftY) {
48 | raster = image.getRaster();
49 | newImage = new BufferedImage(image.getWidth(), image.getHeight(), BufferedImage.TYPE_3BYTE_BGR);
50 | raster2 = newImage.getRaster();
51 |
52 |
53 | int val_i_start = 0;
54 | int val_i_end = image.getHeight();
55 | int val_height = 0;
56 | int val_x_start = 0;
57 | int val_x_ori_start = 0;
58 | int val_x_width = image.getWidth();
59 |
60 | if(shiftY > 0) {
61 | val_i_start = shiftY;
62 | val_i_end = image.getHeight();
63 | val_height = shiftY * -1;
64 | }
65 |
66 | if(shiftY < 0) {
67 | val_i_start = 0;
68 | val_i_end = image.getHeight() + shiftY;
69 | val_height = Math.abs(shiftY);
70 | }
71 |
72 | if(shiftX > 0) {
73 | val_x_start = shiftX;
74 | val_x_width = image.getWidth() - shiftX;
75 | val_x_ori_start = 0;
76 | }
77 |
78 | if(shiftX < 0) {
79 | val_x_start = 0;
80 | val_x_width = image.getWidth() + shiftX;
81 | val_x_ori_start = Math.abs(shiftX);
82 | }
83 |
84 |
85 | // for (int i = val_i_start; i < val_i_end; i++) {
86 | // raster2.setPixels(val_x_start, i, val_x_width, 1,
87 | // raster.getPixels(val_x_ori_start, i + val_height , val_x_width, 1,
88 | // new int[val_x_width * 3]));
89 | // }
90 |
91 | raster2.setPixels(val_x_start, val_i_start, val_x_width, val_i_end - val_i_start,
92 | raster.getPixels(val_x_ori_start, val_i_start + val_height , val_x_width, val_i_end - val_i_start,
93 | new int[val_x_width * ( val_i_end - val_i_start) * 3]));
94 |
95 |
96 | //
97 | // if(shiftY > 0 && shiftX == 0) {
98 | // for (int i = shiftY; i < 576; i++) {
99 | // raster2.setPixels(0, i, image.getWidth(), 1,
100 | // raster.getPixels(0, i - shiftY, image.getWidth(), 1,
101 | // new int[image.getWidth() * 3]));
102 | // }
103 | // }
104 | // else if(shiftY < 0 && shiftX == 0) {
105 | // for (int i = 0; i < 576 + shiftY; i++) {
106 | // raster2.setPixels(0, i, image.getWidth(), 1,
107 | // raster.getPixels(0, i + Math.abs(shiftY), image.getWidth(), 1,
108 | // new int[image.getWidth() * 3]));
109 | // }
110 | // }
111 | // else if(shiftY > 0 && shiftX > 0) {
112 | // for (int i = shiftY; i < 576; i++) {
113 | // raster2.setPixels(0 + shiftX, i, image.getWidth() - shiftX, 1,
114 | // raster.getPixels(0, i - shiftY, image.getWidth() - shiftX, 1,
115 | // new int[(image.getWidth() - shiftX) * 3]));
116 | // }
117 | // }
118 | // else if(shiftY < 0 && shiftX > 0) {
119 | // for (int i = 0; i < 576 + shiftY; i++) {
120 | // raster2.setPixels(0 + shiftX, i, image.getWidth() - shiftX, 1,
121 | // raster.getPixels(0, i + Math.abs(shiftY), image.getWidth() - shiftX, 1,
122 | // new int[(image.getWidth()- shiftX) * 3]));
123 | // }
124 | // }
125 |
126 |
127 | return newImage;
128 |
129 |
130 | }
131 |
132 | }
133 |
--------------------------------------------------------------------------------
/CryptImage_Dev/src/com/ib/cryptimage/core/SimpleDiscret11Black.java:
--------------------------------------------------------------------------------
1 | /**
2 | * This file is part of CryptImage.
3 | *
4 | * CryptImage is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * CryptImage is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with CryptImage. If not, see
16 | *
17 | * 18 oct. 2015 Author Mannix54
18 | */
19 |
20 |
21 |
22 | package com.ib.cryptimage.core;
23 |
24 |
25 | /**
26 | * @author Mannix54
27 | *
28 | */
29 | public class SimpleDiscret11Black extends SimpleDiscret11 {
30 | int[] tabPixels;
31 | int[] rgbPixel = new int[3];
32 |
33 | public SimpleDiscret11Black(int key16bits, int audienceLevel, int mode, int height, int width) {
34 | super(key16bits, audienceLevel, mode, height, width);
35 | }
36 |
37 |
38 | public SimpleDiscret11Black(int key16bits, int audienceLevel, int mode, int height, int width, double perc1,
39 | double perc2) {
40 | super(key16bits, audienceLevel, mode, height, width, perc1, perc2);
41 | }
42 |
43 | protected void drawLine(int y){
44 | //draw black line at start of delay
45 | raster.setPixels(0, y, JobConfig.getDelay2(), 1,
46 | new int[JobConfig.getDelay2() * 3]);
47 | }
48 |
49 | protected void drawLineDec(int y){
50 | //draw color line at end of delay
51 | try {
52 | rgbPixel = raster.getPixel(this.width - 1 - delayArray[this.seqFullFrame][y], y,
53 | new int[3]);
54 | } catch (Exception e) {
55 | rgbPixel = raster.getPixel(this.width - 1 - delayArray[this.seqFullFrame][y], y,
56 | new int[3]);
57 | }
58 |
59 | tabPixels = new int[delayArray[this.seqFullFrame][y]*3];
60 | for (int i = 0; i < tabPixels.length; i=i+3) {
61 | tabPixels[i] = rgbPixel[0];
62 | tabPixels[i+1] = rgbPixel[1];
63 | tabPixels[i+2] = rgbPixel[2];
64 | }
65 |
66 | raster.setPixels(this.width - delayArray[this.seqFullFrame][y], y,delayArray[this.seqFullFrame][y], 1,
67 | tabPixels);
68 | }
69 |
70 | }
71 |
72 |
73 |
--------------------------------------------------------------------------------
/CryptImage_Dev/src/com/ib/cryptimage/core/SimpleDiscret11MaskedBorder.java:
--------------------------------------------------------------------------------
1 | /**
2 | * This file is part of CryptImage.
3 | *
4 | * CryptImage is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * CryptImage is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with CryptImage. If not, see
16 | *
17 | * 16 oct. 2015 Author Mannix54
18 | */
19 |
20 |
21 |
22 | package com.ib.cryptimage.core;
23 |
24 |
25 | /**
26 | * @author Mannix54
27 | *
28 | */
29 | public class SimpleDiscret11MaskedBorder extends SimpleDiscret11 {
30 |
31 | int[] tabPixels;
32 | int[] rgbPixel = new int[3];
33 |
34 | public SimpleDiscret11MaskedBorder(int key16bits, int audienceLevel, int mode, int height, int width, double perc1,
35 | double perc2) {
36 | super(key16bits, audienceLevel, mode, height, width, perc1, perc2);
37 | }
38 |
39 | public SimpleDiscret11MaskedBorder(int key16bits, int audienceLevel, int mode, int height, int width) {
40 | super(key16bits, audienceLevel, mode, height, width);
41 | }
42 |
43 | protected void drawLine(int y){
44 | //draw black line at start of delay
45 |
46 | int lineSizePixels = JobConfig.getDelay2() * 3;
47 | int[] tabPixels = new int[lineSizePixels];
48 |
49 | raster.setPixels(0, y, JobConfig.getDelay2(), 1, tabPixels);
50 | }
51 |
52 |
53 | }
54 |
--------------------------------------------------------------------------------
/CryptImage_Dev/src/com/ib/cryptimage/core/SoundCrypt.java:
--------------------------------------------------------------------------------
1 | /**
2 | * This file is part of CryptImage.
3 | *
4 | * CryptImage is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * CryptImage is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with CryptImage. If not, see
16 | *
17 | * 1 déc. 2014 Author Mannix54
18 | * http://ibsoftware.free.fr/cryptimage.php
19 | */
20 |
21 |
22 |
23 | package com.ib.cryptimage.core;
24 |
25 |
26 | /**
27 | * @author Mannix54
28 | *
29 | */
30 | public class SoundCrypt {
31 |
32 | private double rate;
33 | private double w = 0;
34 | private double m_dDeccte = 0;
35 | private double m_dDecy1 = 0;
36 | private double m_dDecy0 = 0;
37 | private double m_nGain =1;
38 | private double decy;
39 | private boolean dec;
40 | private int sampleCount = 0;
41 | //private boolean initButterWorthChorus = false;
42 | private boolean initChebyChorus = false;
43 | private boolean initChebyChorus2 = false;
44 |
45 |
46 |
47 | // //low pass butterWorth Chorus2
48 | // private int nzeros_butterChorus;
49 | // private int npoles_butterChorus;
50 | // private double gain_buttterChorus;
51 | // private double[] xv_butterChorus;
52 | // private double[] yv_butterChorus;
53 |
54 | //init cheby chorus
55 | private int nzeros_chebyChorus;
56 | private int npoles_chebyChorus;
57 | private double gain_chebyChorus;
58 | private double[] xv_chebyChorus;
59 | private double[] yv_chebyChorus;
60 |
61 | private int nzeros_chebyChorus2;
62 | private int npoles_chebyChorus2;
63 | private double gain_chebyChorus2;
64 | private double[] xv_chebyChorus2;
65 | private double[] yv_chebyChorus2;
66 |
67 |
68 | /**
69 | *
70 | * @param rate rate in hertz for the samples
71 | * @param dec true if decoding mode
72 | */
73 | public SoundCrypt(int rate, boolean dec, double ampEnc, double ampDec){
74 | if(JobConfig.isHasMultiAudioChannels()) {
75 | ampDec = 2; // avoid audio clic when multi audio channel track
76 | }
77 |
78 | this.dec = dec;
79 | if(this.dec == true){
80 | m_nGain = ampDec;
81 | }
82 | else{
83 | m_nGain = ampEnc;
84 | }
85 | this.rate = rate;
86 |
87 | initCrypt();
88 | }
89 |
90 | private void initCrypt(){
91 | w = 2 * Math.PI * 12800d/rate;
92 | m_dDeccte = 2.0 * Math.cos(w);
93 |
94 | m_dDecy0 = Math.cos(2 * w );
95 | m_dDecy1 = Math.cos(w);
96 |
97 | sampleCount = 0;
98 | }
99 |
100 | public double[] transform(double[] sound, boolean enable) {
101 |
102 | if (this.dec && !JobConfig.isHasMultiAudioChannels()) {
103 | if (this.rate == 44100) {
104 | sound = lowPassChebyShevChorus44100_pre(sound);
105 | } else {
106 | sound = lowPassChebyShevChorus48000_pre(sound);
107 | }
108 | }
109 | // else
110 | // if (this.rate == 44100) {
111 | // sound = lowPassChebyShevChorus44100_post(sound);
112 | // } else {
113 | // sound = lowPassChebyShevChorus48000_post(sound);
114 | // }
115 |
116 | sound = crypt(sound, enable);
117 |
118 | if (this.dec && !JobConfig.isHasMultiAudioChannels()) {
119 | if (this.rate == 44100) {
120 | sound = lowPassChebyShevChorus44100_post(sound);
121 | } else {
122 | sound = lowPassChebyShevChorus48000_post(sound);
123 | }
124 | }
125 | // else
126 | // if (this.rate == 44100) {
127 | // sound = lowPassChebyShevChorus44100_pre(sound);
128 | // } else {
129 | // sound = lowPassChebyShevChorus48000_pre(sound);
130 | // }
131 |
132 | return sound;
133 | }
134 |
135 | private double[] crypt(double[] sound, boolean enable) {
136 |
137 | for (int i = 0; i < sound.length; i++) {
138 | decy = (m_dDeccte * m_dDecy1) - m_dDecy0;
139 | m_dDecy0 = m_dDecy1;
140 | m_dDecy1 = decy;
141 |
142 | if (enable) {
143 | sound[i] = (sound[i] * decy) * m_nGain;
144 | }
145 |
146 | sampleCount++;
147 |
148 | if (sampleCount == this.rate) {
149 | m_dDecy0 = Math.cos(2 * w);
150 | m_dDecy1 = Math.cos(w);
151 | sampleCount = 0;
152 | }
153 | }
154 | return sound;
155 | }
156 |
157 | /**
158 | * filter for 44100 Hz
159 | * @param sound
160 | * @return
161 | */
162 | private double[] lowPassChebyShevChorus44100_pre(double[] sound) {
163 | // init
164 | if (this.initChebyChorus == false) {
165 | nzeros_chebyChorus = 4;
166 | npoles_chebyChorus = 4;
167 | gain_chebyChorus = 6.310833714e+00;
168 | xv_chebyChorus = new double[nzeros_chebyChorus + 1];
169 | yv_chebyChorus = new double[npoles_chebyChorus + 1];
170 | this.initChebyChorus = true;
171 | }
172 |
173 | for (int i = 0; i < sound.length; i++) {
174 | double input = sound[i];
175 | xv_chebyChorus[0] = xv_chebyChorus[1];
176 | xv_chebyChorus[1] = xv_chebyChorus[2];
177 | xv_chebyChorus[2] = xv_chebyChorus[3];
178 | xv_chebyChorus[3] = xv_chebyChorus[4];
179 |
180 | xv_chebyChorus[4] = input / gain_chebyChorus;
181 |
182 | yv_chebyChorus[0] = yv_chebyChorus[1];
183 | yv_chebyChorus[1] = yv_chebyChorus[2];
184 | yv_chebyChorus[2] = yv_chebyChorus[3];
185 | yv_chebyChorus[3] = yv_chebyChorus[4];
186 |
187 | yv_chebyChorus[4] = (xv_chebyChorus[0] + xv_chebyChorus[4]) + 4 * (xv_chebyChorus[1] + xv_chebyChorus[3])
188 | + 6 * xv_chebyChorus[2] + (-0.0622354481 * yv_chebyChorus[0]) + (-0.0826699057 * yv_chebyChorus[1])
189 | + (-0.7552376542 * yv_chebyChorus[2]) + (-0.6351796968 * yv_chebyChorus[3]);
190 |
191 | sound[i] = yv_chebyChorus[4];
192 | }
193 | return sound;
194 |
195 | }
196 |
197 | private double[] lowPassChebyShevChorus44100_post(double[] sound) {
198 | // init
199 | if (this.initChebyChorus2 == false) {
200 | nzeros_chebyChorus2 = 7;
201 | npoles_chebyChorus2 = 7;
202 | gain_chebyChorus2 = 2.211596484e+02;
203 | xv_chebyChorus2 = new double[nzeros_chebyChorus2 + 1];
204 | yv_chebyChorus2 = new double[npoles_chebyChorus2 + 1];
205 | this.initChebyChorus2 = true;
206 | }
207 |
208 | for (int i = 0; i < sound.length; i++) {
209 | double input = sound[i];
210 | xv_chebyChorus2[0] = xv_chebyChorus2[1];
211 | xv_chebyChorus2[1] = xv_chebyChorus2[2];
212 | xv_chebyChorus2[2] = xv_chebyChorus2[3];
213 | xv_chebyChorus2[3] = xv_chebyChorus2[4];
214 | xv_chebyChorus2[4] = xv_chebyChorus2[5];
215 | xv_chebyChorus2[5] = xv_chebyChorus2[6];
216 | xv_chebyChorus2[6] = xv_chebyChorus2[7];
217 | xv_chebyChorus2[7] = input / gain_chebyChorus2;
218 | yv_chebyChorus2[0] = yv_chebyChorus2[1];
219 | yv_chebyChorus2[1] = yv_chebyChorus2[2];
220 | yv_chebyChorus2[2] = yv_chebyChorus2[3];
221 | yv_chebyChorus2[3] = yv_chebyChorus2[4];
222 | yv_chebyChorus2[4] = yv_chebyChorus2[5];
223 | yv_chebyChorus2[5] = yv_chebyChorus2[6];
224 | yv_chebyChorus2[6] = yv_chebyChorus2[7];
225 | yv_chebyChorus2[7] = (xv_chebyChorus2[0] + xv_chebyChorus2[7])
226 | + 7 * (xv_chebyChorus2[1] + xv_chebyChorus2[6]) + 21 * (xv_chebyChorus2[2] + xv_chebyChorus2[5])
227 | + 35 * (xv_chebyChorus2[3] + xv_chebyChorus2[4]) + (0.0935164959 * yv_chebyChorus2[0])
228 | + (-0.4657366789 * yv_chebyChorus2[1]) + (1.2531881677 * yv_chebyChorus2[2])
229 | + (-2.2854956347 * yv_chebyChorus2[3]) + (2.9413622606 * yv_chebyChorus2[4])
230 | + (-2.9346526015 * yv_chebyChorus2[5]) + (1.8190505669 * yv_chebyChorus2[6]);
231 | sound[i] = yv_chebyChorus2[7];
232 | }
233 | return sound;
234 | }
235 |
236 |
237 | /**
238 | * filter for 48000 hz case
239 | * @param sound
240 | * @return
241 | */
242 | private double[] lowPassChebyShevChorus48000_pre(double[] sound) {
243 | // init
244 | if (this.initChebyChorus == false) {
245 | nzeros_chebyChorus = 4;
246 | npoles_chebyChorus = 4;
247 | gain_chebyChorus = 8.183340972e+00;
248 | xv_chebyChorus = new double[nzeros_chebyChorus + 1];
249 | yv_chebyChorus = new double[npoles_chebyChorus + 1];
250 | this.initChebyChorus = true;
251 | }
252 |
253 | for (int i = 0; i < sound.length; i++) {
254 | double input = sound[i];
255 | xv_chebyChorus[0] = xv_chebyChorus[1];
256 | xv_chebyChorus[1] = xv_chebyChorus[2];
257 | xv_chebyChorus[2] = xv_chebyChorus[3];
258 | xv_chebyChorus[3] = xv_chebyChorus[4];
259 |
260 | xv_chebyChorus[4] = input / gain_chebyChorus;
261 |
262 | yv_chebyChorus[0] = yv_chebyChorus[1];
263 | yv_chebyChorus[1] = yv_chebyChorus[2];
264 | yv_chebyChorus[2] = yv_chebyChorus[3];
265 | yv_chebyChorus[3] = yv_chebyChorus[4];
266 | yv_chebyChorus[4] = (xv_chebyChorus[0] + xv_chebyChorus[4]) + 4 * (xv_chebyChorus[1] + xv_chebyChorus[3])
267 | + 6 * xv_chebyChorus[2] + (-0.0626606278 * yv_chebyChorus[0]) + (0.0379954621 * yv_chebyChorus[1])
268 | + (-0.6759257285 * yv_chebyChorus[2]) + (-0.2546007635 * yv_chebyChorus[3]);
269 | sound[i] = yv_chebyChorus[4];
270 | }
271 |
272 | return sound;
273 | }
274 |
275 | private double[] lowPassChebyShevChorus48000_post(double[] sound) {
276 | // init
277 | if (this.initChebyChorus2 == false) {
278 | nzeros_chebyChorus2 = 7;
279 | npoles_chebyChorus2 = 7;
280 | gain_chebyChorus2 = 3.834721196e+02;
281 | xv_chebyChorus2 = new double[nzeros_chebyChorus2 + 1];
282 | yv_chebyChorus2 = new double[npoles_chebyChorus2 + 1];
283 | this.initChebyChorus2 = true;
284 | }
285 |
286 | for (int i = 0; i < sound.length; i++) {
287 | double input = sound[i];
288 | xv_chebyChorus2[0] = xv_chebyChorus2[1];
289 | xv_chebyChorus2[1] = xv_chebyChorus2[2];
290 | xv_chebyChorus2[2] = xv_chebyChorus2[3];
291 | xv_chebyChorus2[3] = xv_chebyChorus2[4];
292 | xv_chebyChorus2[4] = xv_chebyChorus2[5];
293 | xv_chebyChorus2[5] = xv_chebyChorus2[6];
294 | xv_chebyChorus2[6] = xv_chebyChorus2[7];
295 |
296 | xv_chebyChorus2[7] = input / gain_chebyChorus2;
297 |
298 | yv_chebyChorus2[0] = yv_chebyChorus2[1];
299 | yv_chebyChorus2[1] = yv_chebyChorus2[2];
300 | yv_chebyChorus2[2] = yv_chebyChorus2[3];
301 | yv_chebyChorus2[3] = yv_chebyChorus2[4];
302 | yv_chebyChorus2[4] = yv_chebyChorus2[5];
303 | yv_chebyChorus2[5] = yv_chebyChorus2[6];
304 | yv_chebyChorus2[6] = yv_chebyChorus2[7];
305 | yv_chebyChorus2[7] = (xv_chebyChorus2[0] + xv_chebyChorus2[7]) + 7 * (xv_chebyChorus2[1] + xv_chebyChorus2[6])
306 | + 21 * (xv_chebyChorus2[2] + xv_chebyChorus2[5]) + 35 * (xv_chebyChorus2[3] + xv_chebyChorus2[4])
307 | + (0.1130488058 * yv_chebyChorus2[0]) + (-0.6208360469 * yv_chebyChorus2[1])
308 | + (1.7554209098 * yv_chebyChorus2[2]) + (-3.2416570827 * yv_chebyChorus2[3])
309 | + (4.1799016509 * yv_chebyChorus2[4]) + (-3.9042013855 * yv_chebyChorus2[5])
310 | + (2.3845309549 * yv_chebyChorus2[6]);
311 | sound[i] = yv_chebyChorus2[7];
312 | }
313 | return sound;
314 | }
315 |
316 | }
317 |
--------------------------------------------------------------------------------
/CryptImage_Dev/src/com/ib/cryptimage/core/SplitFrames.java:
--------------------------------------------------------------------------------
1 | /**
2 | * This file is part of CryptImage.
3 | *
4 | * CryptImage is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * CryptImage is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with CryptImage. If not, see
16 | *
17 | * 6 juil. 2018 Author Mannix54
18 | */
19 |
20 |
21 |
22 | package com.ib.cryptimage.core;
23 |
24 | import java.awt.image.BufferedImage;
25 | import java.awt.image.Raster;
26 | import java.awt.image.WritableRaster;
27 | import java.io.IOException;
28 |
29 | import javax.imageio.ImageIO;
30 |
31 | /**
32 | * @author Mannix54
33 | *
34 | */
35 | public class SplitFrames {
36 |
37 | BufferedImage img;
38 | String burst1;
39 | String burst2;
40 | int digRate;
41 |
42 | /**
43 | *
44 | */
45 | public SplitFrames(int digRate) {
46 | this.digRate = digRate;
47 | }
48 |
49 | private void initBurst(int currentFrame) {
50 | if (digRate == 17750000) {
51 | if (JobConfig.getGui().getChkWorkaroundSysterCapture().isSelected()) {
52 | switch (currentFrame) {
53 | case 1:
54 | burst1 = "/ressources/burst_top_phase_4.bmp";
55 | burst2 = "/ressources/burst_bot_phase_4.bmp";
56 | break;
57 | case 2:
58 | burst1 = "/ressources/burst_top_phase_1.bmp";
59 | burst2 = "/ressources/burst_bot_phase_1.bmp";
60 | break;
61 | case 3:
62 | burst1 = "/ressources/burst_top_phase_2.bmp";
63 | burst2 = "/ressources/burst_bot_phase_2.bmp";
64 | break;
65 | case 4:
66 | burst1 = "/ressources/burst_top_phase_3.bmp";
67 | burst2 = "/ressources/burst_bot_phase_3.bmp";
68 | break;
69 | default:
70 | burst1 = "/ressources/burst_top_phase_4.bmp";
71 | burst2 = "/ressources/burst_bot_phase_4.bmp";
72 | break;
73 | }
74 | } else {
75 | switch (currentFrame) {
76 | case 1:
77 | burst1 = "/ressources/burst_top_phase_1.bmp";
78 | burst2 = "/ressources/burst_bot_phase_1.bmp";
79 | break;
80 | case 2:
81 | burst1 = "/ressources/burst_top_phase_2.bmp";
82 | burst2 = "/ressources/burst_bot_phase_2.bmp";
83 | break;
84 | case 3:
85 | burst1 = "/ressources/burst_top_phase_3.bmp";
86 | burst2 = "/ressources/burst_bot_phase_3.bmp";
87 | break;
88 | case 4:
89 | burst1 = "/ressources/burst_top_phase_4.bmp";
90 | burst2 = "/ressources/burst_bot_phase_4.bmp";
91 | break;
92 | default:
93 | burst1 = "/ressources/burst_top_phase_1.bmp";
94 | burst2 = "/ressources/burst_bot_phase_1.bmp";
95 | break;
96 | }
97 | }
98 | } else if (digRate == 14750000) {
99 | switch (currentFrame) {
100 | case 1:
101 | burst1 = "/ressources/burst_14.75_phase_1_top.bmp";
102 | burst2 = "/ressources/burst_14.75_phase_1_bot.bmp";
103 | break;
104 | case 2:
105 | burst1 = "/ressources/burst_14.75_phase_2_top.bmp";
106 | burst2 = "/ressources/burst_14.75_phase_2_bot.bmp";
107 | break;
108 | case 3:
109 | burst1 = "/ressources/burst_14.75_phase_3_top.bmp";
110 | burst2 = "/ressources/burst_14.75_phase_3_bot.bmp";
111 | break;
112 | case 4:
113 | burst1 = "/ressources/burst_14.75_phase_4_top.bmp";
114 | burst2 = "/ressources/burst_14.75_phase_4_bot.bmp";
115 | break;
116 | default:
117 | System.out.println("error pal frame number");
118 | burst1 = "/ressources/burst_14.75_phase_1_top.bmp";
119 | burst2 = "/ressources/burst_14.75_phase_1_bot.bmp";
120 | break;
121 | }
122 | }
123 |
124 | }
125 |
126 | public BufferedImage splitFrames(boolean grey, BufferedImage img) {
127 | initBurst(JobConfig.getCurrentPalFrame());
128 |
129 | this.img = img;
130 | BufferedImage buff = new BufferedImage(944, 626, BufferedImage.TYPE_3BYTE_BGR);
131 |
132 | img = convertToType(img, BufferedImage.TYPE_3BYTE_BGR);
133 |
134 | WritableRaster raster = buff.getRaster();
135 |
136 | BufferedImage burst_top = null;
137 | try {
138 | burst_top = ImageIO.read(getClass().getResource(burst1));
139 | } catch (IOException e1) {
140 | // TODO Auto-generated catch block
141 | e1.printStackTrace();
142 | }
143 | BufferedImage burst_bot = null;
144 | try {
145 | burst_bot = ImageIO.read(getClass().getResource(burst2));
146 | } catch (IOException e) {
147 | // TODO Auto-generated catch block
148 | e.printStackTrace();
149 | }
150 |
151 | Raster rasterBurst1 = burst_top.getRaster();
152 | Raster rasterBurst2 = burst_bot.getRaster();
153 |
154 | Raster rasterfullFrame = img.getRaster();
155 |
156 | raster.setPixels(76, 21, 36, 288,
157 | rasterBurst1.getPixels(0, 0, 36, 288, new int[36 * 288 * 3]));
158 |
159 | raster.setPixels(76, 332, 36, 288,
160 | rasterBurst2.getPixels(0, 0, 36, 288, new int[36 * 288 * 3]));
161 |
162 | //buff = convertToType(buff, BufferedImage.TYPE_BYTE_GRAY);
163 |
164 | int j = 0;
165 |
166 | for (int i = 0; i < 576; i++) {
167 | //System.out.println(i);
168 | raster.setPixels(156, j + 21, 768, 1,
169 | rasterfullFrame.getPixels(0, i, 768, 1, new int[768 *3]));
170 | i++;
171 | j++;
172 | }
173 |
174 | j=0;
175 | for (int i = 1; i < 576; i++) {
176 | //System.out.println(i);
177 | raster.setPixels(156, j + 332, 768, 1,
178 | rasterfullFrame.getPixels(0, i , 768, 1, new int[768 *3]));
179 | i++;
180 | j++;
181 | }
182 |
183 | if(grey) {
184 | return convertToType(buff, BufferedImage.TYPE_BYTE_GRAY);
185 | }
186 | else {
187 | return buff;
188 | }
189 |
190 | }
191 |
192 | public BufferedImage unsplitFrames(BufferedImage buff) {
193 | if(buff.getWidth() !=944 || buff.getHeight() != 626 ) {
194 | return buff;
195 | }
196 |
197 | buff = convertToType(buff, BufferedImage.TYPE_3BYTE_BGR);
198 | BufferedImage fullFrame = new BufferedImage(768, 576, BufferedImage.TYPE_3BYTE_BGR);
199 | WritableRaster rasterFullFrame = fullFrame.getRaster();
200 | Raster raster = buff.getRaster();
201 |
202 | int j = 0;
203 |
204 | for (int i = 0; i < 576; i++) {
205 | //System.out.println(i);
206 | rasterFullFrame.setPixels(0, i, 768, 1,
207 | raster.getPixels(156, j + 21, 768, 1, new int[768 * 3]));
208 | i++;
209 | j++;
210 |
211 | }
212 |
213 | j=0;
214 | for (int i = 1; i < 576; i++) {
215 | //System.out.println(i);
216 | rasterFullFrame.setPixels(0, i, 768, 1,
217 | raster.getPixels(156, j + 332, 768, 1, new int[768 * 3]));
218 | i++;
219 | j++;
220 |
221 | }
222 |
223 | return fullFrame;
224 |
225 | }
226 |
227 | /**
228 | * Convert a source image to a desired BufferedImage type
229 | * @param sourceImage the image source
230 | * @param targetType the target type
231 | * @return a converted BufferedImage
232 | */
233 | protected BufferedImage convertToType(BufferedImage sourceImage,
234 | int targetType) {
235 | BufferedImage image;
236 |
237 | // if the source image is already the target type, return the source
238 | // image
239 | if (sourceImage.getType() == targetType) {
240 | image = sourceImage;
241 | }
242 | // otherwise create a new image of the target type and draw the new
243 | // image
244 | else {
245 | image = new BufferedImage(sourceImage.getWidth(),
246 | sourceImage.getHeight(), targetType);
247 | image.getGraphics().drawImage(sourceImage, 0, 0, null);
248 | }
249 | return image;
250 | }
251 |
252 |
253 |
254 | }
255 |
--------------------------------------------------------------------------------
/CryptImage_Dev/src/com/ib/cryptimage/core/StreamTrack.java:
--------------------------------------------------------------------------------
1 | package com.ib.cryptimage.core;
2 |
3 | import com.xuggle.xuggler.ICodec;
4 |
5 | public class StreamTrack {
6 | private int id;
7 | private ICodec.ID codecIDInt;
8 | public ICodec.ID getCodecIDInt() {
9 | return codecIDInt;
10 | }
11 |
12 | public void setCodecIDInt(ICodec.ID codecIDInt) {
13 | this.codecIDInt = codecIDInt;
14 | }
15 |
16 | private String type;
17 | private String codecLongName;
18 | private String codecShortName;
19 | public void setCodecShortName(String codecShortName) {
20 | this.codecShortName = codecShortName;
21 | }
22 |
23 | public String getCodecShortName() {
24 | return codecShortName;
25 | }
26 |
27 | private String codecID;
28 | public String getCodecID() {
29 | return codecID;
30 | }
31 |
32 | public void setCodecID(String codecID) {
33 | this.codecID = codecID;
34 | }
35 |
36 | private int numChannels;
37 |
38 | private long duration;
39 |
40 | public long getDuration() {
41 | return duration;
42 | }
43 |
44 | public void setDuration(long duration) {
45 | this.duration = duration;
46 | }
47 |
48 | private long numFrames;
49 |
50 | public long getNumFrames() {
51 | return numFrames;
52 | }
53 |
54 | public void setNumFrames(long numFrames) {
55 | this.numFrames = numFrames;
56 | }
57 |
58 | private int audioRate;
59 |
60 | public int getAudioRate() {
61 | return audioRate;
62 | }
63 |
64 | public void setAudioRate(int audioRate) {
65 | this.audioRate = audioRate;
66 | }
67 |
68 | public StreamTrack(int id, String type, int numChannels, String codecName) {
69 | this.id = id;
70 | this.type = type;
71 | this.numChannels = numChannels;
72 | this.codecLongName = codecName;
73 | }
74 |
75 | public StreamTrack(int id, String type, String codecName) {
76 | this.id = id;
77 | this.type = type;
78 | this.codecLongName = codecName;
79 | }
80 |
81 | public int getId() {
82 | return id;
83 | }
84 |
85 | public void setId(int id) {
86 | this.id = id;
87 | }
88 |
89 | public String getType() {
90 | return type;
91 | }
92 |
93 | public void setType(String type) {
94 | this.type = type;
95 | }
96 |
97 | public int getNumChannels() {
98 | return numChannels;
99 | }
100 |
101 | public void setNumChannels(int numChannels) {
102 | this.numChannels = numChannels;
103 | }
104 |
105 | public String getCodecLongName() {
106 | return codecLongName;
107 | }
108 |
109 | public void setCodecLongName(String codecName) {
110 | this.codecLongName = codecName;
111 | }
112 |
113 | }
114 |
--------------------------------------------------------------------------------
/CryptImage_Dev/src/com/ib/cryptimage/core/StreamsFinder.java:
--------------------------------------------------------------------------------
1 | /**
2 | * This file is part of CryptImage.
3 | *
4 | * CryptImage is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * CryptImage is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with CryptImage. If not, see
16 | *
17 | * 28 nov. 2014 Author Mannix54
18 | * http://ibsoftware.free.fr/cryptimage.php
19 | */
20 |
21 |
22 |
23 | package com.ib.cryptimage.core;
24 |
25 | import com.ib.cryptimage.gui.TrackSelector;
26 | import com.xuggle.xuggler.ICodec;
27 | import com.xuggle.xuggler.IContainer;
28 | import com.xuggle.xuggler.IStream;
29 | import com.xuggle.xuggler.IStreamCoder;
30 | import java.util.Vector;
31 |
32 |
33 | /**
34 | * @author Mannix54
35 | *
36 | */
37 | public class StreamsFinder {
38 |
39 | private IContainer container;
40 | private int[] numStreamsAudio;
41 | private int numAudioChannels;
42 | public int getNumAudioChannels() {
43 | return numAudioChannels;
44 | }
45 |
46 | private int[] numStreamsVideo;
47 | private int numStreams = 0;
48 | private boolean hasVideoTrack = false;
49 | private boolean hasAudioTrack = false;
50 |
51 | private int defaultIdAudioTrack = 0;
52 | private int defaultIdVideoTrack = 0;
53 | private String defaultNameAudioCodec = "";
54 | public String getDefaultNameAudioCodec() {
55 | return defaultNameAudioCodec;
56 | }
57 |
58 | private String defaultNameIDAudioCodec = "";
59 |
60 | public String getDefaultNameIDAudioCodec() {
61 | return defaultNameIDAudioCodec;
62 | }
63 |
64 | private Vector audioTracks = new Vector();
65 | private Vector videoTracks = new Vector();
66 |
67 |
68 | public StreamsFinder(String filename){
69 | container = IContainer.make();
70 | if (container.open(filename, IContainer.Type.READ, null) < 0)
71 | throw new IllegalArgumentException("could not open file: " + filename);
72 | numStreamsAudio = new int[container.getNumStreams()];
73 | numStreamsVideo = new int[container.getNumStreams()];
74 | searchStreams();
75 |
76 | }
77 |
78 | private void searchStreams() {
79 | int numStreams = container.getNumStreams();
80 | int comptAudio = 0;
81 | int comptVideo = 0;
82 |
83 | // find the first video stream
84 | for (int i = 0; i < numStreams; i++) {
85 | IStream stream = container.getStream(i);
86 | IStreamCoder coder = stream.getStreamCoder();
87 | if (coder.getCodecType() == ICodec.Type.CODEC_TYPE_AUDIO) {
88 | this.hasAudioTrack = true;
89 |
90 | StreamTrack audioTrack = new StreamTrack(coder.getStream().getIndex(), "audio", coder.getChannels(), coder.getCodec().getLongName());
91 |
92 | audioTrack.setCodecShortName(coder.getCodec().getName());
93 | audioTrack.setCodecID(coder.getCodec().getID().toString());
94 | audioTrack.setCodecIDInt(coder.getCodecID());
95 | audioTrack.setAudioRate(coder.getSampleRate());
96 |
97 | audioTrack.setDuration(stream.getDuration());
98 | audioTrack.setNumFrames(stream.getNumFrames());
99 |
100 | this.audioTracks.add(audioTrack);
101 |
102 | numStreamsAudio[comptAudio] = i;
103 | comptAudio++;
104 | } else if (coder.getCodecType() == ICodec.Type.CODEC_TYPE_VIDEO) {
105 | this.hasVideoTrack = true;
106 |
107 | StreamTrack videoTrack = new StreamTrack(coder.getStream().getIndex(), "video", coder.getCodec().getLongName());
108 | videoTrack.setCodecIDInt(coder.getCodecID());
109 |
110 | videoTrack.setDuration(stream.getDuration());
111 | videoTrack.setNumFrames(stream.getNumFrames());
112 |
113 | this.videoTracks.add(videoTrack);
114 |
115 | numStreamsVideo[comptVideo] = i;
116 | comptVideo++;
117 | }
118 | }
119 |
120 | JobConfig.setStreamTracksVideo(videoTracks);
121 | JobConfig.setStreamTracksAudio(audioTracks);
122 |
123 | this.numStreams = this.audioTracks.size() + this.videoTracks.size();
124 |
125 | //analyzeStreams();
126 | }
127 |
128 | public void analyzeStreams() {
129 | // set default audio stream
130 | if(audioTracks.size() > 0) {
131 | this.numAudioChannels = audioTracks.get(0).getNumChannels();
132 | this.defaultIdAudioTrack = audioTracks.get(0).getId();
133 | this.defaultNameAudioCodec = audioTracks.get(0).getCodecShortName();
134 | this.defaultNameIDAudioCodec = audioTracks.get(0).getCodecID();
135 | JobConfig.setAudioTrackInfos(audioTracks.get(0));
136 | }
137 |
138 | // for(StreamTrack audioTrack : this.audioTracks ) {
139 | // if(audioTrack.getNumChannels() >= 1 && audioTrack.getNumChannels() < 3) {
140 | // this.numAudioChannels = audioTrack.getNumChannels();
141 | // this.defaultIdAudioTrack = audioTrack.getId();
142 | // this.defaultNameAudioCodec = audioTrack.getCodecShortName();
143 | // this.defaultNameIDAudioCodec = audioTrack.getCodecID();
144 | // JobConfig.setAudioTrackInfos(audioTrack);
145 | // break;
146 | // }
147 | // if(audioTrack.getNumChannels() > 2) {
148 | // this.numAudioChannels = audioTrack.getNumChannels();
149 | // this.defaultIdAudioTrack = audioTrack.getId();
150 | // this.defaultNameAudioCodec = audioTrack.getCodecShortName();
151 | // this.defaultNameIDAudioCodec = audioTrack.getCodecID();
152 | // JobConfig.setAudioTrackInfos(audioTrack);
153 | // }
154 | // }
155 |
156 | // set default video stream
157 | if(this.hasVideoTrack) {
158 | this.defaultIdVideoTrack = this.videoTracks.elementAt(0).getId();
159 | JobConfig.setVideoTrackInfos(this.videoTracks.elementAt(0));
160 | }
161 |
162 |
163 |
164 | }
165 |
166 | public void displayTracksSelector() {
167 | TrackSelector trackSelector = new TrackSelector(JobConfig.getGui().getFrame(),
168 | JobConfig.getRes().getString("trackSelector.label.title"),
169 | videoTracks, audioTracks, true);
170 | trackSelector.display();
171 | }
172 |
173 |
174 | public int getNumStreams(){
175 | return this.numStreams;
176 | }
177 |
178 | public int[] getStreamsAudio(){
179 | return this.numStreamsAudio;
180 | }
181 |
182 | public int[] getStreamsVideo(){
183 | return this.numStreamsVideo;
184 | }
185 |
186 | public int getNumAudioStreams() {
187 | return this.audioTracks.size();
188 | }
189 |
190 | public int getNumVideoStreams() {
191 | return this.videoTracks.size();
192 | }
193 |
194 | public IContainer getContainer(){
195 | return this.container;
196 | }
197 |
198 | public boolean isHasVideoTrack() {
199 | return hasVideoTrack;
200 | }
201 |
202 | public boolean isHasAudioTrack() {
203 | return hasAudioTrack;
204 | }
205 |
206 | public int getDefaultIdAudioTrack() {
207 | return defaultIdAudioTrack;
208 | }
209 |
210 | public int getDefaultIdVideoTrack() {
211 | return defaultIdVideoTrack;
212 | }
213 | }
214 |
--------------------------------------------------------------------------------
/CryptImage_Dev/src/com/ib/cryptimage/core/Transcode.java:
--------------------------------------------------------------------------------
1 | /**
2 | * This file is part of CryptImage.
3 | *
4 | * CryptImage is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * CryptImage is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with CryptImage. If not, see
16 | *
17 | * 10 juil. 2018 Author Mannix54
18 | */
19 |
20 |
21 |
22 | package com.ib.cryptimage.core;
23 |
24 | import java.awt.Graphics;
25 | import java.awt.Graphics2D;
26 | import java.awt.RenderingHints;
27 | import java.awt.image.BufferedImage;
28 | import java.awt.image.ColorModel;
29 | import java.awt.image.WritableRaster;
30 |
31 | /**
32 | * @author Mannix54
33 | *
34 | */
35 | public class Transcode extends Device {
36 | private PalEngine palEngine;
37 | private SecamEngine secamEngine;
38 | private PalEncoder palEncoder;
39 | private PalDecoder palDecoder;
40 |
41 | protected int shiftX;
42 | protected int shiftY;
43 |
44 | protected Shift shift;
45 | private int sWidth = 768;
46 | BufferedImage imageSource;
47 |
48 | /**
49 | *
50 | */
51 | public Transcode() {
52 | int typeGrid = 0;
53 | int freq = 0;
54 | if(JobConfig.getGui().getCmbPalFreq().getSelectedIndex() == 0) {
55 | typeGrid = 0;
56 | freq = 14750000;
57 | }
58 | else {
59 | typeGrid = 1;
60 | freq = 17750000;
61 | }
62 |
63 |
64 | shift = new Shift();
65 | shiftX = Integer.valueOf(JobConfig.getGui().getjShiftX().getValue().toString());
66 | shiftY = Integer.valueOf(JobConfig.getGui().getjShiftY().getValue().toString());
67 | JobConfig.setCurrentPalFrameDec(JobConfig.getGui().getCmbPalFrameStart().getSelectedIndex());
68 | JobConfig.setCurrentPalFrame(0);
69 | palEngine = new PalEngine();
70 | secamEngine = new SecamEngine();
71 | palEncoder = new PalEncoder(false, typeGrid);
72 | palDecoder = new PalDecoder(freq);
73 | JobConfig.setPalDecoder(palDecoder);
74 | JobConfig.setPalEncoder(palEncoder);
75 | }
76 |
77 | @Override
78 | public
79 | BufferedImage transform(BufferedImage image) {
80 | JobConfig.incrementPalFrame();
81 | JobConfig.incrementPalFrameDec();
82 |
83 | image = this.convertToType(image, BufferedImage.TYPE_3BYTE_BGR);
84 | if (image.getWidth() != this.sWidth || image.getHeight() != 576) {
85 | image = this.getScaledImage(image, this.sWidth, 576);
86 | }
87 |
88 | JobConfig.setInputImage(image);
89 |
90 | //check shift X and Y
91 | if(shiftX != 0 || shiftY !=0) {
92 | image = shift.transform(image, shiftX, shiftY);
93 | }
94 |
95 | if(JobConfig.frameCount <= JobConfig.getTranscodeSelectedFrameEnd()) {
96 | this.imageSource = deepCopy(image);
97 |
98 | // encodage pal
99 | if (JobConfig.getColorMode() == 1) {
100 | palEngine.setImg(image);
101 | image = palEngine.encode();
102 | }
103 |
104 | //encode image to pal composite
105 | if (JobConfig.getColorMode() == 3 || JobConfig.getColorMode() == 4 ) {
106 | palEncoder.setImage(image);
107 | image = palEncoder.encode(false);
108 | }
109 |
110 | //encode secam
111 | if(JobConfig.getColorMode() == 2){
112 | secamEngine.setImg(image);
113 | image = secamEngine.encode();
114 | }
115 |
116 | //decode secam
117 | if (JobConfig.getColorMode() == 2) {
118 | secamEngine.setImg(image);
119 | return secamEngine.decode();
120 | }
121 |
122 | //decode pal composite
123 | if ( JobConfig.getColorMode() == 1) {
124 | palEngine.setImg(image);
125 | return palEngine.decode(false);
126 | }
127 |
128 | //decode pal image composite
129 | if (JobConfig.getColorMode() == 3 || JobConfig.getColorMode() == 5 ) {
130 | palDecoder.setImage(image);
131 | return palDecoder.decode();
132 | }
133 |
134 | return image;
135 | }
136 | else {
137 | return image;
138 | }
139 | }
140 |
141 | @Override
142 | public boolean isEnable() {
143 | // TODO Auto-generated method stub
144 | return false;
145 | }
146 |
147 | @Override
148 | public int getAudienceLevel() {
149 | // TODO Auto-generated method stub
150 | return 0;
151 | }
152 |
153 | @Override
154 | public int getKey11bits() {
155 | // TODO Auto-generated method stub
156 | return 0;
157 | }
158 |
159 | @Override
160 | public void closeFileData() {
161 | // TODO Auto-generated method stub
162 |
163 | }
164 |
165 | @Override
166 | public void skipFrame() {
167 | // TODO Auto-generated method stub
168 |
169 | }
170 |
171 |
172 | /**
173 | * Convert a source image to a desired BufferedImage type
174 | * @param sourceImage the image source
175 | * @param targetType the target type
176 | * @return a converted BufferedImage
177 | */
178 | private BufferedImage convertToType(BufferedImage sourceImage,
179 | int targetType) {
180 | BufferedImage image;
181 |
182 | // if the source image is already the target type, return the source
183 | // image
184 | if (sourceImage.getType() == targetType) {
185 | image = sourceImage;
186 | }
187 | // otherwise create a new image of the target type and draw the new
188 | // image
189 | else {
190 | image = new BufferedImage(sourceImage.getWidth(),
191 | sourceImage.getHeight(), targetType);
192 | image.getGraphics().drawImage(sourceImage, 0, 0, null);
193 | }
194 | return image;
195 | }
196 |
197 |
198 | /**
199 | * Scale an image to a new size
200 | * @param src the image source
201 | * @param w the new width
202 | * @param h the new height
203 | * @return the resized image
204 | */
205 | private BufferedImage getScaledImage(BufferedImage src, int w, int h){
206 | int finalw = w;
207 | int finalh = h;
208 | double factor = 1.00d;
209 | double shiftw = 1d;
210 |
211 | if(src.getWidth()==720 && src.getHeight()==576 ){
212 | shiftw = (double)src.getWidth()/(double)w; // case of if width = 720 and height = 576
213 | }
214 |
215 | if(src.getWidth() > src.getHeight()){
216 | factor = ((double)src.getHeight()/(double)src.getWidth());
217 | finalh = (int)(finalw * factor * shiftw);
218 | }else{
219 | factor = ((double)src.getWidth()/(double)src.getHeight());
220 | finalw = (int)(finalh * factor );
221 | }
222 |
223 | BufferedImage resizedImg = new BufferedImage(finalw, finalh, BufferedImage.TRANSLUCENT);
224 | Graphics2D g2 = resizedImg.createGraphics();
225 | g2.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR);
226 | g2.drawImage(src, 0, 0, finalw, finalh, null);
227 | g2.dispose();
228 |
229 | //step 2 create a bufferedimage with exact size
230 |
231 | BufferedImage target = new BufferedImage(w, h, BufferedImage.TYPE_3BYTE_BGR);
232 |
233 | Graphics g3 = target.getGraphics();
234 | g3.drawImage(resizedImg, 0, (target.getHeight() - resizedImg.getHeight())/2, null);
235 |
236 | return target;
237 | }
238 |
239 |
240 | /**
241 | * clone a BufferedImage
242 | * @param bi the BufferedImage to clone
243 | * @return a cloned BufferedImage
244 | */
245 | private BufferedImage deepCopy(BufferedImage bi) {
246 | ColorModel cm = bi.getColorModel();
247 | boolean isAlphaPremultiplied = cm.isAlphaPremultiplied();
248 | WritableRaster raster = bi.copyData(null);
249 | return new BufferedImage(cm, raster, isAlphaPremultiplied, null);
250 | }
251 |
252 | @Override
253 | public int getKey() {
254 | // TODO Auto-generated method stub
255 | return 0;
256 | }
257 |
258 | public String getDeviceName() {
259 | return "Transcode";
260 | }
261 |
262 | @Override
263 | public boolean isInsideRangeSliderFrames() {
264 | if(JobConfig.frameCount <= JobConfig.getTranscodeSelectedFrameEnd()) {
265 | return true;
266 | }
267 | else {
268 | return false;
269 | }
270 | }
271 |
272 | }
273 |
--------------------------------------------------------------------------------
/CryptImage_Dev/src/com/ib/cryptimage/core/Utils.java:
--------------------------------------------------------------------------------
1 | package com.ib.cryptimage.core;
2 |
3 | import java.awt.Graphics;
4 | import java.awt.Graphics2D;
5 | import java.awt.RenderingHints;
6 | import java.awt.image.BufferedImage;
7 | import java.awt.image.ColorModel;
8 | import java.awt.image.WritableRaster;
9 |
10 | public final class Utils {
11 | /**
12 | * clone a BufferedImage
13 | * @param bi the BufferedImage to clone
14 | * @return a cloned BufferedImage
15 | */
16 | public static BufferedImage deepCopy(BufferedImage bi) {
17 | ColorModel cm = bi.getColorModel();
18 | boolean isAlphaPremultiplied = cm.isAlphaPremultiplied();
19 | WritableRaster raster = bi.copyData(null);
20 | return new BufferedImage(cm, raster, isAlphaPremultiplied, null);
21 | }
22 |
23 | /**
24 | * Scale an image to a new size
25 | * @param src the image source
26 | * @param w the new width
27 | * @param h the new height
28 | * @return the resized image
29 | */
30 | public static BufferedImage getScaledImage(BufferedImage src, int w, int h){
31 | int finalw = w;
32 | int finalh = h;
33 | double factor = 1.0d;
34 | double shiftw = 1d;
35 |
36 | if(src.getWidth()==720 && src.getHeight()==576 ){
37 | shiftw = (double)src.getWidth()/(double)w; // case of if width = 720 and height = 576
38 | }
39 | else if(src.getWidth()==768 && src.getHeight() == 576 && w == 720){
40 | shiftw = (double)src.getWidth()/720d;
41 | }
42 | else if(src.getWidth()==720 && src.getHeight()!=576 && w == 720){
43 | shiftw = 768d/(double)src.getWidth();
44 | }
45 |
46 | if(src.getWidth() > src.getHeight()){
47 | factor = ((double)src.getHeight()/(double)src.getWidth());
48 | finalh = (int)(finalw * factor * shiftw);
49 | }else{
50 | factor = ((double)src.getWidth()/(double)src.getHeight());
51 | finalw = (int)(finalh * factor);
52 | }
53 |
54 | BufferedImage resizedImg = new BufferedImage(finalw, finalh, BufferedImage.TRANSLUCENT);
55 | Graphics2D g2 = resizedImg.createGraphics();
56 | g2.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR);
57 | g2.drawImage(src, 0, 0, finalw, finalh, null);
58 | g2.dispose();
59 |
60 | //step 2 create a bufferedimage with exact size
61 |
62 | BufferedImage target = new BufferedImage(w, h, BufferedImage.TYPE_3BYTE_BGR);
63 |
64 | Graphics g3 = target.getGraphics();
65 | g3.drawImage(resizedImg, 0, (target.getHeight() - resizedImg.getHeight())/2, null);
66 |
67 | return target;
68 | }
69 |
70 | public static BufferedImage joinImages(BufferedImage inputFrame, BufferedImage outputFrame) {
71 | BufferedImage finalImage = new BufferedImage(1920, 1080, BufferedImage.TYPE_3BYTE_BGR);
72 |
73 | if(JobConfig.isWantJoinInputOutputFrames()) {
74 | inputFrame = getScaledImage(inputFrame, 960, 1080);
75 | outputFrame = getScaledImage(outputFrame, 960, 1080);
76 |
77 | finalImage.getRaster().setPixels(0, 0, 960, 1080, inputFrame.getRaster().getPixels(0, 0, 960, 1080, new int[1920 * 1080 * 3]));
78 | finalImage.getRaster().setPixels(960, 0, 960, 1080, outputFrame.getRaster().getPixels(0, 0, 960, 1080, new int[1920 * 1080 * 3]));
79 |
80 | return finalImage;
81 | }
82 | else {
83 | return outputFrame;
84 | }
85 | }
86 |
87 | public static String getTime(int timer) {
88 | int hours = timer / 3600; // get the amount of hours from the seconds
89 | int remainder = timer % 3600; // get the rest in seconds
90 | int minutes = remainder / 60; // get the amount of minutes from the rest
91 | int seconds = remainder % 60; // get the new rest
92 | String disHour = (hours < 10 ? "0" : "") + hours; // get hours and add "0" before if lower than 10
93 | String disMinu = (minutes < 10 ? "0" : "") + minutes; // get minutes and add "0" before if lower than 10
94 | String disSec = (seconds < 10 ? "0" : "") + seconds; // get seconds and add "0" before if lower than 10
95 | String formattedTime = disHour + ":" + disMinu + ":" + disSec; // get the whole time
96 | return formattedTime;
97 | }
98 |
99 | }
100 |
--------------------------------------------------------------------------------
/CryptImage_Dev/src/com/ib/cryptimage/core/VideocryptDec.java:
--------------------------------------------------------------------------------
1 | /**
2 | * This file is part of CryptImage.
3 | *
4 | * CryptImage is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * CryptImage is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with CryptImage. If not, see
16 | *
17 | * 4 août 2016 Author Mannix54
18 | */
19 |
20 |
21 |
22 | package com.ib.cryptimage.core;
23 |
24 | import java.awt.image.BufferedImage;
25 | import java.awt.image.WritableRaster;
26 | import java.io.BufferedReader;
27 | import java.io.FileReader;
28 | import java.io.IOException;
29 |
30 | /**
31 | * @author Mannix54
32 | *
33 | */
34 | public class VideocryptDec extends Videocrypt {
35 |
36 |
37 | WritableRaster raster;
38 | WritableRaster raster2;
39 | BufferedImage newImage;
40 | boolean wantCorrel = false;
41 |
42 |
43 | /**
44 | *
45 | */
46 | public VideocryptDec(String nameDataFile,
47 | boolean wantCorrel) {
48 | super(false);
49 | this.wantCorrel = wantCorrel;
50 |
51 | if (!nameDataFile.equals("")) {
52 | try {
53 | fileInBuff = new BufferedReader(new FileReader(nameDataFile));
54 | this.fileInReader = new FileReader(nameDataFile);
55 | } catch (IOException e) {
56 | // TODO Auto-generated catch block
57 | e.printStackTrace();
58 | }
59 | }
60 |
61 | }
62 |
63 | @Override
64 | public BufferedImage transform(BufferedImage image) {
65 | numFrame++;
66 | JobConfig.incrementPalFrame();
67 | JobConfig.incrementPalFrameDec();
68 |
69 | image = this.convertToType(image, BufferedImage.TYPE_3BYTE_BGR);
70 | if (image.getWidth() != this.sWidth || image.getHeight() != 576) {
71 | image = this.getScaledImage(image, this.sWidth, 576);
72 | }
73 |
74 | JobConfig.setInputImage(image);
75 |
76 | //check shift X and Y
77 | if(shiftX != 0 || shiftY !=0) {
78 | image = shift.transform(image, shiftX, shiftY);
79 | }
80 |
81 | if(JobConfig.frameCount <= JobConfig.getVideocryptSelectedFrameEnd()) {
82 | raster = image.getRaster();
83 | newImage = new BufferedImage(this.sWidth, 576, BufferedImage.TYPE_3BYTE_BGR);
84 | raster2 = newImage.getRaster();
85 |
86 | if (this.wantCorrel == false) {
87 |
88 | if (JobConfig.isWantVideocryptTags()) {
89 | if (!tagLine()) {
90 | this.enable = false;
91 | return image;
92 | }
93 | } else {
94 | if (!this.readFileData()) {
95 | this.enable = false;
96 | return image;
97 | }
98 | }
99 |
100 | //encode image to pal composite
101 | if (JobConfig.getColorMode() == 3 || JobConfig.getColorMode() == 4 ) {
102 | palEncoder.setImage(image);
103 | image = palEncoder.encode(false);
104 | raster = image.getRaster();
105 | }
106 |
107 | cutAndRotate();
108 |
109 | } else {
110 | //encode image to pal composite
111 | if (JobConfig.getColorMode() == 3 || JobConfig.getColorMode() == 4 ) {
112 | palEncoder.setImage(image);
113 | image = palEncoder.encode(false);
114 | raster = image.getRaster();
115 | }
116 |
117 | searchCorrel();
118 | }
119 |
120 | // encodage pal
121 | if (JobConfig.getColorMode() == 1) {
122 | palEngine.setImg(newImage);
123 | newImage = palEngine.average(valTab, strictMode);
124 | }
125 |
126 | //decode pal image composite
127 | if (JobConfig.getColorMode() == 3 || JobConfig.getColorMode() == 5 ) {
128 | palDecoder.setImage(newImage);
129 | newImage = palDecoder.decode();
130 | }
131 |
132 |
133 | this.enable = true;
134 |
135 | return newImage;
136 | }
137 | else {
138 | return image;
139 | }
140 | }
141 |
142 | private void cutAndRotate(){
143 |
144 | if(strictMode == false) {
145 | for (int i = 0; i < 576; i++) {
146 | raster2.setPixels(0, i, valTab[i], 1,
147 | raster.getPixels(this.sWidth - valTab[i], i, valTab[i], 1,
148 | new int[valTab[i]*3]));
149 | raster2.setPixels(valTab[i], i, this.sWidth - valTab[i], 1,
150 | raster.getPixels(0, i, this.sWidth - valTab[i], 1,
151 | new int[(this.sWidth - valTab[i])*3]));
152 | }
153 | }
154 | else {
155 | for (int i = 0; i < 576; i++) {
156 |
157 | raster2.setPixels(0 , i, 12, 1,
158 | raster.getPixels(0, i, 12, 1,
159 | new int[(12)*3]));
160 |
161 | raster2.setPixels(0 +12, i, valTab[i] -12, 1,
162 | raster.getPixels(this.sWidth - valTab[i], i, valTab[i] -12 , 1,
163 | new int[(valTab[i] -12) * 3]));
164 | raster2.setPixels(valTab[i], i, this.sWidth - valTab[i] -12, 1,
165 | raster.getPixels(0 +12, i, this.sWidth - valTab[i] -12, 1,
166 | new int[(this.sWidth - valTab[i] -12)*3]));
167 |
168 | raster2.setPixels(this.sWidth - 12 , i, 12, 1,
169 | raster.getPixels(this.sWidth - 12, i, 12, 1,
170 | new int[(12)*3]));
171 |
172 | }
173 | }
174 |
175 |
176 | }
177 |
178 | private void searchCorrel() {
179 | int maxsum = (int) -1e20;
180 | int x, i = 0;
181 | int sum = 0;
182 | int[] offset = new int[768];
183 |
184 | int valCut1 = 0;
185 | int[] pixels1 = new int[768 * 3];
186 | int[] pixels2 = new int[768 * 3];
187 | int[] tab;
188 | int coef, coef2;
189 |
190 | tab = raster.getPixels(0, 0, 768, 576, new int[768 * 3 * 576]);
191 |
192 | for (int y = 1; y < 576; y++) {
193 | maxsum = (int) -1e20;
194 | // line 1
195 | for (int x1 = 0; x1 < 768; x1++) {
196 | pixels1[x1 * 3] = tab[x1 * 3 + 768 * 3 * y];
197 | pixels1[x1 * 3 + 1] = tab[x1 * 3 + 1 + 768 * 3 * y];
198 | pixels1[x1 * 3 + 2] = tab[x1 * 3 + 2 + 768 * 3 * y];
199 | }
200 |
201 | // line 2
202 | for (int x1 = 0; x1 < 768; x1++) {
203 | pixels2[x1 * 3] = tab[x1 * 3 + 768 * 3 * (y - 1)];
204 | pixels2[x1 * 3 + 1] = tab[x1 * 3 + 1 + 768 * 3 * (y - 1)];
205 | pixels2[x1 * 3 + 2] = tab[x1 * 3 + 2 + 768 * 3 * (y - 1)];
206 | }
207 |
208 | for (x = 0; x < 768; x++) {
209 |
210 | sum = 0;
211 | coef = x;
212 |
213 | for (i = 0; i < 768 - x; i++) {
214 | sum += (0.299 * pixels1[i * 3] + 0.587 * pixels1[i * 3 + 1] + 0.114 * pixels1[i * 3 + 2])
215 | * (0.299 * pixels2[coef * 3] + 0.587 * pixels2[coef * 3 + 1]
216 | + 0.114 * pixels2[coef * 3 + 2]);
217 | coef++;
218 | }
219 |
220 | coef2 = 0;
221 |
222 | for (; i < 768; i++) {
223 | sum += (0.299 * pixels1[i * 3] + 0.587 * pixels1[i * 3 + 1] + 0.114 * pixels1[i * 3 + 2])
224 | * (0.299 * pixels2[coef2 * 3] + 0.587 * pixels2[coef2 * 3 + 1]
225 | + 0.114 * pixels2[coef2 * 3 + 2]);
226 | coef2++;
227 | }
228 |
229 | if (sum > maxsum) {
230 | maxsum = sum;
231 | offset[y] = x;
232 | }
233 |
234 | }
235 | offset[y] = (offset[y] + offset[y - 1]) % 768;
236 | }
237 |
238 | for (int j = 0; j < 576; j++) {
239 | valCut1 = offset[j];
240 | raster2.setPixels(0, j, valCut1, 1,
241 | raster.getPixels(this.sWidth - valCut1, j, valCut1, 1, new int[valCut1 * 3]));
242 | raster2.setPixels(valCut1, j, this.sWidth - valCut1, 1,
243 | raster.getPixels(0, j, this.sWidth - valCut1, 1, new int[(this.sWidth - valCut1) * 3]));
244 |
245 | if(JobConfig.isLogVideocrypt() && !JobConfig.getGui().getChkPlayer().isSelected()){
246 | feedLog(numFrame, valCut1/3);
247 | }
248 | }
249 |
250 | }
251 |
252 | private boolean tagLine(){
253 | String binRangeStart = "";
254 | String binRangeEnd = "";
255 | String binSeed = "";
256 |
257 | int nbPixels = 8;
258 | int whiteMin = 140; //200
259 | int whiteMax = 255;
260 | int blackMin = 0;
261 | int blackMax = 127;
262 |
263 | int[] tab = new int[3];
264 | double somme = 0;
265 | int incre = 0;
266 |
267 | //tag seed
268 | for (int i = 0; i < 24; i++) {
269 | for (int j = 0; j < nbPixels; j++) {
270 | somme += ( raster.getPixel(incre, 575,tab)[0] + raster.getPixel(incre, 575,tab)[1] +raster.getPixel(incre, 575,tab)[2] )/3d;
271 | incre++;
272 | }
273 | somme = somme/nbPixels;
274 | if(somme >=blackMin && somme < blackMax){
275 | binSeed = binSeed + "0";
276 | somme = 0;
277 | }
278 | else{
279 | if(somme >whiteMin && somme <= whiteMax){
280 | binSeed = binSeed + "1";
281 | somme = 0;
282 | }
283 | }
284 | }
285 |
286 |
287 | somme = 0;
288 | incre = 0;
289 |
290 | // tag range start
291 | for (int i = 0; i < 8; i++) {
292 | for (int j = 0; j < nbPixels; j++) {
293 | somme += (raster.getPixel(incre + 24 * nbPixels, 575, tab)[0] + raster.getPixel(incre + 24 *nbPixels, 575, tab)[1] + raster.getPixel(incre + 24 * nbPixels, 575, tab)[2]) / 3d;
294 | incre++;
295 | }
296 | somme = somme/nbPixels;
297 | if (somme >= blackMin && somme < blackMax) {
298 | binRangeStart = binRangeStart + "0";
299 | somme = 0;
300 | } else {
301 | if (somme > whiteMin && somme <= whiteMax) {
302 | binRangeStart = binRangeStart + "1";
303 | somme = 0;
304 | }
305 | }
306 | }
307 |
308 | somme = 0;
309 | incre = 0;
310 |
311 | // tag range end
312 | for (int i = 0; i < 8; i++) {
313 | for (int j = 0; j < nbPixels; j++) {
314 | somme += (raster.getPixel(incre + 32 * nbPixels, 575, tab)[0] + raster.getPixel(incre + 32 *nbPixels, 575, tab)[1] + raster.getPixel(incre + 32 * nbPixels, 575, tab)[2]) / 3d;
315 | incre++;
316 | }
317 | somme = somme/nbPixels;
318 | if (somme >= blackMin && somme < blackMax) {
319 | binRangeEnd = binRangeEnd + "0";
320 | somme = 0;
321 | } else {
322 | if (somme > whiteMin && somme <= whiteMax) {
323 | binRangeEnd = binRangeEnd + "1";
324 | somme = 0;
325 | }
326 | }
327 | }
328 |
329 |
330 |
331 |
332 | //check values
333 | if (!checkValuesTags(binRangeStart, binRangeEnd, binSeed)){
334 | this.skip = true;
335 | if (!JobConfig.getGui().getChkPlayer().isSelected() && JobConfig.isLogVideocrypt()) {
336 | feedLog(numFrame, -1);
337 | }
338 | return false;
339 | }
340 |
341 | this.rangeStart = Integer.parseInt(binRangeStart,2);
342 | this.rangeEnd = Integer.parseInt(binRangeEnd,2);
343 | this.seed = Integer.parseInt(binSeed, 2);
344 |
345 | generateValues(this.seed);
346 |
347 | this.skip = false;
348 | return true;
349 | }
350 |
351 | private boolean checkValuesTags(String rangeStart, String rangeEnd, String binSeed) {
352 | try {
353 | if (Integer.parseInt(rangeStart, 2) >= 1 && Integer.parseInt(rangeStart, 2) <= 128) {
354 | if (Integer.parseInt(rangeEnd, 2) >= 129 && Integer.parseInt(rangeEnd, 2) <= 255) {
355 | if (Integer.parseInt(binSeed, 2) >= 1 && Integer.parseInt(binSeed, 2) <= 16777216) {
356 | return true;
357 | }
358 | }
359 | }
360 |
361 | } catch (Exception e) {
362 | System.out.println("faux");
363 | return false;
364 | }
365 | return false;
366 | }
367 |
368 | @Override
369 | public void closeFileData() {
370 | try {
371 | if(JobConfig.isLogVideocrypt()
372 | && !JobConfig.getGui().getChkPlayer().isSelected()){
373 | this.fileLog.flush();
374 | this.fileLog.close();
375 | }
376 | } catch (IOException e) {
377 | // TODO Auto-generated catch block
378 | e.printStackTrace();
379 | }
380 |
381 | }
382 |
383 | @Override
384 | public boolean isEnable() {
385 | // TODO Auto-generated method stub
386 | return this.enable;
387 | }
388 |
389 | @Override
390 | public int getAudienceLevel() {
391 | // TODO Auto-generated method stub
392 | return 0;
393 | }
394 |
395 | @Override
396 | public int getKey11bits() {
397 | // TODO Auto-generated method stub
398 | return 0;
399 | }
400 |
401 | @Override
402 | public void skipFrame() {
403 | if (fileInBuff != null) {
404 | this.readFileDataDummy();
405 | }
406 |
407 | }
408 |
409 | @Override
410 | public int getKey() {
411 | // TODO Auto-generated method stub
412 | return 0;
413 | }
414 |
415 | @Override
416 | public boolean isInsideRangeSliderFrames() {
417 | if(JobConfig.frameCount <= JobConfig.getVideocryptSelectedFrameEnd()) {
418 | return true;
419 | }
420 | else {
421 | return false;
422 | }
423 | }
424 |
425 | }
426 |
--------------------------------------------------------------------------------
/CryptImage_Dev/src/com/ib/cryptimage/core/VideocryptEnc.java:
--------------------------------------------------------------------------------
1 | /**
2 | * This file is part of CryptImage.
3 | *
4 | * CryptImage is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * CryptImage is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with CryptImage. If not, see
16 | *
17 | * 4 août 2016 Author Mannix54
18 | */
19 |
20 |
21 |
22 | package com.ib.cryptimage.core;
23 |
24 | import java.awt.image.BufferedImage;
25 | import java.awt.image.WritableRaster;
26 | import java.io.BufferedReader;
27 | import java.io.FileReader;
28 | import java.io.FileWriter;
29 | import java.io.IOException;
30 | import java.util.Random;
31 |
32 | /**
33 | * @author Mannix54
34 | *
35 | */
36 | public class VideocryptEnc extends Videocrypt {
37 |
38 | WritableRaster raster;
39 | WritableRaster raster2;
40 | BufferedImage newImage;
41 | private boolean bPreviewMode;
42 |
43 | /**
44 | *
45 | */
46 | public VideocryptEnc( String nameDataFile,
47 | String nameManualEncodingFile, boolean bPreviewMode) {
48 | super(true);
49 | this.bPreviewMode = bPreviewMode;
50 |
51 | try {
52 | if(!bPreviewMode){
53 | fileOut = new FileWriter(nameDataFile + ".vid");
54 | }
55 | } catch (IOException e) {
56 | // TODO Auto-generated catch block
57 | e.printStackTrace();
58 | }
59 | if(JobConfig.isWantVideocryptEncRandom() == false ){
60 | try {
61 | fileInBuff = new BufferedReader(new FileReader(nameManualEncodingFile));
62 | this.fileInReader = new FileReader(nameManualEncodingFile);
63 | } catch (IOException e) {
64 | // TODO Auto-generated catch block
65 | e.printStackTrace();
66 | }
67 | }else{
68 | this.rangeStart = Integer.valueOf(JobConfig.getGui().getComboRangeStart().getSelectedItem().toString());
69 | this.rangeEnd = Integer.valueOf(JobConfig.getGui().getComboRangeEnd().getSelectedItem().toString());
70 | // if(JobConfig.isRestrictRangeCuttingPoints()){
71 | // this.rangeStart = 20;
72 | // this.rangeEnd = 236;
73 | // this.typeRange = 1;
74 | // }
75 | // else{
76 | // this.rangeStart = 1;
77 | // this.rangeEnd = 255;
78 | // this.typeRange = 2;
79 | // }
80 | }
81 | }
82 |
83 | @Override
84 | public BufferedImage transform(BufferedImage image) {
85 | numFrame++;
86 | JobConfig.incrementPalFrame();
87 | JobConfig.incrementPalFrameDec();
88 |
89 | this.enable = true;
90 |
91 | image = this.convertToType(image, BufferedImage.TYPE_3BYTE_BGR);
92 | if (image.getWidth() != this.sWidth || image.getHeight() != 576) {
93 | image = this.getScaledImage(image, this.sWidth, 576);
94 | }
95 |
96 | JobConfig.setInputImage(image);
97 |
98 | //check shift X and Y
99 | if(shiftX != 0 || shiftY !=0) {
100 | image = shift.transform(image, shiftX, shiftY);
101 | }
102 |
103 | if(JobConfig.frameCount <= JobConfig.getVideocryptSelectedFrameEnd()) {
104 | raster = image.getRaster();
105 | newImage = new BufferedImage(this.sWidth, 576, BufferedImage.TYPE_3BYTE_BGR);
106 | raster2 = newImage.getRaster();
107 |
108 |
109 | if(JobConfig.isWantVideocryptEncRandom() == false ){
110 | if(!this.readFileData()){
111 | this.enable = false;
112 | //skip
113 | if (this.skip){
114 | this.skipFrame();
115 | }
116 | return image;
117 | }
118 | }
119 | else{
120 | int min = 1;
121 | int max = 16777216;
122 | Random rand = new Random();
123 |
124 | int valVideocrypt;
125 |
126 | valVideocrypt = (int) (rand.nextInt(max - min + 1) + min);
127 | this.seed = valVideocrypt;
128 | generateValues(valVideocrypt);
129 | }
130 |
131 | //encode image to pal composite
132 | if (JobConfig.getColorMode() == 3 || JobConfig.getColorMode() == 4 ) {
133 | palEncoder.setImage(image);
134 | image = palEncoder.encode(false);
135 | raster = image.getRaster();
136 | }
137 |
138 | cutAndRotate();
139 |
140 | //decode pal image composite
141 | if (JobConfig.getColorMode() == 3 || JobConfig.getColorMode() == 5 ) {
142 | palDecoder.setImage(newImage);
143 | newImage = palDecoder.decode();
144 | }
145 |
146 | if(!this.bPreviewMode){
147 | this.feedFileData();
148 | }
149 |
150 | //encodage pal
151 | if(JobConfig.getColorMode() == 1){
152 | palEngine.setImg(newImage);
153 | newImage = palEngine.average(valTab, strictMode);
154 | }
155 | //encodage secam
156 | if(JobConfig.getColorMode() == 2){
157 | secamEngine.setImg(newImage);
158 | newImage = secamEngine.averageSpecial();
159 | }
160 |
161 | //tags
162 | if(JobConfig.isWantVideocryptTags()){
163 | tagLine();
164 | }
165 |
166 | return newImage;
167 | }
168 | else {
169 | this.skipFrame();
170 | return image;
171 | }
172 |
173 |
174 | }
175 |
176 | private void cutAndRotate(){
177 |
178 | if(this.strictMode == false) {
179 | for (int i = 0; i < 576; i++) {
180 | raster2.setPixels(0, i, this.sWidth - valTab[i], 1,
181 | raster.getPixels(valTab[i], i, this.sWidth - valTab[i],
182 | 1,new int[(this.sWidth - valTab[i])*3]));
183 | raster2.setPixels(this.sWidth - valTab[i], i, valTab[i], 1,
184 | raster.getPixels(0, i, valTab[i], 1,
185 | new int[valTab[i]*3]));
186 | }
187 | }
188 | else {
189 | for (int i = 0; i < 576; i++) {
190 |
191 | raster2.setPixels(0 , i, 12, 1,
192 | raster.getPixels(0, i, 12, 1,
193 | new int[(12)*3]));
194 |
195 | raster2.setPixels(0 + 12, i, this.sWidth - valTab[i] - 12, 1,
196 | raster.getPixels(valTab[i], i, this.sWidth - valTab[i] - 12,
197 | 1,new int[(this.sWidth - valTab[i] - 12)*3]));
198 | raster2.setPixels(this.sWidth - valTab[i], i, valTab[i] -12, 1,
199 | raster.getPixels(0 + 12, i, valTab[i] -12, 1,
200 | new int[(valTab[i]-12)*3]));
201 |
202 | raster2.setPixels(this.sWidth - 12 , i, 12, 1,
203 | raster.getPixels(valTab[i], i, 12, 1,
204 | new int[(12)*3]));
205 |
206 |
207 | }
208 | }
209 |
210 | }
211 |
212 | private void feedFileData(){
213 | try {
214 | fileOut.write(this.seed + ";" + this.rangeStart + ";" + this.rangeEnd + "\r\n");
215 |
216 | } catch (IOException e) {
217 | // TODO Auto-generated catch block
218 | e.printStackTrace();
219 | }
220 | }
221 |
222 | private void feedFileDataDummy(){
223 | try {
224 | fileOut.write("skip" + "\r\n");
225 | } catch (IOException e) {
226 | // TODO Auto-generated catch block
227 | e.printStackTrace();
228 | }
229 | }
230 |
231 | private void tagLine(){
232 | String binRangeStart = String.format
233 | ("%8s", Integer.toBinaryString(this.rangeStart)).replace(" ", "0");
234 | String binRangeEnd = String.format
235 | ("%8s", Integer.toBinaryString(this.rangeEnd)).replace(" ", "0");
236 | String binSeed = String.format
237 | ("%24s", Integer.toBinaryString(seed)).replace(" ", "0");
238 |
239 | int[] black = {0,0,0};
240 | int[] white = {255,255,255};
241 | int incre = 0;
242 | int nbPixels = 8;
243 |
244 | //tag seed
245 | for (int i = 0; i < binSeed.length(); i++) {
246 | if(binSeed.charAt(i) == '0'){
247 | for (int j = 0; j < nbPixels; j++) {
248 | raster2.setPixel( incre, 575, black);
249 | incre++;
250 | }
251 | }
252 | else{
253 | for (int j = 0; j < nbPixels; j++) {
254 | raster2.setPixel( incre, 575, white);
255 | incre++;
256 | }
257 | }
258 | }
259 |
260 | incre = 0;
261 |
262 | //tag range start
263 | for (int i = 0; i < binRangeStart.length(); i++) {
264 | if(binRangeStart.charAt(i) == '0'){
265 | for (int j = 0; j < nbPixels; j++) {
266 | raster2.setPixel( incre + 24 * nbPixels, 575, black);
267 | incre++;
268 | }
269 |
270 | }
271 | else{
272 | for (int j = 0; j < nbPixels; j++) {
273 | raster2.setPixel(incre + 24 * nbPixels, 575, white);
274 | incre++;
275 | }
276 | }
277 | }
278 |
279 | incre = 0;
280 |
281 | //tag range end
282 | for (int i = 0; i < binRangeEnd.length(); i++) {
283 | if(binRangeEnd.charAt(i) == '0'){
284 | for (int j = 0; j < nbPixels; j++) {
285 | raster2.setPixel( incre + 24 * nbPixels + 8 * nbPixels, 575, black);
286 | incre++;
287 | }
288 | }
289 | else{
290 | for (int j = 0; j < nbPixels; j++) {
291 | raster2.setPixel( incre +24 * nbPixels + 8 * nbPixels, 575, white);
292 | incre++;
293 | }
294 | }
295 | }
296 |
297 |
298 | }
299 |
300 | @Override
301 | public boolean isEnable() {
302 | // TODO Auto-generated method stub
303 | return true;
304 | }
305 |
306 | @Override
307 | public int getAudienceLevel() {
308 | // TODO Auto-generated method stub
309 | return 0;
310 | }
311 |
312 | @Override
313 | public int getKey11bits() {
314 | // TODO Auto-generated method stub
315 | return 0;
316 | }
317 |
318 | @Override
319 | public void closeFileData() {
320 | try {
321 | fileOut.flush();
322 | fileOut.close();
323 | if(JobConfig.isLogVideocrypt()
324 | && !JobConfig.getGui().getChkPlayer().isSelected()){
325 | this.fileLog.flush();
326 | this.fileLog.close();
327 | }
328 | } catch (IOException e) {
329 | // TODO Auto-generated catch block
330 | e.printStackTrace();
331 | }
332 | }
333 |
334 | @Override
335 | public void skipFrame() {
336 | if(!this.bPreviewMode){
337 | this.feedFileDataDummy();
338 | }
339 |
340 | }
341 |
342 | @Override
343 | public int getKey() {
344 | // TODO Auto-generated method stub
345 | return 0;
346 | }
347 |
348 | @Override
349 | public boolean isInsideRangeSliderFrames() {
350 | if(JobConfig.frameCount <= JobConfig.getVideocryptSelectedFrameEnd()) {
351 | return true;
352 | }
353 | else {
354 | return false;
355 | }
356 | }
357 |
358 | }
359 |
--------------------------------------------------------------------------------
/CryptImage_Dev/src/com/ib/cryptimage/core/YuvCalc.java:
--------------------------------------------------------------------------------
1 | /**
2 | * This file is part of CryptImage.
3 | *
4 | * CryptImage is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * CryptImage is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with CryptImage. If not, see
16 | *
17 | * 18 juil. 2016 Author Mannix54
18 | */
19 |
20 |
21 |
22 | package com.ib.cryptimage.core;
23 |
24 | import com.ib.cryptimage.core.InitException;
25 |
26 | /**
27 | * @author Mannix54
28 | *
29 | */
30 | public class YuvCalc extends InitException {
31 | /**
32 | *
33 | */
34 | private static final long serialVersionUID = 1L;
35 | private float y;
36 | private float u;
37 | private float v;
38 | private float red;
39 | private float green;
40 | private float blue;
41 | private boolean yuv = false;
42 | private boolean rgb = false;
43 | private CosSinus cosSin;
44 | float redCoef1, redCoef2, redCoef3, greenCoef1,
45 | greenCoef2, greenCoef3, blueCoef1, blueCoef2, blueCoef3;
46 | float uCoef1, uCoef2, uCoef3, vCoef1, vCoef2, vCoef3;
47 |
48 | /**
49 | *
50 | */
51 | public YuvCalc() {
52 | // TODO Auto-generated constructor stub
53 |
54 | switch (JobConfig.getTypeYUV()) {
55 | case 0:
56 | // bt.601
57 | redCoef1 = 0.299f;
58 | redCoef2 = -0.14713f;
59 | redCoef3 = 0.615f;
60 |
61 | greenCoef1 = 0.587f;
62 | greenCoef2 = -0.28886f;
63 | greenCoef3 = -0.51499f;
64 |
65 | blueCoef1 = 0.114f;
66 | blueCoef2 = 0.436f;
67 | blueCoef3 = -0.10001f;
68 |
69 | uCoef1 = 0;
70 | uCoef2 = -0.39465f;
71 | uCoef3 = 2.03211f;
72 |
73 | vCoef1 = 1.13983f;
74 | vCoef2 = -0.5860f;
75 | vCoef3 = 0;
76 | break;
77 | case 1:
78 | // bt.709
79 | redCoef1 = 0.2126f;
80 | redCoef2 = -0.09991f;
81 | redCoef3 = 0.615f;
82 |
83 | greenCoef1 = 0.7152f;
84 | greenCoef2 = -0.33609f;
85 | greenCoef3 = -0.55861f;
86 |
87 | blueCoef1 = 0.0722f;
88 | blueCoef2 = 0.436f;
89 | blueCoef3 = -0.05639f;
90 |
91 | uCoef1 = 0;
92 | uCoef2 = -0.21482f;
93 | uCoef3 = 2.12798f;
94 |
95 | vCoef1 = 1.28033f;
96 | vCoef2 = -0.38059f;
97 | vCoef3 = 0;
98 | break;
99 | case 2:
100 | // other
101 | redCoef1 = 0.299f;
102 | redCoef2 = -0.168736f;
103 | redCoef3 = 0.5f;
104 |
105 | greenCoef1 = 0.587f;
106 | greenCoef2 = -0.331264f;
107 | greenCoef3 = -0.418688f;
108 |
109 | blueCoef1 = 0.114f;
110 | blueCoef2 = 0.5f;
111 | blueCoef3 = -0.081312f;
112 |
113 | uCoef1 = 0;
114 | uCoef2 = -0.3455f;
115 | uCoef3 = 1.7790f;
116 |
117 | vCoef1 = 1.4075f;
118 | vCoef2 = -0.7169f;
119 | vCoef3 = 0;
120 |
121 | break;
122 | default:
123 | break;
124 | }
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 | cosSin = new CosSinus();
134 | }
135 |
136 | public void setRGB(float r, float g, float b){
137 | this.red = r;
138 | this.green = g;
139 | this.blue = b;
140 | rgb = true;
141 | }
142 |
143 | public void setYUV(float y, float u, float v){
144 | if(y > 255){
145 | y = 255;
146 | }
147 | if(y < 0){
148 | y = 0;
149 | }
150 | if(u > 255){
151 | u = 255;
152 | }
153 | if(u < 0){
154 | u = 0;
155 | }
156 | if(v > 255){
157 | v = 255;
158 | }
159 | if(v < 0){
160 | v = 0;
161 | }
162 |
163 | this.y =y;
164 | this.u = u;
165 | this.v = v;
166 | yuv = true;
167 | }
168 |
169 | public int[] getRotateRGB(int[] tabRGB,float angle){
170 | setRGB((float)tabRGB[0], (float)tabRGB[1],(float)tabRGB[2]);
171 |
172 | convertRGBtoYUV();
173 |
174 | float u_temp = u -128;
175 | float v_temp = v -128;
176 |
177 | float new_u_temp, new_v_temp;
178 |
179 |
180 | new_u_temp = (float) ((u_temp * cosSin.getCos((int) angle)
181 | - v_temp * cosSin.getSin((int) angle)));
182 | new_v_temp = (float) ((u_temp * cosSin.getSin((int) angle)
183 | + v_temp * cosSin.getCos((int) angle)));
184 |
185 | float y_temp = y;
186 | new_u_temp = new_u_temp +128;
187 | new_v_temp = new_v_temp +128;
188 |
189 | setYUV(y_temp, new_u_temp, new_v_temp);
190 | convertYUVtoRGB();
191 |
192 | int[] rgbTab = new int[3];
193 | rgbTab[0] = (int) red;
194 | rgbTab[1] = (int) green;
195 | rgbTab[2] = (int) blue;
196 |
197 | return rgbTab;
198 | }
199 |
200 | public int[] getRGBInverseV(int[] tabRGB, int phase){
201 | setRGB((float)tabRGB[0], (float)tabRGB[1],(float)tabRGB[2]);
202 |
203 | convertRGBtoYUV();
204 |
205 | int[] yuv = new int[3];
206 |
207 | yuv[0] = (int)y;
208 | yuv[1] = (int)u;
209 |
210 |
211 | int temp = (int) (( v -128 ) * phase +128);
212 | yuv[2] = temp;
213 |
214 | return convertYUVtoRGB(yuv);
215 | }
216 |
217 | public int[] getRotateYUV(int[] tabYUV,float angle){
218 | setYUV((float)tabYUV[0], (float)tabYUV[1],(float)tabYUV[2]);
219 |
220 |
221 | float u_temp = u -128;
222 | float v_temp = v -128;
223 |
224 | float new_u_temp, new_v_temp;
225 |
226 |
227 | new_u_temp = (float) ((u_temp * cosSin.getCos((int) angle)
228 | - v_temp * cosSin.getSin((int) angle)));
229 | new_v_temp = (float) ((u_temp * cosSin.getSin((int) angle)
230 | + v_temp * cosSin.getCos((int) angle)));
231 |
232 | float y_temp = y;
233 | new_u_temp = new_u_temp +128;
234 | new_v_temp = new_v_temp +128;
235 |
236 | setYUV(y_temp, new_u_temp, new_v_temp);
237 |
238 | tabYUV[0] = (int) y;
239 | tabYUV[1] = (int) u;
240 | tabYUV[2] = (int) v;
241 |
242 | return tabYUV;
243 | }
244 |
245 |
246 | public void convertRGBtoYUV(){
247 | if(!rgb){
248 | try {
249 | throw new InitException("rgb values not initialized");
250 | } catch (InitException e) {
251 | // TODO Auto-generated catch block
252 | e.printStackTrace();
253 | }
254 | }
255 |
256 | y = red * redCoef1 + green * greenCoef1 + blue * blueCoef1;
257 | u = red * redCoef2 + green * greenCoef2 + blue * blueCoef2 + 128f;
258 | v = red * redCoef3 + green * greenCoef3 + blue * blueCoef3 + 128f;
259 |
260 | if(y > 255){
261 | y = 255;
262 | }
263 | if(y < 0){
264 | y = 0;
265 | }
266 | if(u > 255){
267 | u = 255;
268 | }
269 | if(u < 0){
270 | u = 0;
271 | }
272 | if(v > 255){
273 | v = 255;
274 | }
275 | if(v < 0){
276 | v = 0;
277 | }
278 |
279 | }
280 |
281 | public void original_convertRGBtoYUV(){
282 | if(!rgb){
283 | try {
284 | throw new InitException("rgb values not initialized");
285 | } catch (InitException e) {
286 | // TODO Auto-generated catch block
287 | e.printStackTrace();
288 | }
289 | }
290 | y = red * redCoef1 + green * greenCoef1 + blue * blueCoef1 +16f;
291 | u = red * redCoef2 + green * greenCoef2 + blue * blueCoef2 + 128f;
292 | v = red * redCoef3 + green * greenCoef3 + blue * blueCoef3 + 128f;
293 |
294 | if(y > 255){
295 | y = 255;
296 | }
297 | if(y < 0){
298 | y = 0;
299 | }
300 | if(u > 255){
301 | u = 255;
302 | }
303 | if(u < 0){
304 | u = 0;
305 | }
306 | if(v > 255){
307 | v = 255;
308 | }
309 | if(v < 0){
310 | v = 0;
311 | }
312 |
313 | }
314 |
315 | public int[] convertYUVtoRGB(int[] pixelYUV){
316 | setYUV(pixelYUV[0], pixelYUV[1], pixelYUV[2]);
317 | convertYUVtoRGB();
318 |
319 | int[] pixRGB = new int[3];
320 | pixRGB[0] = this.getRed();
321 | pixRGB[1] = this.getGreen();
322 | pixRGB[2] = this.getBlue();
323 | return pixRGB;
324 | }
325 |
326 | public int[] convertRGBtoYUV(int[] pixelRGB){
327 | setRGB(pixelRGB[0], pixelRGB[1], pixelRGB[2]);
328 | convertRGBtoYUV();
329 |
330 | int[] pixYUV = new int[3];
331 | pixYUV[0] = (int)this.getY();
332 | pixYUV[1] = (int)this.getU();
333 | pixYUV[2] = (int)this.getV();
334 | return pixYUV;
335 | }
336 |
337 | public void convertYUVtoRGB(){
338 | if(!yuv){
339 | try {
340 | throw new InitException("yuv values not initialized");
341 | } catch (InitException e) {
342 | // TODO Auto-generated catch block
343 | e.printStackTrace();
344 | }
345 | }
346 |
347 | red = y + vCoef1 * (v - 128f) + uCoef1* (u - 128f) ;
348 | green = y + uCoef2 * (u - 128f) + vCoef2 * (v - 128f) ;
349 | blue = y + uCoef3 * (u - 128f) + vCoef3 * (v - 128f) ;
350 | if(red > 255){
351 | red = 255;
352 | }
353 | if(red < 0){
354 | red = 0;
355 | }
356 | if(green > 255){
357 | green = 255;
358 | }
359 | if(green < 0){
360 | green = 0;
361 | }
362 | if(blue > 255){
363 | blue = 255;
364 | }
365 | if(blue < 0){
366 | blue = 0;
367 | }
368 | }
369 |
370 | public void original_convertYUVtoRGB(){
371 | if(!yuv){
372 | try {
373 | throw new InitException("yuv values not initialized");
374 | } catch (InitException e) {
375 | // TODO Auto-generated catch block
376 | e.printStackTrace();
377 | }
378 | }
379 |
380 | red = y + vCoef1 * (v - 128f) + uCoef1* (u - 128f) -16f;
381 | green = y + uCoef2 * (u - 128f) + vCoef2 * (v - 128f) -16f;
382 | blue = y + uCoef3 * (u - 128f) + vCoef3 * (v - 128f) -16f;
383 | if(red > 255){
384 | red = 255;
385 | }
386 | if(red < 0){
387 | red = 0;
388 | }
389 | if(green > 255){
390 | green = 255;
391 | }
392 | if(green < 0){
393 | green = 0;
394 | }
395 | if(blue > 255){
396 | blue = 255;
397 | }
398 | if(blue < 0){
399 | blue = 0;
400 | }
401 | }
402 |
403 |
404 |
405 | public float getY() {
406 | return y;
407 | }
408 |
409 | public void setY(float y) {
410 | this.y = y;
411 | }
412 |
413 | public float getU() {
414 | return u;
415 | }
416 |
417 | public void setU(float u) {
418 | this.u = u;
419 | }
420 |
421 | public float getV() {
422 | return v;
423 | }
424 |
425 | public void setV(float v) {
426 | this.v = v;
427 | }
428 |
429 | public int getRed() {
430 | if(red < 0){
431 | red = 0;
432 | }
433 | if(red > 255){
434 | red = 255;
435 | }
436 | return (int)red;
437 | }
438 |
439 | public void setRed(float red) {
440 | this.red = red;
441 | }
442 |
443 | public int getGreen() {
444 | if(green < 0){
445 | green = 0;
446 | }
447 | if(green > 255){
448 | green = 255;
449 | }
450 | return (int)green;
451 | }
452 |
453 | public void setGreen(float green) {
454 | this.green = green;
455 | }
456 |
457 | public int getBlue() {
458 | if(blue < 0){
459 | blue = 0;
460 | }
461 | if(blue > 255){
462 | blue = 255;
463 | }
464 | return (int)blue;
465 | }
466 |
467 | public void setBlue(float blue) {
468 | this.blue = blue;
469 | }
470 |
471 | public boolean isYuv() {
472 | return yuv;
473 | }
474 |
475 | public boolean isRgb() {
476 | return rgb;
477 | }
478 |
479 | }
480 |
481 | class InitException extends Exception{
482 | /**
483 | *
484 | */
485 | private static final long serialVersionUID = 1L;
486 | public InitException() {}
487 |
488 | public InitException(String message) {
489 | super(message);
490 | }
491 | public InitException(Throwable cause) {
492 | super(cause);
493 | }
494 | public InitException(String message, Throwable cause) {
495 | super(message, cause);
496 | }
497 | }
498 |
499 |
--------------------------------------------------------------------------------
/CryptImage_Dev/src/com/ib/cryptimage/core/systems/eurocrypt/EurocryptConf.java:
--------------------------------------------------------------------------------
1 | /**
2 | * This file is part of CryptImage.
3 | *
4 | * CryptImage is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * CryptImage is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with CryptImage. If not, see
16 | *
17 | * 2024-01-18 Author Mannix54
18 | * http://ibsoftware.free.fr/cryptimage.php
19 | */
20 |
21 | package com.ib.cryptimage.core.systems.eurocrypt;
22 |
23 | public final class EurocryptConf {
24 |
25 | public static boolean isEncodeMac = true;
26 | public static boolean isEncodeMacDecode576pNoEurocrypt = false;
27 | public static boolean isDecodeMac = false;
28 | public static boolean isDecode576p = false;
29 |
30 | public static boolean isDisableEurocrypt = false;
31 | public static boolean isEurocryptSingleCut = true;
32 | public static boolean isEurocryptDoubleCut = false;
33 |
34 | public static String seedCode = "12345678";
35 |
36 | private static EurocryptGui gui;
37 |
38 | public static EurocryptGui getGui() {
39 | return gui;
40 | }
41 |
42 | public static void setGui(EurocryptGui eurocryptGui) {
43 | gui = eurocryptGui;
44 | }
45 | public static int width = 1344;
46 | public static int height = 576;
47 |
48 | public static int frameStart = 1;
49 | public static int frameEnd = 200000;
50 |
51 | public static int selectedFrameStart = 1;
52 | public static int selectedFrameEnd = 200000;
53 |
54 | }
55 |
--------------------------------------------------------------------------------
/CryptImage_Dev/src/com/ib/cryptimage/core/systems/eurocrypt/EurocryptListener.java:
--------------------------------------------------------------------------------
1 | /**
2 | * This file is part of CryptImage.
3 | *
4 | * CryptImage is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * CryptImage is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with CryptImage. If not, see
16 | *
17 | * 2024-01-18 Author Mannix54
18 | * http://ibsoftware.free.fr/cryptimage.php
19 | */
20 |
21 | package com.ib.cryptimage.core.systems.eurocrypt;
22 |
23 | import java.awt.event.ActionEvent;
24 | import java.awt.event.ActionListener;
25 |
26 | import javax.swing.JFormattedTextField;
27 | import javax.swing.JRadioButton;
28 | import javax.swing.event.ChangeEvent;
29 | import javax.swing.event.ChangeListener;
30 | import javax.swing.event.DocumentEvent;
31 | import javax.swing.event.DocumentListener;
32 |
33 | import com.ib.cryptimage.core.JobConfig;
34 |
35 | public class EurocryptListener implements ActionListener, DocumentListener, ChangeListener {
36 |
37 | private EurocryptGui eurocryptGui;
38 |
39 | public EurocryptListener(EurocryptGui eurocryptGui) {
40 | this.eurocryptGui = eurocryptGui;
41 | }
42 |
43 | @Override
44 | public void changedUpdate(DocumentEvent e) {
45 |
46 | }
47 |
48 | @Override
49 | public void insertUpdate(DocumentEvent e) {
50 | // TODO Auto-generated method stub
51 | manageFormatedTxtFields(this.eurocryptGui.getTxtSeedCode());
52 |
53 | }
54 |
55 | @Override
56 | public void removeUpdate(DocumentEvent e) {
57 | // TODO Auto-generated method stub
58 |
59 | }
60 |
61 | @Override
62 | public void actionPerformed(ActionEvent e) {
63 | Object src = e.getSource();
64 |
65 | if (src instanceof JRadioButton) {
66 | manageRadioButton((JRadioButton) src);
67 | }
68 |
69 | }
70 |
71 | private void manageFormatedTxtFields(JFormattedTextField src) {
72 | if(src.equals(this.eurocryptGui.getTxtSeedCode())){
73 | EurocryptConf.seedCode = src.getText();
74 | }
75 | }
76 |
77 | private void manageRadioButton(JRadioButton src) {
78 | if(src.equals(this.eurocryptGui.getRdiMacCoding())){
79 | if(src.isSelected()){
80 | EurocryptConf.isEncodeMac = true;
81 | EurocryptConf.isEncodeMacDecode576pNoEurocrypt = false;
82 | EurocryptConf.isDecodeMac = false;
83 | EurocryptConf.isDecode576p = false;
84 |
85 | JobConfig.setWantDec(false);
86 | EurocryptConf.width = 1344;
87 | }
88 | }
89 | else if(src.equals(this.eurocryptGui.getRdiMacCoding576p())){
90 | if(src.isSelected()){
91 | EurocryptConf.isEncodeMac = false;
92 | EurocryptConf.isEncodeMacDecode576pNoEurocrypt = true;
93 | EurocryptConf.isDecodeMac = false;
94 | EurocryptConf.isDecode576p = false;
95 |
96 | EurocryptConf.width = 768;
97 |
98 | JobConfig.setWantDec(false);
99 | }
100 | }
101 | else if(src.equals(this.eurocryptGui.getRdiMacDecoding())){
102 | if(src.isSelected()){
103 | EurocryptConf.isEncodeMac = false;
104 | EurocryptConf.isEncodeMacDecode576pNoEurocrypt = false;
105 | EurocryptConf.isDecodeMac = true;
106 | EurocryptConf.isDecode576p = false;
107 |
108 | EurocryptConf.width = 768;
109 |
110 | JobConfig.setWantDec(true);
111 | }
112 | }
113 | else if(src.equals(this.eurocryptGui.getRdiMacDecoding576p())){
114 | if(src.isSelected()){
115 | EurocryptConf.isEncodeMac = false;
116 | EurocryptConf.isEncodeMacDecode576pNoEurocrypt = false;
117 | EurocryptConf.isDecodeMac = false;
118 | EurocryptConf.isDecode576p = true;
119 |
120 | EurocryptConf.width = 768;
121 |
122 | JobConfig.setWantDec(true);
123 | }
124 | }
125 | else if(src.equals(this.eurocryptGui.getRdiEurocryptDisable())){
126 | if(src.isSelected()){
127 | EurocryptConf.isDisableEurocrypt = true;
128 | EurocryptConf.isEurocryptSingleCut = false;
129 | EurocryptConf.isEurocryptDoubleCut = false;
130 | }
131 | }
132 | else if(src.equals(this.eurocryptGui.getRdiEurocryptSingleCut())){
133 | if(src.isSelected()){
134 | EurocryptConf.isDisableEurocrypt = false;
135 | EurocryptConf.isEurocryptSingleCut = true;
136 | EurocryptConf.isEurocryptDoubleCut = false;
137 | }
138 | }
139 | else if(src.equals(this.eurocryptGui.getRdiEurocryptDoubleCut())) {
140 | EurocryptConf.isDisableEurocrypt = false;
141 | EurocryptConf.isEurocryptSingleCut = false;
142 | EurocryptConf.isEurocryptDoubleCut = true;
143 | }
144 | }
145 |
146 | @Override
147 | public void stateChanged(ChangeEvent arg0) {
148 | // TODO Auto-generated method stub
149 | String time = getTime((int)(EurocryptConf.getGui().getRangeSlider().getValue()/JobConfig.getFrameRate()));
150 | EurocryptConf.getGui().getTxtValueMinRangeSlider()
151 | .setText(EurocryptConf.getGui().getRangeSlider().getValue() + " (" + time + ")");
152 |
153 | time = getTime((int)(EurocryptConf.getGui().getRangeSlider().getUpperValue()/JobConfig.getFrameRate()));
154 | EurocryptConf.getGui().getTxtValueMaxRangeSlider()
155 | .setText(EurocryptConf.getGui().getRangeSlider().getUpperValue() + " (" + time + ")") ;
156 |
157 | EurocryptConf.selectedFrameStart = EurocryptConf.getGui().getRangeSlider().getValue();
158 | EurocryptConf.selectedFrameEnd = EurocryptConf.getGui().getRangeSlider().getUpperValue();
159 |
160 | //EurocryptConf.frameStart = EurocryptConf.getGui().getRangeSlider().getValue();
161 | //EurocryptConf.frameEnd = EurocryptConf.getGui().getRangeSlider().getUpperValue();
162 |
163 | }
164 |
165 | private String getTime(int timer) {
166 | int hours = timer / 3600; // get the amount of hours from the seconds
167 | int remainder = timer % 3600; // get the rest in seconds
168 | int minutes = remainder / 60; // get the amount of minutes from the rest
169 | int seconds = remainder % 60; // get the new rest
170 | String disHour = (hours < 10 ? "0" : "") + hours; // get hours and add "0" before if lower than 10
171 | String disMinu = (minutes < 10 ? "0" : "") + minutes; // get minutes and add "0" before if lower than 10
172 | String disSec = (seconds < 10 ? "0" : "") + seconds; // get seconds and add "0" before if lower than 10
173 | String formattedTime = disHour + ":" + disMinu + ":" + disSec; // get the whole time
174 | return formattedTime;
175 | }
176 |
177 |
178 | }
179 |
180 |
--------------------------------------------------------------------------------
/CryptImage_Dev/src/com/ib/cryptimage/core/types/AudioCodecType.java:
--------------------------------------------------------------------------------
1 | /**
2 | * This file is part of CryptImage.
3 | *
4 | * CryptImage is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * CryptImage is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with CryptImage. If not, see
16 | *
17 | * 11 jan. 2024 Author Mannix54
18 | * http://ibsoftware.free.fr/cryptimage.php
19 | */
20 |
21 | package com.ib.cryptimage.core.types;
22 |
23 | public class AudioCodecType {
24 |
25 | public static int MP3_96KBS = 0;
26 | public static int MP3_128KBS = 1;
27 | public static int MP3_160KBS = 2;
28 | public static int MP3_192KBS = 3;
29 | public static int MP3_224KBS = 4;
30 | public static int MP3_320KBS = 5;
31 | public static int WAV = 6;
32 | public static int FLAC = 7;
33 |
34 | public static String[] getAudioCodecs() {
35 | return new String[] {"mp3 96 kbs","mp3 128 kbs","mp3 160 kbs",
36 | "mp3 192 kbs","mp3 224 kbs","mp3 320 kbs","wav (mkv)", "flac (mkv)"};
37 | }
38 |
39 | }
40 |
--------------------------------------------------------------------------------
/CryptImage_Dev/src/com/ib/cryptimage/core/types/ColorType.java:
--------------------------------------------------------------------------------
1 | /**
2 | * This file is part of CryptImage.
3 | *
4 | * CryptImage is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * CryptImage is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with CryptImage. If not, see
16 | *
17 | * 15 jan. 2024 Author Mannix54
18 | * http://ibsoftware.free.fr/cryptimage.php
19 | */
20 |
21 | package com.ib.cryptimage.core.types;
22 |
23 | import com.ib.cryptimage.core.JobConfig;
24 |
25 | public class ColorType {
26 |
27 | public static int RGB = 0;
28 | public static int PAL = 1;
29 | public static int SECAM = 2;
30 | public static int PAL_COMPOSITE_ENC_DEC = 3;
31 | public static int PAL_COMPOSITE_ENC = 4;
32 | public static int PAL_COMPOSITE_DEC = 5;
33 |
34 | public static String[] getColors() {
35 | return new String[]{JobConfig.getRes().getString("cbColorMode.rgb"),
36 | JobConfig.getRes().getString("cbColorMode.pal"),
37 | JobConfig.getRes().getString("cbColorMode.secam"),
38 | JobConfig.getRes().getString("cbColorMode.pal.composite.full"),
39 | JobConfig.getRes().getString("cbColorMode.pal.composite.encode"),
40 | JobConfig.getRes().getString("cbColorMode.pal.composite.decode")};
41 | }
42 |
43 | }
44 |
--------------------------------------------------------------------------------
/CryptImage_Dev/src/com/ib/cryptimage/core/types/ExtensionType.java:
--------------------------------------------------------------------------------
1 | /**
2 | * This file is part of CryptImage.
3 | *
4 | * CryptImage is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * CryptImage is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with CryptImage. If not, see
16 | *
17 | * 11 jan. 2024 Author Mannix54
18 | * http://ibsoftware.free.fr/cryptimage.php
19 | */
20 |
21 | package com.ib.cryptimage.core.types;
22 |
23 | public class ExtensionType {
24 |
25 | public static int MP4 = 0;
26 | public static int AVI = 1;
27 | public static int MKV = 2;
28 | public static int MPEG = 3;
29 | public static int TS = 4;
30 |
31 | public static String[] getExtensions() {
32 | return new String[] {"mp4","avi","mkv", "mpeg", "ts"};
33 | }
34 |
35 | }
36 |
--------------------------------------------------------------------------------
/CryptImage_Dev/src/com/ib/cryptimage/core/types/SystemType.java:
--------------------------------------------------------------------------------
1 | /**
2 | * This file is part of CryptImage.
3 | *
4 | * CryptImage is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * CryptImage is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with CryptImage. If not, see
16 | *
17 | * 9 jan. 2024 Author Mannix54
18 | * http://ibsoftware.free.fr/cryptimage.php
19 | */
20 |
21 | package com.ib.cryptimage.core.types;
22 |
23 | public final class SystemType {
24 |
25 | public static int DISCRET11 = 0;
26 | public static int SYSTER = 1;
27 | public static int VIDEOCRYPT = 2;
28 | public static int EUROCRYPT = 3;
29 | public static int TRANSCODE = 4;
30 |
31 | public static String[] getSystems() {
32 | return new String[] {"Discret11", "Nagravision syster", "Videocrypt", "MAC-Eurocrypt", "Transcode"};
33 | }
34 |
35 | }
36 |
--------------------------------------------------------------------------------
/CryptImage_Dev/src/com/ib/cryptimage/core/types/VideoCodecType.java:
--------------------------------------------------------------------------------
1 | /**
2 | * This file is part of CryptImage.
3 | *
4 | * CryptImage is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * CryptImage is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with CryptImage. If not, see
16 | *
17 | * 11 jan. 2024 Author Mannix54
18 | * http://ibsoftware.free.fr/cryptimage.php
19 | */
20 |
21 | package com.ib.cryptimage.core.types;
22 |
23 |
24 | public final class VideoCodecType {
25 |
26 | public static int H264 = 0;
27 | public static int MPEG2 = 1;
28 | public static int DIVX = 2;
29 | public static int HUFFYUV = 3;
30 | public static int H264V2 = 4;
31 | public static int FFV1 = 5;
32 |
33 | public static String[] getVideoCodecs() {
34 | return new String[] {"h264","mpeg2", "divx", "huffyuv", "h264 v2", "FFV1"};
35 | }
36 |
37 |
38 | }
39 |
--------------------------------------------------------------------------------
/CryptImage_Dev/src/com/ib/cryptimage/gui/MultiCode_DocumentListener.java:
--------------------------------------------------------------------------------
1 | /**
2 | * This file is part of CryptImage.
3 | *
4 | * CryptImage is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * CryptImage is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with CryptImage. If not, see
16 | *
17 | * 22 déc. 2014 Author Mannix54
18 | * http://ibsoftware.free.fr/cryptimage.php
19 | */
20 |
21 |
22 |
23 | package com.ib.cryptimage.gui;
24 |
25 | import javax.swing.event.DocumentEvent;
26 | import javax.swing.event.DocumentListener;
27 |
28 | /**
29 | * @author Mannix54
30 | *
31 | */
32 | public class MultiCode_DocumentListener implements DocumentListener {
33 |
34 | private MainGui mainGui;
35 |
36 | public MultiCode_DocumentListener(MainGui mainGui) {
37 | this.mainGui = mainGui;
38 | }
39 |
40 | @Override
41 | public void changedUpdate(DocumentEvent e) {
42 | // TODO Auto-generated method stub
43 |
44 | }
45 |
46 | @Override
47 | public void insertUpdate(DocumentEvent e) {
48 | computeAudienceMulti(mainGui.getTxtMultiCode().getText());
49 | }
50 |
51 | @Override
52 | public void removeUpdate(DocumentEvent e) {
53 | computeAudienceMulti(mainGui.getTxtMultiCode().getText());
54 | }
55 |
56 | private void computeAudienceMulti(String audienceMulti){
57 | String word11bits = "(";
58 | audienceMulti = audienceMulti.replaceAll("#", "");
59 | audienceMulti = audienceMulti.replaceAll(" ", "");
60 |
61 | boolean[] audienceTab = new boolean[7];
62 |
63 | for (int i = 0; i < 7; i++) {
64 | audienceTab[i] = false;
65 | }
66 |
67 | for (int i = 0; i < audienceMulti.length(); i++) {
68 | switch (Integer.valueOf(audienceMulti.substring(i, i+1))) {
69 | case 1:
70 | audienceTab[0] = true;
71 | break;
72 | case 2:
73 | audienceTab[1] = true;
74 | break;
75 | case 3:
76 | audienceTab[2] = true;
77 | break;
78 | case 4:
79 | audienceTab[3] = true;
80 | break;
81 | case 5:
82 | audienceTab[4] = true;
83 | break;
84 | case 6:
85 | audienceTab[5] = true;
86 | break;
87 | case 7:
88 | audienceTab[6] = true;
89 | break;
90 | default:
91 | break;
92 | }
93 | }
94 |
95 |
96 | for (int i = 0; i < 7; i++) {
97 | if(audienceTab[i] == true){
98 | word11bits = word11bits + " " + ( i+1 ) + ":" + get11bitsKeyWordMulti(this.mainGui.getSlid16bitsWord().getValue(),
99 | i+1);
100 | }
101 | }
102 |
103 | word11bits = word11bits.trim();
104 | word11bits = word11bits + " )";
105 |
106 | this.mainGui.getLbl11bitsInfo().setText(word11bits);
107 | }
108 |
109 | /**
110 | * get the 11 bits keyword
111 | * @param key16bits the 16 bits keyword
112 | */
113 | private String get11bitsKeyWordMulti(int key16bits, int index){
114 | String word = String.format
115 | ("%16s", Integer.toBinaryString(key16bits)).replace(" ", "0");
116 | String audience ="";
117 |
118 | switch (index) {
119 | case 1:
120 | //audience 1
121 | audience = word.substring(0, 11);
122 | break;
123 | case 2:
124 | //audience 2
125 | audience = word.substring(3, 14);
126 | break;
127 | case 3:
128 | //audience 3
129 | audience = word.substring(6, 16) + word.charAt(0);
130 | break;
131 | case 4:
132 | //audience 4
133 | audience = word.substring(9, 16) + word.substring(0, 4);
134 | break;
135 | case 5:
136 | //audience 5
137 | audience = word.substring(12, 16) + word.substring(0, 7);
138 | break;
139 | case 6:
140 | //audience 6
141 | audience = word.charAt(15) + word.substring(0, 10) ;
142 | break;
143 | case 7:
144 | //audience 7
145 | return "1337";
146 | //break;
147 | default:
148 | audience = "";
149 | break;
150 | }
151 |
152 | return String.format("%04d", Integer.parseInt(audience,2));
153 | }
154 |
155 |
156 |
157 | final Runnable updateGui = new Runnable() {
158 | public void run() {
159 | mainGui.getTxtMultiCode().setText(
160 | mainGui.getTxtMultiCode().getText().replaceAll(" ", ""));
161 | }
162 | };
163 |
164 | }
165 |
--------------------------------------------------------------------------------
/CryptImage_Dev/src/com/ib/cryptimage/gui/ShowLicense.java:
--------------------------------------------------------------------------------
1 | /**
2 | * This file is part of CryptImage.
3 | *
4 | * CryptImage is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * CryptImage is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with CryptImage. If not, see
16 | *
17 | * 3 janv. 2015 Author Mannix54
18 | * http://ibsoftware.free.fr/cryptimage.php
19 | */
20 |
21 |
22 |
23 | package com.ib.cryptimage.gui;
24 |
25 | import java.awt.BorderLayout;
26 | import java.io.IOException;
27 | import java.io.InputStream;
28 | import java.io.InputStreamReader;
29 | import javax.swing.JOptionPane;
30 | import javax.swing.JPanel;
31 | import javax.swing.JScrollPane;
32 | import javax.swing.JTextArea;
33 |
34 | /**
35 | * @author Mannix54
36 | *
37 | */
38 |
39 | public class ShowLicense{
40 | private JScrollPane jScrollPane1;
41 | private JTextArea textArea;
42 | private JPanel pan;
43 |
44 |
45 |
46 | public ShowLicense() {
47 | initComponents();
48 | }
49 |
50 | public void show(){
51 | JOptionPane.showMessageDialog(null, pan, "GNU GPL V3 license",
52 | JOptionPane.INFORMATION_MESSAGE);
53 | }
54 |
55 | private void initComponents() {
56 |
57 | textArea = new JTextArea();
58 |
59 | textArea.setColumns(80);
60 | textArea.setLineWrap(true);
61 | textArea.setRows(30);
62 | textArea.setWrapStyleWord(true);
63 | textArea.setEditable(false);
64 | jScrollPane1 = new JScrollPane(textArea);
65 |
66 | InputStream in = getClass().getResourceAsStream("/ressources/license.txt");
67 | try {
68 | textArea.read(new InputStreamReader(in), null);
69 | } catch (IOException e) {
70 | e.printStackTrace();
71 | }
72 |
73 | pan = new JPanel();
74 | pan.setLayout(new BorderLayout());
75 | pan.add(jScrollPane1, BorderLayout.CENTER);
76 |
77 |
78 | }
79 |
80 | }
81 |
--------------------------------------------------------------------------------
/CryptImage_Dev/src/com/ib/cryptimage/gui/TrackSelector.java:
--------------------------------------------------------------------------------
1 | package com.ib.cryptimage.gui;
2 |
3 | import java.awt.BorderLayout;
4 | import java.awt.FlowLayout;
5 | import java.awt.event.ActionEvent;
6 | import java.awt.event.ActionListener;
7 | import java.util.Vector;
8 |
9 |
10 | import javax.swing.BoxLayout;
11 | import javax.swing.ImageIcon;
12 | import javax.swing.JButton;
13 | import javax.swing.JComboBox;
14 | import javax.swing.JDialog;
15 | import javax.swing.JFrame;
16 | import javax.swing.JLabel;
17 | import javax.swing.JPanel;
18 |
19 | import com.ib.cryptimage.core.JobConfig;
20 | import com.ib.cryptimage.core.StreamTrack;
21 |
22 | public class TrackSelector extends JDialog {
23 | private static final long serialVersionUID = -4376588786721498267L;
24 | private Vector videoTracks;
25 | private Vector audioTracks;
26 |
27 | JComboBox comboTrackVideos;
28 | JComboBox comboTrackAudios;
29 |
30 |
31 | public TrackSelector(JFrame parent, String title,
32 | Vector videoTracks, Vector audioTracks, boolean modal) {
33 | super(parent, title, modal);
34 | this.setSize(600, 300);
35 | this.setLocationRelativeTo(null);
36 |
37 | this.videoTracks = videoTracks;
38 | this.audioTracks = audioTracks;
39 |
40 | initGUI();
41 |
42 | this.setResizable(false);
43 | }
44 |
45 | public void display() {
46 | this.setVisible(true);
47 | }
48 |
49 | private void initGUI() {
50 |
51 | JPanel panGlobal = new JPanel();
52 | panGlobal.setLayout(new BoxLayout(panGlobal, BoxLayout.Y_AXIS));
53 |
54 | JLabel lblVideoTrack = new JLabel(JobConfig.getRes().getString("trackSelector.label.video"));
55 |
56 | String[] labelsVideos = new String[videoTracks.size()];
57 |
58 | int count = 0;
59 | for(StreamTrack videoTrack : videoTracks) {
60 | labelsVideos[count] = JobConfig.getRes().getString("trackSelector.label.track") + " " + (count + 1) + " : " + videoTrack.getCodecLongName();
61 | count++;
62 | }
63 |
64 | comboTrackVideos = new JComboBox(labelsVideos);
65 |
66 | JLabel lblAudioTrack = new JLabel(JobConfig.getRes().getString("trackSelector.label.audio"));
67 |
68 | String[] labelsAudios = new String[audioTracks.size()];
69 |
70 | count = 0;
71 | for(StreamTrack audioTrack : audioTracks) {
72 | labelsAudios[count] = JobConfig.getRes().getString("trackSelector.label.track") + " " + (count + 1) + " : " + audioTrack.getCodecLongName();
73 | count++;
74 | }
75 |
76 | comboTrackAudios = new JComboBox(labelsAudios);
77 |
78 | JPanel panTracksVideo = new JPanel();
79 | panTracksVideo.add(lblVideoTrack);
80 | panTracksVideo.add(comboTrackVideos);
81 |
82 | JPanel panTracksAudio = new JPanel();
83 | panTracksAudio.add(lblAudioTrack);
84 | panTracksAudio.add(comboTrackAudios);
85 |
86 |
87 | JPanel panBtn = new JPanel();
88 | panBtn.setLayout(new FlowLayout(FlowLayout.RIGHT));
89 |
90 | JButton btnValid = new JButton(JobConfig.getRes().getString("genEncFile.btnValid"));
91 | btnValid.setIcon(new ImageIcon(this.getClass().getResource("/icons/apply.png")));
92 | btnValid.addActionListener(new ActionListener() {
93 | @Override
94 | public void actionPerformed(ActionEvent e) {
95 | JobConfig.setVideoTrackInfos(JobConfig.getStreamTracksVideo().elementAt(comboTrackVideos.getSelectedIndex()));
96 | JobConfig.setAudioTrackInfos(JobConfig.getStreamTracksAudio().elementAt(comboTrackAudios.getSelectedIndex()));
97 |
98 | JobConfig.setDefaultIdAudioTrack(JobConfig.getStreamTracksAudio().elementAt(comboTrackAudios.getSelectedIndex()).getId());
99 | JobConfig.setDefaultIdVideoTrack(JobConfig.getStreamTracksVideo().elementAt(comboTrackVideos.getSelectedIndex()).getId());
100 |
101 | dispose();
102 | }
103 | });
104 |
105 |
106 | panBtn.add(btnValid);
107 |
108 | panGlobal.add(panTracksVideo);
109 | panGlobal.add(panTracksAudio);
110 | panGlobal.add(panBtn);
111 |
112 | this.getContentPane().add(panGlobal, BorderLayout.CENTER);
113 |
114 | }
115 |
116 | }
117 |
--------------------------------------------------------------------------------
/CryptImage_Dev/src/com/ib/cryptimage/gui/VideoPlayer.java:
--------------------------------------------------------------------------------
1 | /**
2 | * This file is part of CryptImage.
3 | *
4 | * CryptImage is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * CryptImage is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with CryptImage. If not, see
16 | *
17 | * 29 sept. 2014 Author Mannix54
18 | * http://ibsoftware.free.fr/cryptimage.php
19 | */
20 |
21 |
22 |
23 | package com.ib.cryptimage.gui;
24 |
25 | import java.awt.BorderLayout;
26 | import java.awt.Color;
27 |
28 | import javax.swing.ImageIcon;
29 | import javax.swing.JDialog;
30 | import javax.swing.JLabel;
31 | import javax.swing.JPanel;
32 | import javax.swing.JButton;
33 |
34 | import com.ib.cryptimage.core.JobConfig;
35 |
36 | import java.awt.event.ActionEvent;
37 | import java.awt.event.ActionListener;
38 | import java.awt.event.MouseEvent;
39 | import java.awt.event.MouseListener;
40 | import java.awt.event.WindowEvent;
41 | import java.awt.event.WindowListener;
42 | import java.awt.image.BufferedImage;
43 |
44 |
45 |
46 |
47 | public class VideoPlayer implements MouseListener, ActionListener, WindowListener {
48 |
49 | private JLabel label;
50 | private JLabel labelState;
51 | private ImageIcon icon;
52 | private JDialog frame;
53 | private JPanel panLabel;
54 | private JPanel panBtn;
55 |
56 | private JButton btnInverse;
57 | private JButton btnExit;
58 | private double frameRate;
59 | private long systemPreviousCurrentTime = 0;
60 | private boolean inverse;
61 |
62 |
63 | public VideoPlayer(double frameRate) {
64 |
65 | frame = new JDialog();
66 | frame.addWindowListener(this);
67 |
68 |
69 |
70 | this.frame.setLayout(new BorderLayout());
71 | frame.setIconImage(new ImageIcon(this.getClass().getResource("/icons/logo_jframe.png")).getImage());
72 | this.frameRate = frameRate;
73 | this.inverse = false;
74 | icon = new ImageIcon();
75 | label = new JLabel(icon);
76 | panLabel = new JPanel();
77 | panLabel.add(label);
78 | panLabel.setSize(icon.getIconWidth()+10, icon.getIconHeight()+10);
79 |
80 |
81 | this.btnInverse = new JButton(JobConfig.getRes().getString("videoPlayer.btnInverse"));
82 | this.btnExit = new JButton(JobConfig.getRes().getString("videoPlayer.btnExit"));
83 | panBtn = new JPanel();
84 | panBtn.setLayout(new BorderLayout());
85 | panBtn.add(btnInverse, BorderLayout.WEST);
86 |
87 | labelState = new JLabel(JobConfig.getRes().getString("videoPlayer.labelState"));
88 | labelState.setForeground(Color.green);
89 | panBtn.add(labelState,BorderLayout.CENTER);
90 | panBtn.add(btnExit,BorderLayout.EAST);
91 |
92 | this.btnInverse.addActionListener(this);
93 | this.btnExit.addActionListener(this);
94 |
95 | frame.getContentPane().add(panLabel, BorderLayout.NORTH);
96 | frame.getContentPane().add(panBtn,BorderLayout.SOUTH);
97 |
98 |
99 | frame.setSize(panLabel.getWidth(), panLabel.getHeight() + 60);
100 |
101 | frame.setAlwaysOnTop(true);
102 | frame.setResizable(false);
103 |
104 | }
105 |
106 | public void addImage(BufferedImage img) {
107 | this.icon.setImage(img);
108 | label.setIcon(icon);
109 |
110 | panLabel.setSize(icon.getIconWidth()+10, icon.getIconHeight()+10);
111 | frame.setSize(panLabel.getWidth() + 15, panLabel.getHeight() + 60);
112 | }
113 |
114 | public void showImage() {
115 | frame.setVisible(true);
116 |
117 | double systemClockCurrentTime = System.currentTimeMillis();
118 |
119 | double diffTime = systemClockCurrentTime - this.systemPreviousCurrentTime;
120 | double time;
121 |
122 | if (diffTime > (1000/frameRate) && this.systemPreviousCurrentTime !=0){
123 | time = 0;
124 | }
125 | else if(this.systemPreviousCurrentTime == 0){
126 | time = (1000/frameRate);
127 | }
128 | else {
129 | time = (1000/frameRate) - diffTime;
130 | }
131 |
132 | try {
133 | Thread.sleep((long) time );
134 | } catch (InterruptedException e) {
135 | e.printStackTrace();
136 | }
137 |
138 | this.systemPreviousCurrentTime = System.currentTimeMillis();
139 | }
140 |
141 |
142 | public void close(){
143 | this.frame.dispose();
144 | }
145 |
146 | public boolean isInverse() {
147 | return inverse;
148 | }
149 |
150 |
151 | @Override
152 | public void mouseClicked(MouseEvent arg0) {
153 |
154 | }
155 |
156 | @Override
157 | public void mouseEntered(MouseEvent arg0) {
158 | // TODO Auto-generated method stub
159 |
160 | }
161 |
162 | @Override
163 | public void mouseExited(MouseEvent arg0) {
164 | // TODO Auto-generated method stub
165 |
166 | }
167 |
168 | @Override
169 | public void mousePressed(MouseEvent arg0) {
170 | // TODO Auto-generated method stub
171 |
172 | }
173 |
174 | @Override
175 | public void mouseReleased(MouseEvent arg0) {
176 | // TODO Auto-generated method stub
177 |
178 | }
179 |
180 | @Override
181 | public void actionPerformed(ActionEvent e) {
182 | Object src = e.getSource();
183 | if ((src instanceof JButton)) {
184 | if(src.equals(this.btnInverse)){
185 | if(inverse == true){
186 | this.inverse = false;
187 | this.labelState.setText(JobConfig.getRes().getString("videoPlayer.labelState.green"));
188 | labelState.setForeground(Color.green);
189 | }
190 | else{
191 | this.inverse = true;
192 | this.labelState.setText(JobConfig.getRes().getString("videoPlayer.labelState.red"));
193 | labelState.setForeground(Color.red);
194 | }
195 | } else if(src.equals(this.btnExit)){
196 | if(JobConfig.isStop()==false){
197 | JobConfig.setStop(true);
198 | }
199 | else {
200 | this.frame.dispose();
201 | }
202 | }
203 | }
204 | }
205 |
206 | @Override
207 | public void windowActivated(WindowEvent e) {
208 | // TODO Auto-generated method stub
209 |
210 | }
211 |
212 | @Override
213 | public void windowClosed(WindowEvent e) {
214 | // TODO Auto-generated method stub
215 |
216 |
217 | }
218 |
219 | @Override
220 | public void windowDeactivated(WindowEvent e) {
221 | // TODO Auto-generated method stub
222 |
223 | }
224 |
225 | @Override
226 | public void windowDeiconified(WindowEvent e) {
227 | // TODO Auto-generated method stub
228 |
229 | }
230 |
231 | @Override
232 | public void windowIconified(WindowEvent e) {
233 | // TODO Auto-generated method stub
234 |
235 | }
236 |
237 | @Override
238 | public void windowOpened(WindowEvent e) {
239 | // TODO Auto-generated method stub
240 |
241 | }
242 |
243 | @Override
244 | public void windowClosing(WindowEvent e) {
245 | if(JobConfig.isStop()==false){
246 | JobConfig.setStop(true);
247 | }
248 | else {
249 | this.frame.dispose();
250 | }
251 | }
252 |
253 | }
254 |
--------------------------------------------------------------------------------
/CryptImage_Dev/src/icons/apply.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Potomac/cryptimage/5627315e777ec78c803ec9201c6e57962c7889b8/CryptImage_Dev/src/icons/apply.png
--------------------------------------------------------------------------------
/CryptImage_Dev/src/icons/cancel.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Potomac/cryptimage/5627315e777ec78c803ec9201c6e57962c7889b8/CryptImage_Dev/src/icons/cancel.png
--------------------------------------------------------------------------------
/CryptImage_Dev/src/icons/de.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Potomac/cryptimage/5627315e777ec78c803ec9201c6e57962c7889b8/CryptImage_Dev/src/icons/de.png
--------------------------------------------------------------------------------
/CryptImage_Dev/src/icons/documentation.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Potomac/cryptimage/5627315e777ec78c803ec9201c6e57962c7889b8/CryptImage_Dev/src/icons/documentation.png
--------------------------------------------------------------------------------
/CryptImage_Dev/src/icons/encrypted.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Potomac/cryptimage/5627315e777ec78c803ec9201c6e57962c7889b8/CryptImage_Dev/src/icons/encrypted.png
--------------------------------------------------------------------------------
/CryptImage_Dev/src/icons/es.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Potomac/cryptimage/5627315e777ec78c803ec9201c6e57962c7889b8/CryptImage_Dev/src/icons/es.png
--------------------------------------------------------------------------------
/CryptImage_Dev/src/icons/exit.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Potomac/cryptimage/5627315e777ec78c803ec9201c6e57962c7889b8/CryptImage_Dev/src/icons/exit.png
--------------------------------------------------------------------------------
/CryptImage_Dev/src/icons/filenew.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Potomac/cryptimage/5627315e777ec78c803ec9201c6e57962c7889b8/CryptImage_Dev/src/icons/filenew.png
--------------------------------------------------------------------------------
/CryptImage_Dev/src/icons/fileopen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Potomac/cryptimage/5627315e777ec78c803ec9201c6e57962c7889b8/CryptImage_Dev/src/icons/fileopen.png
--------------------------------------------------------------------------------
/CryptImage_Dev/src/icons/filesave.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Potomac/cryptimage/5627315e777ec78c803ec9201c6e57962c7889b8/CryptImage_Dev/src/icons/filesave.png
--------------------------------------------------------------------------------
/CryptImage_Dev/src/icons/fr.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Potomac/cryptimage/5627315e777ec78c803ec9201c6e57962c7889b8/CryptImage_Dev/src/icons/fr.png
--------------------------------------------------------------------------------
/CryptImage_Dev/src/icons/gb.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Potomac/cryptimage/5627315e777ec78c803ec9201c6e57962c7889b8/CryptImage_Dev/src/icons/gb.png
--------------------------------------------------------------------------------
/CryptImage_Dev/src/icons/help.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Potomac/cryptimage/5627315e777ec78c803ec9201c6e57962c7889b8/CryptImage_Dev/src/icons/help.png
--------------------------------------------------------------------------------
/CryptImage_Dev/src/icons/it.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Potomac/cryptimage/5627315e777ec78c803ec9201c6e57962c7889b8/CryptImage_Dev/src/icons/it.png
--------------------------------------------------------------------------------
/CryptImage_Dev/src/icons/logo_jframe.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Potomac/cryptimage/5627315e777ec78c803ec9201c6e57962c7889b8/CryptImage_Dev/src/icons/logo_jframe.png
--------------------------------------------------------------------------------
/CryptImage_Dev/src/icons/pl.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Potomac/cryptimage/5627315e777ec78c803ec9201c6e57962c7889b8/CryptImage_Dev/src/icons/pl.png
--------------------------------------------------------------------------------
/CryptImage_Dev/src/ressources/PAL_subcarrier_ori.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Potomac/cryptimage/5627315e777ec78c803ec9201c6e57962c7889b8/CryptImage_Dev/src/ressources/PAL_subcarrier_ori.png
--------------------------------------------------------------------------------
/CryptImage_Dev/src/ressources/burst_14.75_phase_1_bot.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Potomac/cryptimage/5627315e777ec78c803ec9201c6e57962c7889b8/CryptImage_Dev/src/ressources/burst_14.75_phase_1_bot.bmp
--------------------------------------------------------------------------------
/CryptImage_Dev/src/ressources/burst_14.75_phase_1_top.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Potomac/cryptimage/5627315e777ec78c803ec9201c6e57962c7889b8/CryptImage_Dev/src/ressources/burst_14.75_phase_1_top.bmp
--------------------------------------------------------------------------------
/CryptImage_Dev/src/ressources/burst_14.75_phase_2_bot.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Potomac/cryptimage/5627315e777ec78c803ec9201c6e57962c7889b8/CryptImage_Dev/src/ressources/burst_14.75_phase_2_bot.bmp
--------------------------------------------------------------------------------
/CryptImage_Dev/src/ressources/burst_14.75_phase_2_top.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Potomac/cryptimage/5627315e777ec78c803ec9201c6e57962c7889b8/CryptImage_Dev/src/ressources/burst_14.75_phase_2_top.bmp
--------------------------------------------------------------------------------
/CryptImage_Dev/src/ressources/burst_14.75_phase_3_bot.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Potomac/cryptimage/5627315e777ec78c803ec9201c6e57962c7889b8/CryptImage_Dev/src/ressources/burst_14.75_phase_3_bot.bmp
--------------------------------------------------------------------------------
/CryptImage_Dev/src/ressources/burst_14.75_phase_3_top.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Potomac/cryptimage/5627315e777ec78c803ec9201c6e57962c7889b8/CryptImage_Dev/src/ressources/burst_14.75_phase_3_top.bmp
--------------------------------------------------------------------------------
/CryptImage_Dev/src/ressources/burst_14.75_phase_4_bot.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Potomac/cryptimage/5627315e777ec78c803ec9201c6e57962c7889b8/CryptImage_Dev/src/ressources/burst_14.75_phase_4_bot.bmp
--------------------------------------------------------------------------------
/CryptImage_Dev/src/ressources/burst_14.75_phase_4_top.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Potomac/cryptimage/5627315e777ec78c803ec9201c6e57962c7889b8/CryptImage_Dev/src/ressources/burst_14.75_phase_4_top.bmp
--------------------------------------------------------------------------------
/CryptImage_Dev/src/ressources/burst_1_fix_c2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Potomac/cryptimage/5627315e777ec78c803ec9201c6e57962c7889b8/CryptImage_Dev/src/ressources/burst_1_fix_c2.png
--------------------------------------------------------------------------------
/CryptImage_Dev/src/ressources/burst_2_fix_c2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Potomac/cryptimage/5627315e777ec78c803ec9201c6e57962c7889b8/CryptImage_Dev/src/ressources/burst_2_fix_c2.png
--------------------------------------------------------------------------------
/CryptImage_Dev/src/ressources/burst_bot_phase_1.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Potomac/cryptimage/5627315e777ec78c803ec9201c6e57962c7889b8/CryptImage_Dev/src/ressources/burst_bot_phase_1.bmp
--------------------------------------------------------------------------------
/CryptImage_Dev/src/ressources/burst_bot_phase_2.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Potomac/cryptimage/5627315e777ec78c803ec9201c6e57962c7889b8/CryptImage_Dev/src/ressources/burst_bot_phase_2.bmp
--------------------------------------------------------------------------------
/CryptImage_Dev/src/ressources/burst_bot_phase_3.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Potomac/cryptimage/5627315e777ec78c803ec9201c6e57962c7889b8/CryptImage_Dev/src/ressources/burst_bot_phase_3.bmp
--------------------------------------------------------------------------------
/CryptImage_Dev/src/ressources/burst_bot_phase_4.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Potomac/cryptimage/5627315e777ec78c803ec9201c6e57962c7889b8/CryptImage_Dev/src/ressources/burst_bot_phase_4.bmp
--------------------------------------------------------------------------------
/CryptImage_Dev/src/ressources/burst_top_phase_1.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Potomac/cryptimage/5627315e777ec78c803ec9201c6e57962c7889b8/CryptImage_Dev/src/ressources/burst_top_phase_1.bmp
--------------------------------------------------------------------------------
/CryptImage_Dev/src/ressources/burst_top_phase_2.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Potomac/cryptimage/5627315e777ec78c803ec9201c6e57962c7889b8/CryptImage_Dev/src/ressources/burst_top_phase_2.bmp
--------------------------------------------------------------------------------
/CryptImage_Dev/src/ressources/burst_top_phase_3.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Potomac/cryptimage/5627315e777ec78c803ec9201c6e57962c7889b8/CryptImage_Dev/src/ressources/burst_top_phase_3.bmp
--------------------------------------------------------------------------------
/CryptImage_Dev/src/ressources/burst_top_phase_4.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Potomac/cryptimage/5627315e777ec78c803ec9201c6e57962c7889b8/CryptImage_Dev/src/ressources/burst_top_phase_4.bmp
--------------------------------------------------------------------------------
/CryptImage_Dev/src/ressources/cryptimage_en.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Potomac/cryptimage/5627315e777ec78c803ec9201c6e57962c7889b8/CryptImage_Dev/src/ressources/cryptimage_en.pdf
--------------------------------------------------------------------------------
/CryptImage_Dev/src/ressources/cryptimage_fr.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Potomac/cryptimage/5627315e777ec78c803ec9201c6e57962c7889b8/CryptImage_Dev/src/ressources/cryptimage_fr.pdf
--------------------------------------------------------------------------------
/CryptImage_Dev/src/ressources/delarray.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Potomac/cryptimage/5627315e777ec78c803ec9201c6e57962c7889b8/CryptImage_Dev/src/ressources/delarray.zip
--------------------------------------------------------------------------------
/CryptImage_Dev/src/ressources/delarray_special.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Potomac/cryptimage/5627315e777ec78c803ec9201c6e57962c7889b8/CryptImage_Dev/src/ressources/delarray_special.zip
--------------------------------------------------------------------------------
/CryptImage_Dev/src/ressources/grid_14.75_phase_1_new.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Potomac/cryptimage/5627315e777ec78c803ec9201c6e57962c7889b8/CryptImage_Dev/src/ressources/grid_14.75_phase_1_new.bmp
--------------------------------------------------------------------------------
/CryptImage_Dev/src/ressources/grid_14.75_phase_2_new.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Potomac/cryptimage/5627315e777ec78c803ec9201c6e57962c7889b8/CryptImage_Dev/src/ressources/grid_14.75_phase_2_new.bmp
--------------------------------------------------------------------------------
/CryptImage_Dev/src/ressources/grid_14.75_phase_3_new.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Potomac/cryptimage/5627315e777ec78c803ec9201c6e57962c7889b8/CryptImage_Dev/src/ressources/grid_14.75_phase_3_new.bmp
--------------------------------------------------------------------------------
/CryptImage_Dev/src/ressources/grid_14.75_phase_4_new.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Potomac/cryptimage/5627315e777ec78c803ec9201c6e57962c7889b8/CryptImage_Dev/src/ressources/grid_14.75_phase_4_new.bmp
--------------------------------------------------------------------------------
/CryptImage_Dev/src/ressources/level1_KEY.TXT:
--------------------------------------------------------------------------------
1 | 10
2 | 11
3 | 12
4 | 13
5 | 16
6 | 17
7 | 18
8 | 19
9 | 13
10 | 14
11 | 15
12 | 16
13 | 0
14 | 1
15 | 2
16 | 3
17 | 21
18 | 22
19 | 23
20 | 24
21 | 18
22 | 19
23 | 20
24 | 21
25 | 23
26 | 24
27 | 25
28 | 26
29 | 26
30 | 27
31 | 28
32 | 29
33 | 19
34 | 20
35 | 21
36 | 22
37 | 11
38 | 12
39 | 13
40 | 14
41 | 28
42 | 29
43 | 30
44 | 31
45 | 4
46 | 5
47 | 6
48 | 7
49 | 22
50 | 23
51 | 24
52 | 25
53 | 5
54 | 6
55 | 7
56 | 8
57 | 31
58 | 0
59 | 1
60 | 2
61 | 27
62 | 28
63 | 29
64 | 30
65 | 3
66 | 4
67 | 5
68 | 6
69 | 8
70 | 9
71 | 10
72 | 11
73 | 14
74 | 15
75 | 16
76 | 17
77 | 25
78 | 26
79 | 27
80 | 28
81 | 15
82 | 16
83 | 17
84 | 18
85 | 7
86 | 8
87 | 9
88 | 10
89 | 17
90 | 18
91 | 19
92 | 20
93 | 29
94 | 30
95 | 31
96 | 0
97 | 24
98 | 25
99 | 26
100 | 27
101 | 20
102 | 21
103 | 22
104 | 23
105 | 1
106 | 2
107 | 3
108 | 4
109 | 6
110 | 7
111 | 8
112 | 9
113 | 12
114 | 13
115 | 14
116 | 15
117 | 9
118 | 10
119 | 11
120 | 12
121 | 2
122 | 3
123 | 4
124 | 5
125 | 30
126 | 31
127 | 0
128 | 1
129 | 24
130 | 25
131 | 26
132 | 27
133 | 2
134 | 3
135 | 4
136 | 5
137 | 31
138 | 0
139 | 1
140 | 2
141 | 7
142 | 8
143 | 9
144 | 10
145 | 13
146 | 14
147 | 15
148 | 16
149 | 26
150 | 27
151 | 28
152 | 29
153 | 14
154 | 15
155 | 16
156 | 17
157 | 18
158 | 19
159 | 20
160 | 21
161 | 22
162 | 23
163 | 24
164 | 25
165 | 5
166 | 6
167 | 7
168 | 8
169 | 19
170 | 20
171 | 21
172 | 22
173 | 12
174 | 13
175 | 14
176 | 15
177 | 17
178 | 18
179 | 19
180 | 20
181 | 27
182 | 28
183 | 29
184 | 30
185 | 10
186 | 11
187 | 12
188 | 13
189 | 11
190 | 12
191 | 13
192 | 14
193 | 6
194 | 7
195 | 8
196 | 9
197 | 1
198 | 2
199 | 3
200 | 4
201 | 0
202 | 1
203 | 2
204 | 3
205 | 4
206 | 5
207 | 6
208 | 7
209 | 3
210 | 4
211 | 5
212 | 6
213 | 8
214 | 9
215 | 10
216 | 11
217 | 15
218 | 16
219 | 17
220 | 18
221 | 23
222 | 24
223 | 25
224 | 26
225 | 29
226 | 30
227 | 31
228 | 0
229 | 25
230 | 26
231 | 27
232 | 28
233 | 9
234 | 10
235 | 11
236 | 12
237 | 21
238 | 22
239 | 23
240 | 24
241 | 20
242 | 21
243 | 22
244 | 23
245 | 30
246 | 31
247 | 0
248 | 1
249 | 16
250 | 17
251 | 18
252 | 19
253 | 28
254 | 29
255 | 30
256 | 31
257 |
--------------------------------------------------------------------------------
/CryptImage_Dev/src/ressources/level2_KEY.TXT:
--------------------------------------------------------------------------------
1 | 0
2 | 1
3 | 2
4 | 3
5 | 4
6 | 5
7 | 6
8 | 7
9 | 2
10 | 5
11 | 4
12 | 7
13 | 8
14 | 9
15 | 10
16 | 11
17 | 14
18 | 17
19 | 16
20 | 19
21 | 22
22 | 25
23 | 24
24 | 27
25 | 28
26 | 31
27 | 30
28 | 1
29 | 24
30 | 27
31 | 26
32 | 29
33 | 8
34 | 11
35 | 10
36 | 13
37 | 20
38 | 23
39 | 22
40 | 25
41 | 20
42 | 21
43 | 22
44 | 23
45 | 30
46 | 31
47 | 0
48 | 1
49 | 16
50 | 17
51 | 18
52 | 19
53 | 28
54 | 29
55 | 30
56 | 31
57 | 10
58 | 11
59 | 12
60 | 13
61 | 16
62 | 17
63 | 18
64 | 19
65 | 12
66 | 15
67 | 14
68 | 17
69 | 0
70 | 1
71 | 2
72 | 3
73 | 20
74 | 23
75 | 22
76 | 25
77 | 18
78 | 19
79 | 20
80 | 21
81 | 22
82 | 25
83 | 24
84 | 27
85 | 26
86 | 27
87 | 28
88 | 29
89 | 18
90 | 21
91 | 20
92 | 23
93 | 10
94 | 13
95 | 12
96 | 15
97 | 28
98 | 29
99 | 30
100 | 31
101 | 4
102 | 5
103 | 6
104 | 7
105 | 22
106 | 23
107 | 24
108 | 25
109 | 4
110 | 7
111 | 6
112 | 9
113 | 30
114 | 1
115 | 0
116 | 3
117 | 26
118 | 29
119 | 28
120 | 31
121 | 2
122 | 5
123 | 4
124 | 7
125 | 8
126 | 9
127 | 10
128 | 11
129 | 14
130 | 15
131 | 16
132 | 17
133 | 24
134 | 27
135 | 26
136 | 29
137 | 14
138 | 17
139 | 16
140 | 19
141 | 6
142 | 9
143 | 8
144 | 11
145 | 16
146 | 19
147 | 18
148 | 21
149 | 28
150 | 31
151 | 30
152 | 1
153 | 24
154 | 25
155 | 26
156 | 27
157 | 20
158 | 21
159 | 22
160 | 23
161 | 0
162 | 3
163 | 2
164 | 5
165 | 6
166 | 7
167 | 8
168 | 9
169 | 12
170 | 13
171 | 14
172 | 15
173 | 8
174 | 11
175 | 10
176 | 13
177 | 2
178 | 3
179 | 4
180 | 5
181 | 30
182 | 31
183 | 0
184 | 1
185 | 24
186 | 25
187 | 26
188 | 27
189 | 2
190 | 3
191 | 4
192 | 5
193 | 30
194 | 1
195 | 0
196 | 3
197 | 6
198 | 9
199 | 8
200 | 11
201 | 12
202 | 15
203 | 14
204 | 17
205 | 26
206 | 27
207 | 28
208 | 29
209 | 14
210 | 15
211 | 16
212 | 17
213 | 18
214 | 19
215 | 20
216 | 21
217 | 22
218 | 23
219 | 24
220 | 25
221 | 4
222 | 7
223 | 6
224 | 9
225 | 18
226 | 21
227 | 20
228 | 23
229 | 12
230 | 13
231 | 14
232 | 15
233 | 16
234 | 19
235 | 18
236 | 21
237 | 26
238 | 29
239 | 28
240 | 31
241 | 10
242 | 11
243 | 12
244 | 13
245 | 10
246 | 13
247 | 12
248 | 15
249 | 6
250 | 7
251 | 8
252 | 9
253 | 0
254 | 3
255 | 2
256 | 5
--------------------------------------------------------------------------------
/CryptImage_Dev/src/ressources/mainGui_fr.properties:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Potomac/cryptimage/5627315e777ec78c803ec9201c6e57962c7889b8/CryptImage_Dev/src/ressources/mainGui_fr.properties
--------------------------------------------------------------------------------
/CryptImage_Dev/src/ressources/mainGui_pl.properties:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Potomac/cryptimage/5627315e777ec78c803ec9201c6e57962c7889b8/CryptImage_Dev/src/ressources/mainGui_pl.properties
--------------------------------------------------------------------------------
/CryptImage_Dev/src/ressources/subcarrier_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Potomac/cryptimage/5627315e777ec78c803ec9201c6e57962c7889b8/CryptImage_Dev/src/ressources/subcarrier_2.png
--------------------------------------------------------------------------------
/CryptImage_Dev/src/ressources/subcarrier_phase_1.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Potomac/cryptimage/5627315e777ec78c803ec9201c6e57962c7889b8/CryptImage_Dev/src/ressources/subcarrier_phase_1.bmp
--------------------------------------------------------------------------------
/CryptImage_Dev/src/ressources/subcarrier_phase_1_.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Potomac/cryptimage/5627315e777ec78c803ec9201c6e57962c7889b8/CryptImage_Dev/src/ressources/subcarrier_phase_1_.bmp
--------------------------------------------------------------------------------
/CryptImage_Dev/src/ressources/subcarrier_phase_1__.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Potomac/cryptimage/5627315e777ec78c803ec9201c6e57962c7889b8/CryptImage_Dev/src/ressources/subcarrier_phase_1__.bmp
--------------------------------------------------------------------------------
/CryptImage_Dev/src/ressources/subcarrier_phase_2.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Potomac/cryptimage/5627315e777ec78c803ec9201c6e57962c7889b8/CryptImage_Dev/src/ressources/subcarrier_phase_2.bmp
--------------------------------------------------------------------------------
/CryptImage_Dev/src/ressources/subcarrier_phase_2_.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Potomac/cryptimage/5627315e777ec78c803ec9201c6e57962c7889b8/CryptImage_Dev/src/ressources/subcarrier_phase_2_.bmp
--------------------------------------------------------------------------------
/CryptImage_Dev/src/ressources/subcarrier_phase_3.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Potomac/cryptimage/5627315e777ec78c803ec9201c6e57962c7889b8/CryptImage_Dev/src/ressources/subcarrier_phase_3.bmp
--------------------------------------------------------------------------------
/CryptImage_Dev/src/ressources/subcarrier_phase_3_.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Potomac/cryptimage/5627315e777ec78c803ec9201c6e57962c7889b8/CryptImage_Dev/src/ressources/subcarrier_phase_3_.bmp
--------------------------------------------------------------------------------
/CryptImage_Dev/src/ressources/subcarrier_phase_4.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Potomac/cryptimage/5627315e777ec78c803ec9201c6e57962c7889b8/CryptImage_Dev/src/ressources/subcarrier_phase_4.bmp
--------------------------------------------------------------------------------
/CryptImage_Dev/src/ressources/subcarrier_phase_4_.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Potomac/cryptimage/5627315e777ec78c803ec9201c6e57962c7889b8/CryptImage_Dev/src/ressources/subcarrier_phase_4_.bmp
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # cryptimage
2 |
3 | Cryptimage is an open source software under the license GNU GPL v3 which purpose is to reproduce old analog TV encryption systems.
4 |
5 | Systems simulated are :
6 |
7 | - discret 11 (used between 1984 and 1995 by french TV network "canal plus")
8 |
9 | - nagravision syster (used between 1995 and 2010)
10 |
11 | - videocrypt (used by Sky TV and by several other broadcasters on astra satellites)
12 |
13 | - MAC-Eurocrypt
14 |
15 | This software allows to encrypt a video file (image and sound) , and allows also a decryption of an encrypted file, by meeting the standard discret11, nagravision syster, videocrypt and MAC-Eurocrypt.
16 | Besides the ability to reproduce in a digital way these encryption systems, its second use is to allow the re-use of hardware descramblers by injecting to them an encrypted video file produced by cryptimage.
17 |
18 | Official web site :
19 | http://cryptimage.vot.pl
20 |
21 | Dependencies needed to compile the source code :
22 |
23 | - slf4j : https://mvnrepository.com/artifact/org.slf4j/slf4j-api/1.7.7 https://mvnrepository.com/artifact/org.slf4j/slf4j-simple/1.7.7
24 | - xuggle-xuggler 5.4 : https://mvnrepository.com/artifact/xuggle/xuggle-xuggler/5.4
25 |
--------------------------------------------------------------------------------
/changelog.txt:
--------------------------------------------------------------------------------
1 | v1.8.2 2024-04-17
2 | - Fix crash when FFV1 codec and MP4 container are selected,
3 | the graphical interface will refuse this FFV1/MP4 combination (because it is not compatible).
4 |
5 | v1.8.1 2024-04-16
6 | - Fix crash when flac codec is selected
7 |
8 | v1.8.0 2024-02-16
9 | - Add RangeSlider control,
10 | we can now set both the beginning and ending of the encode/decode process
11 | - Add new option for MAC-Eurocrypt for decoding scrambled 768x576 videos
12 | - New pseudo random number generator (PRNG) for Eurocrypt,
13 | note that scrambled Eurocrypt videos made by 1.7.0 version will not be decoded
14 | by 1.8.0 version, as the PRNG is different.
15 | - Improved robustness of Mac-Eurocrypt GUI
16 | - Bugfixes for Discret11 (decoding and search code mode)
17 | - Update documentation
18 |
19 | v1.7.0 2024-01-27
20 | - Add MAC-Eurocrypt
21 | - Source code reorganization (constants for audio, video and extension types)
22 | - Update documentation
23 |
24 | v1.6.6 2024-01-03
25 | - Fix crash when opening an input video file that has no audio track
26 |
27 | v1.6.5 2023-12-26
28 | - Add multi-channel audio management :
29 | Cryptimage can now manage and generate multi-audio channels
30 | - Add multi video/audio tracks selection : when video file contains several
31 | audio languages tracks and several video tracks then a window will
32 | allow the user to select video and audio tracks.
33 | - Add FLAC audio codec in audio/video panel
34 |
35 | v1.6.4 2023-04-10
36 | - Fix bug in "Join" feature when device is not active
37 |
38 | v1.6.3 2023-04-09
39 | - new checkbox on audio/video panel :"Join" for displaying side by side input and output frames
40 | - discret11 : "masked edge" checkbox displays now a black bar
41 |
42 | v1.6.1 2021-06-29
43 | - fix crash in photo mode when using syster and pal composite mode
44 |
45 | v1.6.0 2020-06-14
46 | - add stretch mode for 4/3 ratio
47 | - update PDF documentations
48 |
49 | v1.5.4 beta 2020-01-30
50 | 1) discret11
51 | - automatic 16 bit key search option : when clicking
52 | on "cancel" button the result of search is now displayed
53 |
54 | 2) java
55 | - add compatibility with java 13 runtime for jar version of cryptimage
56 |
57 | v1.5.3 beta 2019-02-17
58 | 1) discret 11
59 | - white threshold setting : sets the detection threshold for lines 310 and 622
60 | - auto repaint of lines 310 and 622 (by checking "null delays" and "decrypt" options)
61 | - automatic 16 bit key search option
62 |
63 | 2) color rendering
64 | - new pal options : pal composite, can create true pal composite encoding/decoding images
65 |
66 | 3) transcode option
67 | for converting videos without unscrambling/descrambling it,
68 | useful for testing pal composite options
69 |
70 | 4) display
71 | a new 944x626 display resolution output in "audio/video" tab
72 |
73 | 5) geometry
74 | add shift X/Y options in "audio/video" tab
75 |
76 | v1.4.5 2017-08-23
77 | - bugfix in syster :
78 | the increment value was by error restricted to a scale 1-127,
79 | now the increment can have a value between 1 and 255 ( odd value )
80 |
81 | v1.4.4 2017-08-22
82 | -syster : the encoding parameter file will be also created automatically
83 | with the feature "decrypt by line correlation"
84 |
85 | v1.4.3 2017-06-28
86 | - new feature : pan and scan mode
87 | - better pal and secam emulation color
88 | - improvements in discret11 for decryption :
89 | small black sideband to the right of the image,
90 | a little faster decoding with the line correlation mode
91 |
92 | v1.3.0 2017-05-01
93 | - new feature for discret11 : "null delay" checkbox
94 |
95 | v1.2.2 2016-08-18
96 | - new feature for videocrypt : a tag for line 1 ( a digital tatoo )
97 | it will allow an automatic decryption
98 | - bug fixes : language translations, csv file for videocrypt, better photo mode for syster
99 |
100 | v1.2.1 2016-08-11
101 | - minor bug fix for the management of the csv file for videocrypt
102 |
103 | v1.2.0 2016-08-11
104 | - new feature : videocrypt
105 | - new feature : pal and secam color management for syster and videocrypt
106 | - new feature in syster : checkbox for setting a different offset/increment for the second half-frame
107 |
108 | v1.0.0 2016-07-17
109 | - multi-language support for the GUI ( 6 languages )
110 |
111 | v0.0.14 2015-12-15
112 | - syster : the default setting will chose the same offset/increment for first and second half-frame
113 |
114 | v0.0.13 2015-12-11
115 | - bug fix for managing audio track in mkv file
116 |
117 | v0.0.11 2015-11-27
118 | - new feature : nagravision syster
119 | - new feature for discret11 : automatic decryption by line correlation
120 | - new audio features : wav codec, the choice of the bitrate for mp3 codec, the choice of the audio sampling frequency
121 | - photo mode in discret11 : it can work with the checkbox "meet the standard"
122 | - new feature for the GUI : bar menu
123 | - new video feature : add FFV1 video codec
124 |
125 | v0.0.8 2015-01-10
126 | - new feature for discret11 : multicode mode
127 | - new audio feature : stereo sound
128 | - improvements in discret11 for decryption ( no need to specify the audience level )
129 | - minor bugfix in the GUI
130 |
131 | v0.0.7 2014-12-26
132 | - new feature for discret11 : 16 bit word, no need to specify the 11 bit word
133 | - new feature for discret11 : sound management
134 | - new feature for discret11 : keyboard code
135 | - new feature : timestamp checkbox
136 | - new video codec : huffyuv
137 | - automatic backup of the settings to a configuration file located in the user directory
138 |
139 | v0.0.2 2014-09-28
140 | - alpha version, no sound management, no GUI, works only in command line
141 |
--------------------------------------------------------------------------------
/install.txt:
--------------------------------------------------------------------------------
1 | Compilation and installation of cryptimage
2 |
3 | 1. With Maven
4 | This is the easy way, download and install maven :
5 | https://maven.apache.org/
6 |
7 | open a console and go to the directory where the file "pom.xml" is present (root of the cryptimage git project),
8 | type this command :
9 | mvn clean compile assembly:single
10 |
11 | you will get a runnable jar file in a sub-directory "target" : cryptimage-X.Y.Z-SNAPSHOT_universal-jar-with-dependencies.jar
12 |
13 | to run the program type in a console :
14 | java -jar cryptimage-X.Y.Z-SNAPSHOT_universal-jar-with-dependencies.jar
15 |
16 |
17 | 2. With a java IDE like eclipse
18 | Download and install eclipse (for java project) :
19 | https://www.eclipse.org/
20 |
21 | create a java project with eclipse and import the src directory of the cryptimage source code,
22 | then add the needed dependencies (slf4j and xuggle-xuggler 5.4), a zip file containing the jar dependencies files are
23 | provided in the official site of cryptimage (http://cryptimage.vot.pl) and in the github (https://github.com/Potomac/cryptimage),
24 |
25 | and in eclipse create a runnable jar, the main class is "com.ib.cryptimage.core.Application" :
26 | https://help.eclipse.org/oxygen/index.jsp?topic=%2Forg.eclipse.jdt.doc.user%2Ftasks%2Ftasks-37.htm
27 |
28 |
--------------------------------------------------------------------------------
/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 | 4.0.0
6 |
7 | com.ib.cryptimage
8 | cryptimage
9 | 1.8.2-SNAPSHOT
10 |
11 | cryptimage
12 |
13 | http://cryptimage.vot.pl
14 |
15 |
16 | UTF-8
17 | 1.7
18 | 1.7
19 |
20 |
21 |
22 |
23 | xuggle repo
24 | https://files.liferay.com/mirrors/xuggle.googlecode.com/svn/trunk/repo/share/java/
25 |
26 |
27 |
28 |
29 |
30 |
31 | org.slf4j
32 | slf4j-api
33 | 2.0.7
34 |
35 |
36 |
37 |
38 | org.slf4j
39 | slf4j-simple
40 | 2.0.7
41 |
42 |
43 |
44 |
45 | xuggle
46 | xuggle-xuggler
47 | 5.4
48 |
49 |
50 |
51 |
52 | junit
53 | junit
54 | 4.13.1
55 | test
56 |
57 |
58 |
59 |
60 | CryptImage_Dev/src/
61 |
62 |
63 |
64 |
65 |
66 | maven-clean-plugin
67 | 3.1.0
68 |
69 |
70 |
71 | maven-resources-plugin
72 | 3.0.2
73 |
74 |
75 | maven-compiler-plugin
76 | 3.8.0
77 |
78 |
79 | maven-surefire-plugin
80 | 2.22.1
81 |
82 |
83 | maven-jar-plugin
84 | 3.0.2
85 |
86 |
87 | maven-install-plugin
88 | 2.5.2
89 |
90 |
91 | maven-deploy-plugin
92 | 2.8.2
93 |
94 |
95 |
96 | maven-site-plugin
97 | 3.7.1
98 |
99 |
100 | maven-project-info-reports-plugin
101 | 3.0.0
102 |
103 |
104 |
105 | maven-assembly-plugin
106 |
107 |
108 |
109 | com.ib.cryptimage.core.Application
110 |
111 |
112 |
113 | jar-with-dependencies
114 |
115 | true
116 | cryptimage-${project.version}_universal
117 |
118 |
119 |
120 | make-assembly
121 | package
122 |
123 | single
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 | CryptImage_Dev/src/
135 |
136 | ressources/*
137 | icons/*
138 |
139 |
140 |
141 |
142 |
143 |
144 |
--------------------------------------------------------------------------------