Image class which provides a thin layer around an IplImage. More...
#include "wimage.hpp"
Public Types | |
typedef T | BaseType |
Public Member Functions | |
virtual | ~WImage ()=0 |
int | Channels () const |
int | ChannelSize () const |
void | CopyFrom (const WImage< T > &src) |
int | Depth () const |
template<> | |
int | Depth () const |
template<> | |
int | Depth () const |
template<> | |
int | Depth () const |
template<> | |
int | Depth () const |
template<> | |
int | Depth () const |
template<> | |
int | Depth () const |
template<> | |
int | Depth () const |
int | Height () const |
T * | ImageData () |
const T * | ImageData () const |
IplImage * | Ipl () |
const IplImage * | Ipl () const |
T * | operator() (int c, int r) |
const T * | operator() (int c, int r) const |
int | PixelSize () const |
const T * | Row (int r) const |
T * | Row (int r) |
void | SetZero () |
WImageView< T > | View (int c, int r, int width, int height) |
int | Width () const |
int | WidthStep () const |
Protected Member Functions | |
WImage (const WImage &) | |
WImage (IplImage *img) | |
void | operator= (const WImage &) |
void | SetIpl (IplImage *image) |
Protected Attributes | |
IplImage * | image_ |
Image class which provides a thin layer around an IplImage.
The goals of the class design are:
-# All the data has explicit ownership to avoid memory leaks -# No hidden allocations or copies for performance. -# Easy access to OpenCV methods (which will access IPP if available) -# Can easily treat external data as an image -# Easy to create images which are subsets of other images -# Fast pixel access which can take advantage of number of channels if known at compile time.
The WImage class is the image class which provides the data accessors. The 'W' comes from the fact that it is also a wrapper around the popular but inconvenient IplImage class. A WImage can be constructed either using a WImageBuffer class which allocates and frees the data, or using a WImageView class which constructs a subimage or a view into external data. The view class does no memory management. Each class actually has two versions, one when the number of channels is known at compile time and one when it isn't. Using the one with the number of channels specified can provide some compile time optimizations by using the fact that the number of channels is a constant.
We use the convention (c,r) to refer to column c and row r with (0,0) being the upper left corner. This is similar to standard Euclidean coordinates with the first coordinate varying in the horizontal direction and the second coordinate varying in the vertical direction. Thus (c,r) is usually in the domain [0, width) X [0, height)
Example usage:
Functions that are not part of the basic image allocation, viewing, and access should come from OpenCV, except some useful functions that are not part of OpenCV can be found in wimage_util.h
typedef T cv::WImage< T >::BaseType |
|
protected |
|
inlineexplicitprotected |
References IplImage::depth.
|
inline |
References cv::WImage< T >::image_, and IplImage::nChannels.
Referenced by cv::WImageBuffer< T >::CloneFrom(), cv::WImage< T >::operator()(), cv::WImage< T >::PixelSize(), and cv::WImageC< T, C >::WImageC().
|
inline |
|
inline |
References cvCopy(), cv::WImage< T >::image_, and cv::WImage< T >::Ipl().
Referenced by cv::WImageBuffer< T >::CloneFrom(), and cv::WImageBufferC< T, C >::CloneFrom().
int cv::WImage< T >::Depth | ( | ) | const |
|
inline |
References IPL_DEPTH_8U.
|
inline |
References IPL_DEPTH_8S.
|
inline |
References IPL_DEPTH_16S.
|
inline |
References IPL_DEPTH_16U.
|
inline |
References IPL_DEPTH_32S.
|
inline |
References IPL_DEPTH_32F.
|
inline |
References IPL_DEPTH_64F.
|
inline |
References IplImage::height, and cv::WImage< T >::image_.
Referenced by cv::WImageBuffer< T >::CloneFrom(), and cv::WImageBufferC< T, C >::CloneFrom().
|
inline |
References cv::WImage< T >::image_, and IplImage::imageData.
|
inline |
References cv::WImage< T >::image_, and IplImage::imageData.
|
inline |
References cv::WImage< T >::image_.
Referenced by cv::WImage< T >::CopyFrom(), cv::WImageC< T, C >::CopyFrom(), cv::WImageView< T >::operator=(), cv::WImageViewC< T, C >::operator=(), cv::WImageView< T >::WImageView(), and cv::WImageViewC< T, C >::WImageViewC().
|
inline |
References cv::WImage< T >::image_.
|
inline |
References cv::WImage< T >::Channels(), cv::WImage< T >::image_, IplImage::imageData, and IplImage::widthStep.
|
inline |
References cv::WImage< T >::Channels(), cv::WImage< T >::image_, IplImage::imageData, and IplImage::widthStep.
|
protected |
Referenced by cv::WImageC< T, C >::Channels(), cv::WImageBuffer< T >::IsNull(), cv::WImageBufferC< T, C >::IsNull(), and cv::WImage< T >::SetZero().
|
inline |
References cv::WImage< T >::Channels(), cv::WImage< T >::ChannelSize(), and cv::WImage< T >::Depth().
|
inline |
References cv::WImage< T >::image_, IplImage::imageData, and IplImage::widthStep.
|
inline |
References cv::WImage< T >::image_, IplImage::imageData, and IplImage::widthStep.
|
inlineprotected |
References IplImage::depth, and cv::WImage< T >::image_.
Referenced by cv::WImageView< T >::operator=(), cv::WImageBuffer< T >::ReleaseImage(), cv::WImageC< T, C >::SetIpl(), cv::WImageBuffer< T >::SetIpl(), and cv::WImageView< T >::WImageView().
|
inline |
References cvSetZero(), cv::WImage< T >::image_, cv::WImage< T >::operator=(), cv::WImage< T >::View(), and cv::WImage< T >::WImage().
|
inline |
References cv::WImage< T >::image_, and IplImage::width.
Referenced by cv::WImageBuffer< T >::CloneFrom(), and cv::WImageBufferC< T, C >::CloneFrom().
|
inline |
References cv::WImage< T >::image_, and IplImage::widthStep.
|
protected |
Referenced by cv::WImage< T >::Channels(), cv::WImage< T >::CopyFrom(), cv::WImage< T >::Height(), cv::WImage< T >::ImageData(), cv::WImage< T >::Ipl(), cv::WImage< T >::operator()(), cv::WImage< T >::Row(), cv::WImage< T >::SetIpl(), cv::WImage< T >::SetZero(), cv::WImage< T >::Width(), and cv::WImage< T >::WidthStep().