CodeVis.com SourceForge.net Logo

CVImage.cpp File Reference


Detailed Description

CVImage.cpp implements common functions for CVImage, 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.

RCSfile
CVImage.cpp,v
Date
2004/02/08 23:47:39
Revision
1.1.1.1
Author
mikeellison

Definition in file CVImage.cpp.

#include <stdio.h>
#include <memory.h>
#include "CVUtil.h"
#include "CVFile.h"
#include "CVImage.h"
#include "CVImageRGB24.h"
#include "CVImageRGBFloat.h"
#include "CVImageGrey.h"

Go to the source code of this file.


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