HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
IMX_Buffer Class Reference

#include <IMX_Buffer.h>

+ Inheritance diagram for IMX_Buffer:

Public Member Functions

 IMX_Buffer ()
 Creates a new buffer. You must call setSize to make this buffer usable. More...
 
 IMX_Buffer (int width, int height, CE_Image::StorageType storage, int channels)
 Create and call setSize. More...
 
 IMX_Buffer (const IMX_Buffer &other)
 
 IMX_Buffer (IMX_Buffer &&other) noexcept
 
 IMX_Buffer (const PXL_Raster &rp)
 
 ~IMX_Buffer () override
 
EntryType poolTypeID () const override
 
void copyMetadata (const IMX_Buffer &source)
 
void copyStorageType (const IMX_Buffer &i)
 Set storesIntegers, isFixedPoint, bytes, channels. More...
 
void setStorageType (CE_Image::StorageType storage, int channels)
 Set storesIntegers, isFixedPoint, bytes, channels. More...
 
void setStorageType (CE_Image::StorageType storage)
 Set storesIntegers, isFixedPoint, bytes. More...
 
void setStorageBytes (int)
 
void setStorageBytes (int, bool)
 
void setChannels (int channels)
 Set channels, don't change storesIntegers, isFixedPoint, or bytes. More...
 
CE_Image::StorageType getStorageType () const
 Get the data type used to store pixel data for each channel. More...
 
bool storesIntegers () const
 Does this buffer store integers? More...
 
bool isFixedPoint () const
 Does this buffer use fixed point to store non-integer data? More...
 
int getChannels () const
 Get the number of channels per pixel. More...
 
int getStorageBytes () const
 Number of bytes per channel. More...
 
void setBufferSize (int width, int height)
 Sets size of this buffer. More...
 
exint bufferWidth () const
 Get width (number of columns in a row) of the buffer. More...
 
exint bufferHeight () const
 Get height (number of rows) of the buffer. More...
 
int64 getBufferSize () const
 Returns the number of bytes required to store the entire buffer. More...
 
void setBufferXforms (const UT_Vector2F &buffer_to_image_scale, const UT_Vector2F &buffer_to_image_xlate, const UT_Vector2F &buffer_from_image_scale, const UT_Vector2F &buffer_from_image_xlate, const UT_Vector2F &buffer_to_pixel_scale, const UT_Vector2F &buffer_to_pixel_xlate, const UT_Matrix4F &image_to_world, const UT_Matrix4F &world_to_image, const UT_Matrix4F &camera_to_world, const UT_Vector3F &camera_image_pos)
 Set transform between image and buffer space. More...
 
void setBorder (IMX_BorderType border)
 Sets the border type of this image. Constant means it is zero. More...
 
IMX_BorderType getBorderType () const
 Returns type of the border. More...
 
void setTypeInfo (IMX_TypeInfo typeinfo)
 Sets the semantic type info of this image. More...
 
IMX_TypeInfo getTypeInfo () const
 Returns the semantic type. More...
 
void setStatProjection (IMX_Projection projection)
 
IMX_Projection statProjection () const
 Returns the projection type. More...
 
void setDefaultColor (const UT_Vector4F &)
 
UT_Vector4F getDefaultColor () const
 
UT_Vector4I getDefaultColorI () const
 return the current integer value, which might be different More...
 
void copy (const IMX_Buffer &other)
 
IMX_Bufferoperator= (const IMX_Buffer &other)
 
void deepCopy (const IMX_Buffer &other)
 
void swap (IMX_Buffer &other)
 
IMX_Bufferoperator= (IMX_Buffer &&other)
 
bool stealable () const
 
void setStealable (bool v) const
 
bool isAligned (const IMX_Buffer &src) const
 True if the buffer pixels line up: width and the transforms from image space match. More...
 
void copyBuffer (const IMX_Buffer &other)
 Only copy the buffer pointers, the stat data is left unchanged. More...
 
void moveBuffer (IMX_Buffer &src)
 Move the buffer to this from src, src is left dirty. More...
 
void makeBufferUnique ()
 
