Main Page | Class Hierarchy | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages | Examples

vetFrameHSV Class Reference

#include <vetFrameHSV.h>

Inheritance diagram for vetFrameHSV:

vetFrame

Public Types

enum  ChannelHSV

Public Member Functions

 vetFrameHSV ()
 Default constructor, initialize height and width to 0.
 vetFrameHSV (unsigned int width, unsigned int height)
 Create an image with the given dimensions, allocates empty data.
 vetFrameHSV (vetFrameHSV &img)
 Copy Constructor, create an image from another image, copying memory.
 vetFrameHSV (vetFrameRGB96 &img)
 Copy Constructor, create an image from another image, copying memory.
 vetFrameHSV (vetFrameGrey &img)
 Copy Constructor, create an image from another image, copying memory.
 ~vetFrameHSV ()
 Destructor currenly clear pixel data (array).
VETRESULT setWidth (unsigned int newWidth)
VETRESULT setHeight (unsigned int newHeight)
void * dump_buffer ()
 Read current buffer address.
VETRESULT reAllocCanvas (unsigned int w, unsigned int h)
unsigned int getBpp ()
 Get current format's BPP (Bits per Pixel).
VETRESULT setBlack ()
 Initialize image (with current canvas) to black (min brightness).
VETRESULT setWhite ()
 Initialize image (with current canvas) to white (max brightness).
VETRESULT extractBrightness (unsigned char *buffer, unsigned int *size=NULL)
VETRESULT setPixel (unsigned int x, unsigned int y, PixelHSV p)
 Set pixel (x, y) to the specified value, conversion to PixelGrey is implemented.
VETRESULT setHSV (unsigned int x, unsigned int y, unsigned short int hue, unsigned char sat, unsigned char val)
 Set pixel (x, y) to the specified values: Red, Green, Blue.
VETRESULT setChannel (unsigned int x, unsigned int y, ChannelHSV ch, unsigned int value)
 Set pixel (x, y) to the specified values: Red, Green, Blue.
VETRESULT getPixel (unsigned int x, unsigned int y, PixelHSV &p)
 Get pixel (x, y) value and store it to p.
unsigned int getChannel (unsigned int x, unsigned int y, ChannelHSV ch)
 Get pixel's channel value (x, y).
vetFrameHSVclearWith (PixelHSV &bg)
 Clear all pixel to the specified value.
vetFrameHSVclearChannel (ChannelHSV ch, unsigned int value=0)
 Clear all pixel to the specified value in specified channel.
vetFrameHSVcopy (vetFrameHSV &img)
 Copies all pixel data from img Throws an exception if images are of different size.
vetFrameHSVoperator= (vetFrameHSV &img)
 Copies all pixel data from img using copy method. Throws an exception if images are of different size.
vetFrameHSVoperator+= (vetFrameHSV &img)
 Overload equals-add (+=) operator for two images (pixel += loop) Throws an exception if images are of different size.
vetFrameHSVoperator-= (vetFrameHSV &img)
 Overload equals-sub (-=) operator for two images (pixel -= loop) Throws an exception if images are of different size.
vetFrameHSVoperator/= (vetFrameHSV &img)
 Overload equals-div (-=) operator for two images (pixel /= loop) Throws an exception if images are of different size.
vetFrameHSVoperator *= (vetFrameHSV &img)
 Overload equals-mul (-=) operator for two images (pixel *= loop) Throws an exception if images are of different size.
vetFrameHSVoperator>> (vetFrameRGB24 &img)
 Ouput operator, export to standard VETLib frame formats, export image data, it's like a copy constructor by parameter side.
vetFrameHSVoperator>> (vetFrameHSV &img)
 Ouput operator, export to standard VETLib frame formats, export image data, it's like a copy constructor by parameter side.
vetFrameHSVoperator>> (vetFrameRGB96 &img)
 Ouput operator, export to standard VETLib frame formats, export image data, it's like a copy constructor by parameter side.
vetFrameHSVoperator>> (vetFrameGrey &img)
 Ouput operator, export to standard VETLib frame formats, export image data, it's like a copy constructor by parameter side.
