VIPER REFERENCE MANUAL


NAME
iflPixel - class for pixel abstraction

HEADER FILE
#include <ifl/iflPixel.h>

PUBLIC METHOD SUMMARY

   Constructing and destroying
iflPixel ( iflDataType type=iflDataType(0), int nc=0, const void* data=NULL);
iflPixel ( const iflPixel& pix);
~iflPixel (  );

   Initializing
void set ( iflDataType type, int nc=0, const void* data=NULL);
void convert ( const iflPixel& pix, iflDataType toType, int nc=0, int* chanList=NULL);
void operator= ( const iflPixel& pix);

   Member access
double getElem ( int index) const;
void setElem ( double val, int index=0);
double min (  ) const;
double max (  ) const;
int getNumChans (  ) const;
iflDataType getDataType (  ) const;
void* getData (  ) const;

   Convenience operators
double operator[] ( int index) const;
int operator== ( const iflPixel& pix);
int operator!= ( const iflPixel& pix);

CLASS DESCRIPTION
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.

METHOD DESCRIPTIONS

   iflPixel()
iflPixel ( iflDataType type=iflDataType(0), int nc=0, const 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.

   ~iflPixel()
~iflPixel (  );

The destructor frees all memory associated with the iflPixel.

   convert()
void convert ( const iflPixel& pix, iflDataType toType, int nc=0, int* chanList=NULL);

This method 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 method returns a pointer to the pixel component array.

   getDataType()
iflDataType getDataType (  ) const;

This method returns the data type of the pixel.

   getElem()
double getElem ( int index) const;

This method returns the pixel component selected by index. The first component is at index zero. This is identical in function to the operator[]() method.

   getNumChans()
int getNumChans (  ) const;

This method returns the number of channels in the pixel.

   max()
double max (  ) const;

This method returns the maximum value of the pixel component array.

   min()
double min (  ) const;

This method returns the minimum value of the pixel component array.

   operator!=()
int operator!= ( const iflPixel& pix);

This operator returns TRUE if 'this' iflPixel is not the same as pix ( i.e. they differ in the data type, number of channels or values ); FALSE otherwise.

   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& pix);

This operator returns TRUE if 'this' iflPixel is the same as pix ( i.e. both have the same data type, number of channels and values ); FALSE otherwise.

   operator[]()
double operator[] ( int index) const;

This method returns the pixel component selected by index. The first component is at index zero. This is identical in function to the getElem() method.

   set()
void set ( iflDataType type, int nc=0, const void* data=NULL);

This method 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 val, int index=0);

This method sets the pixel component selected by index to val. The first component is at index zero.