void adoptRaster (PXL_Raster &raster, bool convert_colorspace)
 
void copyOrConvert (const IMX_Buffer &other)
 
bool extract (void *dst, exint dstsize, CE_Image::StorageType dststorage, int dstchannels) const
 
bool insert (const void *src, exint srcsize, CE_Image::StorageType srcstorage, int srcchannels)
 
UT_UniquePtr< TIL_RasterbuildRaster () const
 
const UT_SharedPtr
< CE_BufferHostByte > & 
CPUBufferPtr () const
 for debugging More...
 
const UT_SharedPtr< CE_Image > & GPUBufferPtr () const
 
void setPixelV4 (int x, int y, const UT_Vector4F &c)
 Sets an individual pixel. More...
 
void setPixelF (int x, int y, fpreal32 i)
 
void setPixelI (int x, int y, int i)
 
UT_Vector4F getPixelV4 (int x, int y) const
 Fetches the value of an individual pixel. More...
 
int getPixelI (int x, int y) const
 
UT_Vector4F getPixelV4 (fpreal64 x, fpreal64 y) const
 
void getPixelRaw (UT_Array< uint8 > &dest, int x, int y) const
 
const int16getCPUBufferRFixed16 () const
 
int16getCPUBufferWFixed16 ()
 
const uint8getCPUBufferRFixed8 () const
 
uint8getCPUBufferWFixed8 ()
 
const fpreal16getCPUBufferRF16 () const
 
fpreal16getCPUBufferWF16 ()
 
const fpreal32getCPUBufferRF32 () const
 
fpreal32getCPUBufferWF32 ()
 
const unsigned char * getCPUBufferRI8 () const
 
unsigned char * getCPUBufferWI8 ()
 
const int16getCPUBufferRI16 () const
 
int16getCPUBufferWI16 ()
 
const int32getCPUBufferRI32 () const
 
int32getCPUBufferWI32 ()
 
voidgetCPUBuffer (bool read, bool write)
 
voidgetCPUBufferR () const
 
voidgetCPUBufferW ()
 
template<CE_Image::StorageType STORAGE>
const CE_StorageTypeTraits
< STORAGE >::DataType * 
getCPUBufferR () const
 
template<CE_Image::StorageType STORAGE>
CE_StorageTypeTraits< STORAGE >
::DataType * 
getCPUBuffer (bool read, bool write)
 
CE_ImagegetGPUBuffer (bool read, bool write)
 
const CE_ImagegetGPUBufferR () const
 
CE_ImagegetGPUBufferW ()
 
bool isOnGPU () const
 Returns true if this buffer's data is currently on the GPU. More...
 
bool isOnCPU () const
 
cl::Buffer getGPUStat () const
 
bool isDirty () const
 False if there are computed pixels in the CPU or GPU buffer. More...
 
void freeBuffers ()
 Frees the pixel memory (also does setDirty()) More...
 
void destroy ()
 Frees all the memory used by buffer. More...
 
bool allocated () const
 True if getCPU/GPUBuffer has been done since last freeBuffers() More...
 
void setConstantV4 (const UT_Vector4F &i)
 
void setConstantV3 (const UT_Vector3F &i)
 
void setConstantF (fpreal32 i=0.0f)
 
void setConstantI (int32 i=0)
 
void setUninitialized ()
 
bool isConstant () const
 
bool validateBuffer () const
 
template<typename T >
void matchAndCopyToVoxels (UT_VoxelArray< T > &dest) const
 
int64 getMemoryUsage () const
 
int64 getDeviceMemoryUsage () const
 
- Public Member Functions inherited from IMX_PoolEntry
 IMX_PoolEntry ()
 Creates a new buffer. You must call setSize to make this buffer usable. More...
 
virtual ~IMX_PoolEntry ()
 
 IMX_PoolEntry (const IMX_PoolEntry &)=delete
 
IMX_PoolEntryoperator= (const IMX_PoolEntry &)=delete
 
bool isInUseGPU () const
 
void setInUseGPUFlag () const
 
void clearInUseGPUFlag () const
 

