dif


Deep Image File Format

Deep Image file format allows you to handle, store and manipulate pixels with additional Z samples. It now uses Field3D and save/loads the data through Sparse Fields.

``` using namespace Field3D;

DifImage img(V2i(650, 480));

unsigned int r, g, b, a; /* Channel indices */

img.addChannel("r", r); img.addChannel("g", g); img.addChannel("b", b); img.addChannel("a", a);

// Optimal for speedup see SpeedIssues page img.addDepth(3.2f); img.addDepth(3.4f);

float data[4] = {1.0f, 2.0f, 3.0f, 1.0f};

// Write the data to depth 3.2f on Position 0 x 0 img.writeData(V2i(0, 0), 3.2f, data);

// Read the red channel's value at depth 3.2f on Position 0 x 0 float rval; img.readChannelData(r, V2i(0, 0), 3.2f, rval);

``` Note: Version 1.3 is out and has a significant speedup see SpeedIssues.

Note: There was a small error in Version 1.0 which caused the data to be written in reverse order to the actual channel order. Version 1.2 now stores the channel order to fix that issue.

Project Information

Labels:
deep image file format VFX pixel C API