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

vetFrameGrey Class Reference

Inheritance diagram for vetFrameGrey:

vetFrame

Public Member Functions

 vetFrameGrey ()
 Default constructor, initialize height and width to 0.
 vetFrameGrey (unsigned int width, unsigned int height)
 Create an image with the given dimensions, allocates empty data.
 vetFrameGrey (vetFrameGrey &img)
 Copy Constructor, create an image from another image, copying memory.
 vetFrameGrey (vetFrameYUV420 &img)
 Copy Constructor, create an image from another image, copying memory.
 vetFrameGrey (vetFrameRGB24 &img)
 Copy Constructor, create an image from another image, copying memory.
 vetFrameGrey (vetFrameRGB96 &img)
 Copy Constructor, create an image from another image, copying memory.
 vetFrameGrey (vetFrameRGBA32 &img)
 Copy Constructor, create an image from another image, copying memory.
 ~vetFrameGrey ()
 Destructor currenly clear pixel data (array).
int setWidth (unsigned int newWidth)
int 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).
unsigned int getBufferSize ()
 Read current buffer size (for example the real size of array).
VETRESULT extractBrightness (unsigned char *buffer, unsigned int *size=NULL)
VETRESULT setPixel (unsigned int x, unsigned int y, PixelRGB24 p)
 Set pixel (x, y) to the specified value, conversion to PixelGrey is implemented.
VETRESULT setPixel (unsigned int x, unsigned int y, PixelGrey level)
 Set pixel (x, y) to the specified value.
VETRESULT getPixel (unsigned int x, unsigned int y, PixelGrey &p) const
 Get pixel (x, y) value and store it to p.
const PixelGrey & getPixel (unsigned int x, unsigned int y) const
vetFrameGreyclearWith (PixelGrey bg=0)
 Clear all pixel to the specified value.
vetFrameGreycopy (vetFrameGrey &img)
 Copy data from image data from img.
VETRESULT invert ()
 Absolute value of brightness.
VETRESULT threshold (PixelGrey thresh)
 Threshold brightness.
vetFrameGreyoperator= (vetFrameGrey &img)
 Copies all pixel data from img using copy method. Throws an exception if images are of different size.
vetFrameGreyoperator+= (vetFrameGrey &img)
 Overload equals (+=) operator for two images.
vetFrameGreyoperator-= (vetFrameGrey &img)
 Overload equals (-=) operator for two images.
vetFrameGreyoperator+= (PixelGrey offset)
 Overload equals (+=) operator for Image and constant.
vetFrameGreyoperator-= (PixelGrey offset)
 Overload equals (-=) operator for Image and constant.
vetFrameGreyoperator/= (float factor)
 Overload equals (/=) operator for Image and constant.
vetFrameGreyoperator *= (float factor)
 Overload equals (*=) operator for Image and constant.
vetFrameGreyoperator>> (vetFrameYUV420 &img)
vetFrameGreyoperator>> (vetFrameRGB24 &img)
vetFrameGreyoperator>> (vetFrameRGB96 &img)
vetFrameGreyoperator>> (vetFrameRGBA32 &img)
void operator<< (const vetFrameYUV420 &img)
void operator<< (const vetFrameRGB24 &img)
void operator<< (const vetFrameRGBA32 &img)
void operator<< (const vetFrameRGB96 &img)
VETFRAME_PROFILE getProfile ()
VETFRAME_CHANNEL_TYPE getChannelType ()
 
int getFOURCC ()
 Get FOURCC code of current data format, visit http://www.fourcc.org for all codes.

Data Fields

PixelGrey * data

Detailed Description

Definition at line 52 of file vetFrameGrey.h.


Constructor & Destructor Documentation

vetFrameGrey::vetFrameGrey 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 37 of file vetFrameGrey.cpp.

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

vetFrameGrey::vetFrameGrey vetFrameGrey img  ) 
 

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

Parameters:
img source grey image.

Definition at line 51 of file vetFrameGrey.cpp.

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

vetFrameGrey::vetFrameGrey vetFrameYUV420 img  ) 
 

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

Parameters:
img source cache image (will be converted to greyscale).

Definition at line 70 of file vetFrameGrey.cpp.

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

vetFrameGrey::vetFrameGrey vetFrameRGB24 img  ) 
 

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

Parameters:
img source color image (will be converted to greyscale).

Definition at line 86 of file vetFrameGrey.cpp.

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

vetFrameGrey::vetFrameGrey vetFrameRGB96 img  ) 
 

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

Parameters:
img source color image (will be converted to greyscale).

Definition at line 102 of file vetFrameGrey.cpp.

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

vetFrameGrey::vetFrameGrey vetFrameRGBA32 img  ) 
 

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

Parameters:
img source color image (will be converted to greyscale).

Definition at line 118 of file vetFrameGrey.cpp.

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


Member Function Documentation

vetFrameGrey & vetFrameGrey::clearWith PixelGrey  bg = 0  ) 
 

Clear all pixel to the specified value.

Parameters:
bg a PixelRGB to overwrite on all image, default is black.
Returns:
current instance address.

Definition at line 276 of file vetFrameGrey.cpp.

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

vetFrameGrey & vetFrameGrey::copy vetFrameGrey img  ) 
 

Copy data from image data from img.

Copies all pixel brightness to img. Throws an exception if images are of different size.

Parameters:
img The image to copy the brightness from.

Definition at line 308 of file vetFrameGrey.cpp.

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

Referenced by operator=().

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

Read current buffer address.

Returns:
pointer to current buffer.

Implements vetFrame.