Protected Member Functions

void poolResetGPUBuffer () override
 These implement methods required by the pool. More...
 
void poolSetOnGPU (bool ongpu) override
 Update OnGPU. More...
 
bool poolIsGPUBufferEmpty () const override
 True if the gpu buffer is null. More...
 
bool poolIsGPUBufferValid () const override
 True if the gpu buffer is not null and valid. More...
 
bool poolSwapGPUBuffer (IMX_PoolEntry *otherbase) override
 True if the swap does something. More...
 
void poolShallowCopyGPUBuffer (const IMX_PoolEntry *srcbase) override
 Shallow copy. More...
 

Friends

class IMX_Layer
 
class IMX_CEMemoryPool
 

Additional Inherited Members

- Public Types inherited from IMX_PoolEntry
enum  EntryType { EntryType::BUFFER = 0, EntryType::VDB }
 To avoid the need for dynamic casts: More...
 
- Protected Attributes inherited from IMX_PoolEntry
int myGPUInUseCount = 0
 

Detailed Description

The per-pixel data for a single IMX_Layer

Buffer has several formats to store data in, for instance whether it is on the GPU or CPU. Buffers are converted by copying, or snippets are used to change the OpenCL code reading them. As some translators can work in-place, the format is considered a setting of the Buffer, rather than having different Buffer subclasses for each format.

This is a first working version of such a buffer, though it's missing a lot of features. There's only one supported format (32-bit float), between 1 and 4 channels. This is stored in an array, flattened over the rows first. There is also GPU storage that this buffer uses. States of these buffers (i.e. do they contain up-to-date information?) are encoded in the two boolean flags (myOnCPU and myOnGPU). When the user asks IMX_Buffer something that must access its storage, that storage is first automatically synchronized before the request is fulfilled.

Definition at line 133 of file IMX_Buffer.h.

Constructor & Destructor Documentation

IMX_Buffer::IMX_Buffer ( )

Creates a new buffer. You must call setSize to make this buffer usable.

IMX_Buffer::IMX_Buffer ( int  width,
int  height,
CE_Image::StorageType  storage,
int  channels 
)

Create and call setSize.

IMX_Buffer::IMX_Buffer ( const IMX_Buffer other)
inline

Definition at line 141 of file IMX_Buffer.h.

IMX_Buffer::IMX_Buffer ( IMX_Buffer &&  other)
inlinenoexcept

Definition at line 142 of file IMX_Buffer.h.

IMX_Buffer::IMX_Buffer ( const PXL_Raster rp)
IMX_Buffer::~IMX_Buffer ( )
override

Member Function Documentation

void IMX_Buffer::adoptRaster ( PXL_Raster raster,
bool  convert_colorspace 
)

Adopt a PXL_Raster into the underlying IMX_Buffer. The buffer's storage type and number of channels must be set before calling. Steals the PXL_Raster data if compatible. Does OCIO transform from raster's space to scene linear if convert is set.

bool IMX_Buffer::allocated ( ) const
inline

True if getCPU/GPUBuffer has been done since last freeBuffers()

Definition at line 405 of file IMX_Buffer.h.

exint IMX_Buffer::bufferHeight ( ) const
inline

Get height (number of rows) of the buffer.

Definition at line 185 of file IMX_Buffer.h.

exint IMX_Buffer::bufferWidth ( ) const
inline

Get width (number of columns in a row) of the buffer.

Definition at line 183 of file IMX_Buffer.h.

UT_UniquePtr<TIL_Raster> IMX_Buffer::buildRaster ( ) const

Constructs a TIL_Raster matching our storage/channel depth. Will be packed. TIL_Raster is subclass from PXL_Raster.

void IMX_Buffer::copy ( const IMX_Buffer other)

Assignment operators; after executing these functions, this buffer will have the same size and data as other.

void IMX_Buffer::copyBuffer ( const IMX_Buffer other)

Only copy the buffer pointers, the stat data is left unchanged.

void IMX_Buffer::copyMetadata ( const IMX_Buffer source)

