OpenDCX

Deep Compositing Extended

OpenDCX 2.2.2 documentation

ChannelAlias

class ChannelAlias

ChannelContext stores a list of these structures to map channel names to channel indices and vice-versa.

There should be one of these for every available ChannelIdx that can be accessed by a ChannelSet. There can be ChannelAliases in multiple ChannelLayers that point to the same ChannelIdx, but there’s always a single global list of ChannelIdx’s.

This allows channels from multiple Parts & files to have different names (aliases) but still align for compositing operations. Ex.’rgb’ and ‘rgba’ layers both refer to the same Chan_R/Chan_G/Chan_B ChannelIdx’s, but ‘rgba’ also includes Chan_A.

Nested layers are informally supported by always considering the last period ‘.’ in the channel name to be the layer/channel separator, so the layer name can have multiple separators describing the nesting. ex. beauty.diffuse.R

ChannelAlias::ChannelAlias(const char *name, const char *layer, ChannelIdx channel, uint32_t position, const char *io_name, OPENEXR_IMF_NAMESPACE::PixelType io_type, int io_part = 0)

Construct a layer/channel alias.

  • name - user-facing name, not including the layer (‘R’, ‘G’, ‘red’,
    green’, ‘alpha’, ‘Z’, etc)
  • layer - user-facing layer name (‘rgba’, ‘beauty’, ‘beauty.diffuse’)
  • channel - global ChannelIdx
  • position - sorted position index within layer (i.e. 0,1,2)
  • io_name - name of channel for file I/O (‘R’ or ‘AR’ vs. ‘rgba.red’
    or ‘opacity.R’)
  • io_type - PixelType to use for file I/O
  • io_part - Part index the channel writes to (TODO: finish support of this)
ChannelIdx ChannelAlias::channel() const

The absolute ChannelIdx the alias points to.

const std::string &ChannelAlias::name() const

Get the channel, layer, or concatenated <layer>.<channel> name

std::string ChannelAlias::fileIOName() const
Default name used in for file I/O
ex. ‘R’ vs. ‘rgba.red’

If this channel is not one of the predefined ones this will be the same as fullName()

int ChannelAlias::layerPosition() const

The index position of the channel inside the layer, allowing channels to be grouped logically by their function.

ex. R,G,B,A vs. A,B,G,R
S,T,P,Q vs. P,Q,S,T
OPENEXR_IMF_NAMESPACE::PixelType ChannelAlias::fileIOPixelType() const

Default pixel data type to use when reading/writing to files

int ChannelAlias::fileIOPartIndex() const

Default Part index to use when reading/writing to files

bool ChannelAlias::operator==(const ChannelAlias&) const

Equality operator compares ChannelIdx.

bool ChannelAlias::operator<(const ChannelAlias &b) const

Used by the sort routine, compares on position

friend std::ostream &ChannelAlias::operator<<(std::ostream&, const ChannelAlias&)

Outputs the full name of the alias to the stream.

ChannelAlias::ChannelAlias(const ChannelAlias&)

Disabled copy constructor / operator