void operator<< (const vetFrameRGB24 &img)
 Input operator, import standard VETLib frame formats, load image data, it's like a copy constructor.
void operator<< (const vetFrameHSV &img)
 Input operator, import standard VETLib frame formats, load image data, it's like a copy constructor.
void operator<< (const vetFrameRGB96 &img)
 Input operator, import standard VETLib frame formats, load image data, it's like a copy constructor.
void operator<< (const vetFrameGrey &img)
 Input operator, import standard VETLib frame formats, load image data, it's like a copy constructor.
VETFRAME_PROFILE getProfile ()
VETFRAME_CHANNEL_TYPE getChannelType ()
 
int getFOURCC ()
 Get FOURCC code of current data format, visit http://www.fourcc.org for all codes.

Static Public Member Functions

static void convPixel_RGB32toHSV (const PixelRGB96 &, PixelHSV &)
 Pixel conversion routines.
static void convPixel_HSVtoRGB32 (const PixelHSV &, PixelRGB96 &)
static void convPixel_RGB24toHSV (const PixelRGB24 &, PixelHSV &)
static void convPixel_HSVtoRGB24 (const PixelHSV &, PixelRGB24 &)
static void convPixel_GREYtoHSV (const PixelGrey &, PixelHSV &)
static void convPixel_HSVtoGREY (const PixelHSV &, PixelGrey &)

Data Fields

PixelHSVdata

Detailed Description

An image consisting of red, green and blue pixels.

The image is stored as an array of ints, each pixel spanning three ints (one for each of its red, green and blue values).

Definition at line 60 of file vetFrameHSV.h.


Constructor & Destructor Documentation

vetFrameHSV::vetFrameHSV unsigned int  width,
unsigned int  height
 

Create an image with the given dimensions, allocates empty data.

Parameters:
width Width of the image
height Height of the image

Definition at line 82 of file vetFrameHSV.cpp.

References data, DEBUG, vetFrame::height, INFO, reAllocCanvas(), and vetFrame::width.

vetFrameHSV::vetFrameHSV vetFrameHSV img  ) 
 

Copy Constructor, create an image from another image, copying memory.

Parameters:
img source color image.

Definition at line 28 of file vetFrameHSV.cpp.

References data, DEBUG, vetFrame::height, INFO, reAllocCanvas(), and vetFrame::width.

vetFrameHSV::vetFrameHSV vetFrameRGB96 img  ) 
 

Copy Constructor, create an image from another image, copying memory.

Parameters:
img source grey image.

Definition at line 47 of file vetFrameHSV.cpp.

References data, DEBUG, vetFrame::height, INFO, reAllocCanvas(), and vetFrame::width.

vetFrameHSV::vetFrameHSV vetFrameGrey img  ) 
 

Copy Constructor, create an image from another image, copying memory.

Parameters:
img source grey image.

Definition at line 64 of file vetFrameHSV.cpp.

References data, DEBUG, vetFrame::height, INFO, reAllocCanvas(), and vetFrame::width.

vetFrameHSV::~vetFrameHSV  ) 
 

Destructor currenly clear pixel data (array).

Destructor for vetFrameHSV class. Frees memory allocated to array:

Definition at line 101 of file vetFrameHSV.cpp.

References data, and INFO.


Member Function Documentation

vetFrameHSV & vetFrameHSV::clearChannel ChannelHSV  ch,
unsigned int  value = 0
 

Clear all pixel to the specified value in specified channel.

Parameters:
ch the channel to clear.
bg pixel color to overwrite on the channel.
Returns:
current instance address.

Definition at line 299 of file vetFrameHSV.cpp.

References data, DEBUG, vetFrame::height, PixelHSV::hue, INFO, PixelHSV::sat, PixelHSV::val, and vetFrame::width.

vetFrameHSV & vetFrameHSV::clearWith PixelHSV bg  ) 
 

Clear all pixel to the specified value.

Parameters:
bg a PixelHSV to overwrite on all image.
Returns:
current instance address.

Definition at line 283 of file vetFrameHSV.cpp.

References data, DEBUGMSG, vetFrame::height, and vetFrame::width.

