Skip to content

Commit 8fa60dc

Browse files
Merge pull request #212 from vsg-dev/ColorSpaceControl
Added color space controls.
2 parents b2484fc + 4c7c779 commit 8fa60dc

File tree

8 files changed

+134
-56
lines changed

8 files changed

+134
-56
lines changed

README.md

+67-19
Original file line numberDiff line numberDiff line change
@@ -114,14 +114,17 @@ Options specific to a ReaderWriter are specified on the commandline using two da
114114

115115
## File formats supported by all built in ReaderWriters
116116

117-
$ vsgconv --features
118117
vsgXchange::all
119118
vsgXchange::curl provides support for 0 extensions, and 2 protocols.
120119
Protocols Supported ReaderWriter methods
121120
---------- ------------------------------
122121
http read(vsg::Path, ..)
123122
https read(vsg::Path, ..)
124123

124+
vsg::Options::Value type
125+
------------------- ----
126+
CURLOPT_SSL_OPTIONS uint32_t
127+
125128
vsg::VSG provides support for 2 extensions, and 0 protocols.
126129
Extensions Supported ReaderWriter methods
127130
---------- ------------------------------
@@ -133,7 +136,7 @@ Options specific to a ReaderWriter are specified on the commandline using two da
133136
---------- ------------------------------
134137
.spv read(vsg::Path, ..) write(vsg::Path, ..)
135138

136-
vsgXchange::glsl provides support for 16 extensions, and 0 protocols.
139+
vsg::glsl provides support for 16 extensions, and 0 protocols.
137140
Extensions Supported ReaderWriter methods
138141
---------- ------------------------------
139142
.comp read(vsg::Path, ..) write(vsg::Path, ..)
@@ -153,24 +156,39 @@ Options specific to a ReaderWriter are specified on the commandline using two da
153156
.tese read(vsg::Path, ..) write(vsg::Path, ..)
154157
.vert read(vsg::Path, ..) write(vsg::Path, ..)
155158

159+
vsg::txt provides support for 7 extensions, and 0 protocols.
160+
Extensions Supported ReaderWriter methods
161+
---------- ------------------------------
162+
.bat read(vsg::Path, ..) read(std::istream, ..) read(uint8_t* ptr, size_t size, ..)
163+
.json read(vsg::Path, ..) read(std::istream, ..) read(uint8_t* ptr, size_t size, ..)
164+
.md read(vsg::Path, ..) read(std::istream, ..) read(uint8_t* ptr, size_t size, ..)
165+
.sh read(vsg::Path, ..) read(std::istream, ..) read(uint8_t* ptr, size_t size, ..)
166+
.text read(vsg::Path, ..) read(std::istream, ..) read(uint8_t* ptr, size_t size, ..)
167+
.txt read(vsg::Path, ..) read(std::istream, ..) read(uint8_t* ptr, size_t size, ..)
168+
.xml read(vsg::Path, ..) read(std::istream, ..) read(uint8_t* ptr, size_t size, ..)
169+
156170
vsgXchange::cpp provides support for 1 extensions, and 0 protocols.
157171
Extensions Supported ReaderWriter methods
158172
---------- ------------------------------
159173
.cpp write(vsg::Path, ..)
160174

