Image Component Library (ICL)
|
ImgBase is the Image-Interface class that provides save access to underlying Img-template \. More...
#include <ImgBase.h>
Public Member Functions | |
virtual | ~ImgBase () |
Destructor. | |
bool | hasMetaData () const |
returns whether meta data has been associated to this image | |
void | setMetaData (const std::string &data) |
associates new meta data with this image | |
void | clearMetaData () |
removes all meta data | |
const std::string & | getMetaData () const |
returns associated meta data | |
std::string & | getMetaData () |
returns associated meta data (unconst) | |
Protected Member Functions | |
ImgBase (depth d, const ImgParams ¶ms) | |
Creates an ImgBase object with specified image parameters. | |
Protected Attributes | |
ImgParams | m_oParams |
all image params | |
depth | m_eDepth |
depth of the image (depth8 for icl8u/depth32 for icl32f) | |
utils::Time | m_timestamp |
timestamp of the image | |
std::string | m_metaData |
additional information associated with this image | |
shallow copy | |
virtual ImgBase * | shallowCopy (const utils::Rect &roi, const std::vector< int > &channelIndices, format fmt, utils::Time time=utils::Time::null, ImgBase **ppoDst=NULL)=0 |
const ImgBase * | shallowCopy (const utils::Rect &roi, const std::vector< int > &channelIndices, format fmt, utils::Time time=utils::Time::null) const |
ImgBase * | reinterpretChannels (format newFmt, ImgBase **ppoDst=NULL) |
Create a shallow copy of this image with a new format. | |
const ImgBase * | reinterpretChannels (format newFmt) const |
Create a shallow copy of this image with a new format (const version) | |
ImgBase * | shallowCopy (const utils::Rect &roi, ImgBase **ppoDst=NULL) |
Create a shallow copy of the image. | |
ImgBase * | shallowCopy (ImgBase **ppoDst=NULL) |
const ImgBase * | shallowCopy (const utils::Rect &roi) const |
Create a shallow copy of a const source image. | |
ImgBase * | selectChannels (const std::vector< int > &channelIndices, ImgBase **ppoDst=0) |
Create a shallow copy of selected channels of an image. | |
ImgBase * | selectChannel (int channelIndex, ImgBase **ppoDst=0) |
Create a shallow copy of a single image channel of an image. | |
const ImgBase * | selectChannels (const std::vector< int > &channelIndices) const |
Create a shallow copy of selected channels of a const image. | |
const ImgBase * | selectChannel (int channelIndex) const |
Create a shallow copy of a single image channel of a const image. | |
deep copy and depth conversion | |
virtual ImgBase * | deepCopy (ImgBase **ppoDst=0) const =0 |
Create a deep copy of a given image. | |
virtual ImgBase * | deepCopyROI (ImgBase **ppoDst=0) const =0 |
Create a deep copy of an images ROI. | |
template<class T > | |
Img< T > * | convert (Img< T > *poDst=NULL) const |
returns an Img<T> instance of this image (type-conversion or deep copy) | |
ImgBase * | convert (depth d) const |
returns a converted (or deep copied) instance of this image | |
ImgBase * | convert (ImgBase *poDst) const |
converts image data into the given destination image | |
template<class T > | |
Img< T > * | convertROI (Img< T > *poDst=NULL) const |
returns a converted (or deep copied) instance of this images ROI | |
ImgBase * | convertROI (depth d) const |
returns a converted (or deep copied) instance of this images ROI | |
ImgBase * | convertROI (ImgBase *poDst) const |
converts this images ROI into a given destination image | |
virtual ImgBase * | scaledCopy (const utils::Size &newSize, scalemode eScaleMode=interpolateNN) const =0 |
Create a scaled copy with given size of an image. | |
virtual ImgBase * | scaledCopy (ImgBase **ppoDst=0, scalemode eScaleMode=interpolateNN) const =0 |
Create a scaled copy into a given destination image. | |
virtual ImgBase * | scaledCopyROI (const utils::Size &newSize, scalemode eScaleMode=interpolateNN) const =0 |
Create a scaled copy with given size of an images ROI. | |
virtual ImgBase * | scaledCopyROI (ImgBase **ppoDst=0, scalemode eScaleMode=interpolateNN) const =0 |
Create a scaled copy of an images ROI with optionally given destination image. | |
asImg<T> cast templates | |
template<class T > | |
Img< T > * | asImg () |
dynamically casts this image to one of its Img<T> subclasses | |
template<class T > | |
const Img< T > * | asImg () const |
dynamically casts this image to one of its Img<T> subclasses (const version) | |
Img< icl8u > * | as8u () |
convenience shortcut version for asImg<icl8u>() | |
Img< icl16s > * | as16s () |
convenience shortcut version for asImg<icl16s>() | |
Img< icl32s > * | as32s () |
convenience shortcut version for asImg<icl32s>() | |
Img< icl32f > * | as32f () |
convenience shortcut version for asImg<icl32f>() | |
Img< icl64f > * | as64f () |
convenience shortcut version for asImg<icl64f>() | |
const Img< icl8u > * | as8u () const |
convenience shortcut version for asImg<icl8u>() | |
const Img< icl16s > * | as16s () const |
convenience shortcut version for asImg<icl16s>() | |
const Img< icl32s > * | as32s () const |
convenience shortcut version for asImg<icl32s>() | |
const Img< icl32f > * | as32f () const |
convenience shortcut version for asImg<icl32f>() | |
const Img< icl64f > * | as64f () const |
convenience shortcut version for asImg<icl64f>() | |
getter (without ROI handling) | |
const ImgParams & | getParams () const |
returns all params in terms of a const ImgParams reference | |
const utils::Size & | getSize () const |
returns the size of the images | |
int | getWidth () const |
returns the images width | |
int | getHeight () const |
returns the images height | |
int | getDim () const |
returns the pixel count of each channel | |
int | getChannels () const |
returns the channel count of the image | |
depth | getDepth () const |
returns the depth (depth8u or depth32f) | |
format | getFormat () const |
returns the current (color)-format of this image | |
utils::Time | getTime () const |
returns the timestamp of the image | |
virtual int | getLineStep () const =0 |
returns the length of an image line in bytes (width*sizeof(Type)) | |
ROI handling | |
const utils::Rect & | getROI () const |
returns the images ROI rectangle | |
void | getROI (utils::Point &offset, utils::Size &size) const |
copies the current ROI into the given offset and size references | |
utils::Point | getROIOffset () const |
returns the images ROI offset (upper left corner) | |
utils::Size | getROISize () const |
returns the images ROI size | |
int | getROIWidth () const |
returns the images ROI width | |
int | getROIHeight () const |
returns the images ROI height | |
int | getROIXOffset () const |
returns the images ROI XOffset | |
int | getROIYOffset () const |
returns the images ROI YOffset | |
utils::Rect | getImageRect () const |
returns the image rect (0,0,width, height) | |
void | setROIOffset (const utils::Point &offset) |
sets the image ROI offset to the given value | |
void | setROISize (const utils::Size &size) |
sets the image ROI size to the given value | |
void | setROI (const utils::Point &offset, const utils::Size &size) |
set both image ROI offset and size | |
void | setROI (const utils::Rect &roi) |
sets the image ROI to the given rectangle | |
void | setROIOffsetAdaptive (const utils::Point &offset) |
checks, eventually adapts and finally sets the image ROI size | |
void | setROISizeAdaptive (const utils::Size &size) |
checks, eventually adapts and finally sets the image ROI size | |
void | setROIAdaptive (const utils::Rect &roi) |
checks, eventually adapts and finally sets the image ROI size | |
int | hasFullROI () const |
returns ROISize == ImageSize | |
void | setFullROI () |
resets the image ROI to the whole image size with offset (0,0) | |
border functions | |
virtual void | fillBorder (bool setFullROI=true)=0 |
extrudes ROI borders through non-ROI borders | |
virtual void | fillBorder (icl64f val, bool setFullROI=true)=0 |
fills all non-ROI pixels with a given value | |
virtual void | fillBorder (const std::vector< icl64f > &vals, bool setFullROI=true)=0 |
fills all non-ROI pixels with a given value | |
virtual void | fillBorder (const ImgBase *src, bool setFullROI=true)=0 |
copies images non-border pixels from source image. | |
data access | |
virtual const void * | getDataPtr (int iChannel) const =0 |
returns a pointer to first data element of a given channel | |
virtual void * | getDataPtr (int iChannel)=0 |
returns a pointer to first data element of a given channel | |
channel management | |
virtual void | detach (int iIndex=-1)=0 |
Makes the image channels independent from other images. | |
virtual void | removeChannel (int iChannel)=0 |
Removes a specified channel. | |
virtual void | swapChannels (int iIndexA, int iIndexB)=0 |
Swap channel A and B. | |
void | setParams (const ImgParams ¶ms) |
sets all image parameters in order channels,size,format,roi | |
virtual void | setChannels (int iNewNumChannels)=0 |
sets the channel count to a new value | |
virtual void | setSize (const utils::Size &s)=0 |
resizes the image to new size (image data is lost!) | |
void | setFormat (format fmt) |
sets the format associated with channels of the image | |
void | setTime (const utils::Time time) |
sets the timestamp of the image | |
void | setTime () |
sets timestamp of the image to the current time | |
min and max element | |
icl64f | getMax (int iChannel, utils::Point *coords=0) const |
Returns max pixel value of channel iChannel within ROI. | |
icl64f | getMin (int iChannel, utils::Point *coords=0) const |
Returns min pixel value of channel iChannel within ROI. | |
icl64f | getMin () const |
return maximal pixel value over all channels (restricted to ROI) | |
icl64f | getMax () const |
return minimal pixel value over all channels (restricted to ROI) | |
const utils::Range< icl64f > | getMinMax (int iChannel, utils::Point *minCoords=0, utils::Point *maxCoords=0) const |
Returns min and max pixel values of channel iChannel within ROI. | |
const utils::Range< icl64f > | getMinMax () const |
Returns min and max pixel values of all channels within ROI. | |
in-place image adaption | |
virtual void | scale (const utils::Size &s, scalemode eScaleMode=interpolateNN)=0 |
performs an in-place resize operation on the image (IPP-OPTIMIZED) | |
virtual void | mirror (axis eAxis, bool bOnlyROI=false)=0 |
performs an in-place mirror operation | |
void | clear (int iChannel=-1, icl64f val=0, bool bROIOnly=true) |
Sets the ROI pixels of one or all channels to a specified value. | |
void | normalizeAllChannels (const utils::Range< icl64f > &dstRange) |
Normalize the channel min/ max range to the new min, max range. | |
void | normalizeChannel (int iChannel, const utils::Range< icl64f > &srcRange, const utils::Range< icl64f > &dstRange) |
Normalize the channel from a given min/max range to the new range. | |
void | normalizeChannel (int iChannel, const utils::Range< icl64f > &dstRange) |
Normalize the channel from a given min/max range to the new range. | |
void | normalizeImg (const utils::Range< icl64f > &srcRange, const utils::Range< icl64f > &dstRange) |
Normalize the image from a given min/max range to the new range. | |
void | normalizeImg (const utils::Range< icl64f > &dstRange) |
Normalize the image from a min/max range to the new range. | |
utility functions | |
void | print (const std::string sTitle="image") const |
prints the image to std-out | |
bool | validChannel (const int iChannel) const |
validate the given channel index | |
bool | isEqual (const utils::Size &s, int nChannels) const |
returns if two images have same size, and channel count | |
bool | isEqual (const ImgParams ¶ms) |
checks if the image has the given parameters | |
bool | isEqual (const ImgParams ¶ms, depth d) |
checks if the image has given params and depth | |
bool | isEqual (const ImgBase *otherImage) |
checks if the image has given params and depth as another image | |
virtual bool | isIndependent () const =0 |
returns whether image data is currently shared |
ImgBase is the Image-Interface class that provides save access to underlying Img-template \.
The ImgBase class provides access to the following basic image features:
As the ImgBase is an abstract class, no ImgBase objects can be instantiated It merely provides a common interface to methods provided by the inherited classe Img<T>. It can be used in all functions the abstract about the underlying data type. E.g. consider a scaling operation on images: When regarding an image as a continuous 2D function, it is not necessary to know the images data type when scaling it. However the developer might say: "At the latest if I want to implement some kind of interpolation I have to know the actual data type I'm working on".
The ImgBase class implements exactly this kind of abstraction from the underlying implementation. Although the implementation has indeed to tackle each of the different data types (E.g. floating point types vs. integer types) in an appropriate way, it is possible to call such function directly on the abstract ImgBase object.
Many other operations are also conceptually independent on the concrete pixel type, e.g. recombining or selecting channels For these operations the ImgBase class provides abstract or implemented methods ensuring a common and type-independent interface.
For example, to resize an image, one can easily write:
void any_function(ImgBase *poBase){ poBase->setSize(Size(640,480)); ... }
The following example should explain how to work with ImgBase class.
void special_function_8u(Img8u* poImage){...} void special_function_16s(Img16f* poImage){...} ... void special_function_64f(Img64f* poImage){...} void generic_function(ImgBase *poImage){ switch(poImage->getDepth()){ case depth8u: special_function_8u(poImage->asImg<icl8u>()); case depth16s: special_function_8u(poImage->asImg<icl16s>()); ... case depth64f: special_function_(poImage->asImg<icl64f>()); } }
Template functions can be called in an analogous way:
template<class T> void template_function(Img<T> *poImg){...} void generic_function(ImgBase *poImage){ switch(poImage->getDepth()){ case depth8u: template_function(poImage->asImg<icl8u>()); case depth16s: template_function(poImage->asImg<icl16s>()); ... case depth64f: template_function(poImage->asImg<icl64f>()); } }
virtual icl::core::ImgBase::~ImgBase | ( | ) | [virtual] |
Destructor.
icl::core::ImgBase::ImgBase | ( | depth | d, |
const ImgParams & | params | ||
) | [protected] |
Creates an ImgBase object with specified image parameters.
Img<icl16s>* icl::core::ImgBase::as16s | ( | ) | [inline] |
convenience shortcut version for asImg<icl16s>()
const Img<icl16s>* icl::core::ImgBase::as16s | ( | ) | const [inline] |
convenience shortcut version for asImg<icl16s>()
Img<icl32f>* icl::core::ImgBase::as32f | ( | ) | [inline] |
convenience shortcut version for asImg<icl32f>()
const Img<icl32f>* icl::core::ImgBase::as32f | ( | ) | const [inline] |
convenience shortcut version for asImg<icl32f>()
Img<icl32s>* icl::core::ImgBase::as32s | ( | ) | [inline] |
convenience shortcut version for asImg<icl32s>()
const Img<icl32s>* icl::core::ImgBase::as32s | ( | ) | const [inline] |
convenience shortcut version for asImg<icl32s>()
Img<icl64f>* icl::core::ImgBase::as64f | ( | ) | [inline] |
convenience shortcut version for asImg<icl64f>()
const Img<icl64f>* icl::core::ImgBase::as64f | ( | ) | const [inline] |
convenience shortcut version for asImg<icl64f>()
Img<icl8u>* icl::core::ImgBase::as8u | ( | ) | [inline] |
convenience shortcut version for asImg<icl8u>()
const Img<icl8u>* icl::core::ImgBase::as8u | ( | ) | const [inline] |
convenience shortcut version for asImg<icl8u>()
Img<T>* icl::core::ImgBase::asImg | ( | ) | [inline] |
dynamically casts this image to one of its Img<T> subclasses
This function performs an emulated dynamic_cast on this image and returns a Img<T>*. If this image can not be casted to the the template type that is specified by the template parameter T, a NULL-pointer is returned. To avoid an expensive RTTI-runtime check using dynamic_cast, this images depth is compared the the depth associated the the template parameter T.
const Img<T>* icl::core::ImgBase::asImg | ( | ) | const [inline] |
void icl::core::ImgBase::clear | ( | int | iChannel = -1 , |
icl64f | val = 0 , |
||
bool | bROIOnly = true |
||
) |
Sets the ROI pixels of one or all channels to a specified value.
iChannel | Channel to fill with zero (default: -1 = all channels) |
val | destination value (default: 0) |
bROIOnly | if set false, the whole image is set to val |
void icl::core::ImgBase::clearMetaData | ( | ) | [inline] |
removes all meta data
Img<T>* icl::core::ImgBase::convert | ( | Img< T > * | poDst = NULL | ) | const |
returns an Img<T> instance of this image (type-conversion or deep copy)
If the requested type differs from the actual image type, then a type conversion is performed to transfer the image data to poDst. Else deepCopy is called, to transfer the image data. If poDst is NULL, it is created with identical parameters, except for the images depth, which is given by the template parameter T. (For developers: The convert function builds the base function for other higher level functions like deepCopy. Internally it calls the icl namespace function deepCopyChannel, which decides if data has to be copied or converted.)
poDst | destination image. If NULL, then a deep copy of the current image is returned |
ImgBase* icl::core::ImgBase::convert | ( | depth | d | ) | const |
returns a converted (or deep copied) instance of this image
This function can be called using an explicit destination depth. The function switches the depth parameter and calls the associated convert<T> template function
d | new images depth |
ImgBase* icl::core::ImgBase::convert | ( | ImgBase * | poDst | ) | const |
converts image data into the given destination image
poDst | destination image (exploited if not NULL else a deep copy of this is returned) |
Img<T>* icl::core::ImgBase::convertROI | ( | Img< T > * | poDst = NULL | ) | const |
returns a converted (or deep copied) instance of this images ROI
This function behaves essentially like the above functions, except it is applied on the source image ROI only.
poDst | optionally given destination image pointer. |
ImgBase* icl::core::ImgBase::convertROI | ( | depth | d | ) | const |
returns a converted (or deep copied) instance of this images ROI
This function behaves essentially like the above functions, except it is applied on the source image ROI only.
d | new images depth |
ImgBase* icl::core::ImgBase::convertROI | ( | ImgBase * | poDst | ) | const |
converts this images ROI into a given destination image
The destination image is exploited if not NULL, else a deep copy of this is created and returned.
poDst | destination image (its depth is hold, other parameters are adapted) |
virtual ImgBase* icl::core::ImgBase::deepCopy | ( | ImgBase ** | ppoDst = 0 | ) | const [pure virtual] |
Create a deep copy of a given image.
An optional destination image can be given via ppoDst. If ppoDst is NULL, a new image created and returned. If ppoDst points to NULL, the new image is created at *ppoDst. Otherwise, the given destination image (*ppoDst) is adapted to this images params including its depth. If the destination images depth differs from this images depth, (*ppoDst) is first released and then created new on the heap
ppoDst | optionally given destination image |
Implemented in icl::core::Img< Type >, icl::core::Img< ICL_QUICK_TYPE >, icl::core::Img< T >, icl::core::Img< icl32f >, and icl::core::Img< icl8u >.
virtual ImgBase* icl::core::ImgBase::deepCopyROI | ( | ImgBase ** | ppoDst = 0 | ) | const [pure virtual] |
Create a deep copy of an images ROI.
This function creates copies this images ROI into an optional given destination image. If ppoDst is NULL, a new image is created. If it points to NULL, a new image is created at *ppoDst. Otherwise the destination image is adapted in size, channels and depth to this image (the size is set to this images ROI size). The copy operation is performed line-wise using memcpy, what makes deepCopyROI very fast.
ppoDst | optionally given destination image |
Implemented in icl::core::Img< Type >, icl::core::Img< ICL_QUICK_TYPE >, icl::core::Img< T >, icl::core::Img< icl32f >, and icl::core::Img< icl8u >.
virtual void icl::core::ImgBase::detach | ( | int | iIndex = -1 | ) | [pure virtual] |
Makes the image channels independent from other images.
iIndex | index of the channel, that should be detached. (If iIndex is an legal channel index only the corresponding channel will be detached. If iIndex is -1 (default) all channels are detached |
Implemented in icl::core::Img< Type >, icl::core::Img< ICL_QUICK_TYPE >, icl::core::Img< T >, icl::core::Img< icl32f >, and icl::core::Img< icl8u >.
virtual void icl::core::ImgBase::fillBorder | ( | bool | setFullROI = true | ) | [pure virtual] |
extrudes ROI borders through non-ROI borders
This function can be used fill all image border pixles (pixels outside the current ROI with the value of the closest ROI-pixel
Implemented in icl::core::Img< Type >, icl::core::Img< ICL_QUICK_TYPE >, icl::core::Img< T >, icl::core::Img< icl32f >, and icl::core::Img< icl8u >.
virtual void icl::core::ImgBase::fillBorder | ( | icl64f | val, |
bool | setFullROI = true |
||
) | [pure virtual] |
fills all non-ROI pixels with a given value
Implemented in icl::core::Img< Type >, icl::core::Img< ICL_QUICK_TYPE >, icl::core::Img< T >, icl::core::Img< icl32f >, and icl::core::Img< icl8u >.
virtual void icl::core::ImgBase::fillBorder | ( | const std::vector< icl64f > & | vals, |
bool | setFullROI = true |
||
) | [pure virtual] |
fills all non-ROI pixels with a given value
here, for each channel a given value is used, so vals.size() must be at least this->getChannels()
Implemented in icl::core::Img< Type >, icl::core::Img< ICL_QUICK_TYPE >, icl::core::Img< T >, icl::core::Img< icl32f >, and icl::core::Img< icl8u >.
virtual void icl::core::ImgBase::fillBorder | ( | const ImgBase * | src, |
bool | setFullROI = true |
||
) | [pure virtual] |
copies images non-border pixels from source image.
The source image must provided pixel values for each non border pixel of this image. So the source images size must be at least (X+1)x(Y+1) where (X,Y) is the lower right non-border pixel of this image.
Implemented in icl::core::Img< Type >, icl::core::Img< ICL_QUICK_TYPE >, icl::core::Img< T >, icl::core::Img< icl32f >, and icl::core::Img< icl8u >.
int icl::core::ImgBase::getChannels | ( | ) | const [inline] |
returns the channel count of the image
virtual const void* icl::core::ImgBase::getDataPtr | ( | int | iChannel | ) | const [pure virtual] |
returns a pointer to first data element of a given channel
Implemented in icl::core::Img< Type >, icl::core::Img< ICL_QUICK_TYPE >, icl::core::Img< T >, icl::core::Img< icl32f >, and icl::core::Img< icl8u >.
virtual void* icl::core::ImgBase::getDataPtr | ( | int | iChannel | ) | [pure virtual] |
returns a pointer to first data element of a given channel
Implemented in icl::core::Img< Type >, icl::core::Img< ICL_QUICK_TYPE >, icl::core::Img< T >, icl::core::Img< icl32f >, and icl::core::Img< icl8u >.
depth icl::core::ImgBase::getDepth | ( | ) | const [inline] |
returns the depth (depth8u or depth32f)
int icl::core::ImgBase::getDim | ( | ) | const [inline] |
returns the pixel count of each channel
format icl::core::ImgBase::getFormat | ( | ) | const [inline] |
returns the current (color)-format of this image
int icl::core::ImgBase::getHeight | ( | ) | const [inline] |
returns the images height
utils::Rect icl::core::ImgBase::getImageRect | ( | ) | const [inline] |
returns the image rect (0,0,width, height)
virtual int icl::core::ImgBase::getLineStep | ( | ) | const [pure virtual] |
returns the length of an image line in bytes (width*sizeof(Type))
This information is compulsory for calling any IPP function.
Implemented in icl::core::Img< Type >, icl::core::Img< ICL_QUICK_TYPE >, icl::core::Img< T >, icl::core::Img< icl32f >, and icl::core::Img< icl8u >.
icl64f icl::core::ImgBase::getMax | ( | int | iChannel, |
utils::Point * | coords = 0 |
||
) | const |
Returns max pixel value of channel iChannel within ROI.
iChannel | Index of channel |
coords | (optinal) if not null, the pixel position of the max is written into this argument |
Reimplemented in icl::core::Img< Type >, icl::core::Img< ICL_QUICK_TYPE >, icl::core::Img< T >, icl::core::Img< icl32f >, and icl::core::Img< icl8u >.
icl64f icl::core::ImgBase::getMax | ( | ) | const |
return minimal pixel value over all channels (restricted to ROI)
Reimplemented in icl::core::Img< Type >, icl::core::Img< ICL_QUICK_TYPE >, icl::core::Img< T >, icl::core::Img< icl32f >, and icl::core::Img< icl8u >.
const std::string& icl::core::ImgBase::getMetaData | ( | ) | const [inline] |
returns associated meta data
std::string& icl::core::ImgBase::getMetaData | ( | ) | [inline] |
returns associated meta data (unconst)
icl64f icl::core::ImgBase::getMin | ( | int | iChannel, |
utils::Point * | coords = 0 |
||
) | const |
Returns min pixel value of channel iChannel within ROI.
iChannel | Index of channel |
coords | (optinal) if not null, the pixel position of the min is written into this argument |
Reimplemented in icl::core::Img< Type >, icl::core::Img< ICL_QUICK_TYPE >, icl::core::Img< T >, icl::core::Img< icl32f >, and icl::core::Img< icl8u >.
icl64f icl::core::ImgBase::getMin | ( | ) | const |
return maximal pixel value over all channels (restricted to ROI)
Reimplemented in icl::core::Img< Type >, icl::core::Img< ICL_QUICK_TYPE >, icl::core::Img< T >, icl::core::Img< icl32f >, and icl::core::Img< icl8u >.
const utils::Range<icl64f> icl::core::ImgBase::getMinMax | ( | int | iChannel, |
utils::Point * | minCoords = 0 , |
||
utils::Point * | maxCoords = 0 |
||
) | const |
Returns min and max pixel values of channel iChannel within ROI.
iChannel | Index of channel |
minCoords | (optinal) if not null, the pixel position of the min is written into this argument |
maxCoords | (optinal) if not null, the pixel position of the max is written into this argument |
Reimplemented in icl::core::Img< Type >, icl::core::Img< ICL_QUICK_TYPE >, icl::core::Img< T >, icl::core::Img< icl32f >, and icl::core::Img< icl8u >.
const utils::Range<icl64f> icl::core::ImgBase::getMinMax | ( | ) | const |
Returns min and max pixel values of all channels within ROI.
Reimplemented in icl::core::Img< Type >, icl::core::Img< ICL_QUICK_TYPE >, icl::core::Img< T >, icl::core::Img< icl32f >, and icl::core::Img< icl8u >.
const ImgParams& icl::core::ImgBase::getParams | ( | ) | const [inline] |
returns all params in terms of a const ImgParams reference
This enables the programmer to write
imageA.setParams(imageB.getParams());
const utils::Rect& icl::core::ImgBase::getROI | ( | ) | const [inline] |
returns the images ROI rectangle
void icl::core::ImgBase::getROI | ( | utils::Point & | offset, |
utils::Size & | size | ||
) | const [inline] |
copies the current ROI into the given offset and size references
int icl::core::ImgBase::getROIHeight | ( | ) | const [inline] |
returns the images ROI height
utils::Point icl::core::ImgBase::getROIOffset | ( | ) | const [inline] |
returns the images ROI offset (upper left corner)
utils::Size icl::core::ImgBase::getROISize | ( | ) | const [inline] |
returns the images ROI size
int icl::core::ImgBase::getROIWidth | ( | ) | const [inline] |
returns the images ROI width
int icl::core::ImgBase::getROIXOffset | ( | ) | const [inline] |
returns the images ROI XOffset
int icl::core::ImgBase::getROIYOffset | ( | ) | const [inline] |
returns the images ROI YOffset
const utils::Size& icl::core::ImgBase::getSize | ( | ) | const [inline] |
returns the size of the images
utils::Time icl::core::ImgBase::getTime | ( | ) | const [inline] |
returns the timestamp of the image
int icl::core::ImgBase::getWidth | ( | ) | const [inline] |
returns the images width
int icl::core::ImgBase::hasFullROI | ( | ) | const [inline] |
returns ROISize == ImageSize
bool icl::core::ImgBase::hasMetaData | ( | ) | const [inline] |
returns whether meta data has been associated to this image
bool icl::core::ImgBase::isEqual | ( | const utils::Size & | s, |
int | nChannels | ||
) | const [inline] |
returns if two images have same size, and channel count
s | size to test |
nChannels | channel count to test |
bool icl::core::ImgBase::isEqual | ( | const ImgParams & | params | ) | [inline] |
checks if the image has the given parameters
bool icl::core::ImgBase::isEqual | ( | const ImgParams & | params, |
depth | d | ||
) | [inline] |
checks if the image has given params and depth
bool icl::core::ImgBase::isEqual | ( | const ImgBase * | otherImage | ) | [inline] |
checks if the image has given params and depth as another image
virtual bool icl::core::ImgBase::isIndependent | ( | ) | const [pure virtual] |
returns whether image data is currently shared
This function does only return true, if all channel pointers have reference count 1 -- i.e. all channels are currently not shared with another image
Implemented in icl::core::Img< Type >, icl::core::Img< ICL_QUICK_TYPE >, icl::core::Img< T >, icl::core::Img< icl32f >, and icl::core::Img< icl8u >.
virtual void icl::core::ImgBase::mirror | ( | axis | eAxis, |
bool | bOnlyROI = false |
||
) | [pure virtual] |
performs an in-place mirror operation
This function is an in-place version of the flippedCopy function, that is also provided in this class. Its performance is comparable to the out-place function
eAxis | axis for the mirror operations |
bOnlyROI | if set, only the ROI of this image is mirrored, else the whole image is mirrored. |
Implemented in icl::core::Img< Type >, icl::core::Img< ICL_QUICK_TYPE >, icl::core::Img< T >, icl::core::Img< icl32f >, and icl::core::Img< icl8u >.
void icl::core::ImgBase::normalizeAllChannels | ( | const utils::Range< icl64f > & | dstRange | ) |
Normalize the channel min/ max range to the new min, max range.
The min/ max range from the source channels are automatically detected, separately for each channel.
dstRange | range of all channels after the operation |
void icl::core::ImgBase::normalizeChannel | ( | int | iChannel, |
const utils::Range< icl64f > & | srcRange, | ||
const utils::Range< icl64f > & | dstRange | ||
) |
Normalize the channel from a given min/max range to the new range.
iChannel | channel index |
srcRange | assumption of the current range of the channel |
dstRange | range of the channel after the operation |
void icl::core::ImgBase::normalizeChannel | ( | int | iChannel, |
const utils::Range< icl64f > & | dstRange | ||
) |
Normalize the channel from a given min/max range to the new range.
The min/ max range from the source channel is automatically detected, separately for this channel. (Internally: this function calls normalizeChannel with srcRage = this->getMinMax(iChannel) )
iChannel | channel index |
dstRange | range of the channel after the operation |
void icl::core::ImgBase::normalizeImg | ( | const utils::Range< icl64f > & | srcRange, |
const utils::Range< icl64f > & | dstRange | ||
) |
Normalize the image from a given min/max range to the new range.
srcRange | assumption of the current image range |
dstRange | range of the image after the operation |
void icl::core::ImgBase::normalizeImg | ( | const utils::Range< icl64f > & | dstRange | ) |
Normalize the image from a min/max range to the new range.
The min/ max range from the image is automatically detected, combined over all image channels. (Internally: this function calls normalizeImg with srcRage = this->getMinMax() )
dstRange | range of the image after the operation |
void icl::core::ImgBase::print | ( | const std::string | sTitle = "image" | ) | const |
prints the image to std-out
sTitle | optional title, that can be printed before printing the image parameters to identify the message. |
ImgBase* icl::core::ImgBase::reinterpretChannels | ( | format | newFmt, |
ImgBase ** | ppoDst = NULL |
||
) | [inline] |
Create a shallow copy of this image with a new format.
newFmt | new format to choose. This must be compatible to the channel count of this image. |
ppoDst | destination image (exploited as possible) |
const ImgBase* icl::core::ImgBase::reinterpretChannels | ( | format | newFmt | ) | const [inline] |
Create a shallow copy of this image with a new format (const version)
newFmt | new format to choose. This must be compatible to the channel count of this image. |
virtual void icl::core::ImgBase::removeChannel | ( | int | iChannel | ) | [pure virtual] |
Removes a specified channel.
If a non-matrix format image looses a channel, the new channel count will not match to the channel count, that is associated with the current format. In this case, a warning is written to std::out, and the format will be set to formatMatrix implicitly. To avoid this warning the programmer has to change the format explicitly before to formatMatrix.
iChannel | Index of channel to remove |
Implemented in icl::core::Img< Type >, icl::core::Img< ICL_QUICK_TYPE >, icl::core::Img< T >, icl::core::Img< icl32f >, and icl::core::Img< icl8u >.
virtual void icl::core::ImgBase::scale | ( | const utils::Size & | s, |
scalemode | eScaleMode = interpolateNN |
||
) | [pure virtual] |
performs an in-place resize operation on the image (IPP-OPTIMIZED)
The image size is adapted on demand to the given size, and the image data is scaled. This function is SLOW in comparison to the scaledCopy function that is also provided in this class, as an additional scaling buffer is allocated and released at runtime.
s | new size of this image |
eScaleMode | interpolation method to use for the scaling operation |
Implemented in icl::core::Img< Type >, icl::core::Img< ICL_QUICK_TYPE >, icl::core::Img< T >, icl::core::Img< icl32f >, and icl::core::Img< icl8u >.
virtual ImgBase* icl::core::ImgBase::scaledCopy | ( | const utils::Size & | newSize, |
scalemode | eScaleMode = interpolateNN |
||
) | const [pure virtual] |
Create a scaled copy with given size of an image.
newSize | size of the new image |
eScaleMode | interpolation method to use when scaling the image |
Implemented in icl::core::Img< Type >, icl::core::Img< ICL_QUICK_TYPE >, icl::core::Img< T >, icl::core::Img< icl32f >, and icl::core::Img< icl8u >.
virtual ImgBase* icl::core::ImgBase::scaledCopy | ( | ImgBase ** | ppoDst = 0 , |
scalemode | eScaleMode = interpolateNN |
||
) | const [pure virtual] |
Create a scaled copy into a given destination image.
If the given destination pointer ppoDst is NULL, a deep copy of this image is returned. If ppoDst points to NULL, a new a deep copy of this image is created at *ppoDst. Otherwise, the destination image is only adapted in its depth to this image; its size is hold.
ppoDst | optionally given destination image pointer |
eScaleMode | interpolation method to use when scaling the image |
Implemented in icl::core::Img< Type >, icl::core::Img< ICL_QUICK_TYPE >, icl::core::Img< T >, icl::core::Img< icl32f >, and icl::core::Img< icl8u >.
virtual ImgBase* icl::core::ImgBase::scaledCopyROI | ( | const utils::Size & | newSize, |
scalemode | eScaleMode = interpolateNN |
||
) | const [pure virtual] |
Create a scaled copy with given size of an images ROI.
This function behaves identically to the scaledCopy function above, except it is applied on the source images ROI only.
newSize | size of the new image |
eScaleMode | interpolation method to use when scaling the image |
Implemented in icl::core::Img< Type >, icl::core::Img< ICL_QUICK_TYPE >, icl::core::Img< T >, icl::core::Img< icl32f >, and icl::core::Img< icl8u >.
virtual ImgBase* icl::core::ImgBase::scaledCopyROI | ( | ImgBase ** | ppoDst = 0 , |
scalemode | eScaleMode = interpolateNN |
||
) | const [pure virtual] |
Create a scaled copy of an images ROI with optionally given destination image.
This function behaves identically to the scaledCopy function above, except it is applied on the source images ROI only.
ppoDst | optionally given destination image pointer |
eScaleMode | interpolation method to use when scaling the image |
Implemented in icl::core::Img< Type >, icl::core::Img< ICL_QUICK_TYPE >, icl::core::Img< T >, icl::core::Img< icl32f >, and icl::core::Img< icl8u >.
ImgBase* icl::core::ImgBase::selectChannel | ( | int | channelIndex, |
ImgBase ** | ppoDst = 0 |
||
) | [inline] |
Create a shallow copy of a single image channel of an image.
This function is a shortcut to use icl::ImgBase::selectChannels(const std::vector<int>&,icl::ImgBase**) to select a single channel from an image
channelIndex | index of the channel to select (if invalid, NULL is returned) |
ppoDst | destination image |
const ImgBase* icl::core::ImgBase::selectChannel | ( | int | channelIndex | ) | const [inline] |
Create a shallow copy of a single image channel of a const image.
This function is a shortcut to use icl::ImgBase::selectChannels(const std::vector<int>&)const to select a single channel from a const image image
channelIndex | index of the channel to select (if invalid, NULL is returned) |
Reimplemented in icl::core::Img< Type >, icl::core::Img< ICL_QUICK_TYPE >, icl::core::Img< T >, icl::core::Img< icl32f >, and icl::core::Img< icl8u >.
ImgBase* icl::core::ImgBase::selectChannels | ( | const std::vector< int > & | channelIndices, |
ImgBase ** | ppoDst = 0 |
||
) | [inline] |
Create a shallow copy of selected channels of an image.
This function can be used if only one or some channels of a given const image should be used in further processing steps. It helps to avoid the necessity of "deepCopy" calls there.
channelIndices | vector containing channel indices to copy |
ppoDst | destination image (if Null, a new one is created) |
const ImgBase* icl::core::ImgBase::selectChannels | ( | const std::vector< int > & | channelIndices | ) | const [inline] |
Create a shallow copy of selected channels of a const image.
channelIndices | vector containing channel indices to copy |
Reimplemented in icl::core::Img< Type >, icl::core::Img< ICL_QUICK_TYPE >, icl::core::Img< T >, icl::core::Img< icl32f >, and icl::core::Img< icl8u >.
virtual void icl::core::ImgBase::setChannels | ( | int | iNewNumChannels | ) | [pure virtual] |
sets the channel count to a new value
This function works only on demand, that means, that channels will only be created/deleted, if the new channel count differs from the current. If the current image has a non-matrix format, then the new channel count must match to the channel count associated with this format. If not, a warning is written to std::out, and the format is set to formatMatrix implicitly. To avoid this warning, the image format must be set to formatMatrix explicitly before calling setChannels
iNewNumChannels | new channel count |
Implemented in icl::core::Img< Type >, icl::core::Img< ICL_QUICK_TYPE >, icl::core::Img< T >, icl::core::Img< icl32f >, and icl::core::Img< icl8u >.
void icl::core::ImgBase::setFormat | ( | format | fmt | ) |
sets the format associated with channels of the image
The channel count of the image is set to the channel count associated with the set format, if they differ. E.g an image with one channel will have 3 channels after a setFormat(formatRGB) - call.
fmt | new format value |
void icl::core::ImgBase::setFullROI | ( | ) | [inline] |
resets the image ROI to the whole image size with offset (0,0)
void icl::core::ImgBase::setMetaData | ( | const std::string & | data | ) | [inline] |
associates new meta data with this image
void icl::core::ImgBase::setParams | ( | const ImgParams & | params | ) |
sets all image parameters in order channels,size,format,roi
void icl::core::ImgBase::setROI | ( | const utils::Point & | offset, |
const utils::Size & | size | ||
) | [inline] |
set both image ROI offset and size
void icl::core::ImgBase::setROI | ( | const utils::Rect & | roi | ) | [inline] |
sets the image ROI to the given rectangle
void icl::core::ImgBase::setROIAdaptive | ( | const utils::Rect & | roi | ) | [inline] |
checks, eventually adapts and finally sets the image ROI size
void icl::core::ImgBase::setROIOffset | ( | const utils::Point & | offset | ) | [inline] |
sets the image ROI offset to the given value
void icl::core::ImgBase::setROIOffsetAdaptive | ( | const utils::Point & | offset | ) | [inline] |
checks, eventually adapts and finally sets the image ROI size
void icl::core::ImgBase::setROISize | ( | const utils::Size & | size | ) | [inline] |
sets the image ROI size to the given value
void icl::core::ImgBase::setROISizeAdaptive | ( | const utils::Size & | size | ) | [inline] |
checks, eventually adapts and finally sets the image ROI size
virtual void icl::core::ImgBase::setSize | ( | const utils::Size & | s | ) | [pure virtual] |
resizes the image to new size (image data is lost!)
operation is performed on demand - if the image has already the given size, then nothing is done at all. For resizing operation with scaling of the image data use scale. Note: The ROI of the image is set to the hole image using delROI(), notwithstanding if a resize operation was performed or not.
s | new image size (if x or y is < 0, the original width/height is used) |
Implemented in icl::core::Img< Type >, icl::core::Img< ICL_QUICK_TYPE >, icl::core::Img< T >, icl::core::Img< icl32f >, and icl::core::Img< icl8u >.
void icl::core::ImgBase::setTime | ( | const utils::Time | time | ) | [inline] |
sets the timestamp of the image
void icl::core::ImgBase::setTime | ( | ) | [inline] |
sets timestamp of the image to the current time
virtual ImgBase* icl::core::ImgBase::shallowCopy | ( | const utils::Rect & | roi, |
const std::vector< int > & | channelIndices, | ||
format | fmt, | ||
utils::Time | time = utils::Time::null , |
||
ImgBase ** | ppoDst = NULL |
||
) | [pure virtual] |
Create a shallow copy of an image with given
ppoDst | destination image which is exploited if possible, or otherwise reallocated |
roi | ROI of the new Image |
channelIndices | indices to select from the source image. These channels are shallow-copied into the destination image |
fmt | format of the new image (the channel count that is associated with this format must be equal to the channel count that is implicitely defined by the size of the vector channelIndices |
time | new timestamp for the returned image |
Implemented in icl::core::Img< Type >, icl::core::Img< ICL_QUICK_TYPE >, icl::core::Img< T >, icl::core::Img< icl32f >, and icl::core::Img< icl8u >.
const ImgBase* icl::core::ImgBase::shallowCopy | ( | const utils::Rect & | roi, |
const std::vector< int > & | channelIndices, | ||
format | fmt, | ||
utils::Time | time = utils::Time::null |
||
) | const [inline] |
Create a shallow copy of an image with given (const version)
roi | ROI of the new Image |
channelIndices | indices to select from the source image. These channels are shallow-copied into the destination image (if size is null, all channels are selected) |
fmt | format of the new image (the channel count that is associated with this format must be equal to the channel count that is implicitely defined by the size of the vector channelIndices |
time | new timestamp for the returned image |
Reimplemented in icl::core::Img< Type >, icl::core::Img< ICL_QUICK_TYPE >, icl::core::Img< T >, icl::core::Img< icl32f >, and icl::core::Img< icl8u >.
ImgBase* icl::core::ImgBase::shallowCopy | ( | const utils::Rect & | roi, |
ImgBase ** | ppoDst = NULL |
||
) | [inline] |
Create a shallow copy of the image.
It exploits the given destination image if possible, i.e. if the pixel depth matches. Else this image is released and a new one is created. Optionally a second argument can be specified to get a new image with the given ROI.
ppoDst | pointer to the destination image pointer If ppoDst is NULL, a new image is created, if ppoDst points to NULL, a new image is created at *ppoDst; |
roi | new ROI of the new image. If Rect::null, the source images roi is used. |
ImgBase* icl::core::ImgBase::shallowCopy | ( | ImgBase ** | ppoDst = NULL | ) | [inline] |
const ImgBase* icl::core::ImgBase::shallowCopy | ( | const utils::Rect & | roi | ) | const [inline] |
Create a shallow copy of a const source image.
In contrast to the not const function shallowCopy, the const one does not provide to specify a destination image pointer, because this must neither be const nor not const. If it would be const, it would not be possible to adapt it to correct parameters, otherwise it would violate the const concept as it could be used to change the const result.
This function can only be used to get const copy of a source image with a special ROI.
roi | ROI of the returned image (Rect::null is not allowed!) |
Reimplemented in icl::core::Img< Type >, icl::core::Img< ICL_QUICK_TYPE >, icl::core::Img< T >, icl::core::Img< icl32f >, and icl::core::Img< icl8u >.
virtual void icl::core::ImgBase::swapChannels | ( | int | iIndexA, |
int | iIndexB | ||
) | [pure virtual] |
Swap channel A and B.
The channel swap operation is shallow; only the channel pointers are swapped.
iIndexA | Index of channel A; |
iIndexB | Index of channel B |
Implemented in icl::core::Img< Type >, icl::core::Img< ICL_QUICK_TYPE >, icl::core::Img< T >, icl::core::Img< icl32f >, and icl::core::Img< icl8u >.
bool icl::core::ImgBase::validChannel | ( | const int | iChannel | ) | const [inline] |
validate the given channel index
depth icl::core::ImgBase::m_eDepth [protected] |
depth of the image (depth8 for icl8u/depth32 for icl32f)
std::string icl::core::ImgBase::m_metaData [protected] |
additional information associated with this image
ImgParams icl::core::ImgBase::m_oParams [protected] |
all image params
the params class consists of
utils::Time icl::core::ImgBase::m_timestamp [protected] |
timestamp of the image