DD::Image::PlanarI Class Reference

Inherited by DD::Image::NukeWrapper [private], and DD::Image::PlanarIop.

List of all members.

Public Types

enum  PackedPreference { ePackedPreferenceNone, ePackedPreferencePacked, ePackedPreferenceUnpacked }
typedef ChannelSet PlaneID
typedef std::set< PlaneIDPlaneSet

Public Member Functions

virtual PackedPreference packedPreference () const =0
virtual size_t getStripeCount () const =0
virtual Box getStripeBox (int idx) const =0
virtual size_t rowToStripeIndex (int y) const =0
Box getOutputBox () const
PlanarI::PlaneID getRequestedPlaneFromChannel (Channel chan)
PlaneSet getAllPlanes (ChannelSet channelSet)
ChannelSet getAllChannels (ChannelSet channelSet)
virtual LocalPlaneCache * getCache ()
virtual bool stripesCanBeRenderedInParallel ()

Static Public Member Functions

static PlaneID GetPlaneFromChannel (Channel chan)

Protected Member Functions

virtual PlaneID getPlaneFromChannel (Channel chan)

Friends

class PlaneCacheI

Detailed Description

PlanarI is a mix-in class to be implemented by Iops which prefer to be accessed in a planar way (i.e. with fetchPlane)

It is not itself an Iop because the subclasses might want to inherit from some other subclass of Iop. However doing so will disable caching and is not recommended; for optimal perfomance always inherit from PlanarIop.


Member Function Documentation

virtual PackedPreference DD::Image::PlanarI::packedPreference ( ) const [pure virtual]

whether the Iop prefers to output packed or unpacked data. If the Iop is neutral it should return ePackedPreferenceNone and then the decision will be made on whether other criteria, such as what the downstream ops prefer to consume

Implemented in DD::Image::Read.

Referenced by DD::Image::GeneralTile::GeneralTile().

virtual size_t DD::Image::PlanarI::getStripeCount ( ) const [pure virtual]

get the number of blocks

Referenced by DD::Image::GeneralTile::GeneralTile(), and getOutputBox().

virtual Box DD::Image::PlanarI::getStripeBox ( int  idx) const [pure virtual]

get the size of box /idx/

Referenced by DD::Image::GeneralTile::GeneralTile(), and getOutputBox().

virtual size_t DD::Image::PlanarI::rowToStripeIndex ( int  y) const [pure virtual]

get the box number that row /y/ is in

Referenced by DD::Image::GeneralTile::at(), and DD::Image::GeneralTile::GeneralTile().

Box DD::Image::PlanarI::getOutputBox ( ) const

Return the full output box covered by the stripes.

Uses getStripeBox() and getStripeCount().

References getStripeBox(), getStripeCount(), and DD::Image::Box::merge().

PlanarI::PlaneID DD::Image::PlanarI::getRequestedPlaneFromChannel ( Channel  chan)

call getPlaneFromChannel() and then mask it versus the channels that have actually been requested.

It is possible for PlanarIs not to be Iops, which presents us with a difficulty. Let's just have single-channel planes for those, which will always be safe.

We need the requested channels, to make sure that the plane doesn't include any non-requested ones.

Some Ops are basically "pass-through" (have no out channels), and therefore the requested_channels() on them are not set. However, since they are pass-through we can use the requested channels of their input instead.

expand out the channels, so that R becomes RGBA, etc

except, we have to restrict this, so that we don't have RGBA if only RGB was requested: mask with the requested channels

References DD::Image::ChannelSet::contains(), getPlaneFromChannel(), DD::Image::Iop::input(), DD::Image::Iop::out_channels(), and DD::Image::Iop::requested_channels().

Referenced by getAllChannels(), and getAllPlanes().

PlanarI::PlaneID DD::Image::PlanarI::GetPlaneFromChannel ( Channel  chan) [static]

The default implementation of GetPlaneFromChannel; each nuke layer forms a separate plane.

Static for use in Reader::getPlaneFromChannel.

References DD::Image::ChannelSet::addBrothers(), DD::Image::Chan_DeepBack, DD::Image::Chan_Mask_PlanarTrack, and DD::Image::Chan_U.

Referenced by getPlaneFromChannel().

PlanarI::PlaneSet DD::Image::PlanarI::getAllPlanes ( ChannelSet  channelSet)

Get the set of channels which is the intersection between the channelSet passed in, the planes containing the channels in channelSet, and the channels that have been requested, as a PlaneSet.

References getRequestedPlaneFromChannel().

Referenced by DD::Image::GeneralTile::GeneralTile().

ChannelSet DD::Image::PlanarI::getAllChannels ( ChannelSet  channelSet)

Get the set of channels which is the intersection between the channelSet passed in, the planes containing the channels in channelSet, and the channels that have been requested

References getRequestedPlaneFromChannel().

LocalPlaneCache * DD::Image::PlanarI::getCache ( ) [virtual]

Access the cache for this Planar interface the default implementation returns NULL, implying no caching, which can be very slow.

Reimplemented in DD::Image::PlanarIop.

Referenced by DD::Image::GeneralTile::GeneralTile().

virtual bool DD::Image::PlanarI::stripesCanBeRenderedInParallel ( ) [inline, virtual]

Return whether or not the stripes can be rendered on multiple threads in parallel. If threading is done within the stripes, you should return false from this to avoid an explosion in the number of threads being used for the render.

In future, if you return true from this you might be asked to render multiple stripes at once on different threads. You should therefore take care that your rendering function (renderStripe, in the case of a PlanarIop) is thread-safe.

NOTE that this is provided for future compatibility only, and for the time being if you want guaranteed multi-threading you should implement it yourself within renderStripe and return false from this function.

PlanarI::PlaneID DD::Image::PlanarI::getPlaneFromChannel ( Channel  chan) [protected, virtual]

override this if you want your planes to be different to the default.

by default Nuke will call renderStripe()/doFetchPlane() once for each layer. You define its belief about what a 'layer' is here. for example, if you return info().channels(), it will render all your channels at once; if you return chan it will render each channel separately.

Reimplemented in DD::Image::Read.

References GetPlaneFromChannel().

Referenced by getRequestedPlaneFromChannel().