Public Member Functions | |
ImagePlane (const DD::Image::Box &bounds, bool packed, DD::Image::ChannelSet mask, int nComps) | |
Construct based upon bounds, packedness, mask and number of compenents. | |
ImagePlane (const ImagePlaneDescriptor &ipd) | |
Construct based upon a descriptor. | |
ImagePlane (const DD::Image::Box &bounds) | |
Construct based upon BBox. | |
float * | writable () |
const float * | readable () const |
void | copyIntersectionFrom (const ImagePlane &other) |
int | chanNo (Channel z) const |
const float & | at (int x, int y, int z) const |
Get a reference to the data at (x, y) with the channel number /z/. | |
float & | writableAt (int x, int y, int z) |
Get a reference to the data at (x, y) with the channel number /z/. | |
ImageTilePtr | writableAt (int y, int z) |
ImageTileReadOnlyPtr | readableAt (int y, int z) const |
int | colStride () const |
int | rowStride () const |
int | chanStride () const |
size_t | usage () const |
void | clear () |
Protected Member Functions | |
RefCountedFloatBuffer | buffer (int x, int y) const |
The data is a reference-counted float buffer consisting of contiguous pixel data for the defined bounding box and channels.
This is a relatively low-level class intended for code that interfaces with external code and has to operate in a particular. More complex mechanisms can be built upon this.
float* DD::Image::ImagePlane::writable | ( | ) | [inline] |
Allocate data if needed and return a non-const pointer to it. The pointer is to element (x, y, z), where x = bounds().x(), y = bounds().y() and z is the lowest Channel in channels()
References DD::Image::RefCountedFloatBuffer::allocate().
Referenced by DD::Image::Iop::doFetchPlane().
const float* DD::Image::ImagePlane::readable | ( | ) | const [inline] |
Return a non-const pointer to the data. The pointer is to element (x, y, z), where x = bounds().x(), y = bounds().y() and z is the lowest Channel in channels()
void DD::Image::ImagePlane::copyIntersectionFrom | ( | const ImagePlane & | other | ) |
Copy the intersection in channels and bbox from the other plane to this one in the most efficient way possible. Note that this may involve a pointer copy rather than a memory copy if the intersection is a subset of the other plane (or identical to it).
Allocates memory if needed, is (and preferred) valid to call it without having called writable().
References DD::Image::ImagePlaneDescriptor::_bounds, _data, DD::Image::ImagePlaneDescriptor::_mask, DD::Image::ImagePlaneDescriptor::_nComps, DD::Image::ImagePlaneDescriptor::_packed, buffer(), DD::Image::Box::r(), DD::Image::ChannelSet::size(), DD::Image::Box::t(), DD::Image::Box::x(), and DD::Image::Box::y().
int DD::Image::ImagePlane::chanNo | ( | Channel | z | ) | const [inline] |
Find out the index within this plane for the given Channel. E.g. a Mask_RGBA plane will have Chan_Red = 0, Chan_Green = 1, Chan_Blue = 2, Chan_Alpha = 3, but a Mask_Green | Mask_Alpha plane will have Chan_Green = 0 and Chan_Alpha = 1.
Returns -1 if the channel is not present. This is the value that is passed as the last parameter of at() and would be multiplied by the chanStride().
int DD::Image::ImagePlane::colStride | ( | ) | const [inline] |
Get the stride between columns. Is the number of channels for packed planes. For unpacked planes is 1.
int DD::Image::ImagePlane::rowStride | ( | ) | const [inline] |
Return the stride between rows. Is the number of channels times the width for packed planes. For unpacked planes is the width.
int DD::Image::ImagePlane::chanStride | ( | ) | const [inline] |
Return the stride between channels. Is 1 for packed planes. For unpacked planes is the width times the height.
©2009 The Foundry Visionmongers, Ltd. All Rights Reserved. |