Open CASCADE Technology Reference Manual 8.0.0
Loading...
Searching...
No Matches
Public Member Functions | Data Fields | Protected Attributes
Image_PixMapData Class Reference

Structure to manage image buffer. More...

#include <Image_PixMapData.hxx>

Inheritance diagram for Image_PixMapData:
Inheritance graph
[legend]

Public Member Functions

 Image_PixMapData ()
 Empty constructor.
 
bool Init (const occ::handle< NCollection_BaseAllocator > &theAlloc, const size_t theSizeBPP, const size_t theSizeX, const size_t theSizeY, const size_t theSizeRowBytes, uint8_t *theDataPtr)
 Initializer.
 
bool Init (const occ::handle< NCollection_BaseAllocator > &theAlloc, const size_t theSizeBPP, const NCollection_Vec3< size_t > &theSizeXYZ, const size_t theSizeRowBytes, uint8_t *theDataPtr)
 Initializer.
 
void ZeroData ()
 Reset all values to zeros.
 
const uint8_tRow (const size_t theRow) const
 Return data pointer to requested row (first column).
 
uint8_tChangeRow (const size_t theRow)
 Return data pointer to requested row (first column).
 
const uint8_tValue (const size_t theRow, const size_t theCol) const
 Return data pointer to requested position.
 
uint8_tChangeValue (size_t theRow, size_t theCol)
 Return data pointer to requested position.
 
const uint8_tValueXY (size_t theX, size_t theY) const
 Return data pointer to requested position.
 
uint8_tChangeValueXY (size_t theX, size_t theY)
 Return data pointer to requested position.
 
const uint8_tSlice (size_t theSlice) const
 Return data pointer to requested 2D slice.
 
uint8_tChangeSlice (size_t theSlice)
 Return data pointer to requested 2D slice.
 
const uint8_tSliceRow (size_t theSlice, size_t theRow) const
 Return data pointer to requested row (first column).
 
uint8_tChangeSliceRow (size_t theSlice, size_t theRow)
 Return data pointer to requested row (first column).
 
const uint8_tValueXYZ (size_t theX, size_t theY, size_t theZ) const
 Return data pointer to requested position.
 
uint8_tChangeValueXYZ (size_t theX, size_t theY, size_t theZ)
 Return data pointer to requested position.
 
size_t MaxRowAligmentBytes () const
 Compute the maximal row alignment for current row size.
 
void SetTopDown (const bool theIsTopDown)
 Setup scanlines order in memory - top-down or bottom-up. Drawers should explicitly specify this value if current state IsTopDown() was ignored!
 
- Public Member Functions inherited from NCollection_Buffer
 NCollection_Buffer (const occ::handle< NCollection_BaseAllocator > &theAlloc, const size_t theSize=0, uint8_t *theData=nullptr)
 Default constructor. When theData is NULL but theSize is not 0 than buffer of specified size will be allocated.
 
 ~NCollection_Buffer () override
 Destructor.
 
const uint8_tData () const noexcept
 
uint8_tChangeData () noexcept
 
bool IsEmpty () const noexcept
 
size_t Size () const noexcept
 Return buffer length in bytes.
 
const occ::handle< NCollection_BaseAllocator > & Allocator () const noexcept
 
void SetAllocator (const occ::handle< NCollection_BaseAllocator > &theAlloc)
 Assign new buffer allocator with de-allocation of buffer.
 
bool Allocate (const size_t theSize)
 Allocate the buffer.
 
void Free ()
 De-allocate buffer.
 
virtual void DumpJson (Standard_OStream &theOStream, int theDepth=-1) const
 Dumps the content of me into the stream.
 
- Public Member Functions inherited from Standard_Transient
 Standard_Transient ()
 Empty constructor.
 
 Standard_Transient (const Standard_Transient &)
 Copy constructor – does nothing.
 
Standard_Transientoperator= (const Standard_Transient &)
 Assignment operator, needed to avoid copying reference counter.
 
virtual ~Standard_Transient ()=default
 Destructor must be virtual.
 
virtual const opencascade::handle< Standard_Type > & DynamicType () const
 Returns a type descriptor about this object.
 
bool IsInstance (const opencascade::handle< Standard_Type > &theType) const
 Returns a true value if this is an instance of Type.
 
bool IsInstance (const char *const theTypeName) const
 Returns a true value if this is an instance of TypeName.
 
bool IsKind (const opencascade::handle< Standard_Type > &theType) const
 Returns true if this is an instance of Type or an instance of any class that inherits from Type. Note that multiple inheritance is not supported by OCCT RTTI mechanism.
 
bool IsKind (const char *const theTypeName) const
 Returns true if this is an instance of TypeName or an instance of any class that inherits from TypeName. Note that multiple inheritance is not supported by OCCT RTTI mechanism.
 
Standard_TransientThis () const
 Returns non-const pointer to this object (like const_cast). For protection against creating handle to objects allocated in stack or call from constructor, it will raise exception Standard_ProgramError if reference counter is zero.
 
int GetRefCount () const noexcept
 Get the reference counter of this object.
 
void IncrementRefCounter () noexcept
 Increments the reference counter of this object. Uses relaxed memory ordering since incrementing only requires atomicity, not synchronization with other memory operations.
 
int DecrementRefCounter () noexcept
 Decrements the reference counter of this object; returns the decremented value. Uses release ordering for the decrement to ensure all writes to the object are visible before the count reaches zero. An acquire fence is added only when the count reaches zero, ensuring proper synchronization before deletion. This is more efficient than using acq_rel for every decrement.
 
virtual void Delete () const
 Memory deallocator for transient classes.
 

