Nuke binary plugins 15.1.5
 
Loading...
Searching...
No Matches
DD::Image::DeepInPlaceOutputPlane Class Reference

#include <DeepPlane.h>

Inheritance diagram for DD::Image::DeepInPlaceOutputPlane:
DD::Image::DeepOutputPlane DD::Image::DeepPlane

Public Member Functions

 DeepInPlaceOutputPlane (DD::Image::ChannelSet channels, DD::Image::Box box, DeepPixel::Ordering ordering=DeepPixel::eUnordered)
 
void reserveSamples (size_t sampleCount)
 
void setSampleCount (int y, int x, size_t newSampleCount)
 
void setSampleCount (DD::Image::Box::iterator it, size_t newSampleCount)
 
DeepOutputPixel getPixel (const DD::Image::Box::iterator &it)
 
DeepOutputPixel getPixel (int y, int x)
 
void reviseSamples ()
 
bool isComplete () const
 
bool isInError () const
 
- Public Member Functions inherited from DD::Image::DeepOutputPlane
 DeepOutputPlane (DD::Image::ChannelSet channels, DD::Image::Box box, DeepPixel::Ordering ordering=DeepPixel::eUnordered)
 
void addHole ()
 
void addPixel (const DeepOutPixel &f)
 
void addPixel (const DeepPixel &f)
 
- Public Member Functions inherited from DD::Image::DeepPlane
 DeepPlane ()
 
 DeepPlane (const DeepPlane &)
 
void operator= (const DeepPlane &other)
 
 ~DeepPlane ()
 
const ChannelMapchannels () const
 
const DD::Image::Boxbox () const
 
DeepPixel::Ordering ordering () const
 
int pixels () const
 
int positionToOffset (int y, int x) const
 
DeepPixel getPixel (int y, int x) const
 
DeepPixel getPixel (DD::Image::Box::iterator it) const
 
bool covers (DD::Image::Box box, DD::Image::ChannelSet cs) const
 
bool covers (int y, int x) const
 
size_t memUsage () const
 
size_t getSampleCount (int y, int x) const
 
size_t getSampleCount (const DD::Image::Box::iterator &it) const
 
size_t getTotalSampleCount () const
 

Additional Inherited Members

- Protected Member Functions inherited from DD::Image::DeepPlane
 DeepPlane (DD::Image::ChannelSet channels, DD::Image::Box box, DeepPixel::Ordering ordering=DeepPixel::eUnordered)
 
size_t getPixelCount () const
 
- Protected Attributes inherited from DD::Image::DeepPlane
DD::Image::ChannelMap _channels
 
DD::Image::Box _box
 
DeepPixel::Ordering _ordering
 
DeepPlaneData * _sharedData
 

Detailed Description

DeepInPlaceOutputPlane is a subclass of DeepOutputPlane that allows the pixel data to be altered in place.

Pattern of use should be: create a DeepInPlaceOutputPlane with the required channels, box and ordering, and then call reserveSamples() to allocate storage for the samples then setSampleCount() and getPixel() at each position within that box from top left to bottom right (see Box::iterator). This results in a valid plane that can then be accessed with the accessor methods above.

Overallocated planes may be trimmed to size using reviseSamples(). setSampleCount() will increase the allocation if required but doing so is expensive.

Constructor & Destructor Documentation

◆ DeepInPlaceOutputPlane()

DD::Image::DeepInPlaceOutputPlane::DeepInPlaceOutputPlane ( DD::Image::ChannelSet  channels,
DD::Image::Box  box,
DeepPixel::Ordering  ordering = DeepPixel::eUnordered 
)

Create a new output plane

References DD::Image::DeepPlane::_box, and DD::Image::DeepPlane::_sharedData.

Member Function Documentation

◆ reserveSamples()

void DD::Image::DeepInPlaceOutputPlane::reserveSamples ( size_t  sampleCount)

reserve memory in DeepPlaneData for pixel sample data

References DD::Image::DeepPlane::_channels, DD::Image::DeepPlane::_sharedData, and DD::Image::ChannelMap::size().

◆ setSampleCount() [1/2]

void DD::Image::DeepInPlaceOutputPlane::setSampleCount ( int  y,
int  x,
size_t  newSampleCount 
)

set the newSampleCount amount of samples at pixel, Initialises Data for direct access

Note that sample counts should be set sequentially. setSampleCount() invalidates all pixels after (see Box::iterator) this pixel. After setting the sample count for a pixel all subsequent pixels are invalid. Their sample count and pixel data must be reset.

set the newSampleCount amount of samples at pixel 'it', Initialises Data for direct access

References DD::Image::DeepPlane::_box, DD::Image::DeepPlane::_channels, DD::Image::DeepPlane::_sharedData, DD::Image::Box::r(), DD::Image::ChannelMap::size(), DD::Image::Box::t(), DD::Image::Box::x(), and DD::Image::Box::y().

◆ setSampleCount() [2/2]

void DD::Image::DeepInPlaceOutputPlane::setSampleCount ( DD::Image::Box::iterator  it,
size_t  newSampleCount 
)
inline

set the newSampleCount amount of samples at pixel 'it', Initialises Data for direct access

Note that sample counts should be set sequentially. setSampleCount() invalidates all pixels after (see Box::iterator) this pixel. After setting the sample count for a pixel all subsequent pixels are invalid. Their sample count and pixel data must be reset.

◆ getPixel() [1/2]

DeepOutputPixel DD::Image::DeepInPlaceOutputPlane::getPixel ( const DD::Image::Box::iterator &  it)
inline

get a modifiable pixel, at 'it'

Note that this data is only valid after the sample count has been set using setSampleCount().

◆ getPixel() [2/2]

DeepOutputPixel DD::Image::DeepInPlaceOutputPlane::getPixel ( int  y,
int  x 
)

◆ reviseSamples()

void DD::Image::DeepInPlaceOutputPlane::reviseSamples ( void  )

Reduces overallocated data.

References DD::Image::DeepPlane::_sharedData.

◆ isComplete()

bool DD::Image::DeepInPlaceOutputPlane::isComplete ( ) const

Low overhead verification of a complete plane.

References DD::Image::DeepPlane::_box, and isInError().

◆ isInError()

bool DD::Image::DeepInPlaceOutputPlane::isInError ( ) const
inline

Error checking to debug invalid use.

Referenced by isComplete().



©2024 The Foundry Visionmongers, Ltd. All Rights Reserved.
www.foundry.com