CVImage Class Reference#include <CVImage.h>
Inheritance diagram for CVImage:
List of all members.
Detailed Description
CVImage is the root image class for image capture and processing.
Stores the image as an unpadded array of pixels. Multiple formats are supported as derived classes. If you add a new type, you'll need to add it into the CVIMAGE_TYPE enum and add support where the type is referenced in CVImage in addition to creating the new child class itself.
Externally, use CVImage::CreateImage(), ReleaseImage(), and the other static functions to construct and destruct images. Do *not* use new and delete! CVImages are reference counted objects.
CVImage objects can now be sub images of other CVImage objects. What that means is that if you want to access the fData buffer directly via CVImage::GetRawDataPtr(), you need to take account of the x/y offsets and the fact that the size of the data buffer won't necessarily be the same size as the image.
You can get the absolute width and height of the image buffer from CVImage::AbsWidth() and CVImage::AbsHeight().
For the absolute X and Y offsets, use CVImage::XOffsetAbs() and CVImage::YOffsetAbs().
Please use these functions rather than just checking for parents and grabbing the parent's data! The parent might be a sub image as well.
Loading and saving currently support PNM (Portable Anywhere Maps) in binary formats only. Floating point and 32-bit integer formats have their own derivation of these formats. See documentation for the CVImage::Load() and CVImage::Save() functions in the code.
When adding new functions, if it's easy and portable please add them to only the CVImage base class. However, for image-type specific stuff, make them pure virtuals in the base class (if possible - if not return CVRES_NOT_IMPLEMENTED from the base), then implement them on all image types individually. If it's going to kill the speed to make the function generic in the base class, use the latter method and implement it for each type.
A note on threading....
CVImage objects should be accessed in a serialized manner. Additionally, all child (sub)images and parent images of a CVImage object should be serialized with each other. If you want to access a single image (or an image and its sub-images) simultaneously from multiple threads for anything but the const functions, I'd highly recommend making a copy of it first with CVImage::CreateCopy().
- See also:
- CVImageGrey, CVImageRGB24, CVImageRGBFloat
- RCSfile
- CVImage.h,v
- Date
- 2004/02/08 23:47:39
- Revision
- 1.1.1.1
- Author
- mikeellison
Definition at line 111 of file CVImage.h. Public Types
Public Member Functions
- virtual int GetNumChannels () const=0
- virtual int GetBytesPerPixel () const=0
- virtual CVIMAGE_TYPE GetImageType () const=0
- virtual const char * GetPNMExtension () const=0
- virtual char GetPNMMagicVal () const=0
- virtual CVRES GetMaxPixelValue (float &maxValue) const=0
- virtual CVRES GetPixel (int x, int y, float &r, float &g, float &b) const=0
- virtual CVRES SetPixel (int x, int y, float r, float g, float b)=0
- CVRES Clear ()
- CVRES SetSubPosition (int newXOffset, int newYOffset, int newWidth, int newHeight)
- unsigned char * GetRawDataPtr () const
- int XOffsetRel () const
- int YOffsetRel () const
- int XOffsetAbs () const
- int YOffsetAbs () const
- int AbsWidth () const
- int AbsHeight () const
- int Width () const
- int Height () const
- int Size () const
- int AbsSize () const
- bool IsImageRoot () const
- unsigned long AddRef ()
- unsigned long DecRef ()
Static Public Member Functions
- CVRES CreateImage (CVIMAGE_TYPE type, CVImage *&image, int width, int height, bool init=true)
- CVRES ReleaseImage (CVImage *&image)
- CVRES CreateCompatible (const CVImage *srcImg, CVImage *&dstImg, bool init=true)
- CVRES CreateCompatible (const CVImage *srcImg, CVImage *&dstImg, int width, int height, bool init=true)
- CVRES CreateSub (const CVImage *orgImg, CVImage *&dstImg, int xOffset, int yOffset, int width, int height)
- CVRES CopyImage (const CVImage *srcImg, CVImage *&dstImg)
- CVRES CopyImage (const CVImage *srcImg, CVImage *&dstImg, int xOffset, int yOffset, int width, int height)
- CVRES CreateFromWin32Bmp (CVIMAGE_TYPE imageType, CVImage *&dstImage, const BITMAPINFOHEADER *bmih, const unsigned char *data)
- bool IsBigEndianMachine ()
- CVRES Load (const char *filename, CVImage *&newImage)
- CVRES Save (const char *filename, const CVImage *outputImage, bool overwrite=true)
Protected Member Functions
Static Protected Member Functions
Protected Attributes
Member Enumeration Documentation
|
|
- Enumeration values:
-
| CVIMAGE_DEFAULT |
Default type (sometimes used for auto-detect). |
| CVIMAGE_RGB24 |
8-bit red, green, blue triplets |
| CVIMAGE_RGBFLOAT |
32-bit float red, green, blue triplets |
| CVIMAGE_GREY |
8-bit intensity values |
Definition at line 121 of file CVImage.h.
Referenced by CVDevGrabImage(), CVDevStartCap(), CVSaveImage(), CVImageRGBFloat::GetImageType(), CVImageRGB24::GetImageType(), CVImageGrey::GetImageType(), and Load(). |
Constructor & Destructor Documentation
| CVImage::CVImage |
( |
|
) |
[protected] |
|
| CVImage::~CVImage |
( |
|
) |
[protected, virtual] |
|
Member Function Documentation
| int CVImage::AbsHeight |
( |
|
) |
const |
|
| int CVImage::AbsSize |
( |
|
) |
const |
|
| int CVImage::AbsWidth |
( |
|
) |
const |
|
|
|
Returns the absolute width of the fData image buffer. - Returns:
- int - Absolute width of root image
Definition at line 699 of file CVImage.cpp.
References fParentImage, and fWidth.
Referenced by AbsSize(), CopyImage(), GetMaxPixel(), CVImageRGBFloat::GetPixel(), CVImageRGB24::GetPixel(), CVImageGrey::GetPixel(), Save(), CVImageRGBFloat::SetPixel(), CVImageRGB24::SetPixel(), and CVImageGrey::SetPixel(). |
| unsigned long CVImage::AddRef |
( |
|
) |
|
|
| CVRES CVImage::CopyImage |
( |
const CVImage * |
srcImg, |
|
|
CVImage *& |
dstImg, |
|
|
int |
xOffset, |
|
|
int |
yOffset, |
|
|
int |
width, |
|
|
int |
height |
|
) |
[static] |
|
|
|
CopyImage() creates a new image of the same type as srcImg and stores it in dstImg. The data from srcImg is copied into a buffer owned by dstImg. Caller must call CVImage::ReleaseImage() on the returned image when done.
This version allows you to specify offsets, width, and height of the data to copy into a new image.
- Parameters:
-
| srcImg | - source image to copy from |
| dstImg | - uninitialized image ptr. Contains copy of srcImg on return. |
| xOffset | - relative x offset for top-left of copy. |
| yOffset | - relative y offset for top-left of copy. |
| width | - width of destination image. |
| height | - height of destination image. |
- Returns:
- CVRES result code
- See also:
- CVRES_CORE_ENUM, CVRES_IMAGE_ENUM, CVImage::ReleaseImage()
Definition at line 367 of file CVImage.cpp.
References AbsWidth(), CreateImage(), CVAssert, CVFAILED, CVRES, CVRES_IMAGE_INVALID_SUB_POSITION, CVRES_INVALID_PARAMETER, CVRES_SUCCESS, fData, fHeight, fWidth, GetBytesPerPixel(), GetImageType(), XOffsetAbs(), and YOffsetAbs(). |
| CVRES CVImage::Create |
( |
int |
width, |
|
|
int |
height, |
|
|
bool |
init |
|
) |
[protected] |
|
|
|
Create - internal image creation function. Creates the buffer and sets it up, then calls AddRef().
- Parameters:
-
| width | - width of image in pixels. |
| height | - height of image in pixels. |
| init | - if true, initializes image pixels to 0. |
- Returns:
- CVRES result code.
- See also:
- CVRES_CORE_ENUM, CVRES_IMAGE_ENUM
Definition at line 598 of file CVImage.cpp.
References AddRef(), Clear(), CVRES, CVRES_IMAGE_INVALID_SIZE, CVRES_OUT_OF_MEMORY, CVRES_SUCCESS, fData, fHeight, fOwnData, fWidth, and GetBytesPerPixel().
Referenced by CreateImage(), CVImageRGBFloat::SetFromWin32Bmp(), CVImageRGB24::SetFromWin32Bmp(), and CVImageGrey::SetFromWin32Bmp(). |
| CVRES CVImage::CreateCompatible |
( |
const CVImage * |
srcImg, |
|
|
CVImage *& |
dstImg, |
|
|
int |
width, |
|
|
int |
height, |
|
|
bool |
init = true |
|
) |
[static] |
|
|
|
CreateCompatible creates an image of the same type as the specified srcImg. This version uses user-specified dimensions for the new image. Call CVImage::ReleaseImage() on returned image when done.
- Parameters:
-
| srcImg | - source image to get information from. |
| dstImg | - uninitialized image ptr. Set on return. |
| width | - width of desired image in pixels. |
| height | - height of desired image in pixels. |
| init | - if true, image data is set to 0. |
- Returns:
- CVRES result code
- See also:
- CVRES_CORE_ENUM, CVRES_IMAGE_ENUM, CVImage::ReleaseImage()
Definition at line 227 of file CVImage.cpp.
References CreateImage(), CVRES, and GetImageType(). |
| CVRES CVImage::CreateCompatible |
( |
const CVImage * |
srcImg, |
|
|
CVImage *& |
dstImg, |
|
|
bool |
init = true |
|
) |
[static] |
|
| CVRES CVImage::CreateFromWin32Bmp |
( |
CVIMAGE_TYPE |
imageType, |
|
|
CVImage *& |
dstImage, |
|
|
const BITMAPINFOHEADER * |
bmih, |
|
|
const unsigned char * |
data |
|
) |
[static] |
|
|
|
CreateFromWin32Bmp creates an image from a bitmap buffer. 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. You must call CVImage::ReleaseImage() on the image when you are done.
- Parameters:
-
| imageType | - type of image to create |
| dstImage | - uninitialized image ptr. Set on return. |
| 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()
Definition at line 453 of file CVImage.cpp.
References CVAssert, CVIMAGE_DEFAULT, CVIMAGE_GREY, CVIMAGE_RGB24, CVIMAGE_RGBFLOAT, CVRES, CVRES_IMAGE_INVALID_DATA, CVRES_IMAGE_UNKNOWN_TYPE, CVRES_IMAGE_UNSUPPORTED_FORMAT, CVRES_OUT_OF_MEMORY, and SetFromWin32Bmp().
Referenced by CVVidCaptureDSWin32::Grab(), and CVVidCaptureDSWin32::SampleCB(). |
|
|
CreateImage creates an image of the appropriate type.
Use this instead of new to create image objects. If width and height are non-zero, creates the appropriate memory for the image and adds a reference. Otherwise, does not create memory buffer or add reference.
Call CVImage::ReleaseImage() on the returned image when done.
- Parameters:
-
| type | - specifies the type of image to create. |
| image | - uninitialized image ptr. Set on return. |
| width | - desired width of image in pixels. |
| height | - desired height of image in pixels. |
| init | - if true, image data is set to 0. |
- Returns:
- CVRES result code
- See also:
- CVRES_CORE_ENUM, CVRES_IMAGE_ENUM, CVImage::ReleaseImage()
Definition at line 116 of file CVImage.cpp.
References Create(), CVAssert, CVIMAGE_DEFAULT, CVIMAGE_GREY, CVIMAGE_RGB24, CVIMAGE_RGBFLOAT, CVRES, CVRES_IMAGE_UNKNOWN_TYPE, CVRES_OUT_OF_MEMORY, and CVRES_SUCCESS.
Referenced by CopyImage(), CreateCompatible(), CreateSub(), CVSaveImage(), and Load(). |
| CVRES CVImage::CreateSub |
( |
const CVImage * |
orgImg, |
|
|
CVImage *& |
dstImg, |
|
|
int |
xOffset, |
|
|
int |
yOffset, |
|
|
int |
width, |
|
|
int |
height |
|
) |
[static] |
|
|
|
CreateSub creates a sub-image of the specified parent.
dstImage should not be instantiated prior to calling CreateSub. Sub image is returned in dstImage.
The sub image references the parent's fData member, and the parent image must not be deleted before you are done using the sub image.
You may create a sub image of a sub image, ad infinum. It'll handle the offsets. Call CVImage::ReleaseImage() when done.
- Parameters:
-
| orgImg | - parent image to derive subimage from. |
| dstImg | - uninitialized image ptr. Set on return. |
| xOffset | - relative x offset for top-left of sub image. |
| yOffset | - relative y offset for top-left of sub image. |
| width | - width of sub image. |
| height | - height of sub image. |
- Returns:
- CVRES result code
- See also:
- CVRES_CORE_ENUM, CVRES_IMAGE_ENUM, CVImage::ReleaseImage()
CVImage::SetSubPosition()
Definition at line 260 of file CVImage.cpp.
References AddRef(), CreateImage(), CVAssert, CVFAILED, CVRES, CVRES_IMAGE_INVALID_SUB_POSITION, CVRES_SUCCESS, fData, fHeight, fOwnData, fParentImage, fWidth, fXOffset, fYOffset, and GetImageType().
Referenced by capCallback(). |
| unsigned long CVImage::DecRef |
( |
|
) |
|
|
| virtual int CVImage::GetBytesPerPixel |
( |
|
) |
const [pure 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
- See also:
- GetNumChannels()
Implemented in CVImageGrey, CVImageRGB24, and CVImageRGBFloat.
Referenced by AbsSize(), CopyImage(), Create(), CVImgStructFromImage(), CVSaveImage(), DllCaptureCb(), Load(), Save(), and Size(). |
| virtual CVIMAGE_TYPE CVImage::GetImageType |
( |
|
) |
const [pure virtual] |
|
|
template<class PixelTypeT> |
| CVRES CVImage::GetMaxPixel |
( |
PixelTypeT & |
maxVal |
) |
const [inline, protected] |
|
|
|
GetMaxPixel() provides an easy way to retrieve the maximum pixel value.
Right now, we call it from GetMaxPixelValue() in the child classes, so the caller doesn't have to deal with undue templating and we don't have to deal with rewriting the code each time.
Note that the PixelTypeT type is specific to the type of image. CVImageGrey uses an unsigned character, CVImageRGBFloat uses a float, etc. Using the wrong type is a good way to go haywire in the memory, which is one reason why this is protected and encapsulated via GetMaxPixelValue().
- Parameters:
-
| maxVal | - reference to value, set on return. Must be of the same pixel type that the image contains. |
- Returns:
- CVRES result code.
- See also:
- GetMaxPixelValue()
Definition at line 666 of file CVImage.h.
References AbsWidth(), CVAssert, CVMax(), CVRES, CVRES_IMAGE_MUST_INITIALIZE_ERR, CVRES_SUCCESS, fData, fHeight, fWidth, GetNumChannels(), XOffsetAbs(), and YOffsetAbs().
Referenced by CVImageRGBFloat::GetMaxPixelValue(), CVImageRGB24::GetMaxPixelValue(), and CVImageGrey::GetMaxPixelValue(). |
| virtual CVRES CVImage::GetMaxPixelValue |
( |
float & |
maxValue |
) |
const [pure virtual] |
|
| virtual int CVImage::GetNumChannels |
( |
|
) |
const [pure virtual] |
|
| virtual CVRES CVImage::GetPixel |
( |
int |
x, |
|
|
int |
y, |
|
|
float & |
r, |
|
|
float & |
g, |
|
|
float & |
b |
|
) |
const [pure 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.
All child classes should implement this.
- 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()
Implemented in CVImageGrey, CVImageRGB24, and CVImageRGBFloat.
Referenced by SlowNegateImage(). |
| virtual const char* CVImage::GetPNMExtension |
( |
|
) |
const [pure virtual] |
|
| virtual char CVImage::GetPNMMagicVal |
( |
|
) |
const [pure virtual] |
|
| unsigned char * CVImage::GetRawDataPtr |
( |
|
) |
const |
|
|
|
GetRawDataPtr() retrieves the image data ptr.
Remember that this may be a sub image, in which case the data ptr returned is to the raw buffer of a parent image. It can also be of any format / byte size - check GetImageType() to determine how to access the buffer.
So, any time you access the raw data you should use the XOffsetAbs, YOffsetAbs, AbsWidth, and AbsHeight functions when calculating your pointers into the data.
Also remember that if you modify a sub image, you'll be modifying the parent image and any other overlapping sub images. If you want to muck with an image without messing up any others, use CVImage::CopyImage() first to get a base image that owns its own data.
Note that the xOffset and yOffset are relative to parent. They will be calculated at runtime if you call this function.
- Returns:
- unsigned char* to image data
Definition at line 796 of file CVImage.cpp.
References fData.
Referenced by CVImgStructFromImage(), CVSaveImage(), DllCaptureCb(), Load(), and Save(). |
| int CVImage::Height |
( |
|
) |
const |
|
| bool CVImage::IsBigEndianMachine |
( |
|
) |
[static] |
|
|
|
IsBigEndianMachine returns true if it is on a big-endian machine, such as a Macintosh, and returns false on little-endian machines like Intel or AMD PC's.
- Returns:
- bool - true if big-endian, false if little-endian.
Definition at line 806 of file CVImage.cpp.
Referenced by CVImageRGBFloat::GetPNMMagicVal(), and Load(). |
| bool CVImage::IsImageRoot |
( |
|
) |
const |
|
| CVRES CVImage::Load |
( |
const char * |
filename, |
|
|
CVImage *& |
newImage |
|
) |
[static] |
|
|
|
Load() creates the appropriate image type based on type of file.
newImage should *not* be instantiated prior to passing it in.
Currently only supports binary .pgm, .ppm, .pxm, and .pdm formats.
.pgm and .ppm were created by Jef Poskanzer with his Portable Bitmap Utilities, and are not only very simple but also widely supported and well documented.
.pxm is based on the .ppm format, but using 32-bit floating point values for R, G, and B. The magic value used for .pxm files differs depending on endian-ness. I'm using P7 for little endian, and P8 for big-endian.
.pdm is a similar idea, but with 32-bit integer values. The magic values for .pdm files are P9 for little-endian, and PA for big-endian.
In both .pxm and .pdm files, the max value is ignored on load, although written in Save(). The max pixel value is written as 255 for .ppm's and .pgm's and is also ignored on load.
- Parameters:
-
| filename | - ASCIIZ filename of the image to load |
| newImage | - uninitialized pointer to image. Set on return. |
- Returns:
- CVRES result code
- See also:
- CVRES_CORE_ENUM, CVRES_IMAGE_ENUM, CVRES_FILE_ENUM,
CVImage::Save()
Definition at line 840 of file CVImage.cpp.
References CVFile::Close(), CreateImage(), CVAssert, CVFAILED, CVIMAGE_GREY, CVIMAGE_RGB24, CVIMAGE_RGBFLOAT, CVIMAGE_TYPE, CVRES, CVRES_FILE_DOES_NOT_EXIST, CVRES_IMAGE_FILE_CORRUPTED, CVRES_IMAGE_UNKNOWN_TYPE, CVRES_IMAGE_UNSUPPORTED_TYPE, CVRES_OUT_OF_MEMORY, CVRES_SUCCESS, CVTrace, CVFile::FileExists(), GetBytesPerPixel(), GetRawDataPtr(), IsBigEndianMachine(), CVFile::OpenForRead(), CVFile::ReadLine(), ReadNonCommentLine(), ReleaseImage(), and Size().
Referenced by CVLoadImage(). |
|
|
operator= is overridden to generate an error if someone attempts to use it - Don't use it! Use CreateCopy() or CreateSub() instead depending on whether you want a deep or shallow copy of the object.
Definition at line 1278 of file CVImage.cpp.
References CVAssert. |
| CVRES CVImage::ReadNonCommentLine |
( |
CVFile * |
file, |
|
|
char * |
buffer, |
|
|
int |
maxBufLen |
|
) |
[static, protected] |
|
|
|
ReleaseImage decrements the reference count of an image and will free the image if it hits zero. It may also free parent images if the specified image holds the last reference to a parent.
- Parameters:
-
| image | - pointer to image to release. Is set to NULL if last reference was deleted. |
- Returns:
- CVRES result code
- See also:
- CVRES_CORE_ENUM, CVRES_IMAGE_ENUM, CVImage::CreateImage()
Definition at line 164 of file CVImage.cpp.
References CVAssert, CVRES, CVRES_INVALID_PARAMETER, CVRES_SUCCESS, DecRef(), and fRefCount.
Referenced by capCallback(), CVDevGrabImage(), CVLoadImage(), CVSaveImage(), DecRef(), Load(), CVVidCaptureDSWin32::SampleCB(), and TestIt(). |
| CVRES CVImage::Save |
( |
const char * |
filename, |
|
|
const CVImage * |
outputImage, |
|
|
bool |
overwrite = true |
|
) |
[static] |
|
|
|
Save() saves an image file to disk.
Format is automatically chosen depending on image type. See Load() for comments.
File extension is appended if none is set (preferred)
- Parameters:
-
| filename | - ASCIIZ filename of image to save. You do not need to include the extension - it is automatically determined. |
| outputImage | - Image to write to the file. |
| overwrite | - if true, overwrites the file if one already exists. |
- Returns:
- CVRES result code
- See also:
- CVRES_CORE_ENUM, CVRES_IMAGE_ENUM, CVRES_FILE_ENUM,
CVImage::Load()
Definition at line 1151 of file CVImage.cpp.
References AbsWidth(), CVFile::Close(), CVFile::Create(), CVAssert, CVFAILED, CVRES, CVRES_IMAGE_ALREADY_EXISTS, CVRES_IMAGE_EMPTY_ERR, CVRES_OUT_OF_MEMORY, CVRES_SUCCESS, CVTrace, fData, CVFile::FileExists(), GetBytesPerPixel(), GetMaxPixelValue(), GetPNMExtension(), GetPNMMagicVal(), GetRawDataPtr(), Height(), Width(), CVFile::Write(), CVFile::WriteString(), XOffsetAbs(), and YOffsetAbs().
Referenced by capCallback(), CVSaveImage(), and TestIt(). |
| CVRES CVImage::SetFromWin32Bmp |
( |
const BITMAPINFOHEADER * |
bmih, |
|
|
const unsigned char * |
data |
|
) |
[protected, virtual] |
|
| virtual CVRES CVImage::SetPixel |
( |
int |
x, |
|
|
int |
y, |
|
|
float |
r, |
|
|
float |
g, |
|
|
float |
b |
|
) |
[pure 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.
All child classes should implement this.
- 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()
Implemented in CVImageGrey, CVImageRGB24, and CVImageRGBFloat.
Referenced by SlowNegateImage(). |
| CVRES CVImage::SetSubPosition |
( |
int |
newXOffset, |
|
|
int |
newYOffset, |
|
|
int |
newWidth, |
|
|
int |
newHeight |
|
) |
|
|
|
|
SetSubPosition() moves the ROI of the image within its parent. Will return CVRES_IMAGE_OPERATION_INVALID_ON_ROOT if you try to use this on a root image instead of a sub image.
- Parameters:
-
| newXOffset | - relative x offset of new pos within parent. |
| newYOffset | - relative y offset of new pos within parent. |
| newWidth | - new width of sub image. |
| newHeight | - new height of sub image. |
- Returns:
- CVRES result code.
- See also:
- CVRES_CORE_ENUM, CVRES_IMAGE_ENUM, CVImage::CreateSub()
Definition at line 1290 of file CVImage.cpp.
References CVAssert, CVRES, CVRES_IMAGE_INVALID_SUB_POSITION, CVRES_IMAGE_OPERATION_INVALID_ON_ROOT, CVRES_SUCCESS, fData, fHeight, fParentImage, fWidth, fXOffset, fYOffset, and IsImageRoot(). |
| int CVImage::Size |
( |
|
) |
const |
|
| int CVImage::Width |
( |
|
) |
const |
|
| int CVImage::XOffsetAbs |
( |
|
) |
const |
|
| int CVImage::XOffsetRel |
( |
|
) |
const |
|
|
|
Returns relative offset within parent image. - Returns:
- int - X Offset relative to parent.
Definition at line 646 of file CVImage.cpp.
References fXOffset.
Referenced by CopyImage(). |
| int CVImage::YOffsetAbs |
( |
|
) |
const |
|
| int CVImage::YOffsetRel |
( |
|
) |
const |
|
|
|
Returns relative offset within parent image. - Returns:
- int - Y Offset relative to parent.
Definition at line 655 of file CVImage.cpp.
References fYOffset.
Referenced by CopyImage(). |
Member Data Documentation
|
|
Definition at line 718 of file CVImage.h.
Referenced by Clear(), CopyImage(), Create(), CreateSub(), CVImage(), GetMaxPixel(), CVImageRGBFloat::GetPixel(), CVImageRGB24::GetPixel(), CVImageGrey::GetPixel(), GetRawDataPtr(), Save(), CVImageRGBFloat::SetFromWin32Bmp(), CVImageRGB24::SetFromWin32Bmp(), CVImageGrey::SetFromWin32Bmp(), CVImageRGBFloat::SetPixel(), CVImageRGB24::SetPixel(), CVImageGrey::SetPixel(), SetSubPosition(), and ~CVImage(). |
|
|
Definition at line 717 of file CVImage.h.
Referenced by AbsHeight(), CopyImage(), Create(), CreateSub(), CVImage(), GetMaxPixel(), CVImageRGBFloat::GetPixel(), CVImageRGB24::GetPixel(), CVImageGrey::GetPixel(), Height(), CVImageRGBFloat::SetFromWin32Bmp(), CVImageRGB24::SetFromWin32Bmp(), CVImageGrey::SetFromWin32Bmp(), CVImageRGBFloat::SetPixel(), CVImageRGB24::SetPixel(), CVImageGrey::SetPixel(), SetSubPosition(), and Size(). |
|
|
Definition at line 716 of file CVImage.h.
Referenced by AbsWidth(), CopyImage(), Create(), CreateSub(), CVImage(), GetMaxPixel(), CVImageRGBFloat::GetPixel(), CVImageRGB24::GetPixel(), CVImageGrey::GetPixel(), CVImageRGBFloat::SetFromWin32Bmp(), CVImageRGB24::SetFromWin32Bmp(), CVImageGrey::SetFromWin32Bmp(), CVImageRGBFloat::SetPixel(), CVImageRGB24::SetPixel(), CVImageGrey::SetPixel(), SetSubPosition(), Size(), and Width(). |
The documentation for this class was generated from the following files:
|