Data Fields

size_t SizeBPP
 bytes per pixel
 
size_t SizeX
 width in pixels
 
size_t SizeY
 height in pixels
 
size_t SizeZ
 depth in pixels
 
size_t SizeRowBytes
 number of bytes per line (in most cases equal to 3 * sizeX)
 
size_t SizeSliceBytes
 number of bytes per 2D slice
 
size_t TopToDown
 image scanlines direction in memory from Top to the Down
 

Protected Attributes

uint8_tmyTopRowPtr
 pointer to the topmost row (depending on scanlines order in memory)
 
- Protected Attributes inherited from NCollection_Buffer
uint8_tmyData
 data pointer
 
size_t mySize
 buffer length in bytes
 
occ::handle< NCollection_BaseAllocatormyAllocator
 buffer allocator
 

Additional Inherited Members

- Public Types inherited from Standard_Transient
typedef void base_type
 Returns a type descriptor about this object.
 
- Static Public Member Functions inherited from Standard_Transient
static constexpr const charget_type_name ()
 Returns a type descriptor about this object.
 
static const opencascade::handle< Standard_Type > & get_type_descriptor ()
 Returns type descriptor of Standard_Transient class.
 

Detailed Description

Structure to manage image buffer.

Constructor & Destructor Documentation

◆ Image_PixMapData()

Image_PixMapData::Image_PixMapData ( )
inline

Empty constructor.

Member Function Documentation

◆ ChangeRow()

uint8_t * Image_PixMapData::ChangeRow ( const size_t theRow)
inline

Return data pointer to requested row (first column).

◆ ChangeSlice()

uint8_t * Image_PixMapData::ChangeSlice ( size_t theSlice)
inline

Return data pointer to requested 2D slice.

◆ ChangeSliceRow()

uint8_t * Image_PixMapData::ChangeSliceRow ( size_t theSlice,
size_t theRow )
inline

Return data pointer to requested row (first column).

◆ ChangeValue()

uint8_t * Image_PixMapData::ChangeValue ( size_t theRow,
size_t theCol )
inline

Return data pointer to requested position.

◆ ChangeValueXY()

uint8_t * Image_PixMapData::ChangeValueXY ( size_t theX,
size_t theY )
inline

Return data pointer to requested position.

◆ ChangeValueXYZ()

uint8_t * Image_PixMapData::ChangeValueXYZ ( size_t theX,
size_t theY,
size_t theZ )
inline

Return data pointer to requested position.

◆ Init() [1/2]

bool Image_PixMapData::Init ( const occ::handle< NCollection_BaseAllocator > & theAlloc,
const size_t theSizeBPP,
const NCollection_Vec3< size_t > & theSizeXYZ,
const size_t theSizeRowBytes,
uint8_t * theDataPtr )
inline

Initializer.

◆ Init() [2/2]

bool Image_PixMapData::Init ( const occ::handle< NCollection_BaseAllocator > & theAlloc,
const size_t theSizeBPP,
const size_t theSizeX,
const size_t theSizeY,
const size_t theSizeRowBytes,
uint8_t * theDataPtr )
inline

Initializer.

◆ MaxRowAligmentBytes()

size_t Image_PixMapData::MaxRowAligmentBytes ( ) const
inline

Compute the maximal row alignment for current row size.

Returns
maximal row alignment in bytes (up to 16 bytes).

◆ Row()

const uint8_t * Image_PixMapData::Row ( const size_t theRow) const
inline

Return data pointer to requested row (first column).

◆ SetTopDown()

void Image_PixMapData::SetTopDown ( const bool theIsTopDown)
inline

Setup scanlines order in memory - top-down or bottom-up. Drawers should explicitly specify this value if current state IsTopDown() was ignored!

Parameters
theIsTopDowntop-down flag

◆ Slice()

const uint8_t * Image_PixMapData::Slice ( size_t theSlice) const
inline

Return data pointer to requested 2D slice.

◆ SliceRow()

const uint8_t * Image_PixMapData::SliceRow ( size_t theSlice,
size_t theRow ) const
inline

Return data pointer to requested row (first column).

◆ Value()

const uint8_t * Image_PixMapData::Value ( const size_t theRow,
const size_t theCol ) const
inline

Return data pointer to requested position.

◆ ValueXY()

const uint8_t * Image_PixMapData::ValueXY ( size_t theX,
size_t theY ) const
inline

Return data pointer to requested position.

◆ ValueXYZ()

const uint8_t * Image_PixMapData::ValueXYZ ( size_t theX,
size_t theY,
size_t theZ ) const
inline

Return data pointer to requested position.

◆ ZeroData()

void Image_PixMapData::ZeroData ( )
inline

Reset all values to zeros.

Field Documentation

◆ myTopRowPtr

uint8_t* Image_PixMapData::myTopRowPtr
protected

pointer to the topmost row (depending on scanlines order in memory)

◆ SizeBPP

size_t Image_PixMapData::SizeBPP

bytes per pixel

◆ SizeRowBytes

size_t Image_PixMapData::SizeRowBytes

number of bytes per line (in most cases equal to 3 * sizeX)

◆ SizeSliceBytes

size_t Image_PixMapData::SizeSliceBytes

number of bytes per 2D slice

◆ SizeX

size_t Image_PixMapData::SizeX

width in pixels

◆ SizeY

size_t Image_PixMapData::SizeY

height in pixels

◆ SizeZ

size_t Image_PixMapData::SizeZ

depth in pixels

◆ TopToDown

size_t Image_PixMapData::TopToDown

image scanlines direction in memory from Top to the Down


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