OpenDCX

Deep Compositing Extended

OpenDCX 2.2.2 documentation

SpMask8

class SpMask8

An 8x8 A-buffer bitmask class which wraps a 64-bit unsigned int. It offers convenience methods for x/y bit access and translating to/from floats for I/O.

The 8x8 fixed size (64 grey values) is a compromise between per-sample memory use and providing enough resolution to resolve spatial alignments. A larger size such as 16x16 would consume 8 floats per sample vs. just 2 for 8x8, while still not providing enough resolution to perform precision transform filtering. To improve subpixel resolution the 8x8 mask can be used in conjunction with 8 additional bits in the DeepFlags class representing partial subpixel-coverage weight which allows each sample to represent 16384 grey values rather than just 64.

The pattern is spatially interpreted with the lowest bit 0 in the lower-left corner and the highest bit 63 in the upper-right corner and always oriented Y-up. This matches most current applications and renderers (c 2016) - even though OpenEXR’s pixel coordinate axis is Y-down:

     -------------------
  7  |56 . . . . . . 63|  +Y
  6  | . . . . . . . . |
  5  | . . . . . . . . |
  4  | . . . . . . . . |
  3  | . . . . . . . . |
  2  | . . . . . . . . |
  1  | . . . . . . . . |
  0  | 0 . . . . . . 7 |  -Y
     -------------------
-X     0 1 2 3 4 5 6 7    +X