This adds saving and loading tests for our supported image formats.
**Saving - bf_imbuf_save.py**
There are 2 template images which are loaded anew for each file save
attempt. One is an 8-bit RGBA image and the other 32-bit. This is
required as many formats use a variety of factors to determine which of
`ibuf->rect` or `ibuf->rectfloat` to use for processing. The templates
are constructed to have alpha transparency as well as values > 1 (or
clamped to 1 for the case of the 8-bit template).
Test flow:
- Load in an appropriate template image
- Save it to the desired format with the desired set of options
- Compare against the reference image
Notes:
- 98 references are used totaling ~3.6MB
- 10-12 second test runtime
- Templates can be reconstructed with the create-templates.blend file
**Loading - bf_imbuf_load.py**
Test flow:
- Load in each of the reference images
- Save them back out as .exr
- Save additional metadata to a secondary file (alpha mode, colorspace etc)
- Compare the saved out .exr with another set of reference .exrs
- Compare the save out file metadata with set of reference metadata
Notes:
- 98 exr references are used totaling ~10MB
- 10-12 second test runtime as well
A HTML report is not implemented. The diff output organization is very
similar to the other tests so it should be somewhat easy to do in the
future if we want.
The standard set of environment variables are implemented for both:
BLENDER_TEST_UPDATE, BLENDER_VERBOSE, and BLENDER_TEST_COLOR
----
There's a variety of images which are probably "incorrect" with current master.
Their reference comparisons will pass, so the tests won't fail, but they look incorrect in Blender or other software.
I believe most/all of these images will be corrected once OIIO is used for saving/loading.
In the provided SVN zip file, check the following for some examples:
reference/png-bw-16-25__from__rgba32.png --> color shift compared to other BW variants
reference/dpx-rgb-08-false__from__rgba08.dpx --> too dark
reference/dpx-*-true*.dpx --> broken alpha? (these have use_cineon_log = True)
Differential Revision: https://developer.blender.org/D16657