void vetFrameHSV::convPixel_GREYtoHSV const PixelGrey &  grey,
PixelHSV hsv
[static]
 

Convert RGB pixel to HSV pixel

Definition at line 842 of file vetFrameHSV.cpp.

References BLUE_COEF, GREEN_COEF, PixelHSV::hue, RED_COEF, PixelHSV::sat, and PixelHSV::val.

Referenced by operator<<().

void vetFrameHSV::convPixel_HSVtoGREY const PixelHSV hsv,
PixelGrey &  grey
[static]
 

Convert HSV pixel to RGB pixel

Definition at line 896 of file vetFrameHSV.cpp.

References BLUE_COEF, GREEN_COEF, PixelHSV::hue, RED_COEF, PixelHSV::sat, and PixelHSV::val.

Referenced by operator>>().

void vetFrameHSV::convPixel_HSVtoRGB24 const PixelHSV hsv,
PixelRGB24 rgb
[static]
 

Convert HSV pixel to RGB pixel

Definition at line 798 of file vetFrameHSV.cpp.

References PixelHSV::hue, PixelHSV::sat, and PixelHSV::val.

Referenced by operator>>().

void vetFrameHSV::convPixel_HSVtoRGB32 const PixelHSV hsv,
PixelRGB96 rgb
[static]
 

Convert HSV pixel to RGB pixel

Definition at line 701 of file vetFrameHSV.cpp.

References PixelHSV::hue, PixelHSV::sat, and PixelHSV::val.

Referenced by operator>>().

void vetFrameHSV::convPixel_RGB24toHSV const PixelRGB24 rgb,
PixelHSV hsv
[static]
 

Convert RGB pixel to HSV pixel

Definition at line 744 of file vetFrameHSV.cpp.

References vetFrameRGB96::BLUE, PixelHSV::hue, PixelHSV::sat, and PixelHSV::val.

Referenced by operator<<().

void vetFrameHSV::convPixel_RGB32toHSV const PixelRGB96 rgb,
PixelHSV hsv
[static]
 

Pixel conversion routines.

Convert RGB pixel to HSV pixel

Definition at line 647 of file vetFrameHSV.cpp.

References vetFrameRGB96::BLUE, PixelHSV::hue, PixelHSV::sat, and PixelHSV::val.

Referenced by operator<<().

vetFrameHSV & vetFrameHSV::copy vetFrameHSV img  ) 
 

Copies all pixel data from img Throws an exception if images are of different size.

Parameters:
img The image to copy the data from.
Returns:
current instance.

Definition at line 354 of file vetFrameHSV.cpp.

References data, vetFrame::height, INFO, and vetFrame::width.

Referenced by operator=().

void* vetFrameHSV::dump_buffer  )  [inline, virtual]
 

Read current buffer address.

Returns:
pointer to current buffer.

Implements vetFrame.

Definition at line 129 of file vetFrameHSV.h.

References data.

unsigned int vetFrameHSV::getBpp  )  [inline, virtual]
 

Get current format's BPP (Bits per Pixel).

Returns:
number of bits for a single pixel (or macropixel).

Implements vetFrame.

Definition at line 134 of file vetFrameHSV.h.

unsigned int vetFrameHSV::getChannel unsigned int  x,
unsigned int  y,
ChannelHSV  ch
 

Get pixel's channel value (x, y).

Parameters:
x x position of the pixel.
y y position of the pixel.
ch selected channel (R, G, B enumeration).
Returns:
value of the selected channel in position (x, y)

Definition at line 258 of file vetFrameHSV.cpp.

References data, vetFrame::height, PixelHSV::hue, PixelHSV::sat, PixelHSV::val, and vetFrame::width.

VETFRAME_CHANNEL_TYPE vetFrameHSV::getChannelType  )  [inline, virtual]
 

Returns:
.

Implements vetFrame.

Definition at line 368 of file vetFrameHSV.h.

int vetFrameHSV::getFOURCC  )  [inline, virtual]
 

Get FOURCC code of current data format, visit http://www.fourcc.org for all codes.

