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

Describes the format and layout of a single plane in an image The plane specifies the format and name of a single image plane in a deep raster image. IMG_Stat contains a list of planes found in the image. Non-deep raster formats only contain one plane. More...

#include <IMG_Plane.h>

Public Member Functions

IMG_Planeoperator= (const IMG_Plane &p)=delete
 
int64 getMemoryUsage (bool inclusive) const
 Returns the amount of memory owned by this IMG_Plane object. More...
 
void setOCIOColorSpace (const UT_StringHolder &space)
 
const UT_StringHoldergetOCIOColorSpace () const
 Look up the OCIO color space when getColorSpace() == PXL_CS_OCIO. More...
 
UT_StringHolder guessOCIOColorSpace (const UT_StringHolder &file_space) const
 
int getPixelSize () const
 
int getPlaneIndex () const
 
int getComponentCount () const
 Returns the number of components this plane consists of. More...
 
IMG_Metadatametadata ()
 
const IMG_Metadatametadata () const
 
bool findMetadata (const UT_StringRef &key, IMG_MetadataItem &value) const
 
const UT_StringHoldermetadataKey () const
 The format's default metadata key. More...
 
bool metadataAsString (const UT_StringRef &key, UT_StringHolder &value, bool pretty_print) const
 
void dump () const
 
void dump (UT_JSONWriter &w) const
 
 IMG_Plane ()
 
 IMG_Plane (const IMG_Plane &p)
 
 IMG_Plane (const UT_StringHolder &name, IMG_DataType dt, IMG_ColorModel cm, int index)
 
void setName (const UT_StringHolder &name)
 
const UT_StringHoldergetName () const
 
void setDataType (IMG_DataType dt)
 
IMG_DataType getDataType () const
 
void setColorModel (IMG_ColorModel cm)
 
IMG_ColorModel getColorModel () const
 
void setTypeInfo (IMG_TypeInfo ti)
 
IMG_TypeInfo getTypeInfo () const
 
void setColorSpace (PXL_ColorSpace cs, fpreal gamma=0.0)
 
PXL_ColorSpace getColorSpace () const
 
fpreal getColorSpaceGamma () const
 
void setComponentNames (const char *c1, const char *c2=0, const char *c3=0, const char *c4=0)
 
void setComponentName (int comp, const char *name)
 
const char * getComponentName (int comp) const
 Returns the name of the individual component of a pixel (r,g,b,a, x,y,z) More...
 
void setBlackWhitePoints (int64 b, int64 w)
 
bool hasBlackWhitePoints () const
 
void getBlackWhitePoints (int64 &b, int64 &w) const
 
IMG_Metadata::const_iterator beginMetadata () const
 
IMG_Metadata::const_iterator endMetadata () const
 
bool importMetadata (const UT_StringRef &key, bool &val) const
 
bool importMetadata (const UT_StringRef &key, int32 &val) const
 
bool importMetadata (const UT_StringRef &key, int64 &val) const
 
bool importMetadata (const UT_StringRef &key, fpreal32 &val) const
 
bool importMetadata (const UT_StringRef &key, fpreal64 &val) const
 
bool importMetadata (const UT_StringRef &key, UT_Matrix4F &val) const
 
bool importMetadata (const UT_StringRef &key, UT_Matrix4D &val) const
 
bool importMetadata (const UT_StringRef &key, UT_StringHolder &val) const
 
bool setMetadata (const UT_StringHolder &key, const IMG_MetadataItem &item)
 
bool setMetadata (const UT_StringHolder &key, const UT_JSONValue &val)
 
bool setMetadata (const UT_StringHolder &key, bool val)
 
bool setMetadata (const UT_StringHolder &key, int64 val)
 
bool setMetadata (const UT_StringHolder &key, fpreal64 val)
 
bool setMetadata (const UT_StringHolder &key, const UT_StringHolder &val)
 

Friends

class IMG_Stat
 

Detailed Description

Describes the format and layout of a single plane in an image The plane specifies the format and name of a single image plane in a deep raster image. IMG_Stat contains a list of planes found in the image. Non-deep raster formats only contain one plane.

Examples:
IMG/IMG_Sample.C.

Definition at line 48 of file IMG_Plane.h.

Constructor & Destructor Documentation

IMG_Plane::IMG_Plane ( )

Planes are generally not created by the user, but by IMG_Stat::addPlane()

IMG_Plane::IMG_Plane ( const IMG_Plane p)

Planes are generally not created by the user, but by IMG_Stat::addPlane()

