1
1
# ## Simple cases
2
- add_format (format " JLD" , " Julia data file (HDF5)" , " .jld" )
3
- add_loader (format " JLD" , :JLD )
4
- add_saver (format " JLD" , :JLD )
2
+ add_format (format " JLD" , " Julia data file (HDF5)" , " .jld" , [:JLD ])
5
3
6
4
# Image formats
7
5
add_format (format " PBMText" , b " P1" , " .pbm" )
@@ -11,83 +9,65 @@ add_format(format"PBMBinary", b"P4", ".pbm")
11
9
add_format (format " PGMBinary" , b " P5" , " .pgm" )
12
10
add_format (format " PPMBinary" , b " P6" , " .ppm" )
13
11
14
- add_format (format " NRRD" , " NRRD" , [" .nrrd" , " .nhdr" ])
15
- add_loader (format " NRRD" , :NRRD )
16
- add_saver (format " NRRD" , :NRRD )
17
-
18
- add_format (format " AndorSIF" , " Andor Technology Multi-Channel File" , " .sif" )
19
- add_loader (format " AndorSIF" , :AndorSIF )
20
-
21
- add_format (format " BMP" , UInt8[0x42 ,0x4d ], " .bmp" )
22
- add_loader (format " BMP" , :ImageMagick )
23
- add_saver (format " BMP" , :ImageMagick )
24
- add_format (format " AVI" , UInt8[0x52 ,0x49 ,0x46 ,0x46 ], " .avi" )
25
- add_loader (format " AVI" , :ImageMagick )
26
- add_saver (format " AVI" , :ImageMagick )
27
- add_format (format " CRW" , UInt8[0x49 ,0x49 ,0x1a ,0x00 ,0x00 ,0x00 ,0x48 ,0x45 ], " .crw" )
28
- add_loader (format " CRW" , :ImageMagick )
29
- add_saver (format " CRW" , :ImageMagick )
30
- add_format (format " CUR" , UInt8[0x00 ,0x00 ,0x02 ,0x00 ], " .cur" )
31
- add_loader (format " CUR" , :ImageMagick )
32
- add_saver (format " CUR" , :ImageMagick )
33
- add_format (format " DCX" , UInt8[0xb1 ,0x68 ,0xde ,0x3a ], " .dcx" )
34
- add_loader (format " DCX" , :ImageMagick )
35
- add_saver (format " DCX" , :ImageMagick )
36
- add_format (format " DOT" , UInt8[0xd0 ,0xcf ,0x11 ,0xe0 ,0xa1 ,0xb1 ,0x1a ,0xe1 ], " .dot" )
37
- add_loader (format " DOT" , :ImageMagick )
38
- add_saver (format " DOT" , :ImageMagick )
39
- add_format (format " EPS" , UInt8[0x25 ,0x21 ,0x50 ,0x53 ,0x2d ,0x41 ,0x64 ,0x6f ], " .eps" )
40
- add_loader (format " EPS" , :ImageMagick )
41
- add_saver (format " EPS" , :ImageMagick )
42
- add_format (format " GIF" , UInt8[0x47 ,0x49 ,0x46 ,0x38 ], " .gif" )
43
- add_loader (format " GIF" , :ImageMagick )
44
- add_saver (format " GIF" , :ImageMagick )
45
- add_format (format " HDR" , UInt8[0x23 ,0x3f ,0x52 ,0x41 ,0x44 ,0x49 ,0x41 ,0x4e ], " .hdr" )
46
- add_loader (format " HDR" , :ImageMagick )
47
- add_saver (format " HDR" , :ImageMagick )
48
- add_format (format " ICO" , UInt8[0x00 ,0x00 ,0x01 ,0x00 ], " .ico" )
49
- add_loader (format " ICO" , :ImageMagick )
50
- add_saver (format " ICO" , :ImageMagick )
51
- add_format (format " INFO" , UInt8[0x7a ,0x62 ,0x65 ,0x78 ], " .info" )
52
- add_loader (format " INFO" , :ImageMagick )
53
- add_saver (format " INFO" , :ImageMagick )
54
- add_format (format " JP2" , UInt8[0x00 ,0x00 ,0x00 ,0x0c ,0x6a ,0x50 ,0x20 ,0x20 ], " .jp2" )
55
- add_loader (format " JP2" , :ImageMagick )
56
- add_saver (format " JP2" , :ImageMagick )
57
- add_format (format " JPEG" , UInt8[0xff ,0xd8 ,0xff ], [" .jpeg" , " .jpg" , " .JPG" ]) # 0xe1
58
- add_loader (format " JPEG" , :ImageMagick )
59
- add_saver (format " JPEG" , :ImageMagick )
60
- add_format (format " PCX" , UInt8[0x0a ,0x05 ,0x01 ,0x01 ], " .pcx" )
61
- add_loader (format " PCX" , :ImageMagick )
62
- add_saver (format " PCX" , :ImageMagick )
63
- add_format (format " PDB" , UInt8[0x73 ,0x7a ,0x65 ,0x7a ], " .pdb" )
64
- add_loader (format " PDB" , :ImageMagick )
65
- add_saver (format " PDB" , :ImageMagick )
66
- add_format (format " PDF" , UInt8[0x25 ,0x50 ,0x44 ,0x46 ], " .pdf" )
67
- add_loader (format " PDF" , :ImageMagick )
68
- add_saver (format " PDF" , :ImageMagick )
69
- add_format (format " PGM" , UInt8[0x50 ,0x35 ,0x0a ], " .pgm" )
70
- add_loader (format " PGM" , :ImageMagick )
71
- add_saver (format " PGM" , :ImageMagick )
72
- add_format (format " PNG" , UInt8[0x89 ,0x50 ,0x4e ,0x47 ,0x0d ,0x0a ,0x1a ,0x0a ], " .png" )
73
- add_loader (format " PNG" , :ImageMagick )
74
- add_saver (format " PNG" , :ImageMagick )
75
- add_format (format " PSD" , UInt8[0x38 ,0x42 ,0x50 ,0x53 ], " .psd" )
76
- add_loader (format " PSD" , :ImageMagick )
77
- add_saver (format " PSD" , :ImageMagick )
78
- add_format (format " RGB" , UInt8[0x01 ,0xda ,0x01 ,0x01 ,0x00 ,0x03 ], " .rgb" )
79
- add_loader (format " RGB" , :ImageMagick )
80
- add_saver (format " RGB" , :ImageMagick )
81
-
82
- add_format (format " TIFF" , (UInt8[0x4d ,0x4d ,0x00 ,0x2a ], UInt8[0x4d ,0x4d ,0x00 ,0x2b ], UInt8[0x49 ,0x49 ,0x2a ,0x00 ]), [" .tiff" , " .tif" ])
83
- add_loader (format " TIFF" , :ImageMagick )
84
- add_saver (format " TIFF" , :ImageMagick )
85
- add_format (format " WMF" , UInt8[0xd7 ,0xcd ,0xc6 ,0x9a ], " .wmf" )
86
- add_loader (format " WMF" , :ImageMagick )
87
- add_saver (format " WMF" , :ImageMagick )
88
- add_format (format " WPG" , UInt8[0xff ,0x57 ,0x50 ,0x43 ], " .wpg" )
89
- add_loader (format " WPG" , :ImageMagick )
90
- add_saver (format " WPG" , :ImageMagick )
12
+ add_format (format " NRRD" , " NRRD" , [" .nrrd" , " .nhdr" ], [:NRRD ])
13
+
14
+ add_format (format " AndorSIF" , " Andor Technology Multi-Channel File" , " .sif" , [:AndorSIF , LOAD])
15
+
16
+
17
+ add_format (format " AVI" , UInt8[0x52 ,0x49 ,0x46 ,0x46 ], " .avi" , [:ImageMagick ])
18
+ add_format (format " CRW" , UInt8[0x49 ,0x49 ,0x1a ,0x00 ,0x00 ,0x00 ,0x48 ,0x45 ], " .crw" , [:ImageMagick ])
19
+ add_format (format " CUR" , UInt8[0x00 ,0x00 ,0x02 ,0x00 ], " .cur" , [:ImageMagick ])
20
+ add_format (format " DCX" , UInt8[0xb1 ,0x68 ,0xde ,0x3a ], " .dcx" , [:ImageMagick ])
21
+ add_format (format " DOT" , UInt8[0xd0 ,0xcf ,0x11 ,0xe0 ,0xa1 ,0xb1 ,0x1a ,0xe1 ], " .dot" , [:ImageMagick ])
22
+ add_format (format " EPS" , UInt8[0x25 ,0x21 ,0x50 ,0x53 ,0x2d ,0x41 ,0x64 ,0x6f ], " .eps" , [:ImageMagick ])
23
+ add_format (format " HDR" , UInt8[0x23 ,0x3f ,0x52 ,0x41 ,0x44 ,0x49 ,0x41 ,0x4e ], " .hdr" , [:ImageMagick ])
24
+ add_format (format " ICO" , UInt8[0x00 ,0x00 ,0x01 ,0x00 ], " .ico" , [:ImageMagick ])
25
+ add_format (format " INFO" , UInt8[0x7a ,0x62 ,0x65 ,0x78 ], " .info" ,[:ImageMagick ])
26
+ add_format (format " JP2" , UInt8[0x00 ,0x00 ,0x00 ,0x0c ,0x6a ,0x50 ,0x20 ,0x20 ], " .jp2" , [:ImageMagick ])
27
+ add_format (format " PCX" , UInt8[0x0a ,0x05 ,0x01 ,0x01 ], " .pcx" , [:ImageMagick ])
28
+ add_format (format " PDB" , UInt8[0x73 ,0x7a ,0x65 ,0x7a ], " .pdb" , [:ImageMagick ])
29
+ add_format (format " PDF" , UInt8[0x25 ,0x50 ,0x44 ,0x46 ], " .pdf" , [:ImageMagick ])
30
+ add_format (format " PGM" , UInt8[0x50 ,0x35 ,0x0a ], " .pgm" , [:ImageMagick ])
31
+ add_format (format " PSD" , UInt8[0x38 ,0x42 ,0x50 ,0x53 ], " .psd" , [:ImageMagick ])
32
+ add_format (format " RGB" , UInt8[0x01 ,0xda ,0x01 ,0x01 ,0x00 ,0x03 ], " .rgb" , [:ImageMagick ])
33
+ add_format (format " WMF" , UInt8[0xd7 ,0xcd ,0xc6 ,0x9a ], " .wmf" , [:ImageMagick ])
34
+ add_format (format " WPG" , UInt8[0xff ,0x57 ,0x50 ,0x43 ], " .wpg" , [:ImageMagick ])
35
+
36
+ add_format (
37
+ format " GIF" ,
38
+ UInt8[0x47 ,0x49 ,0x46 ,0x38 ],
39
+ " .gif" ,
40
+ [:OSXNativeIO , LOAD, OSX],
41
+ [:ImageMagick ]
42
+ )
43
+ add_format (
44
+ format " PNG" ,
45
+ UInt8[0x89 ,0x50 ,0x4e ,0x47 ,0x0d ,0x0a ,0x1a ,0x0a ],
46
+ " .png" ,
47
+ [:OSXNativeIO , LOAD, OSX],
48
+ [:ImageMagick ]
49
+ )
50
+ add_format (
51
+ format " TIFF" ,
52
+ (UInt8[0x4d ,0x4d ,0x00 ,0x2a ], UInt8[0x4d ,0x4d ,0x00 ,0x2b ], UInt8[0x49 ,0x49 ,0x2a ,0x00 ]),
53
+ [" .tiff" , " .tif" ],
54
+ [:OSXNativeIO , LOAD, OSX],
55
+ [:ImageMagick ]
56
+ )
57
+ add_format (
58
+ format " JPEG" ,
59
+ UInt8[0xff ,0xd8 ,0xff ],
60
+ [" .jpeg" , " .jpg" , " .JPG" ],
61
+ [:OSXNativeIO , LOAD, OSX],
62
+ [:ImageMagick ]
63
+ ) # 0xe1
64
+ add_format (
65
+ format " BMP" ,
66
+ UInt8[0x42 ,0x4d ],
67
+ " .bmp" ,
68
+ [:OSXNativeIO , LOAD, OSX],
69
+ [:ImageMagick ]
70
+ )
91
71
92
72
#=
93
73
add_format(format"NPY", UInt8[0x93, 'N', 'U', 'M', 'P', 'Y'], ".npy")
@@ -100,30 +80,14 @@ add_saver(format"ZIP", :ZipeFile)
100
80
=#
101
81
102
82
# Shader files
103
- add_format (format " GLSLShader" , (), [" .frag" , " .vert" , " .geom" , " .comp" ])
104
- add_loader (format " GLSLShader" , :GLAbstraction )
105
- add_saver (format " GLSLShader" , :GLAbstraction )
83
+ add_format (format " GLSLShader" , (), [" .frag" , " .vert" , " .geom" , " .comp" ], [:GLAbstraction ])
106
84
107
85
# Mesh formats
108
- add_format (format " OBJ" , (), " .obj" )
109
- add_loader (format " OBJ" , :MeshIO )
110
- add_saver (format " OBJ" , :MeshIO )
111
-
112
- add_format (format " PLY_ASCII" , " ply\n format ascii 1.0" , " .ply" )
113
- add_format (format " PLY_BINARY" , " ply\n format binary_little_endian 1.0" , " .ply" )
114
-
115
- add_loader (format " PLY_ASCII" , :MeshIO )
116
- add_loader (format " PLY_BINARY" , :MeshIO )
117
- add_saver (format " PLY_ASCII" , :MeshIO )
118
- add_saver (format " PLY_BINARY" , :MeshIO )
119
-
120
- add_format (format " 2DM" , " MESH2D" , " .2dm" )
121
- add_loader (format " 2DM" , :MeshIO )
122
- add_saver (format " 2DM" , :MeshIO )
123
-
124
- add_format (format " OFF" , " OFF" , " .off" )
125
- add_loader (format " OFF" , :MeshIO )
126
- add_saver (format " OFF" , :MeshIO )
86
+ add_format (format " OBJ" , (), " .obj" , [:MeshIO ])
87
+ add_format (format " PLY_ASCII" , " ply\n format ascii 1.0" , " .ply" , [:MeshIO ])
88
+ add_format (format " PLY_BINARY" , " ply\n format binary_little_endian 1.0" , " .ply" , [:MeshIO ])
89
+ add_format (format " 2DM" , " MESH2D" , " .2dm" , [:MeshIO ])
90
+ add_format (format " OFF" , " OFF" , " .off" , [:MeshIO ])
127
91
128
92
129
93
@@ -150,10 +114,7 @@ function detecthdf5(io)
150
114
end
151
115
false
152
116
end
153
- add_format (format " HDF5" , detecthdf5, [" .h5" , " .hdf5" ])
154
- add_loader (format " HDF5" , :HDF5 )
155
- add_saver (format " HDF5" , :HDF5 )
156
-
117
+ add_format (format " HDF5" , detecthdf5, [" .h5" , " .hdf5" ], [:HDF5 ])
157
118
158
119
function detect_stlascii (io)
159
120
try
@@ -190,10 +151,6 @@ function detect_stlbinary(io)
190
151
seekstart (io)
191
152
return result
192
153
end
193
- add_format (format " STL_ASCII" , detect_stlascii, [" .stl" , " .STL" ])
194
- add_format (format " STL_BINARY" , detect_stlbinary, [" .stl" , " .STL" ])
195
- add_loader (format " STL_ASCII" , :MeshIO )
196
- add_saver (format " STL_BINARY" , :MeshIO )
197
- add_saver (format " STL_ASCII" , :MeshIO )
198
- add_loader (format " STL_BINARY" , :MeshIO )
154
+ add_format (format " STL_ASCII" , detect_stlascii, [" .stl" , " .STL" ], [:MeshIO ])
155
+ add_format (format " STL_BINARY" , detect_stlbinary, [" .stl" , " .STL" ], [:MeshIO ])
199
156
0 commit comments