Returns:
int value (usually defined as HEX 0x...).

Implements vetFrame.

Definition at line 370 of file vetFrameHSV.h.

VETRESULT vetFrameHSV::getPixel unsigned int  x,
unsigned int  y,
PixelHSV p
 

Get pixel (x, y) value and store it to p.

Parameters:
x x position of the pixel.
y y position of the pixel.
p address to store selected pixel's value.

Definition at line 238 of file vetFrameHSV.cpp.

References data, vetFrame::height, VETRET_OK, and vetFrame::width.

VETFRAME_PROFILE vetFrameHSV::getProfile  )  [inline, virtual]
 

Returns:
.

Implements vetFrame.

Definition at line 367 of file vetFrameHSV.h.

vetFrameHSV & vetFrameHSV::operator *= vetFrameHSV img  ) 
 

Overload equals-mul (-=) operator for two images (pixel *= loop) Throws an exception if images are of different size.

Parameters:
img The image to multiply to current data.
Returns:
current instance.

Definition at line 421 of file vetFrameHSV.cpp.

References data, vetFrame::height, INFO, and vetFrame::width.

vetFrameHSV & vetFrameHSV::operator+= vetFrameHSV img  ) 
 

Overload equals-add (+=) operator for two images (pixel += loop) Throws an exception if images are of different size.

Parameters:
img The image to add to current data.
Returns:
current instance.

Definition at line 379 of file vetFrameHSV.cpp.

References data, vetFrame::height, INFO, and vetFrame::width.

vetFrameHSV & vetFrameHSV::operator-= vetFrameHSV img  ) 
 

Overload equals-sub (-=) operator for two images (pixel -= loop) Throws an exception if images are of different size.

Parameters:
img The image to subtract to current data.
Returns:
current instance.

Definition at line 393 of file vetFrameHSV.cpp.

References data, vetFrame::height, INFO, and vetFrame::width.

vetFrameHSV & vetFrameHSV::operator/= vetFrameHSV img  ) 
 

Overload equals-div (-=) operator for two images (pixel /= loop) Throws an exception if images are of different size.

Parameters:
img The image to divide to current data.
Returns:
current instance.

Definition at line 407 of file vetFrameHSV.cpp.

References data, vetFrame::height, INFO, and vetFrame::width.

void vetFrameHSV::operator<< const vetFrameGrey img  ) 
 

Input operator, import standard VETLib frame formats, load image data, it's like a copy constructor.

Parameters:
[in] img Greyscale VETLib Frame to be loaded.

Definition at line 615 of file vetFrameHSV.cpp.

References convPixel_GREYtoHSV(), data, vetFrameGrey::data, vetFrame::height, INFO, reAllocCanvas(), and vetFrame::width.

void vetFrameHSV::operator<< const vetFrameRGB96 img  ) 
 

Input operator, import standard VETLib frame formats, load image data, it's like a copy constructor.

Parameters:
[in] img Color VETLib Frame to be loaded.

Definition at line 591 of file vetFrameHSV.cpp.

References convPixel_RGB32toHSV(), data, vetFrameRGB96::data, vetFrame::height, INFO, reAllocCanvas(), and vetFrame::width.

void vetFrameHSV::operator<< const vetFrameHSV img  ) 
 

Input operator, import standard VETLib frame formats, load image data, it's like a copy constructor.

Parameters:
[in] img Color VETLib Frame to be loaded.

Definition at line 561 of file vetFrameHSV.cpp.

References data, vetFrame::height, INFO, reAllocCanvas(), and vetFrame::width.

void vetFrameHSV::operator<< const vetFrameRGB24 img  ) 
 

Input operator, import standard VETLib frame formats, load image data, it's like a copy constructor.

Parameters:
[in] img VETLib Cache24 Frame to be loaded.

Definition at line 538 of file vetFrameHSV.cpp.

References convPixel_RGB24toHSV(), data, vetFrameRGB24::data, vetFrame::height, INFO, reAllocCanvas(), and vetFrame::width.

vetFrameHSV& vetFrameHSV::operator= vetFrameHSV img  )  [inline]
 

