iflPixel(3) Image Format Library C++ Reference Manual iflPixel(3)
iflPixel - class for pixel abstraction
This is a base class and therefore has no inheritance.
#include <ifl/iflPixel.h>
This class abstracts the concept of a pixel of image data. It contains
the data type, the number of channels, and a list of component values.
Pixels are used as arguments on an iflConverter constructor.
CLASS MEMBER FUNCTION SUMMARY [Toc] [Back] Constructor
iflPixel(iflDataType type=iflDataType(0), int nc=0, void* data=NULL)
iflPixel(const iflPixel &pix)
Initializing [Toc] [Back]
void convert(const iflPixel& pix, iflDataType toType, int nc=0,
int* chanList=NULL)
void operator=(const iflPixel &pix)
void set(iflDataType type, int nc=0, void* data = NULL)
Member access [Toc] [Back]
void* getData() const
iflDataType getDataType() const
double getElem(int index) const
int getNumChans() const
void setElem(double elemValue, int index=0)
double min() const
double max() const
Convenience operators [Toc] [Back]
double operator[](int index) const
int operator==(const iflPixel &p)
int operator!=(const iflPixel &p)
FUNCTION DESCRIPTIONS [Toc] [Back] iflPixel()
Page 1
iflPixel(3) Image Format Library C++ Reference Manual iflPixel(3)
iflPixel(iflDataType type=iflDataType(0), int nc=0, void* data=NULL)
iflPixel(const iflPixel &pix)
The first constructor creates a pixel of data type, type, with nc
channels, and with the component values pointed to by data. The
data values are copied into the iflPixel constructed. The second
constructor copies the attributes and data from the iflPixel
specified by pix. By default, a pixel of undefined type with no
components is constructed.
convert()
void convert(const iflPixel& pix, iflDataType toType, int nc=0,
int* chanList=NULL)
This function copies the pixel specified by pix, converting to the
new data type, toType. A subset of the channels can be selected by
listing the channels to copy from the source pixel in chanList. The
length of the channel list is given by nc.
getData()
void* getData() const
This function returns a pointer to the pixel component array. This
is identical in function to the (void*) cast operation.
getDataType()
iflDataType getDataType() const
This function returns the data type of the pixel.
getElem()
double getElem(int index) const
This function returns the pixel component selected by index. The
first component is at index zero. This is identical in function to
the [] subscript operation.
Page 2
iflPixel(3) Image Format Library C++ Reference Manual iflPixel(3)
getNumChans()
int getNumChans() const
This function returns the number of channels in the pixel.
min()
double min() const
This function returns the minimum value of the pixel component
array.
max()
double max() const
This function returns the maximum value of the pixel component
array.
operator[]
double operator[](int index) const
This function returns the pixel component selected by index. The
first component is at index zero. This is identical in function to
the getElem() function.
operator=()
void operator=(const iflPixel &pix)
The assignment operator makes a copy of the right hand pixel, pix,
in the left hand pixel. The new copy retains the same data type,
number of channels, and data values.
operator==()
int operator==(const iflPixel &p)
This operator returns TRUE if 'this' iflPixel is the same as p (
i.e. both have the same data type, number of channels and values );
FALSE otherwise.
Page 3
iflPixel(3) Image Format Library C++ Reference Manual iflPixel(3)
operator!=()
int operator!=(const iflPixel &p)
This operator returns TRUE if 'this' iflPixel is not the same as p (
i.e. they differ in the data type, number of channels or values );
FALSE otherwise.
set()
void set(iflDataType type, int nc=0, void* data = NULL)
This function initializes the pixel's data type to type, sets the
channel count to nc, and copies the component values from data.
setElem()
void setElem(double elemValue, int index=0)
This function sets the pixel component selected by index. The first
component is at index zero.
iflConverter
PPPPaaaaggggeeee 4444 [ Back ]
|