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. More... | |
bool | hasMetaData () const |
returns whether meta data has been associated to this image More... | |
void | setMetaData (const std::string &data) |
associates new meta data with this image More... | |
void | clearMetaData () |
removes all meta data More... | |
const std::string & | getMetaData () const |
returns associated meta data More... | |
std::string & | getMetaData () |
returns associated meta data (unconst) More... | |
Protected Member Functions | |
ImgBase (depth d, const ImgParams ¶ms) | |
Creates an ImgBase object with specified image parameters. More... | |
Protected Attributes | |
ImgParams | m_oParams |
all image params More... | |
depth | m_eDepth |
depth of the image (depth8 for icl8u/depth32 for icl32f) More... | |
utils::Time | m_timestamp |
timestamp of the image More... | |
std::string | m_metaData |
additional information associated with this image More... | |
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. More... | |
const ImgBase * | reinterpretChannels (format newFmt) const |
Create a shallow copy of this image with a new format (const version) More... | |
ImgBase * | shallowCopy (const utils::Rect &roi, ImgBase **ppoDst=NULL) |
Create a shallow copy of the image. More... | |
ImgBase * | shallowCopy (ImgBase **ppoDst=NULL) |
const ImgBase * | shallowCopy (const utils::Rect &roi) const |
Create a shallow copy of a const source image. More... | |
ImgBase * | selectChannels (const std::vector< int > &channelIndices, ImgBase **ppoDst=0) |
Create a shallow copy of selected channels of an image. More... | |
ImgBase * | selectChannel (int channelIndex, ImgBase **ppoDst=0) |
Create a shallow copy of a single image channel of an image. More... | |
const ImgBase * | selectChannels (const std::vector< int > &channelIndices) const |
Create a shallow copy of selected channels of a const image. More... | |
const ImgBase * | selectChannel (int channelIndex) const |
Create a shallow copy of a single image channel of a const image. More... | |
deep copy and depth conversion | |
virtual ImgBase * | deepCopy (ImgBase **ppoDst=0) const =0 |
Create a deep copy of a given image. More... | |
virtual ImgBase * | deepCopyROI (ImgBase **ppoDst=0) const =0 |
Create a deep copy of an images ROI. More... | |
template<class T > | |
ICLCore_API Img< T > * | convert (Img< T > *poDst=NULL) const |
returns an Img<T> instance of this image (type-conversion or deep copy) More... | |
ImgBase * | convert (depth d) const |
returns a converted (or deep copied) instance of this image More... | |
ImgBase * | convert (ImgBase *poDst) const |
converts image data into the given destination image More... | |
template<class T > | |
ICLCore_API Img< T > * | convertROI (Img< T > *poDst=NULL) const |
returns a converted (or deep copied) instance of this images ROI More... | |
ImgBase * | convertROI (depth d) const |
returns a converted (or deep copied) instance of this images ROI More... | |
ImgBase * | convertROI (ImgBase *poDst) const |
converts this images ROI into a given destination image More... | |
virtual ImgBase * | scaledCopy (const utils::Size &newSize, scalemode eScaleMode=interpolateNN) const =0 |
Create a scaled copy with given size of an image. More... | |
virtual ImgBase * | scaledCopy (ImgBase **ppoDst=0, scalemode eScaleMode=interpolateNN) const =0 |
Create a scaled copy into a given destination image. More... | |
virtual ImgBase * | scaledCopyROI (const utils::Size &newSize, scalemode eScaleMode=interpolateNN) const =0 |
Create a scaled copy with given size of an images ROI. More... | |
virtual ImgBase * | scaledCopyROI (ImgBase **ppoDst=0, scalemode eScaleMode=interpolateNN) const =0 |
Create a scaled copy of an images ROI with optionally given destination image. More... | |
asImg<T> cast templates | |
template<class T > | |
Img< T > * | asImg () |
dynamically casts this image to one of its Img<T> subclasses More... | |
template<class T > | |
const Img< T > * | asImg () const |
dynamically casts this image to one of its Img<T> subclasses (const version) More... | |
Img< icl8u > * | as8u () |
convenience shortcut version for asImg<icl8u>() More... | |
Img< icl16s > * | as16s () |
convenience shortcut version for asImg<icl16s>() More... | |
Img< icl32s > * | as32s () |
convenience shortcut version for asImg<icl32s>() More... | |
Img< icl32f > * | as32f () |
convenience shortcut version for asImg<icl32f>() More... | |
Img< icl64f > * | as64f () |
convenience shortcut version for asImg<icl64f>() More... | |
const Img< icl8u > * | as8u () const |
convenience shortcut version for asImg<icl8u>() More... | |
const Img< icl16s > * | as16s () const |
convenience shortcut version for asImg<icl16s>() More... | |
const Img< icl32s > * | as32s () const |
convenience shortcut version for asImg<icl32s>() More... | |
const Img< icl32f > * | as32f () const |
convenience shortcut version for asImg<icl32f>() More... | |
const Img< icl64f > * | as64f () const |
convenience shortcut version for asImg<icl64f>() More... | |
getter (without ROI handling) | |
const ImgParams & | getParams () const |
returns all params in terms of a const ImgParams reference More... | |
const utils::Size & | getSize () const |
returns the size of the images More... | |
int | getWidth () const |
returns the images width More... | |
int | getHeight () const |
returns the images height More... | |
int | getDim () const |
returns the pixel count of each channel More... | |
int | getChannels () const |
returns the channel count of the image More... | |
depth | getDepth () const |
returns the depth (depth8u or depth32f) More... | |
format | getFormat () const |
returns the current (color)-format of this image More... | |
utils::Time | getTime () const |
returns the timestamp of the image More... | |
virtual int | getLineStep () const =0 |
returns the length of an image line in bytes (width*sizeof(Type)) More... | |
ROI handling | |
const utils::Rect & | getROI () const |
returns the images ROI rectangle More... | |
void | getROI (utils::Point &offset, utils::Size &size) const |
copies the current ROI into the given offset and size references More... | |
utils::Point | getROIOffset () const |
returns the images ROI offset (upper left corner) More... | |
utils::Size | getROISize () const |
returns the images ROI size More... | |
int | getROIWidth () const |
returns the images ROI width More... | |
int | getROIHeight () const |
returns the images ROI height More... | |
int | getROIXOffset () const |
returns the images ROI XOffset More... | |
int | getROIYOffset () const |
returns the images ROI YOffset More... | |
utils::Rect | getImageRect () const |
returns the image rect (0,0,width, height) More... | |
void | setROIOffset (const utils::Point &offset) |
sets the image ROI offset to the given value More... | |
void | setROISize (const utils::Size &size) |
sets the image ROI size to the given value More... | |
void | setROI (const utils::Point &offset, const utils::Size &size) |
set both image ROI offset and size More... | |
void | setROI (const utils::Rect &roi) |
sets the image ROI to the given rectangle More... | |
void | setROIOffsetAdaptive (const utils::Point &offset) |
checks, eventually adapts and finally sets the image ROI size More... | |
void | setROISizeAdaptive (const utils::Size &size) |
checks, eventually adapts and finally sets the image ROI size More... | |
void | setROIAdaptive (const utils::Rect &roi) |
checks, eventually adapts and finally sets the image ROI size More... | |
int | hasFullROI () const |
returns ROISize == ImageSize More... | |
void | setFullROI () |
resets the image ROI to the whole image size with offset (0,0) More... | |
border functions | |
virtual void | fillBorder (bool setFullROI=true)=0 |
extrudes ROI borders through non-ROI borders More... | |
virtual void | fillBorder (icl64f val, bool setFullROI=true)=0 |
fills all non-ROI pixels with a given value More... | |
virtual void | fillBorder (const std::vector< icl64f > &vals, bool setFullROI=true)=0 |
fills all non-ROI pixels with a given value More... | |
virtual void | fillBorder (const ImgBase *src, bool setFullROI=true)=0 |
copies images non-border pixels from source image. More... | |
data access | |
virtual const void * | getDataPtr (int iChannel) const =0 |
returns a pointer to first data element of a given channel More... | |
virtual void * | getDataPtr (int iChannel)=0 |
returns a pointer to first data element of a given channel More... | |
channel management | |
virtual void | detach (int iIndex=-1)=0 |
Makes the image channels independent from other images. More... | |
virtual void | removeChannel (int iChannel)=0 |
Removes a specified channel. More... | |
virtual void | swapChannels (int iIndexA, int iIndexB)=0 |
Swap channel A and B. More... | |
void | setParams (const ImgParams ¶ms) |
sets all image parameters in order channels,size,format,roi More... | |
virtual void | setChannels (int iNewNumChannels)=0 |
sets the channel count to a new value More... | |
virtual void | setSize (const utils::Size &s)=0 |
resizes the image to new size (image data is lost!) More... | |
void | setFormat (format fmt) |
sets the format associated with channels of the image More... | |
void | setTime (const utils::Time time) |
sets the timestamp of the image More... | |
void | setTime () |
sets timestamp of the image to the current time More... | |
min and max element | |
icl64f | getMax (int iChannel, utils::Point *coords=0) const |
Returns max pixel value of channel iChannel within ROI. More... | |
icl64f | getMin (int iChannel, utils::Point *coords=0) const |
Returns min pixel value of channel iChannel within ROI. More... | |
icl64f | getMin () const |
return maximal pixel value over all channels (restricted to ROI) More... | |
icl64f | getMax () const |
return minimal pixel value over all channels (restricted to ROI) More... | |
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. More... | |
const utils::Range< icl64f > | getMinMax () const |
Returns min and max pixel values of all channels within ROI. More... | |
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) More... | |
virtual void | mirror (axis eAxis, bool bOnlyROI=false)=0 |
performs an in-place mirror operation More... | |
void | clear (int iChannel=-1, icl64f val=0, bool bROIOnly=true) |
Sets the ROI pixels of one or all channels to a specified value. More... | |
void | normalizeAllChannels (const utils::Range< icl64f > &dstRange) |
Normalize the channel min/ max range to the new min, max range. More... | |
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. More... | |
void | normalizeChannel (int iChannel, const utils::Range< icl64f > &dstRange) |
Normalize the channel from a given min/max range to the new range. More... | |
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. More... | |
void | normalizeImg (const utils::Range< icl64f > &dstRange) |
Normalize the image from a min/max range to the new range. More... | |
utility functions | |
void | print (const std::string sTitle="image") const |
prints the image to std-out More... | |
bool | validChannel (const int iChannel) const |
validate the given channel index More... | |
bool | isEqual (const utils::Size &s, int nChannels) const |
returns if two images have same size, and channel count More... | |
bool | isEqual (const ImgParams ¶ms) |
checks if the image has the given parameters More... | |
bool | isEqual (const ImgParams ¶ms, depth d) |
checks if the image has given params and depth More... | |
bool | isEqual (const ImgBase *otherImage) |
checks if the image has given params and depth as another image More... | |
virtual bool | isIndependent () const =0 |
returns whether image data is currently shared More... | |
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:
The following example should explain how to work with ImgBase class.
Template functions can be called in an analogous way:
|
virtual |
Destructor.
Creates an ImgBase object with specified image parameters.
convenience shortcut version for asImg<icl16s>()
convenience shortcut version for asImg<icl16s>()
convenience shortcut version for asImg<icl32f>()
convenience shortcut version for asImg<icl32f>()
convenience shortcut version for asImg<icl32s>()
convenience shortcut version for asImg<icl32s>()
convenience shortcut version for asImg<icl64f>()
convenience shortcut version for asImg<icl64f>()
convenience shortcut version for asImg<icl8u>()
convenience shortcut version for asImg<icl8u>()
|
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.
|
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 |
|
inline |
removes all meta data
ICLCore_API 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 |
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 |
converts image data into the given destination image
poDst | destination image (exploited if not NULL else a deep copy of this is returned) |
ICLCore_API 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. |
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 |
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) |
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 >.
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 >.
|
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 >.
|
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 >.
|
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 >.
|
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 >.
|
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 >.
|
inline |
returns the channel count of the image
|
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 >.
|
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 >.
|
inline |
returns the depth (depth8u or depth32f)
|
inline |
returns the pixel count of each channel
|
inline |
returns the current (color)-format of this image
|
inline |
returns the images height
|
inline |
returns the image rect (0,0,width, height)
|
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 |
icl64f icl::core::ImgBase::getMax | ( | ) | const |
return minimal pixel value over all channels (restricted to ROI)
|
inline |
returns associated meta data
|
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 |
icl64f icl::core::ImgBase::getMin | ( | ) | const |
return maximal pixel value over all channels (restricted to ROI)
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 |
const utils::Range<icl64f> icl::core::ImgBase::getMinMax | ( | ) | const |
Returns min and max pixel values of all channels within ROI.
|
inline |
returns all params in terms of a const ImgParams reference
This enables the programmer to write
imageA.setParams(imageB.getParams());
|
inline |
returns the images ROI rectangle
|
inline |
copies the current ROI into the given offset and size references
|
inline |
returns the images ROI height
|
inline |
returns the images ROI offset (upper left corner)
|
inline |
returns the images ROI size
|
inline |
returns the images ROI width
|
inline |
returns the images ROI XOffset
|
inline |
returns the images ROI YOffset
|
inline |
returns the size of the images
|
inline |
returns the timestamp of the image
|
inline |
returns the images width
|
inline |
returns ROISize == ImageSize
|
inline |
returns whether meta data has been associated to this image
|
inline |
returns if two images have same size, and channel count
s | size to test |
nChannels | channel count to test |
|
inline |
checks if the image has the given parameters
checks if the image has given params and depth
|
inline |
checks if the image has given params and depth as another image
|
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 >.
|
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. |
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) |
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. |
|
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 >.
|
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 >.
|
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 >.
|
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 >.
|
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 >.
|
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 >.
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 |
|
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) |
|
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) |
|
inline |
Create a shallow copy of selected channels of a const image.
channelIndices | vector containing channel indices to copy |
|
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 |
|
inline |
resets the image ROI to the whole image size with offset (0,0)
|
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
|
inline |
set both image ROI offset and size
|
inline |
sets the image ROI to the given rectangle
|
inline |
checks, eventually adapts and finally sets the image ROI size
|
inline |
sets the image ROI offset to the given value
|
inline |
checks, eventually adapts and finally sets the image ROI size
|
inline |
sets the image ROI size to the given value
|
inline |
checks, eventually adapts and finally sets the image ROI size
|
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 >.
|
inline |
sets the timestamp of the image
|
inline |
sets timestamp of the image to the current time
|
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 >.
|
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 |
|
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. |
|
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!) |
|
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 >.
|
inline |
validate the given channel index
|
protected |
depth of the image (depth8 for icl8u/depth32 for icl32f)
|
protected |
additional information associated with this image
|
protected |
all image params
the params class consists of
|
protected |
timestamp of the image