Copy everything except the buffer allocations, leaving the buffers dirty. This avoids any chance that writing pixels to this will modify the original. It also avoids shared pointer overhead and keeping buffers around longer than needed.

void IMX_Buffer::copyOrConvert ( const IMX_Buffer other)

copy the buffer, converting betwen storage types if needed and doing a shallow copy if possible

void IMX_Buffer::copyStorageType ( const IMX_Buffer i)
inline

Set storesIntegers, isFixedPoint, bytes, channels.

Definition at line 154 of file IMX_Buffer.h.

const UT_SharedPtr<CE_BufferHostByte>& IMX_Buffer::CPUBufferPtr ( ) const
inline

for debugging

Definition at line 290 of file IMX_Buffer.h.

void IMX_Buffer::deepCopy ( const IMX_Buffer other)

Deep copy operator. Unlike copy() (which shares the buffers of the source), this version allocates a new buffer and copies the data into it. This can throw CE exceptions.

void IMX_Buffer::destroy ( )

Frees all the memory used by buffer.

bool IMX_Buffer::extract ( void dst,
exint  dstsize,
CE_Image::StorageType  dststorage,
int  dstchannels 
) const

Copies the buffer into the provided flat destination buffer. The provided size is checked against required size and ASSERT and no copy & return false if a mis-match.

void IMX_Buffer::freeBuffers ( )

Frees the pixel memory (also does setDirty())

IMX_BorderType IMX_Buffer::getBorderType ( ) const

Returns type of the border.

int64 IMX_Buffer::getBufferSize ( ) const

Returns the number of bytes required to store the entire buffer.

int IMX_Buffer::getChannels ( ) const
inline

Get the number of channels per pixel.

Definition at line 176 of file IMX_Buffer.h.

void* IMX_Buffer::getCPUBuffer ( bool  read,
bool  write 
)
inline

Returns a void pointer to the CPU buffer. If a read-only buffer is requested and this buffer is constant, the buffer will be compressed (i.e. of size equal to the number of channels)!

Definition at line 337 of file IMX_Buffer.h.

template<CE_Image::StorageType STORAGE>
CE_StorageTypeTraits<STORAGE>::DataType* IMX_Buffer::getCPUBuffer ( bool  read,
bool  write 
)
inline

Returns this buffer's data array. If read is true, isDirty must be false. If write is true then it turns off isDirty by setting isOnCPU() and turning off isOnGPU() (it is assuming caller will actually write the buffer) If a read-only buffer is requested and this buffer is constant, the buffer will be compressed (i.e. of size equal to the number of channels)!

Definition at line 358 of file IMX_Buffer.h.

void* IMX_Buffer::getCPUBufferR ( ) const
inline

Definition at line 339 of file IMX_Buffer.h.

template<CE_Image::StorageType STORAGE>
const CE_StorageTypeTraits<STORAGE>::DataType* IMX_Buffer::getCPUBufferR ( ) const
inline

Returns this buffer's read-only data array. If this buffer is constant, the buffer will be compressed (i.e. of size equal to the number of channels)!

Definition at line 345 of file IMX_Buffer.h.

const fpreal16* IMX_Buffer::getCPUBufferRF16 ( ) const
inline

Definition at line 323 of file IMX_Buffer.h.

const fpreal32* IMX_Buffer::getCPUBufferRF32 ( ) const
inline

Definition at line 325 of file IMX_Buffer.h.

const int16* IMX_Buffer::getCPUBufferRFixed16 ( ) const
inline

Return pointer to CPU buffer (caller must ask for correct data type) If a read buffer is requested and this buffer is constant, the buffer will be compressed (i.e. of size equal to the number of channels)!

Definition at line 319 of file IMX_Buffer.h.

const uint8* IMX_Buffer::getCPUBufferRFixed8 ( ) const
inline

Definition at line 321 of file IMX_Buffer.h.

const int16* IMX_Buffer::getCPUBufferRI16 ( ) const
inline

Definition at line 329 of file IMX_Buffer.h.

const int32* IMX_Buffer::getCPUBufferRI32 ( ) const
inline