IMG_Plane::IMG_Plane ( const UT_StringHolder name,
IMG_DataType  dt,
IMG_ColorModel  cm,
int  index 
)

Planes are generally not created by the user, but by IMG_Stat::addPlane()

Member Function Documentation

IMG_Metadata::const_iterator IMG_Plane::beginMetadata ( ) const
inline

Metadata iterator

Definition at line 163 of file IMG_Plane.h.

void IMG_Plane::dump ( ) const
void IMG_Plane::dump ( UT_JSONWriter w) const
IMG_Metadata::const_iterator IMG_Plane::endMetadata ( ) const
inline

Metadata iterator

Definition at line 165 of file IMG_Plane.h.

bool IMG_Plane::findMetadata ( const UT_StringRef key,
IMG_MetadataItem value 
) const
inline

Definition at line 153 of file IMG_Plane.h.

void IMG_Plane::getBlackWhitePoints ( int64 b,
int64 w 
) const

Specifies black/white points for integer formats (not supported for FP) always set the data type before setting the BW points. The black and white points must be within the range of the intger data format (ie, 8b - 0-255).

IMG_ColorModel IMG_Plane::getColorModel ( ) const

color model of the pixel, which specifies the components per pixel. (SINGLE_CHAN, RGB, RGBA)

PXL_ColorSpace IMG_Plane::getColorSpace ( ) const

colorspace of the image data in the plane. This helps determine how to display the image data. If PXL_CS_UNKNOWN is returned, the format's colorspace will be used instead. 'gamma' is only needed for PXL_CS_CUSTOM_GAMMA.

fpreal IMG_Plane::getColorSpaceGamma ( ) const

colorspace of the image data in the plane. This helps determine how to display the image data. If PXL_CS_UNKNOWN is returned, the format's colorspace will be used instead. 'gamma' is only needed for PXL_CS_CUSTOM_GAMMA.

int IMG_Plane::getComponentCount ( ) const
inline

Returns the number of components this plane consists of.

Definition at line 148 of file IMG_Plane.h.

const char* IMG_Plane::getComponentName ( int  comp) const

Returns the name of the individual component of a pixel (r,g,b,a, x,y,z)

IMG_DataType IMG_Plane::getDataType ( ) const

data format of the individual pixel components (8bit - FP)

int64 IMG_Plane::getMemoryUsage ( bool  inclusive) const

Returns the amount of memory owned by this IMG_Plane object.

const UT_StringHolder& IMG_Plane::getName ( ) const

plane name - must be unique in the list of planes found in IMG_Stat

const UT_StringHolder& IMG_Plane::getOCIOColorSpace ( ) const

Look up the OCIO color space when getColorSpace() == PXL_CS_OCIO.

int IMG_Plane::getPixelSize ( ) const

the size of a single pixel, in bytes, including the data format and the color model.

int IMG_Plane::getPlaneIndex ( ) const
inline

This is the index of this plane, in the list of planes found in IMG_Stat (0 to getNumPlanes()-1).

Definition at line 145 of file IMG_Plane.h.

IMG_TypeInfo IMG_Plane::getTypeInfo ( ) const

type info of the data contained in the plane. This is purely an advisory indicator on how the data should be handled. Note that this can affect the colorspace of the plane if not COLOR.

UT_StringHolder IMG_Plane::guessOCIOColorSpace ( const UT_StringHolder file_space) const

