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

vetFrameRGBA32 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 <vetFrameRGBA32.h>

Inheritance diagram for vetFrameRGBA32:

vetFrame

Public Types

enum  ChannelRGBA

Public Member Functions

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

bool autoFreeData
unsigned char * data

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 45 of file vetFrameRGBA32.h.


Constructor & Destructor Documentation

vetFrameRGBA32::vetFrameRGBA32 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 33 of file vetFrameRGBA32.cpp.

References autoFreeData, data, and reAllocCanvas().

vetFrameRGBA32::vetFrameRGBA32 vetFrameRGBA32 img  ) 
 

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

Parameters:
img source image.

Definition at line 45 of file vetFrameRGBA32.cpp.

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

vetFrameRGBA32::vetFrameRGBA32 vetFrameRGB24 img  ) 
 

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

Parameters:
img source image.

Definition at line 62 of file vetFrameRGBA32.cpp.

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

vetFrameRGBA32::vetFrameRGBA32 vetFrameRGB96 img  ) 
 

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

Parameters:
img source image.

Definition at line 75 of file vetFrameRGBA32.cpp.

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


Member Function Documentation

vetFrameRGBA32 & vetFrameRGBA32::clearWith unsigned char *  bg  ) 
 

Clear all pixel to the specified value.

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

Definition at line 212 of file vetFrameRGBA32.cpp.

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

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

Read current buffer address.

Returns:
pointer to current buffer.

Implements vetFrame.

Definition at line 105 of file vetFrameRGBA32.h.

References data.

unsigned int vetFrameRGBA32::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 112 of file vetFrameRGBA32.h.

unsigned int vetFrameRGBA32::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 107 of file vetFrameRGBA32.h.

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

VETFRAME_CHANNEL_TYPE vetFrameRGBA32::getChannelType  )  [inline, virtual]
 

Returns:
.

Implements vetFrame.

Definition at line 192 of file vetFrameRGBA32.h.

int vetFrameRGBA32::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 194 of file vetFrameRGBA32.h.

VETRESULT vetFrameRGBA32::getPixel unsigned int  x,
unsigned int  y,
unsigned char *  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.
Note:
No check is made that x and y are in range.

Definition at line 162 of file vetFrameRGBA32.cpp.

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

VETFRAME_PROFILE vetFrameRGBA32::getProfile  )  [inline, virtual]
 

Returns:
.

Implements vetFrame.

Definition at line 191 of file vetFrameRGBA32.h.

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

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

vetFrameRGBA32 & vetFrameRGBA32::operator-= vetFrameRGBA32 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 267 of file vetFrameRGBA32.cpp.

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

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

Definition at line 236 of file vetFrameRGBA32.cpp.

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

VETRESULT vetFrameRGBA32::setPixel unsigned int  x,
unsigned int  y,
unsigned char *  p
 

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 188 of file vetFrameRGBA32.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:38 2006 for VETLib by  doxygen 1.4.4