Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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,
would specify a null file with resolution 640x480 and 3 channels. Token/value pairs accepted are
Along the way, I also made some tweaks to ImageInput::create() to correctly disassemble the RESTful filename to figure out the extension (and thus which II plugin to use, without having to try them all).