Copies all pixel data from img using copy method. Throws an exception if images are of different size.

Parameters:
img The image to copy the data from.
Returns:
current instance.

Definition at line 233 of file vetFrameHSV.h.

References copy().

vetFrameHSV & vetFrameHSV::operator>> vetFrameGrey img  ) 
 

Ouput operator, export to standard VETLib frame formats, export image data, it's like a copy constructor by parameter side.

Parameters:
[out] img Greyscale VETLib Frame to store data.
Returns:
Address of current instance.

Definition at line 519 of file vetFrameHSV.cpp.

References convPixel_HSVtoGREY(), vetFrameGrey::data, data, vetFrame::height, INFO, vetFrameGrey::reAllocCanvas(), and vetFrame::width.

vetFrameHSV & vetFrameHSV::operator>> vetFrameRGB96 img  ) 
 

Ouput operator, export to standard VETLib frame formats, export image data, it's like a copy constructor by parameter side.

Parameters:
[out] img Color VETLib Frame to store data.
Returns:
Address of current instance.

Definition at line 494 of file vetFrameHSV.cpp.

References convPixel_HSVtoRGB32(), vetFrameRGB96::data, data, vetFrame::height, INFO, vetFrameRGB96::reAllocCanvas(), and vetFrame::width.

vetFrameHSV & vetFrameHSV::operator>> vetFrameHSV img  ) 
 

Ouput operator, export to standard VETLib frame formats, export image data, it's like a copy constructor by parameter side.

Parameters:
[out] img Color VETLib Frame to store data.
Returns:
Address of current instance.

Definition at line 461 of file vetFrameHSV.cpp.

References data, vetFrame::height, INFO, reAllocCanvas(), and vetFrame::width.

vetFrameHSV & vetFrameHSV::operator>> vetFrameRGB24 img  ) 
 

Ouput operator, export to standard VETLib frame formats, export image data, it's like a copy constructor by parameter side.

Parameters:
[out] img VETLib Cache24 Frame to store data.
Returns:
Address of current instance.

Definition at line 436 of file vetFrameHSV.cpp.

References convPixel_HSVtoRGB24(), vetFrameRGB24::data, data, vetFrame::height, INFO, vetFrameRGB24::reAllocCanvas(), and vetFrame::width.

VETRESULT vetFrameHSV::setChannel unsigned int  x,
unsigned int  y,
ChannelHSV  ch,
unsigned int  value
 

Set pixel (x, y) to the specified values: Red, Green, Blue.

Parameters:
x x position of the pixel.
y y position of the pixel.
ch selected channel (R, G, B enumeration).
value selected channel's value of the selected pixel.

Definition at line 210 of file vetFrameHSV.cpp.

References data, vetFrame::height, PixelHSV::hue, PixelHSV::sat, PixelHSV::val, VETRET_OK, VETRET_PARAM_ERR, and vetFrame::width.

VETRESULT vetFrameHSV::setHSV unsigned int  x,
unsigned int  y,
unsigned short int  hue,
unsigned char  sat,
unsigned char  val
 

Set pixel (x, y) to the specified values: Red, Green, Blue.

Parameters:
x x position of the pixel.
y y position of the pixel.
red red channel's value of the selected pixel.
green green channel's value of the selected pixel.
blue blue channel's value of the selected pixel.

Definition at line 185 of file vetFrameHSV.cpp.

References data, vetFrame::height, PixelHSV::hue, PixelHSV::sat, PixelHSV::val, VETRET_OK, and vetFrame::width.

VETRESULT vetFrameHSV::setPixel unsigned int  x,
unsigned int  y,
PixelHSV  p
 

Set pixel (x, y) to the specified value, conversion to PixelGrey is implemented.

Parameters:
x x position of the pixel.
y y position of the pixel.
p new value for the selected coords.
Note:
No check is made that x and y are in range.

Definition at line 167 of file vetFrameHSV.cpp.

References data, vetFrame::height, VETRET_OK, and vetFrame::width.


The documentation for this class was generated from the following files:
Generated on Tue Jan 24 11:59:36 2006 for VETLib by  doxygen 1.4.4