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

vetFrameYUV420 Class Reference

This Class implements standard VETLib I/O Frame format. An image consisting of red, green and blue pixels. PixelRGB24 Array [width*height] (raster scan) Currently PixelRGB24 is difined as 3 char (3 * 8 = 24bits). More...

#include <vetFrameYUV420.h>

Inheritance diagram for vetFrameYUV420:

vetFrame

Public Types

enum  ChannelYUV

Public Member Functions

 vetFrameYUV420 ()
 Default constructor, initialize height and width to 0.
 vetFrameYUV420 (unsigned int width, unsigned int height)
 Create an image with the given dimensions, allocates (random) data.
 vetFrameYUV420 (vetFrameYUV420 &img)
 Copy Constructor, create an image from another image, copying memory.
 ~vetFrameYUV420 ()
 Destructor currenly clear pixel data (array).
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)
unsigned int getBufferSize ()
 Read current buffer size (for example the real size of array).
vetFrameYUV420clearWith (unsigned char *bg, ChannelYUV channel)
 Clear all pixel to the specified value.
VETRESULT setPixel (unsigned int x, unsigned int y, unsigned char &value, ChannelYUV channel)
 Set pixel (x, y) to the specified value.
VETRESULT getPixel (unsigned int x, unsigned int y, unsigned char &value, ChannelYUV channel)
 Get pixel (x, y) value and store it to p.
vetFrameYUV420operator= (vetFrameYUV420 &img)
 Copies all pixel data from img. Throws an exception if images are of different size.
vetFrameYUV420operator+= (vetFrameYUV420 &img)
 Overload equals-add (+=) operator for two images (pixel += loop) Throws an exception if images are of different size.
vetFrameYUV420operator *= (vetFrameYUV420 &img)
 Overload equals-add (+=) operator for two images (pixel += loop) Throws an exception if images are of different size.
void operator<< (const vetFrameRGB24 &img)
vetFrameYUV420operator>> (vetFrameRGB24 &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

bool autoFreeData
unsigned char * data
unsigned char * Y
unsigned char * U
unsigned char * V

Detailed Description

This Class implements standard VETLib I/O Frame format. An image consisting of red, green and blue pixels. PixelRGB24 Array [width*height] (raster scan) Currently PixelRGB24 is difined as 3 char (3 * 8 = 24bits).

See also:
PixelRGB24

vetFrame

Version:
0.6
Date:
12/07/2005 - //2005
Author:
Alessandro Polo
VETLib Framework 1.0.2 Copyright (C) Alessandro Polo 2006 http://www.ewgate.net/vetlib

Definition at line 41 of file vetFrameYUV420.h.


Constructor & Destructor Documentation

vetFrameYUV420::vetFrameYUV420 unsigned int  width,
unsigned int  height
 

Create an image with the given dimensions, allocates (random) data.

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

Definition at line 57 of file vetFrameYUV420.cpp.

References autoFreeData, data, and reAllocCanvas().

vetFrameYUV420::vetFrameYUV420 vetFrameYUV420 img  ) 
 

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

Parameters:
img source image.

Definition at line 39 of file vetFrameYUV420.cpp.

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


Member Function Documentation

vetFrameYUV420 & vetFrameYUV420::clearWith unsigned char *  bg,
ChannelYUV  channel
 

Clear all pixel to the specified value.

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

Definition at line 222 of file vetFrameYUV420.cpp.

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

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

Read current buffer address.

Returns:
pointer to current buffer.

Implements vetFrame.

Definition at line 90 of file vetFrameYUV420.h.

References data.

unsigned int vetFrameYUV420::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 96 of file vetFrameYUV420.h.

unsigned int vetFrameYUV420::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 102 of file vetFrameYUV420.h.

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

Referenced by vetFilterNoiseChannel::generateNoise().

VETFRAME_CHANNEL_TYPE vetFrameYUV420::getChannelType  )  [inline, virtual]
 

Returns:
.

Implements vetFrame.

Definition at line 176 of file vetFrameYUV420.h.

int vetFrameYUV420::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 178 of file vetFrameYUV420.h.

VETRESULT vetFrameYUV420::getPixel unsigned int  x,
unsigned int  y,
unsigned char &  value,
ChannelYUV  channel
 

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 151 of file vetFrameYUV420.cpp.

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

VETFRAME_PROFILE vetFrameYUV420::getProfile  )  [inline, virtual]
 

Returns:
.

Implements vetFrame.

Definition at line 175 of file vetFrameYUV420.h.

vetFrameYUV420 & vetFrameYUV420::operator *= vetFrameYUV420 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 293 of file vetFrameYUV420.cpp.

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

vetFrameYUV420 & vetFrameYUV420::operator+= vetFrameYUV420 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 280 of file vetFrameYUV420.cpp.

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

vetFrameYUV420 & vetFrameYUV420::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.
Returns:
current instance.

Definition at line 262 of file vetFrameYUV420.cpp.

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

VETRESULT vetFrameYUV420::setPixel unsigned int  x,
unsigned int  y,
unsigned char &  value,
ChannelYUV  channel
 

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 187 of file vetFrameYUV420.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:39 2006 for VETLib by  doxygen 1.4.4