OpenDCX

Deep Compositing Extended

OpenDCX 2.2.2 documentation

PixelTile

class PixelTile

Abstract class to manage a rectangular region of pixels.

This class is intended for simplifing common pixel-region loops that step from pixel to pixel processing multiple channels simultaneously, vs. using the IlmImfUtil classes which appear organized more for per-plane processing and targeted primarily for texture use.

PixelTile::PixelTile(ChannelContext &channel_ctx, bool yAxisUp = true)

Must provide a ChannelContext at a minimum. When sharing pixel data between multiple PixelTiles they must share the same global ChannelContext to make sure the ChannelIdx’s align. Data and display windows are set to invalid value [0 0 -1 -1]

PixelTile::PixelTile(const OPENEXR_IMF_NAMESPACE::Header&, ChannelContext &channel_ctx, bool yAxisUp = true)

Build from an exr header. This will search for PixelTile related attributes like formatName, apertureWindow, originalDisplayWindow, etc. If those are missing it assigns intuitive defaults (apertureWindow=displayWindow, pa=1.0)

PixelTile::PixelTile(const IMATH_NAMESPACE::Box2i &data_window, const IMATH_NAMESPACE::Box2i &display_window, bool sourceWindowsYAxisUp, const ChannelSet &channels, ChannelContext &channel_ctx, bool yAxisUp = true)

Assigns resolution and channel set. The set of ChannelAliases is used to construct a map of ChannelIdx’s to ChannelAliases. If multiple input ChannelAliases have the same ChannelIdx destination only the first one is accepted and the others are ignored.

display_window is only used to set the window-top reference.

bool yAxisUp() const

Are the data/display windows coordinates Y-up? If true pixel access methods with Y-coordinate args are interpreted as Y-up.

This is intended to help ease the translation of coordinates between most modern applications which use Y-up and OpenEXR which is Y-down.

const IMATH_NAMESPACE::Box2i &PixelTile::dataWindow() const
dataWindow: Bbox of active pixel area - * possibly flipped in Y! *
Check yAxisUp() for direction. Requires a window-top reference, normally taken from display window args to ctors.
virtual void PixelTile::setDataWindow(const IMATH_NAMESPACE::Box2i &data_window, bool sourceWindowYAxisUp = true)

Change the active data window. Virtual so that subclasses can reallocate memory, etc.

const Dcx::ChannelSet &PixelTile::channels() const

Global ChannelSet for tile.

virtual void PixelTile::setChannels(const ChannelSet&)

Assign the active ChannelSet. Virtual so that subclasses can reallocate memory, etc.

size_t PixelTile::numChannels() const

Number of color/aov channels in the ChannelSet.

const ChannelContext *PixelTile::channelContext() const

Global ChannelContext assigned to this tile. Use this to access available ChannelAliases.

const ChannelAlias *getChannelAlias(ChannelIdx) const

Return a ChannelAlias pointer corresponding to a ChannelIdx.

bool PixelTile::isActivePixel(int x, int y) const

Returns true if pixel x,y is inside data window.

PixelTile::PixelTile(const PixelTile&)

Copy constructor only for subclasses.