MIRA
Public Types | Public Member Functions | Protected Attributes | Friends | List of all members
Img< void, 1 > Class Template Reference

untyped image class This class provides a fully dynamic image, where type and channels are not known at compile time. More...

#include <image/Img.h>

Inheritance diagram for Img< void, 1 >:
Inheritance graph
[legend]

Public Types

typedef UntypedImgIterator iterator
 
typedef UntypedImgConstIterator const_iterator
 

Public Member Functions

 Img ()
 
 Img (int width, int height, int type, int channels)
 constructs a new image of given size and type note: the image data is allocated but not initialized More...
 
 Img (const Size2i &size, int type, int channels)
 constructs a new image of given size and type note: the image data is allocated but not initialized More...
 
template<typename TImg >
 Img (const ImgBase< TImg > &other)
 
 Img (const cv::Mat &data)
 constructor from cv::Mat constructor is public, since we do not have a type safe image More...
 
template<typename TImg >
Selfoperator= (const ImgBase< TImg > &other)
 shallow copy More...
 
Img operator() (const cv::Rect &roi)
 returns a ROI out of the image Returns a new image with set ROI on the image data. More...
 
Img operator() (const cv::Rect &roi) const
 returns a ROI out of the image Returns a new image with set ROI on the image data. More...
 
template<typename TPixel , int TChannels>
bool hasType () const
 Returns true, if the untyped image internally has the specified type, i.e. More...
 
iterator begin ()
 
iterator end ()
 
const_iterator begin () const
 
const_iterator end () const
 
 operator const cv::Mat & () const
 cast operator to const cv::Mat More...
 
 operator cv::Mat & ()
 cast operator to cv::Mat More...
 
void assignROI (const cv::Rect &roi, const ImgBase &other)
 Copies the content of other into the specified region of interest (ROI) of THIS image. More...
 
void assignMask (const cv::Rect &roi, const ImgBase &other, const cv::Mat &mask)
 Copies the content of other into the specified region of interest (ROI) of THIS image, where mask has non-zero values. More...
 
void assignPolygon (const cv::Rect &roi, const ImgBase &other, const Polygon2i &poly)
 Copies the content of other into the specified region of interest (ROI) of THIS image, in area covered by polygon. More...
 
bool operator== (const cv::Mat &other) const
 Returns true if two images are equal. More...
 
bool operator!= (const cv::Mat &other) const
 Returns true if two images are different. More...
 
const cv::MatgetMat () const
 Returns const access to internal data. More...
 
bool empty () const
 returns true if internal Mat is empty More...
 
int width () const
 
int height () const
 
std::size_t step () const
 Number of bytes from one row to the next. More...
 
std::size_t bytesPerLine () const
 Returns the number of bytes per image line. More...
 
Size2i size () const
 Returns size of image data. More...
 
int depth () const
 Returns the bit-depth of the image E.g. More...
 
int channels () const
 Returns the number of channels of this image. More...
 
bool isEmpty () const
 returns true if internal Mat is empty More...
 
uint8 * data ()
 Returns pointer to underlying image data. More...
 
const uint8 * data () const
 Returns const pointer to underlying image data. More...
 
uint8 * data (int y)
 Returns pointer to underlying image data starting at scanline y. More...
 
const uint8 * data (int y) const
 Returns const pointer to underlying image data starting at scanline y. More...
 
ImgFormat format () const
 Return the storage format description. More...
 
