CodeVis.com SourceForge.net Logo

CVImageRGB24 Class Reference

#include <CVImageRGB24.h>

Inheritance diagram for CVImageRGB24:

CVImage List of all members.

Detailed Description

CVImageRGB24 is a 24-bit color image class derived from CVImage Pixels are 8-bit per channel unsigned chars, and are stored as triplets in R,G,B order.

See CVImage.h for general documentation.

See also:
CVImage, CVImageGrey, CVImageRGBFloat
RCSfile
CVImageRGB24.h,v
Date
2004/02/08 23:47:39
Revision
1.1.1.1
Author
mikeellison

Definition at line 66 of file CVImageRGB24.h.

Public Member Functions

Protected Member Functions

Private Attributes


Constructor & Destructor Documentation

CVImageRGB24::CVImageRGB24  )  [protected]
 

Protected constructor - use CVImage::CreateImage() to construct.

Definition at line 59 of file CVImageRGB24.cpp.

CVImageRGB24::~CVImageRGB24  )  [protected, virtual]
 

Protected destructor - use CVImage::ReleaseImage() to destroy.

Definition at line 64 of file CVImageRGB24.cpp.


Member Function Documentation

int CVImageRGB24::GetBytesPerPixel  )  const [virtual]
 

GetBytesPerPixel retrieves the number of bytes per pixel. Note that pixel can be in floating point or integer format, depending on the image type.

Returns:
int - bytes per pixel

Implements CVImage.

Definition at line 82 of file CVImageRGB24.cpp.

CVImage::CVIMAGE_TYPE CVImageRGB24::GetImageType  )  const [virtual]
 

GetImageType() retrieves the image type. See CVIMAGE_TYPE enum.

Returns:
CVIMAGE_TYPE specifying the image's type.

Implements CVImage.

Definition at line 91 of file CVImageRGB24.cpp.

References CVImage::CVIMAGE_RGB24, and CVImage::CVIMAGE_TYPE.

CVRES CVImageRGB24::GetMaxPixelValue float &  maxValue  )  const [virtual]
 

GetMaxPixelValue() retrieves the maximum value of any pixel in the image.

In multichannel images (e.g. RGB triplets), it will return the maximum value on any of the channels.

All child classes should implement this.

Parameters:
maxValue - reference to max pixel value, set on return.
Returns:
CVRES result code
See also:
GetPixel(), SetPixel(), CVImage::GetMaxPixel()

Implements CVImage.

Definition at line 130 of file CVImageRGB24.cpp.

References CVRES, and CVImage::GetMaxPixel().

int CVImageRGB24::GetNumChannels  )  const [virtual]
 

GetNumChannels retrieves the number of channels per pixel. This is one in greyscale, 3 in RGB, and 4 in RGBA

Returns:
int - number of channels per pixel.
See also:
GetBytesPerPixel()

Implements CVImage.

Definition at line 73 of file CVImageRGB24.cpp.

CVRES CVImageRGB24::GetPixel int  x,
int  y,
float &  r,
float &  g,
float &  b
const [virtual]
 

GetPixel() retrieves the red, green, and blue values for a specified pixel as floating points.

This is for convenience and prototyping - for high-speed image processing you'll need to work more directly with the image buffer.

Within CVImageRGB24, this returns the red, green, and blue values all of which will be between 0-255.

Parameters:
x - x position within the image of the pixel
y - y position within the image of the pixel
r - receives the red value of the pixel
g - receives the green value of the pixel
b - receives the blue value of the pixel
Returns:
CVRES result code. CVRES_SUCCESS on success.
See also:
SetPixel()

Implements CVImage.

Definition at line 158 of file CVImageRGB24.cpp.

References CVImage::AbsWidth(), CVAssert, CVRES, CVRES_IMAGE_EMPTY_ERR, CVRES_IMAGE_OUT_OF_RANGE, CVRES_SUCCESS, CVImage::fData, CVImage::fHeight, CVImage::fWidth, CVImage::XOffsetAbs(), and CVImage::YOffsetAbs().

const char * CVImageRGB24::GetPNMExtension  )  const [virtual]
 

GetPNMExtension() retrieves the default file extension for PNM file saving. (e.g. ".pgm" for greyscale)

Returns:
const char* - ASCIIZ default file extension, including preceeding '.'
See also:
Load(), Save()

Implements CVImage.

Definition at line 104 of file CVImageRGB24.cpp.

char CVImageRGB24::GetPNMMagicVal  )  const [virtual]
 

GetPNMMagicVal() retrieves the magic value for a pnm file matching the current image format.

Returns:
char - Magic value for PNM files (e.g. '5' for 'P5' .pgm's)
See also:
Load(), Save()

Implements CVImage.

Definition at line 113 of file CVImageRGB24.cpp.

CVRES CVImageRGB24::SetFromWin32Bmp const BITMAPINFOHEADER *  bmih,
const unsigned char *  data
[protected, virtual]
 

Win32-only function for setting image data from a bitmap. WARNING: Currently only supports 24-bit uncompressed RGB bitmaps

Bitmap header and data may be freed after call - we do a deep copy of the data we care about.

Parameters:
bmih - BITMAPINFOHEADER with format information
data - raw bitmap data matching bmih format.
Returns:
CVRES result code.
See also:
CVRES_CORE_ENUM, CVRES_IMAGE_ENUM, CVImage::ReleaseImage()

Reimplemented from CVImage.

Definition at line 292 of file CVImageRGB24.cpp.

References CVImage::Create(), CVAssert, CVRES, CVRES_SUCCESS, CVImage::fData, CVImage::fHeight, and CVImage::fWidth.

CVRES CVImageRGB24::SetPixel int  x,
int  y,
float  r,
float  g,
float  b
[virtual]
 

SetPixel() sets the red, green, and blue pixel values for a pixel

This is for convenience and prototyping - for high-speed image processing you'll need to work more directly with the image buffer.

Within CVImageRGB24, the values are truncated to be between 0 (min) and 255 (max), then set.

Parameters:
x - x position within the image of the pixel
y - y position within the image of the pixel
r - receives the red value of the pixel
g - receives the green value of the pixel
b - receives the blue value of the pixel
Returns:
CVRES result code. CVRES_SUCCESS on success.
See also:
GetPixel()

Implements CVImage.

Definition at line 227 of file CVImageRGB24.cpp.

References CVImage::AbsWidth(), CVAssert, CVMax(), CVMin(), CVRES, CVRES_IMAGE_EMPTY_ERR, CVRES_IMAGE_OUT_OF_RANGE, CVRES_SUCCESS, CVImage::fData, CVImage::fHeight, CVImage::fWidth, CVImage::XOffsetAbs(), and CVImage::YOffsetAbs().


Member Data Documentation

friend CVImageRGB24::CVImage [private]
 

Definition at line 69 of file CVImageRGB24.h.


The documentation for this class was generated from the following files:

Generated on Mon Mar 1 13:27:14 2004 for VidCapture Library by doxygen 1.3.3
CodeVis VidCapture 0.2 Copyright © 2003-2004 by Michael Ellison.