DD::Image::DeepOp Class Reference

Inherits DD::Image::ConvertibleToIop.

Inherited by DD::Image::DeepOnlyOp, and DD::Image::MetaDataOp.

List of all members.

Public Member Functions

virtual Opop ()=0
const DeepInfodeepInfo () const
void validate (bool forReal)
void deepRequest (DD::Image::Box box, const DD::Image::ChannelSet &channels, int count=1)
bool deepEngine (DD::Image::Box box, const DD::Image::ChannelSet &channels, DeepPlane &plane)
bool deepEngine (int y, int x, int r, const DD::Image::ChannelSet &channels, DeepPlane &plane)
void fillCache ()
bool fillCache (bool cancellable, Op::PrevalidateResult *cancelReason)
virtual const char * conversionHelperNodeClass () const
const FormatconvertibleFormat () const

Static Public Member Functions

static const char * DeepNodeShape ()
 return the node shape to be used by Deep & related operators

Protected Member Functions

virtual bool doDeepEngine (DD::Image::Box box, const DD::Image::ChannelSet &channels, DeepOutputPlane &plane)=0
virtual void getDeepRequests (DD::Image::Box box, const DD::Image::ChannelSet &channels, int count, std::vector< RequestData > &reqData)=0
virtual void _validate (bool forReal)=0

Protected Attributes

DeepInfo _deepInfo

Detailed Description

Deep Operator interface.

This is analogous to Iop, except that rows are replaced with deepdata tiles (DeepPlane). Subclasses need to implement three phases

_validate, which should fill in the _deepInfo

getDeepRequests(), which should calculate the region of interest and channels needed on the inputs given a region of interest and channels requested on the deep op.

doDeepEngine(), which should do the actual calculation.

Is an interface so that there can be dual DeepOp/Iops.


Member Function Documentation

virtual bool DD::Image::DeepOp::doDeepEngine ( DD::Image::Box  box,
const DD::Image::ChannelSet channels,
DeepOutputPlane plane 
) [protected, pure virtual]

Calculate the actual deep image data for the given box and channels, and place it in plane. Plane is not yet initialised, and the implementation should fill it in. It is permitted to return a plane which is larger or has more channels than the specified area. Also, it permitted to not assign plane at all, in which case an empty (0-sample) plane will be returned to the caller.

Returns false if processing was halted due to an abort.

Referenced by deepEngine().

virtual void DD::Image::DeepOp::getDeepRequests ( DD::Image::Box  box,
const DD::Image::ChannelSet channels,
int  count,
std::vector< RequestData > &  reqData 
) [protected, pure virtual]

rather then have a DeepOp::_request() function that recursively calls request() on its inputs, this function, the DeepOp version of _request, should place the regions to be requested into the vector passed in. This will be used for more complex render management in future.

Implementations of this function should have no side-effects other than filling in reqData.

Implemented in DD::Image::DeepFilterOp.

Referenced by deepRequest().

virtual void DD::Image::DeepOp::_validate ( bool  forReal) [protected, pure virtual]

Validate the op, which should result in a valid bbox and channelset being placed in _deepInfo. n.b. if you are an Iop you should make sure to call the Iop::_validate function too. If you copy your deepInfo from an input, call Op::validate on that input.

The forReal parameter specifies whether exact information is required. If forReal is false, then it is permitted to not open the file to find out what bbox/channels are present, and rely on expected values from knobs.

Implemented in DD::Image::DeepFilterOp.

virtual Op* DD::Image::DeepOp::op ( ) [pure virtual]

Return the actual Op that this DeepOp interface is on. Implementations should just "return this;"

Referenced by deepEngine(), and deepRequest().

const DeepInfo& DD::Image::DeepOp::deepInfo ( ) const [inline]

Get the current info (bbox/channelset)

void DD::Image::DeepOp::validate ( bool  forReal) [inline]

Validate the op, setting the DeepInfo as a side-effect.

void DD::Image::DeepOp::deepRequest ( DD::Image::Box  box,
const DD::Image::ChannelSet channels,
int  count = 1 
)

Request a given area. This should only be used by code requesting deep data for conversion into some other form: getDeepRequests() should be used for the requests of deep data or Iop data by deep nodes.

References _deepInfo, DD::Image::DeepInfo::channels(), getDeepRequests(), DD::Image::Op::hash(), DD::Image::Box::merge(), and op().

bool DD::Image::DeepOp::deepEngine ( DD::Image::Box  box,
const DD::Image::ChannelSet channels,
DeepPlane plane 
)
bool DD::Image::DeepOp::deepEngine ( int  y,
int  x,
int  r,
const DD::Image::ChannelSet channels,
DeepPlane plane 
) [inline]

Get a given row

Returns false if processing was halted due to an abort.

void DD::Image::DeepOp::fillCache ( )

This pre-fills the cache, spawning threads to do its work. Only call this if you are in the main thread, or have a lock against the other threads.

bool DD::Image::DeepOp::fillCache ( bool  cancellable,
Op::PrevalidateResult cancelReason 
)

This pre-fills the cache, spawning threads to do its work. Only call this if you are in the main thread, or have a lock against the other threads.

If you want the code to pop up a cancellable non-modal progress dialog, set /cancellable/ to true, and then the function will return false if cancelled or aborted, cancelReason (if specified) will be set to either eAborted or eCancelled, depending upon what happened.


Member Data Documentation

The deep info. Analogous to Iop::info_, but rather simpler at present, consisting only of a channelset and a bounding box.

Referenced by deepEngine(), and deepRequest().