CVImageGrey Class Reference#include <CVImageGrey.h>
Inheritance diagram for CVImageGrey:
List of all members.
Detailed Description
CVImageGrey is an 8-bit greyscale image class derived from CVImage
See CVImage.h for general documentation.
- See also:
- CVImage, CVImageRGB24, CVImageRGBFloat
- RCSfile
- CVImageGrey.h,v
- Date
- 2004/02/08 23:47:39
- Revision
- 1.1.1.1
- Author
- mikeellison
Definition at line 64 of file CVImageGrey.h. Public Member Functions
Protected Member Functions
Private Attributes
Constructor & Destructor Documentation
| CVImageGrey::CVImageGrey |
( |
|
) |
[protected] |
|
Member Function Documentation
| int CVImageGrey::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 79 of file CVImageGrey.cpp. |
| CVRES CVImageGrey::GetMaxPixelValue |
( |
float & |
maxValue |
) |
const [virtual] |
|
| int CVImageGrey::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 70 of file CVImageGrey.cpp. |
| CVRES CVImageGrey::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 CVImageGrey, this returns the intensity value on all three channels (red, green, and blue).
- 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 155 of file CVImageGrey.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 * CVImageGrey::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 101 of file CVImageGrey.cpp. |
| char CVImageGrey::GetPNMMagicVal |
( |
|
) |
const [virtual] |
|
| CVRES CVImageGrey::SetFromWin32Bmp |
( |
const BITMAPINFOHEADER * |
bmih, |
|
|
const unsigned char * |
data |
|
) |
[protected, virtual] |
|
| CVRES CVImageGrey::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 CVImageGrey(), this sets the pixel to: value = 0.299r + 0.587g + 0.114b
Values are from the Y (Luminance) in YIQ conversion, Computer Graphics, Principles and Practice 2nd Ed. by Foley, van Dam, Feiner, Hughes.
Intensity values above 255 will be truncated to 255. Values below 0 will be set to 0.
- 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 226 of file CVImageGrey.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
The documentation for this class was generated from the following files:
|