void resize (const Size2i &s)
 Resizes the image to the specified dimensions (without changing its type, i.e. More...
 
void resize (int width, int height)
 Same as above method. More...
 
void clear ()
 Sets each pixel and each channel to zero. More...
 
Img< void, 1 > clone () const
 Deep copy of image data. More...
 
std::size_t total () const
 Returns the total size of the matrix (rows*cols) More...
 
void reflect (BinarySerializer< Derived > &r)
 reflect method for binaryStream serialization This method implements the reflection of width, height, type, and the actual image data serialization. More...
 
void reflect (BinaryDeserializer< Derived > &r)
 reflect method for binaryStream deserialization This method implements the reflection for width, height, type, and the image data deserialization. More...
 
void reflect (JSONSerializer &r)
 reflect method for json serialization This method implements the reflection of general data like width, height and image format, but not the full image data. More...
 

Protected Attributes

cv::Mat mData
 

Friends

class ImgBase< Self >
 

Detailed Description

template<>
class mira::Img< void, 1 >

untyped image class This class provides a fully dynamic image, where type and channels are not known at compile time.

Member Typedef Documentation

◆ iterator

◆ const_iterator

Constructor & Destructor Documentation

◆ Img() [1/5]

Img ( )
inline

◆ Img() [2/5]

Img ( int  width,
int  height,
int  type,
int  channels 
)
inline

constructs a new image of given size and type note: the image data is allocated but not initialized

Parameters
widthwidth of image
heightheight of image
typeCV_TYPE of the image
channelsnumber of channels

◆ Img() [3/5]

Img ( const Size2i size,
int  type,
int  channels 
)
inline

constructs a new image of given size and type note: the image data is allocated but not initialized

Parameters
sizesize of image
typeCV_TYPE of the image
channelsnumber of channels

◆ Img() [4/5]

Img ( const ImgBase< TImg< void, 1 > > &  other)
inline

◆ Img() [5/5]

Img ( const cv::Mat data)
inline

constructor from cv::Mat constructor is public, since we do not have a type safe image

Member Function Documentation

◆ operator=()

Self& operator= ( const ImgBase< TImg< void, 1 > > &  other)
inline

shallow copy

◆ operator()() [1/2]

Img operator() ( const cv::Rect &  roi)
inline

returns a ROI out of the image Returns a new image with set ROI on the image data.

Note
no image data is copied, just a new header is created.

◆ operator()() [2/2]

Img operator() ( const cv::Rect &  roi) const
inline

returns a ROI out of the image Returns a new image with set ROI on the image data.

Note
no image data is copied, just a new header is created.

◆ hasType()

bool hasType ( ) const
inline

Returns true, if the untyped image internally has the specified type, i.e.

TPixel type and TChannels match to the internal image type.

◆ begin() [1/2]

iterator begin ( )
inline

◆ end() [1/2]

iterator end ( )
inline

◆ begin() [2/2]

const_iterator begin ( ) const
inline

◆ end() [2/2]

const_iterator end ( ) const
inline

◆ operator const cv::Mat &()

operator const cv::Mat & ( ) const
inlineinherited

cast operator to const cv::Mat

◆ operator cv::Mat &()

operator cv::Mat & ( )
inlineinherited

cast operator to cv::Mat

◆ assignROI()

void assignROI ( const cv::Rect &  roi,
const ImgBase< Img< void, 1 > > &  other 
)
inlineinherited

Copies the content of other into the specified region of interest (ROI) of THIS image.

Note, the number of rows and columns of "other" and "this" ROI must be equal.

◆ assignMask()

void assignMask ( const cv::Rect &  roi,
const ImgBase< Img< void, 1 > > &  other,
const cv::Mat mask 
)
inlineinherited

Copies the content of other into the specified region of interest (ROI) of THIS image, where mask has non-zero values.

Note, the number of rows and columns of "other", "mask" and "this" ROI must be equal.

◆ assignPolygon()

void assignPolygon ( const cv::Rect &  roi,
const ImgBase< Img< void, 1 > > &  other,
const Polygon2i poly 
)
inlineinherited

Copies the content of other into the specified region of interest (ROI) of THIS image, in area covered by polygon.

The result does not depend on cw/ccw order of polygon points. Note, the number of rows and columns of "other" and "this" ROI must be equal. Polygon points are relative to roi, any polygon points outside roi are ignored! (i.e.they must be >= 0, < roi width/height)!

◆ operator==()

bool operator== ( const cv::Mat other) const
inlineinherited

Returns true if two images are equal.

this methods checks if two images are equal by comparing their dimensions, flags and pixel data (byte wise)

◆ operator!=()

bool operator!= ( const cv::Mat other) const
inlineinherited

Returns true if two images are different.

See operator==

◆ getMat()

const cv::Mat& getMat ( ) const
inlineinherited

Returns const access to internal data.

◆ empty()

bool empty ( ) const
inlineinherited

returns true if internal Mat is empty

◆ width()

int width ( ) const
inlineinherited

◆ height()

int height ( ) const
inlineinherited

◆ step()

std::size_t step ( ) const
inlineinherited

Number of bytes from one row to the next.

◆ bytesPerLine()

std::size_t bytesPerLine ( ) const
inlineinherited

Returns the number of bytes per image line.

◆ size()

Size2i size ( ) const
inlineinherited

Returns size of image data.

◆ depth()

int depth ( ) const
inlineinherited

Returns the bit-depth of the image E.g.

CV_8U, CV_8S, CV_16U, CV_16S, CV_32S, CV_32F, CV_64F

Returns
bit-depth of image

◆ channels()

int channels ( ) const
inlineinherited

Returns the number of channels of this image.

Note: typed images also have a static enum value 'Channels'

Returns
Number of image channels

◆ isEmpty()

bool isEmpty ( ) const
inlineinherited

returns true if internal Mat is empty

◆ data() [1/4]

uint8* data ( )
inlineinherited

Returns pointer to underlying image data.

◆ data() [2/4]

const uint8* data ( ) const
inlineinherited

Returns const pointer to underlying image data.

◆ data() [3/4]

uint8* data ( int  y)
inlineinherited

Returns pointer to underlying image data starting at scanline y.

◆ data() [4/4]

const uint8* data ( int  y) const
inlineinherited

Returns const pointer to underlying image data starting at scanline y.

◆ format()

ImgFormat format ( ) const
inlineinherited

Return the storage format description.

◆ resize() [1/2]

void resize ( const Size2i s)
inlineinherited

Resizes the image to the specified dimensions (without changing its type, i.e.

channels and bit depth remains constant). The method does nothing, if the specified dimensions equal the current size of the image.

◆ resize() [2/2]

void resize ( int  width,
int  height 
)
inlineinherited

Same as above method.

◆ clear()

void clear ( )
inlineinherited

Sets each pixel and each channel to zero.

◆ clone()

Img< void, 1 > clone ( ) const
inlineinherited

Deep copy of image data.

◆ total()

std::size_t total ( ) const
inlineinherited

Returns the total size of the matrix (rows*cols)

◆ reflect() [1/3]

void reflect ( BinarySerializer< Derived > &  r)
inlineinherited

reflect method for binaryStream serialization This method implements the reflection of width, height, type, and the actual image data serialization.

◆ reflect() [2/3]

void reflect ( BinaryDeserializer< Derived > &  r)
inlineinherited

reflect method for binaryStream deserialization This method implements the reflection for width, height, type, and the image data deserialization.

◆ reflect() [3/3]

void reflect ( JSONSerializer r)
inlineinherited

reflect method for json serialization This method implements the reflection of general data like width, height and image format, but not the full image data.

It enables a basic overview in a text visualization.

Friends And Related Function Documentation

◆ ImgBase< Self >

friend class ImgBase< Self >
friend

Member Data Documentation

◆ mData

cv::Mat mData
protectedinherited

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