161-
vsgXchange::stbi provides support for 10 extensions, and 0 protocols.
175+
vsgXchange::stbi provides support for 9 extensions, and 0 protocols.
162176
Extensions Supported ReaderWriter methods
163177
---------- ------------------------------
164-
.bmp read(vsg::Path, ..) read(std::istream, ..) read(uint8_t* ptr, size_t size, ..)
165-
.gif read(vsg::Path, ..) read(std::istream, ..) read(uint8_t* ptr, size_t size, ..)
166-
.jpe read(vsg::Path, ..) read(std::istream, ..) read(uint8_t* ptr, size_t size, ..)
167-
.jpeg read(vsg::Path, ..) read(std::istream, ..) read(uint8_t* ptr, size_t size, ..)
168-
.jpg read(vsg::Path, ..) read(std::istream, ..) read(uint8_t* ptr, size_t size, ..)
178+
.bmp read(vsg::Path, ..) read(std::istream, ..) read(uint8_t* ptr, size_t size, ..) write(vsg::Path, ..) write(std::ostream, ..)
179+
.jpe read(vsg::Path, ..) read(std::istream, ..) read(uint8_t* ptr, size_t size, ..) write(vsg::Path, ..) write(std::ostream, ..)
180+
.jpeg read(vsg::Path, ..) read(std::istream, ..) read(uint8_t* ptr, size_t size, ..) write(vsg::Path, ..) write(std::ostream, ..)
181+
.jpg read(vsg::Path, ..) read(std::istream, ..) read(uint8_t* ptr, size_t size, ..) write(vsg::Path, ..) write(std::ostream, ..)
169182
.pgm read(vsg::Path, ..) read(std::istream, ..) read(uint8_t* ptr, size_t size, ..)
170-
.png read(vsg::Path, ..) read(std::istream, ..) read(uint8_t* ptr, size_t size, ..)
183+
.png read(vsg::Path, ..) read(std::istream, ..) read(uint8_t* ptr, size_t size, ..) write(vsg::Path, ..) write(std::ostream, ..)
171184
.ppm read(vsg::Path, ..) read(std::istream, ..) read(uint8_t* ptr, size_t size, ..)
172185
.psd read(vsg::Path, ..) read(std::istream, ..) read(uint8_t* ptr, size_t size, ..)
173-
.tga read(vsg::Path, ..) read(std::istream, ..) read(uint8_t* ptr, size_t size, ..)
186+
.tga read(vsg::Path, ..) read(std::istream, ..) read(uint8_t* ptr, size_t size, ..) write(vsg::Path, ..) write(std::ostream, ..)
187+
188+
vsg::Options::Value type
189+
------------------- ----
190+
image_format vsg::CoordinateSpace
191+
jpeg_quality int
174192

175193
vsgXchange::dds provides support for 1 extensions, and 0 protocols.
176194
Extensions Supported ReaderWriter methods
@@ -203,7 +221,12 @@ Options specific to a ReaderWriter are specified on the commandline using two da
203221
.ttf read(vsg::Path, ..)
204222
.woff read(vsg::Path, ..)
205223

206-
vsgXchange::assimp provides support for 69 extensions, and 0 protocols.
224+
vsg::Options::Value type
225+
------------------- ----
226+
quad_margin_ratio float
227+
texel_margin_ratio float
228+
229+
vsgXchange::assimp provides support for 70 extensions, and 0 protocols.
207230
Extensions Supported ReaderWriter methods
208231
---------- ------------------------------
209232
.3d read(vsg::Path, ..) read(std::istream, ..) read(uint8_t* ptr, size_t size, ..)
@@ -231,6 +254,7 @@ Options specific to a ReaderWriter are specified on the commandline using two da
231254
.hmp read(vsg::Path, ..) read(std::istream, ..) read(uint8_t* ptr, size_t size, ..)
232255
.ifc read(vsg::Path, ..) read(std::istream, ..) read(uint8_t* ptr, size_t size, ..)
233256
.ifczip read(vsg::Path, ..) read(std::istream, ..) read(uint8_t* ptr, size_t size, ..)
257+
.iqm read(vsg::Path, ..) read(std::istream, ..) read(uint8_t* ptr, size_t size, ..)
234258
.irr read(vsg::Path, ..) read(std::istream, ..) read(uint8_t* ptr, size_t size, ..)
235259
.irrmesh read(vsg::Path, ..) read(std::istream, ..) read(uint8_t* ptr, size_t size, ..)
236260
.lwo read(vsg::Path, ..) read(std::istream, ..) read(uint8_t* ptr, size_t size, ..)
@@ -279,15 +303,23 @@ Options specific to a ReaderWriter are specified on the commandline using two da
279303
vsg::Options::Value type
280304
------------------- ----
281305
crease_angle float
306+
culling bool
307+
discard_empty_nodes bool
308+
external_texture_format vsgXchange::TextureFormat
309+
external_textures bool
282310
generate_sharp_normals bool
283311
generate_smooth_normals bool
312+
material_color_space vsg::CoordinateSpace
313+
print_assimp int
284314
two_sided bool
315+
vertex_color_space vsg::CoordinateSpace
285316

