Skip to content

Commit 7b40f46

Browse files
author
El Mehdi Bennamrouche
committedFeb 20, 2023
first push
0 parents  commit 7b40f46

22 files changed

+1305
-0
lines changed
 

‎bin/.DS_Store

6 KB
Binary file not shown.

‎bin/Main.class

1.75 KB
Binary file not shown.

‎bin/fdf

136 KB
Binary file not shown.

‎image/.DS_Store

6 KB
Binary file not shown.

‎image/apple.png

13.5 KB
Loading

‎image/applefdf.png

1.28 MB
Loading

‎image/fire.png

304 KB
Loading

‎image/firefdf.png

3.81 MB
Loading

‎image/hand.png

35.6 KB
Loading

‎image/handfdf.png

1.17 MB
Loading

‎image/mahdfdf.png

1.93 MB
Loading

‎image/mahdi.png

99.4 KB
Loading

‎image/rac.png

22 KB
Loading

‎image/racfdf.png

1.23 MB
Loading

‎map/.DS_Store

6 KB
Binary file not shown.

‎map/apple.fdf

+128
Large diffs are not rendered by default.

‎map/fire.fdf

+383
Large diffs are not rendered by default.

‎map/hand.fdf

+291
Large diffs are not rendered by default.

‎map/mahdi.fdf

+325
Large diffs are not rendered by default.

‎map/rca.fdf

+128
Large diffs are not rendered by default.

‎source/.DS_Store

6 KB
Binary file not shown.

‎source/Main.java

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
import javax.imageio.ImageIO;
2+
import java.awt.image.BufferedImage;
3+
import java.io.File;
4+
5+
6+
public class Main {
7+
public static void main(String[] args) {
8+
9+
try
10+
{
11+
if (args == null) {
12+
System.err.print("No Args");
13+
System.exit(1);
14+
}
15+
// System.out.print(args[0]);
16+
BufferedImage img = ImageIO.read(new File(args[0]));
17+
18+
for (int j = 0; j < img.getHeight(); j++)
19+
{
20+
21+
for (int i = 0;i < img.getWidth(); i++)
22+
{
23+
int val = img.getRGB(i,j);
24+
String hex = Integer.toHexString(val);
25+
if (val == 0)
26+
{
27+
System.out.print(0 + "," + hex + " ");
28+
}
29+
else
30+
{
31+
if (hex.length() == 8)
32+
System.out.print( 10 + "," +"0x"+ hex.subSequence(2,8)+ " ");
33+
else
34+
System.out.print(10 + "," +"0x"+ hex + " ");
35+
36+
37+
}
38+
}
39+
System.out.print('\n');
40+
}
41+
42+
}catch (Exception ex)
43+
{
44+
System.out.print("Error"+ ex.getMessage());
45+
}
46+
47+
48+
49+
}
50+
}

0 commit comments

Comments
 (0)
Please sign in to comment.