Definition at line 116 of file vetFrameGrey.h.

References data.

unsigned int vetFrameGrey::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 123 of file vetFrameGrey.h.

unsigned int vetFrameGrey::getBufferSize  )  [inline, virtual]
 

Read current buffer size (for example the real size of array).

Returns:
size in bytes of current buffer.

Implements vetFrame.

Definition at line 127 of file vetFrameGrey.h.

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

VETFRAME_CHANNEL_TYPE vetFrameGrey::getChannelType  )  [inline, virtual]
 

Returns:
.

Implements vetFrame.

Definition at line 234 of file vetFrameGrey.h.

int vetFrameGrey::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 236 of file vetFrameGrey.h.

VETRESULT vetFrameGrey::getPixel unsigned int  x,
unsigned int  y,
PixelGrey &  p
const
 

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.
Note:
No check is made that x and y are in range.

Definition at line 248 of file vetFrameGrey.cpp.

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

Referenced by vetFrameGreyETI::operator<<().

VETFRAME_PROFILE vetFrameGrey::getProfile  )  [inline, virtual]
 

Returns:
.

Implements vetFrame.

Definition at line 232 of file vetFrameGrey.h.

VETRESULT vetFrameGrey::invert  ) 
 

Absolute value of brightness.

Calculates absolute values of brightness array

Definition at line 440 of file vetFrameGrey.cpp.

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

vetFrameGrey & vetFrameGrey::operator *= float  factor  ) 
 

Overload equals (*=) operator for Image and constant.

Multiplies each brightness value by fact

Parameters:
fact Multiplication constant

Definition at line 370 of file vetFrameGrey.cpp.

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

vetFrameGrey & vetFrameGrey::operator+= PixelGrey  offset  ) 
 

Overload equals (+=) operator for Image and constant.

Adds fact to each brightness value

Parameters:
fact Addition constant

Definition at line 336 of file vetFrameGrey.cpp.

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

vetFrameGrey & vetFrameGrey::operator+= vetFrameGrey img  ) 
 

Overload equals (+=) operator for two images.

Subtracts img.brightness from brightness array

Parameters:
img The image to be subtracted

Definition at line 404 of file vetFrameGrey.cpp.

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

vetFrameGrey & vetFrameGrey::operator-= PixelGrey  offset  ) 
 

Overload equals (-=) operator for Image and constant.

Subtracts fact from each brightness value

Parameters:
fact Subtraction constant

Definition at line 353 of file vetFrameGrey.cpp.

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

vetFrameGrey & vetFrameGrey::operator-= vetFrameGrey img  ) 
 

Overload equals (-=) operator for two images.

Subtracts img.brightness from brightness array

Parameters:
img The image to be subtracted

Definition at line 422 of file vetFrameGrey.cpp.

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

vetFrameGrey & vetFrameGrey::operator/= float  factor  ) 
 

Overload equals (/=) operator for Image and constant.

Divides each brightness value by fact

Parameters:
fact Division constant

Definition at line 387 of file vetFrameGrey.cpp.

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

void vetFrameGrey::operator<< const vetFrameRGB96 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.

Definition at line 630 of file vetFrameGrey.cpp.

References BLUE_COEF, vetFrameRGB96::data, data, GREEN_COEF, vetFrame::height, INFO, reAllocCanvas(), RED_COEF, and vetFrame::width.

void vetFrameGrey::operator<< const vetFrameRGBA32 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.

Definition at line 653 of file vetFrameGrey.cpp.

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

void vetFrameGrey::operator<< const vetFrameRGB24 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.

Definition at line 604 of file vetFrameGrey.cpp.

References BLUE_COEF, vetFrameRGB24::data, data, GREEN_COEF, vetFrame::height, INFO, reAllocCanvas(), RED_COEF, and vetFrame::width.

void vetFrameGrey::operator<< const vetFrameYUV420 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.

Definition at line 578 of file vetFrameGrey.cpp.

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

vetFrameGrey& vetFrameGrey::operator= vetFrameGrey 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 201 of file vetFrameGrey.h.

References copy().

vetFrameGrey & vetFrameGrey::operator>> vetFrameRGBA32 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.

Definition at line 557 of file vetFrameGrey.cpp.

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

vetFrameGrey & vetFrameGrey::operator>> vetFrameRGB96 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.

Definition at line 529 of file vetFrameGrey.cpp.

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

vetFrameGrey & vetFrameGrey::operator>> vetFrameRGB24 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.

Definition at line 502 of file vetFrameGrey.cpp.

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

vetFrameGrey & vetFrameGrey::operator>> vetFrameYUV420 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.

Definition at line 475 of file vetFrameGrey.cpp.

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

VETRESULT vetFrameGrey::setPixel unsigned int  x,
unsigned int  y,
PixelGrey  level
 

Set pixel (x, y) to the specified value.

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 205 of file vetFrameGrey.cpp.

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

VETRESULT vetFrameGrey::setPixel unsigned int  x,
unsigned int  y,
PixelRGB24  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 226 of file vetFrameGrey.cpp.

References BLUE_COEF, data, GREEN_COEF, vetFrame::height, RED_COEF, VETRET_OK, VETRET_PARAM_ERR, and vetFrame::width.

Referenced by vetFrameRGBETI::operator>>(), and vetFrameGreyETI::operator>>().

VETRESULT vetFrameGrey::threshold PixelGrey  thresh  ) 
 

Threshold brightness.

Sets values below threshold to zero and those equal or above to 255

Parameters:
thresh Threshold value

Definition at line 456 of file vetFrameGrey.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