Definition at line 331 of file IMX_Buffer.h.

const unsigned char* IMX_Buffer::getCPUBufferRI8 ( ) const
inline

Definition at line 327 of file IMX_Buffer.h.

void* IMX_Buffer::getCPUBufferW ( )
inline

Definition at line 340 of file IMX_Buffer.h.

fpreal16* IMX_Buffer::getCPUBufferWF16 ( )
inline

Definition at line 324 of file IMX_Buffer.h.

fpreal32* IMX_Buffer::getCPUBufferWF32 ( )
inline

Definition at line 326 of file IMX_Buffer.h.

int16* IMX_Buffer::getCPUBufferWFixed16 ( )
inline

Definition at line 320 of file IMX_Buffer.h.

uint8* IMX_Buffer::getCPUBufferWFixed8 ( )
inline

Definition at line 322 of file IMX_Buffer.h.

int16* IMX_Buffer::getCPUBufferWI16 ( )
inline

Definition at line 330 of file IMX_Buffer.h.

int32* IMX_Buffer::getCPUBufferWI32 ( )
inline

Definition at line 332 of file IMX_Buffer.h.

unsigned char* IMX_Buffer::getCPUBufferWI8 ( )
inline

Definition at line 328 of file IMX_Buffer.h.

UT_Vector4F IMX_Buffer::getDefaultColor ( ) const
UT_Vector4I IMX_Buffer::getDefaultColorI ( ) const

return the current integer value, which might be different

int64 IMX_Buffer::getDeviceMemoryUsage ( ) const
CE_Image& IMX_Buffer::getGPUBuffer ( bool  read,
bool  write 
)

Returns this buffer's GPU storage object. If read is true, isDirty must be false. If write is true then it turns off isDirty by setting isOnGPU() and turning off isOnCPU() (it is assuming caller will actually write the buffer) When using one of these methods, this buffer must be guarded with the in-use GPU flag. See setInUseGPUFlag() documentation for more information. Can throw CE exceptions.

const CE_Image& IMX_Buffer::getGPUBufferR ( ) const
CE_Image& IMX_Buffer::getGPUBufferW ( )
inline

Definition at line 373 of file IMX_Buffer.h.

cl::Buffer IMX_Buffer::getGPUStat ( ) const

Returns the stat buffer on the GPU, copying it there if necessary. This can throw CE exceptions.

int64 IMX_Buffer::getMemoryUsage ( ) const
int IMX_Buffer::getPixelI ( int  x,
int  y 
) const
void IMX_Buffer::getPixelRaw ( UT_Array< uint8 > &  dest,
int  x,
int  y 
) const
UT_Vector4F IMX_Buffer::getPixelV4 ( int  x,
int  y 
) const

Fetches the value of an individual pixel.

UT_Vector4F IMX_Buffer::getPixelV4 ( fpreal64  x,
fpreal64  y 
) const

Fetches the value at the provided coordinates, using bilinear filtering. Returns value of the nearest pixel for integer buffers.

int IMX_Buffer::getStorageBytes ( ) const
inline

Number of bytes per channel.

Definition at line 178 of file IMX_Buffer.h.

CE_Image::StorageType IMX_Buffer::getStorageType ( ) const
inline

Get the data type used to store pixel data for each channel.

Definition at line 170 of file IMX_Buffer.h.

IMX_TypeInfo IMX_Buffer::getTypeInfo ( ) const

Returns the semantic type.

const UT_SharedPtr<CE_Image>& IMX_Buffer::GPUBufferPtr ( ) const
inline

Definition at line 291 of file IMX_Buffer.h.

bool IMX_Buffer::insert ( const void src,
exint  srcsize,
CE_Image::StorageType  srcstorage,
int  srcchannels 
)

Copies the provided flat buffer into this buffer. The provided size is checked against required size and ASSERT and no copy & return false if a mis-match.

bool IMX_Buffer::isAligned ( const IMX_Buffer src) const

True if the buffer pixels line up: width and the transforms from image space match.

bool IMX_Buffer::isConstant ( ) const
inline

