PCL
pcl::SharedPixelData Class Reference

Handles transparent, type-independent allocation of local and shared pixel data blocks. More...

#include <SharedPixelData.h>

+ Inheritance diagram for pcl::SharedPixelData:

Public Member Functions

 SharedPixelData ()=default
 
 SharedPixelData (const SharedPixelData &x)
 
 SharedPixelData (int width, int height, int numberOfChannels, int bitsPerSample, bool floatSample, int colorSpace)
 
 SharedPixelData (void *handle, int bitsPerSample, bool floatSample, bool complexSample)
 
virtual ~SharedPixelData ()
 
void * Handle () const noexcept
 
bool IsAliased () const
 
bool IsOwner () const
 
bool IsShared () const noexcept
 
SharedPixelDataoperator= (const SharedPixelData &x)
 
bool operator== (const SharedPixelData &x) const noexcept
 

Detailed Description

Definition at line 76 of file SharedPixelData.h.

Constructor & Destructor Documentation

◆ SharedPixelData() [1/4]

pcl::SharedPixelData::SharedPixelData ( )
default

Constructs a SharedPixelData object that represents a local image.

◆ SharedPixelData() [2/4]

pcl::SharedPixelData::SharedPixelData ( void *  handle,
int  bitsPerSample,
bool  floatSample,
bool  complexSample 
)

References an existing shared image with the specified handle and sample data type.

Parameters
handleHandle to a shared image.
bitsPerSampleNumber of bits per pixel sample.
floatSampleWhether this image stores floating point pixel data, or integer pixel data.
complexSampleWhether this image stores complex pixel data or real pixel data.
Note
This constructor throws an Error exception if the specified handle does not correspond to an existing shared image, or if the existing shared image does not have the specified sample data type.

◆ SharedPixelData() [3/4]

pcl::SharedPixelData::SharedPixelData ( int  width,
int  height,
int  numberOfChannels,
int  bitsPerSample,
bool  floatSample,
int  colorSpace 
)

Creates a new shared image with the specified geometry, sample data type and color space.

Parameters
widthImage width in pixels.
heightImage height in pixels.
numberOfChannelsNumber of channels, including nominal channels or color components and alpha channels.
bitsPerSampleNumber of bits per pixel sample.
floatSampleWhether this image stores floating point pixel data, or integer pixel data.
colorSpaceColor space where pixels are represented.

◆ SharedPixelData() [4/4]

pcl::SharedPixelData::SharedPixelData ( const SharedPixelData x)
inline

Copy constructor.

If the argument object x represents a shared image, this constructor references the same shared image. If x is a local image, this function just copies the null handle and has no further effect.

Definition at line 135 of file SharedPixelData.h.

◆ ~SharedPixelData()

virtual pcl::SharedPixelData::~SharedPixelData ( )
inlinevirtual

Virtual destructor.

If this object represents a shared image, it is dereferenced. If the shared image becomes unreferenced, it will be garbage-collected and eventually destroyed by the PixInsight core application.

If this object represents a local image, this destructor has no effect.

Definition at line 150 of file SharedPixelData.h.

Member Function Documentation

◆ Handle()

void* pcl::SharedPixelData::Handle ( ) const
inlinenoexcept

Returns the handle to the shared image represented by this object, or zero (a null pointer) if this object represents a local image.

Definition at line 187 of file SharedPixelData.h.

◆ IsAliased()

bool pcl::SharedPixelData::IsAliased ( ) const

Returns true iff the shared image represented by this object is not uniquely referenced, i.e. if there exist other SharedPixelData objects representing the same shared image. Returns false if the shared image is only referenced by this object, or if this object represents a local image.

◆ IsOwner()

bool pcl::SharedPixelData::IsOwner ( ) const

Returns true iff this object is the owner of the represented shared image. Returns false if this object does not own the shared image, or if this object does not represent a shared image.

◆ IsShared()

bool pcl::SharedPixelData::IsShared ( ) const
inlinenoexcept

Returns true if this object represents a shared image; false if it represents a local image. Shared images live in the PixInsight core application. Local images live in the calling module.

Definition at line 197 of file SharedPixelData.h.

◆ operator=()

SharedPixelData& pcl::SharedPixelData::operator= ( const SharedPixelData x)
inline

Copy assignment operator. Returns a reference to this object.

If this object represents a shared image, it is dereferenced. If the specified object x represents a shared image, then this object will reference it; otherwhise this operator just copies the null handle without further effect.

Definition at line 163 of file SharedPixelData.h.

◆ operator==()

bool pcl::SharedPixelData::operator== ( const SharedPixelData x) const
inlinenoexcept

Returns true iff this object represents the same shared image as another object x, or if both objects represent local images.

Definition at line 178 of file SharedPixelData.h.

Referenced by pcl::PixelAllocator< P >::operator==().


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