286317
vsgXchange::GDAL provides support for 96 extensions, and 0 protocols.
287318
Extensions Supported ReaderWriter methods
288319
---------- ------------------------------
289320
.ACE2 read(vsg::Path, ..)
290321
.asc read(vsg::Path, ..)
322+
.b read(vsg::Path, ..)
291323
.bag read(vsg::Path, ..)
292324
.bil read(vsg::Path, ..)
293325
.bin read(vsg::Path, ..)
@@ -301,20 +333,19 @@ Options specific to a ReaderWriter are specified on the commandline using two da
301333
.dat read(vsg::Path, ..)
302334
.ddf read(vsg::Path, ..)
303335
.dem read(vsg::Path, ..)
304-
.dgrda read(vsg::Path, ..)
305336
.dt0 read(vsg::Path, ..)
306337
.dt1 read(vsg::Path, ..)
307338
.dt2 read(vsg::Path, ..)
308339
.dwg read(vsg::Path, ..)
309-
.e00 read(vsg::Path, ..)
310340
.err read(vsg::Path, ..)
311341
.ers read(vsg::Path, ..)
312342
.fits read(vsg::Path, ..)
343+
.gdb read(vsg::Path, ..)
313344
.gen read(vsg::Path, ..)
314345
.gff read(vsg::Path, ..)
315346
.gif read(vsg::Path, ..)
316347
.gpkg read(vsg::Path, ..)
317-
.gra read(vsg::Path, ..)
348+
.gpkg.zip read(vsg::Path, ..)
318349
.grb read(vsg::Path, ..)
319350
.grb2 read(vsg::Path, ..)
320351
.grc read(vsg::Path, ..)
@@ -334,10 +365,11 @@ Options specific to a ReaderWriter are specified on the commandline using two da
334365
.img read(vsg::Path, ..)
335366
.isg read(vsg::Path, ..)
336367
.j2k read(vsg::Path, ..)
337-
.jls read(vsg::Path, ..)
338368
.jp2 read(vsg::Path, ..)
339369
.jpeg read(vsg::Path, ..)
340370
.jpg read(vsg::Path, ..)
371+
.json read(vsg::Path, ..)
372+
.kap read(vsg::Path, ..)
341373
.kml read(vsg::Path, ..)
342374
.kmz read(vsg::Path, ..)
343375
.kro read(vsg::Path, ..)
@@ -346,7 +378,6 @@ Options specific to a ReaderWriter are specified on the commandline using two da
346378
.map read(vsg::Path, ..)
347379
.mbtiles read(vsg::Path, ..)
348380
.mem read(vsg::Path, ..)
349-
.mnt read(vsg::Path, ..)
350381
.mpl read(vsg::Path, ..)
351382
.mpr read(vsg::Path, ..)
352383
.mrf read(vsg::Path, ..)
@@ -376,23 +407,25 @@ Options specific to a ReaderWriter are specified on the commandline using two da
376407
.tif read(vsg::Path, ..)
377408
.tiff read(vsg::Path, ..)
378409
.toc read(vsg::Path, ..)
379-
.txt read(vsg::Path, ..)
410+
.tpkx read(vsg::Path, ..)
380411
.vrt read(vsg::Path, ..)
381412
.webp read(vsg::Path, ..)
382413
.xml read(vsg::Path, ..)
383414
.xpm read(vsg::Path, ..)
384415
.xyz read(vsg::Path, ..)
385416

386-
vsgXchange::OSG provides support for 115 extensions, and 0 protocols.
417+
osg2vsg::OSG provides support for 132 extensions, and 0 protocols.
387418
Extensions Supported ReaderWriter methods
388419
---------- ------------------------------
389420
.* read(vsg::Path, ..)
390421
.3dc read(vsg::Path, ..)
391422
.3ds read(vsg::Path, ..)
423+
.3gp read(vsg::Path, ..)
392424
.ac read(vsg::Path, ..)
393425
.added read(vsg::Path, ..)
394426
.asc read(vsg::Path, ..)
395427
.attr read(vsg::Path, ..)
428+
.avi read(vsg::Path, ..)
396429
.bmp read(vsg::Path, ..)
397430
.bvh read(vsg::Path, ..)
398431
.bw read(vsg::Path, ..)
@@ -405,8 +438,8 @@ Options specific to a ReaderWriter are specified on the commandline using two da
405438
.curl read(vsg::Path, ..)
406439
.dds read(vsg::Path, ..)
407440
.dxf read(vsg::Path, ..)
408-
.fbx read(vsg::Path, ..)
409441
.flt read(vsg::Path, ..)
442+
.flv read(vsg::Path, ..)
410443
.fnt read(vsg::Path, ..)
411444
.fon read(vsg::Path, ..)
412445
.frag read(vsg::Path, ..)
@@ -433,11 +466,20 @@ Options specific to a ReaderWriter are specified on the commandline using two da
433466
.lw read(vsg::Path, ..)
434467
.lwo read(vsg::Path, ..)
435468
.lws read(vsg::Path, ..)
469+
.m2ts read(vsg::Path, ..)
470+
.m4v read(vsg::Path, ..)
436471
.material read(vsg::Path, ..)
437472
.md2 read(vsg::Path, ..)
473+
.mjpeg read(vsg::Path, ..)
474+
.mkv read(vsg::Path, ..)
438475
.modified read(vsg::Path, ..)
476+
.mov read(vsg::Path, ..)
477+
.mp4 read(vsg::Path, ..)
478+
.mpg read(vsg::Path, ..)
479+
.mpv read(vsg::Path, ..)
439480
.normals read(vsg::Path, ..)
440481
.obj read(vsg::Path, ..)
482+
.ogg read(vsg::Path, ..)
441483
.ogr read(vsg::Path, ..)
442484
.osc read(vsg::Path, ..)
443485
.osg read(vsg::Path, ..)
@@ -473,7 +515,9 @@ Options specific to a ReaderWriter are specified on the commandline using two da
473515
.rgba read(vsg::Path, ..)
474516
.rot read(vsg::Path, ..)
475517
.rotation_path read(vsg::Path, ..)
518+
.sav read(vsg::Path, ..)
476519
.scale read(vsg::Path, ..)
520+
.sdp read(vsg::Path, ..)
477521
.sgi read(vsg::Path, ..)
478522
.shadow read(vsg::Path, ..)
479523
.shp read(vsg::Path, ..)
@@ -498,6 +542,10 @@ Options specific to a ReaderWriter are specified on the commandline using two da
498542
.vert read(vsg::Path, ..)
499543
.view read(vsg::Path, ..)
500544
.vs read(vsg::Path, ..)
545+
.vsga read(vsg::Path, ..)
546+
.vsgb read(vsg::Path, ..)
547+
.vsgt read(vsg::Path, ..)
548+
.wmv read(vsg::Path, ..)
501549
.woff read(vsg::Path, ..)
502550
.x read(vsg::Path, ..)
503551
.zip read(vsg::Path, ..)

include/vsgXchange/images.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ namespace vsgXchange
5454
bool getFeatures(Features& features) const override;
5555

5656
// vsg::Options::setValue(str, value) supported options:
57-
static constexpr const char* jpeg_quality = "jpeg_quality";
57+
static constexpr const char* jpeg_quality = "jpeg_quality"; /// set the int quality value when writing out to image as jpeg file.
58+
static constexpr const char* image_format = "image_format"; /// Override read image format (8bit RGB/RGBA default to sRGB) to be specified class of CoordinateSpace (sRGB or LINEAR).
5859

5960
bool readOptions(vsg::Options& options, vsg::CommandLine& arguments) const override;
6061

include/vsgXchange/models.h

+9-7
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,15 @@ namespace vsgXchange
5151
// vsg::Options::setValue(str, value) supported options:
5252
static constexpr const char* generate_smooth_normals = "generate_smooth_normals";
5353
static constexpr const char* generate_sharp_normals = "generate_sharp_normals";
54-
static constexpr const char* crease_angle = "crease_angle"; /// float
55-
static constexpr const char* two_sided = "two_sided"; /// bool
56-
static constexpr const char* discard_empty_nodes = "discard_empty_nodes"; /// bool
57-
static constexpr const char* print_assimp = "print_assimp"; /// int
58-
static constexpr const char* external_textures = "external_textures"; /// bool
59-
static constexpr const char* external_texture_format = "external_texture_format"; /// TextureFormat enum
60-
static constexpr const char* culling = "culling"; /// bool, insert cull nodes, defaults to true
54+
static constexpr const char* crease_angle = "crease_angle"; /// float
55+
static constexpr const char* two_sided = "two_sided"; /// bool
56+
static constexpr const char* discard_empty_nodes = "discard_empty_nodes"; /// bool
57+
static constexpr const char* print_assimp = "print_assimp"; /// int
58+
static constexpr const char* external_textures = "external_textures"; /// bool
59+
static constexpr const char* external_texture_format = "external_texture_format"; /// TextureFormat enum
60+
static constexpr const char* culling = "culling"; /// bool, insert cull nodes, defaults to true
61+
static constexpr const char* vertex_color_space = "vertex_color_space"; /// CoordinateSpace {sRGB or LINEAR} to assume when reading vertex colors
62+
static constexpr const char* material_color_space = "material_color_space"; /// CoordinateSpace {sRGB or LINEAR} to assume when reading materials colors
6163

6264
bool readOptions(vsg::Options& options, vsg::CommandLine& arguments) const override;
6365

0 commit comments

Comments
 (0)