Guess the OCIO color space based on plane semantics When this is the first plane (index==0), the file_space will be used if there's no existing color space. If the file_space isn't defined (or if it's not the first plane), the color space will be determined using various heuristics (like channel names and data storage).

bool IMG_Plane::hasBlackWhitePoints ( ) const

Specifies black/white points for integer formats (not supported for FP) always set the data type before setting the BW points. The black and white points must be within the range of the intger data format (ie, 8b - 0-255).

bool IMG_Plane::importMetadata ( const UT_StringRef key,
bool &  val 
) const

Import metadata. This will fall back to the value on the IMG_Stat.

bool IMG_Plane::importMetadata ( const UT_StringRef key,
int32 val 
) const

Import metadata. This will fall back to the value on the IMG_Stat.

bool IMG_Plane::importMetadata ( const UT_StringRef key,
int64 val 
) const

Import metadata. This will fall back to the value on the IMG_Stat.

bool IMG_Plane::importMetadata ( const UT_StringRef key,
fpreal32 val 
) const

Import metadata. This will fall back to the value on the IMG_Stat.

bool IMG_Plane::importMetadata ( const UT_StringRef key,
fpreal64 val 
) const

Import metadata. This will fall back to the value on the IMG_Stat.

bool IMG_Plane::importMetadata ( const UT_StringRef key,
UT_Matrix4F val 
) const

Import metadata. This will fall back to the value on the IMG_Stat.

bool IMG_Plane::importMetadata ( const UT_StringRef key,
UT_Matrix4D val 
) const

Import metadata. This will fall back to the value on the IMG_Stat.

bool IMG_Plane::importMetadata ( const UT_StringRef key,
UT_StringHolder val 
) const

Import metadata. This will fall back to the value on the IMG_Stat.

IMG_Metadata& IMG_Plane::metadata ( )
inline

Definition at line 151 of file IMG_Plane.h.

const IMG_Metadata& IMG_Plane::metadata ( ) const
inline

Definition at line 152 of file IMG_Plane.h.

bool IMG_Plane::metadataAsString ( const UT_StringRef key,
UT_StringHolder value,
bool  pretty_print 
) const

Convert metadata to a string value. When pretty_print is true:

  • If there's a menu, the corresponding label will be returned
  • If there's type information, it will be used (i.e. printing a time or memory)
const UT_StringHolder& IMG_Plane::metadataKey ( ) const

The format's default metadata key.

IMG_Plane& IMG_Plane::operator= ( const IMG_Plane p)
delete
void IMG_Plane::setBlackWhitePoints ( int64  b,
int64  w 
)

Specifies black/white points for integer formats (not supported for FP) always set the data type before setting the BW points. The black and white points must be within the range of the intger data format (ie, 8b - 0-255).

void IMG_Plane::setColorModel ( IMG_ColorModel  cm)

color model of the pixel, which specifies the components per pixel. (SINGLE_CHAN, RGB, RGBA)

Examples:
IMG/IMG_Sample.C.
void IMG_Plane::setColorSpace ( PXL_ColorSpace  cs,
fpreal  gamma = 0.0 
)

colorspace of the image data in the plane. This helps determine how to display the image data. If PXL_CS_UNKNOWN is returned, the format's colorspace will be used instead. 'gamma' is only needed for PXL_CS_CUSTOM_GAMMA.

void IMG_Plane::setComponentName ( int  comp,
const char *  name 
)

Sets the individual component name(s) (default: r,g,b,a). Always call after setColorModel().

void IMG_Plane::setComponentNames ( const char *  c1,
const char *  c2 = 0,
const char *  c3 = 0,
const char *  c4 = 0 
)

Sets the individual component name(s) (default: r,g,b,a). Always call after setColorModel().

void IMG_Plane::setDataType ( IMG_DataType  dt)

data format of the individual pixel components (8bit - FP)

Examples:
IMG/IMG_Sample.C.
bool IMG_Plane::setMetadata ( const UT_StringHolder key,
const IMG_MetadataItem item 
)
inline

Set metadata

Definition at line 191 of file IMG_Plane.h.

bool IMG_Plane::setMetadata ( const UT_StringHolder key,
const UT_JSONValue val 
)
inline

Set metadata

Definition at line 193 of file IMG_Plane.h.

bool IMG_Plane::setMetadata ( const UT_StringHolder key,
bool  val 
)
inline

Set metadata

Definition at line 195 of file IMG_Plane.h.

bool IMG_Plane::setMetadata ( const UT_StringHolder key,
int64  val 
)
inline

Set metadata

Definition at line 197 of file IMG_Plane.h.

bool IMG_Plane::setMetadata ( const UT_StringHolder key,
fpreal64  val 
)
inline

Set metadata

Definition at line 199 of file IMG_Plane.h.

bool IMG_Plane::setMetadata ( const UT_StringHolder key,
const UT_StringHolder val 
)
inline

Set metadata

Definition at line 201 of file IMG_Plane.h.

void IMG_Plane::setName ( const UT_StringHolder name)

plane name - must be unique in the list of planes found in IMG_Stat

void IMG_Plane::setOCIOColorSpace ( const UT_StringHolder space)

This sets the PXL_ColorSpace to PXL_CS_OCIO and stores the OCIO color space.

void IMG_Plane::setTypeInfo ( IMG_TypeInfo  ti)

type info of the data contained in the plane. This is purely an advisory indicator on how the data should be handled. Note that this can affect the colorspace of the plane if not COLOR.

Friends And Related Function Documentation

friend class IMG_Stat
friend

Definition at line 230 of file IMG_Plane.h.


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