OpenDCX

Deep Compositing Extended

OpenDCX 2.2.2 documentation

Pixel

class Pixel

Contains a fixed-size array of data and a ChannelSet defining the active channels.

Intentionally similar to Nuke’s DD::Image::Pixel class.

NOTE: This class is solely intended for use in image processing algorithms and not for multi-pixel data storage (ex. a line or tile’s worth.)

(TODO: is it worth it to change this class to a packed channel array? Likely not
as managing the data packing/unpacking may be far more trouble than it’s worth)
Pixel::Pixel()

Channel mask is empty, leaves junk in channels

Pixel::Pixel(const ChannelSet&)

Assigns channel mask but leaves junk in channels

Pixel::Pixel(const ChannelSet&, T val)

Assigns channel mask and sets enabled channels to a single value

Pixel::Pixel(const Pixel&)

Copy constructor

void Pixel::erase()

Set channels to zero (black)

void Pixel::replace(const Pixel&)

Replace values in channels

T *array()

Pointer to beginning of channel data array

T &Pixel::operator[](ChannelIdx)

Channel access

Pixel &Pixel::operator=(const Pixel&)

Assignment

Pixel Pixel::operator*(const Pixel&) const

Multiply

Pixel Pixel::operator/(const Pixel&) const

Divide

Pixel Pixel::operator+(const Pixel&) const

Addition

Pixel Pixel::operator-(const Pixel&) const

Subtraction

void Pixel::print(std::ostream&, const char *prefix, int precision = 6, const ChannelSet &channels = Mask_All) const

Print values