Definition at line 422 of file IMX_Buffer.h.

bool IMX_Buffer::isDirty ( ) const
inline

False if there are computed pixels in the CPU or GPU buffer.

Definition at line 393 of file IMX_Buffer.h.

bool IMX_Buffer::isFixedPoint ( ) const
inline

Does this buffer use fixed point to store non-integer data?

Definition at line 174 of file IMX_Buffer.h.

bool IMX_Buffer::isOnCPU ( ) const
inline

Returns true if this buffer's data is currently on the CPU (this is not necessarily !isOnGPU()).

Definition at line 383 of file IMX_Buffer.h.

bool IMX_Buffer::isOnGPU ( ) const
inline

Returns true if this buffer's data is currently on the GPU.

Definition at line 376 of file IMX_Buffer.h.

void IMX_Buffer::makeBufferUnique ( )

Stop sharing the buffers (so that writes don't affect other layers that have called copyBuffer() on this or vice versa).

template<typename T >
void IMX_Buffer::matchAndCopyToVoxels ( UT_VoxelArray< T > &  dest) const

Resizes dest to match dimensions of this image (its Z-resolution is set to 1) and copies this buffer's data into it. Number of channels in the image should equal tuple size of T. If this layer is dirty, simply sizes the voxel array without touching its values.

void IMX_Buffer::moveBuffer ( IMX_Buffer src)

Move the buffer to this from src, src is left dirty.

IMX_Buffer& IMX_Buffer::operator= ( const IMX_Buffer other)
inline

Definition at line 232 of file IMX_Buffer.h.

IMX_Buffer& IMX_Buffer::operator= ( IMX_Buffer &&  other)
inline

Definition at line 240 of file IMX_Buffer.h.

bool IMX_Buffer::poolIsGPUBufferEmpty ( ) const
inlineoverrideprotectedvirtual

True if the gpu buffer is null.

Implements IMX_PoolEntry.

Definition at line 451 of file IMX_Buffer.h.

bool IMX_Buffer::poolIsGPUBufferValid ( ) const
inlineoverrideprotectedvirtual

True if the gpu buffer is not null and valid.

Implements IMX_PoolEntry.

Definition at line 456 of file IMX_Buffer.h.

void IMX_Buffer::poolResetGPUBuffer ( )
inlineoverrideprotectedvirtual

These implement methods required by the pool.

Resets the GPU Buffer pointer.

Implements IMX_PoolEntry.

Definition at line 441 of file IMX_Buffer.h.

void IMX_Buffer::poolSetOnGPU ( bool  ongpu)
inlineoverrideprotectedvirtual

Update OnGPU.

Implements IMX_PoolEntry.

Definition at line 446 of file IMX_Buffer.h.

void IMX_Buffer::poolShallowCopyGPUBuffer ( const IMX_PoolEntry srcbase)
inlineoverrideprotectedvirtual

Shallow copy.

Implements IMX_PoolEntry.

Definition at line 472 of file IMX_Buffer.h.

bool IMX_Buffer::poolSwapGPUBuffer ( IMX_PoolEntry otherbase)
inlineoverrideprotectedvirtual

True if the swap does something.

Implements IMX_PoolEntry.

Definition at line 461 of file IMX_Buffer.h.

EntryType IMX_Buffer::poolTypeID ( ) const
inlineoverridevirtual

Implements IMX_PoolEntry.

Definition at line 146 of file IMX_Buffer.h.

void IMX_Buffer::setBorder ( IMX_BorderType  border)

Sets the border type of this image. Constant means it is zero.

void IMX_Buffer::setBufferSize ( int  width,
int  height 
)

Sets size of this buffer.

void IMX_Buffer::setBufferXforms ( const UT_Vector2F buffer_to_image_scale,
const UT_Vector2F buffer_to_image_xlate,
const UT_Vector2F buffer_from_image_scale,
const UT_Vector2F buffer_from_image_xlate,
const UT_Vector2F buffer_to_pixel_scale,
const UT_Vector2F buffer_to_pixel_xlate,
const UT_Matrix4F image_to_world,
const UT_Matrix4F world_to_image,
const UT_Matrix4F camera_to_world,
const UT_Vector3F camera_image_pos 
)

Set transform between image and buffer space.

void IMX_Buffer::setChannels ( int  channels)

Set channels, don't change storesIntegers, isFixedPoint, or bytes.

void IMX_Buffer::setConstantF ( fpreal32  i = 0.0f)
inline

Definition at line 411 of file IMX_Buffer.h.

void IMX_Buffer::setConstantI ( int32  i = 0)
void IMX_Buffer::setConstantV3 ( const UT_Vector3F i)
inline

Definition at line 410 of file IMX_Buffer.h.

void IMX_Buffer::setConstantV4 ( const UT_Vector4F i)

Make entire image the same color. This is optimized internally to a 1x1 buffer

void IMX_Buffer::setDefaultColor ( const UT_Vector4F )

Set the default color. This is returned for uncalculatable pixels, and to expand integer vectors from 2,3 to 4. Other usage is not yet determined. Initial value is 0,0,0,1 (may change)

void IMX_Buffer::setPixelF ( int  x,
int  y,
fpreal32  i 
)
inline

Definition at line 298 of file IMX_Buffer.h.

void IMX_Buffer::setPixelI ( int  x,
int  y,
int  i 
)
inline

Definition at line 302 of file IMX_Buffer.h.

void IMX_Buffer::setPixelV4 ( int  x,
int  y,
const UT_Vector4F c 
)
inline

Sets an individual pixel.

Definition at line 294 of file IMX_Buffer.h.

void IMX_Buffer::setStatProjection ( IMX_Projection  projection)

These are the projections in the stat, you want to actually work at imx layer to ensure you update the transforms. Sets the projection of this image.

void IMX_Buffer::setStealable ( bool  v) const
inline

Can be used to control what stealable() subsequently returns. If set to true, indicates to the verbs that this buffer may be stolen from.

Definition at line 247 of file IMX_Buffer.h.

void IMX_Buffer::setStorageBytes ( int  )

Set number of bytes per channel, don't change storesIntegers, isFixedPoint, or channels

void IMX_Buffer::setStorageBytes ( int  ,
bool   
)

Set bytes per channel and isFixedPoint, doesn't change channels. Also sets storesIntegers to false. TODO: should this fail if storesIntegers() is already true? (FIXED_POINT_STORAGE)

void IMX_Buffer::setStorageType ( CE_Image::StorageType  storage,
int  channels 
)

Set storesIntegers, isFixedPoint, bytes, channels.

void IMX_Buffer::setStorageType ( CE_Image::StorageType  storage)

Set storesIntegers, isFixedPoint, bytes.

void IMX_Buffer::setTypeInfo ( IMX_TypeInfo  typeinfo)

Sets the semantic type info of this image.

void IMX_Buffer::setUninitialized ( )
inline

Marks that this buffer is not initialized. This means that when a read buffer is requested, we won't bother doing any copying or data validation. This is useful if you bind this as a read-write layer to a kernel, but will be doing the initialization in the same kernel. Copying from an unitialized buffer will inherit this flag without moving any data. This flag gets cleared when someone writes to this buffer.

Definition at line 420 of file IMX_Buffer.h.

IMX_Projection IMX_Buffer::statProjection ( ) const

Returns the projection type.

bool IMX_Buffer::stealable ( ) const
inline

True if data in this buffer may be stolen from (or changed) by the verbs even if it's an input.

Definition at line 244 of file IMX_Buffer.h.

bool IMX_Buffer::storesIntegers ( ) const
inline

Does this buffer store integers?

Definition at line 172 of file IMX_Buffer.h.

void IMX_Buffer::swap ( IMX_Buffer other)
bool IMX_Buffer::validateBuffer ( ) const

Friends And Related Function Documentation

friend class IMX_CEMemoryPool
friend

Definition at line 548 of file IMX_Buffer.h.

friend class IMX_Layer
friend

Definition at line 135 of file IMX_Buffer.h.


The documentation for this class was generated from the following file: