Skip to content

Commit 27e0d83

Browse files
committed
null image input & output
This I/O plugin for "null" images are a file "format" where output of a null file does nothing at all (no I/O, not even any data copying), and input of a null file just fills the result buffers with black pixels (0 values), with no I/O or data copying. What's this good for? * Benchmarking, if you want to have OIIO's input or output truly take as close to no time whatsoever. * "Dry run" of applications where you don't want it to produce any real output (akin to a Unix command that you redirect output to /dev/null). * Make "fake" input that looks like a file, but the file doesn't exist (if you are happy with constant-colored pixels). The filename allows a REST-ful syntax, where you can append little doodads that specify things like resolution (of the non-existent file), etc. For example, foo.null?RES=640x480&CHANNELS=3 would specify a null file with resolution 640x480 and 3 channels. Token/value pairs accepted are RES=1024x1024 set resolution (3D example: 256x256x100) CHANNELS=4 set number of channels TILES=64x64 makes it look like a tiled image with tile size TYPE=uint8 set the pixel data type PIXEL=r,g,b,... set pixel values (comma separates channel values) TEX=1 make it look like a full MIP-mapped texture attrib=value anything else will set metadata!
1 parent 890e4c3 commit 27e0d83

File tree

6 files changed

+412
-1
lines changed

6 files changed

+412
-1
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ oiio_add_tests (
237237
dither dup-channels
238238
dpx ico iff
239239
jpeg-corrupt-exif
240-
png
240+
null png
241241
psd psd-colormodes
242242
rla sgi
243243
rational

src/libOpenImageIO/imageioplugin.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,7 @@ catalog_plugin (const std::string &format_name,
243243
PLUGENTRY (iff);
244244
PLUGENTRY (jpeg);
245245
PLUGENTRY (jpeg2000);
246+
PLUGENTRY (null);
246247
PLUGENTRY (openexr);
247248
PLUGENTRY (png);
248249
PLUGENTRY (pnm);
@@ -311,6 +312,7 @@ catalog_builtin_plugins ()
311312
#ifdef USE_OPENJPEG
312313
DECLAREPLUG (jpeg2000);
313314
#endif
315+
DECLAREPLUG (null);
314316
DECLAREPLUG (openexr);
315317
DECLAREPLUG (png);
316318
DECLAREPLUG (pnm);

src/null.imageio/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
add_oiio_plugin (nullimageio.cpp)

0 commit comments

Comments
 (0)