151 const std::vector<int> &channelIndices,
169 const std::vector<int> &channelIndices,
173 return const_cast<ImgBase*>(
this)->
shallowCopy(
roi,channelIndices,fmt,time,0);
184 return shallowCopy(getROI(),std::vector<int>(),newFmt,getTime(),ppoDst);
195 return const_cast<ImgBase*>(
this)->
shallowCopy(getROI(),std::vector<int>(),newFmt,getTime());
210 return shallowCopy(
roi,std::vector<int>(),getFormat(),getTime(),ppoDst);
213 return shallowCopy(getROI(),std::vector<int>(),getFormat(),getTime(),ppoDst);
243 return shallowCopy(getROI(),channelIndices,
formatMatrix,getTime(),ppoDst);
256 std::vector<int> v(1); v[0]= channelIndex;
257 return selectChannels(v,ppoDst);
265 return const_cast<ImgBase*>(
this)->
selectChannels(channelIndices, 0);
277 std::vector<int> v(1); v[0]= channelIndex;
return selectChannels(v);
419 return reinterpret_cast<Img<T>*
>(
this);
429 return reinterpret_cast<const Img<T>*
>(
this);
480 int getWidth()
const {
return m_oParams.getWidth(); }
486 int getDim()
const {
return m_oParams.getDim(); }
503 virtual int getLineStep()
const = 0;
511 const utils::Rect &getROI()
const{
return m_oParams.getROI(); }
578 virtual void fillBorder(
bool setFullROI=
true)=0;
581 virtual void fillBorder(
icl64f val,
bool setFullROI=
true)=0;
587 virtual void fillBorder(
const std::vector<icl64f> &vals,
bool setFullROI=
true)=0;
595 virtual void fillBorder(
const ImgBase *src,
bool setFullROI=
true)=0;
604 virtual const void* getDataPtr(
int iChannel)
const = 0;
608 virtual void* getDataPtr(
int iChannel) = 0;
621 virtual void detach(
int iIndex = -1)=0;
632 virtual void removeChannel(
int iChannel)=0;
640 virtual void swapChannels(
int iIndexA,
int iIndexB)=0;
658 virtual void setChannels(
int iNewNumChannels)=0;
683 void setFormat(
format fmt);
757 virtual void mirror(
axis eAxis,
bool bOnlyROI=
false)=0;
764 void clear(
int iChannel = -1,
icl64f val=0,
bool bROIOnly=
true);
814 void print(
const std::string sTitle=
"image")
const;
818 return iChannel >= 0 && iChannel < getChannels();
826 FUNCTION_LOG(
"isEqual("<<s.width<<
","<< s.height <<
","<< nChannels <<
")");
827 return (getSize() == s) && (getChannels() == nChannels);
833 return m_oParams == params;
839 return m_oParams == params &&
getDepth() == d;
853 virtual bool isIndependent()
const=0;
class representing a range defined by min and max value
Definition: Range.h:49
const ImgParams & getParams() const
returns all params in terms of a const ImgParams reference
Definition: ImgBase.h:473
format getFormat() const
returns the current (color)-format of this image
Definition: ImgBase.h:495
int getWidth() const
returns the images width
Definition: ImgBase.h:480
void setROIOffsetAdaptive(const utils::Point &offset)
checks, eventually adapts and finally sets the image ROI size
Definition: ImgBase.h:552
const Img< T > * asImg() const
dynamically casts this image to one of its Img<T> subclasses (const version)
Definition: ImgBase.h:427
undocument this line if you encounter any issues!
Definition: Any.h:37
int getROIYOffset() const
returns the images ROI YOffset
Definition: ImgBase.h:533
ImgBase * shallowCopy(ImgBase **ppoDst=NULL)
Definition: ImgBase.h:212
ImgBase * selectChannel(int channelIndex, ImgBase **ppoDst=0)
Create a shallow copy of a single image channel of an image.
Definition: ImgBase.h:254
Img< T > * asImg()
dynamically casts this image to one of its Img<T> subclasses
Definition: ImgBase.h:417
ICLCore_API std::ostream & operator<<(std::ostream &s, const format &f)
puts a string representation of format into the given stream
const ImgBase * reinterpretChannels(format newFmt) const
Create a shallow copy of this image with a new format (const version)
Definition: ImgBase.h:193
void getROI(utils::Point &offset, utils::Size &size) const
copies the current ROI into the given offset and size references
Definition: ImgBase.h:515
ICL Time class (taken from the Ice lib)
Definition: Time.h:52
ICLQt_API ImgROI roi(ImgQ &r)
creates a ROI-struct from an image
Img< icl32f > * as32f()
convenience shortcut version for asImg<icl32f>()
Definition: ImgBase.h:442
const Img< icl32s > * as32s() const
convenience shortcut version for asImg<icl32s>()
Definition: ImgBase.h:455
Img< icl32s > * as32s()
convenience shortcut version for asImg<icl32s>()
Definition: ImgBase.h:439
bool isEqual(const ImgBase *otherImage)
checks if the image has given params and depth as another image
Definition: ImgBase.h:843
depth getDepth() const
returns the depth (depth8u or depth32f)
Definition: ImgBase.h:492
Img< icl64f > * as64f()
convenience shortcut version for asImg<icl64f>()
Definition: ImgBase.h:445
std::string m_metaData
additional information associated with this image
Definition: ImgBase.h:901
void setROISize(const utils::Size &size)
sets the image ROI size to the given value
Definition: ImgBase.h:542
bool isEqual(const ImgParams ¶ms, depth d)
checks if the image has given params and depth
Definition: ImgBase.h:837
void setROIOffset(const utils::Point &offset)
sets the image ROI offset to the given value
Definition: ImgBase.h:539
The ImgParams class stores all image parameters .
Definition: ImgParams.h:58
void setTime(const utils::Time time)
sets the timestamp of the image
Definition: ImgBase.h:686
ICLQt_API ImgROI data(ImgQ &r)
creates full ROI ROI-struct
format
determines the color-format, that is associated with the images channels
Definition: Types.h:70
Img< icl16s > * as16s()
convenience shortcut version for asImg<icl16s>()
Definition: ImgBase.h:436
bool isEqual(const utils::Size &s, int nChannels) const
returns if two images have same size, and channel count
Definition: ImgBase.h:825
int getROIWidth() const
returns the images ROI width
Definition: ImgBase.h:524
int getROIHeight() const
returns the images ROI height
Definition: ImgBase.h:527
#define ICLASSERT_RETURN_VAL(X, VALUE)
Definition: Macros.h:148
Ipp64f icl64f
64Bit floating point type for the ICL
Definition: BasicTypes.h:52
depth m_eDepth
depth of the image (depth8 for icl8u/depth32 for icl32f)
Definition: ImgBase.h:895
Size class of the ICL.
Definition: Size.h:61
void setROI(const utils::Rect &roi)
sets the image ROI to the given rectangle
Definition: ImgBase.h:548
const std::string & getMetaData() const
returns associated meta data
Definition: ImgBase.h:870
depth getDepth()
getDepth<T> returns to depth enum associated to type T
ImgBase * reinterpretChannels(format newFmt, ImgBase **ppoDst=NULL)
Create a shallow copy of this image with a new format.
Definition: ImgBase.h:183
Img< icl8u > * as8u()
convenience shortcut version for asImg<icl8u>()
Definition: ImgBase.h:433
bool validChannel(const int iChannel) const
validate the given channel index
Definition: ImgBase.h:817
const ImgBase * selectChannels(const std::vector< int > &channelIndices) const
Create a shallow copy of selected channels of a const image.
Definition: ImgBase.h:263
void setROISizeAdaptive(const utils::Size &size)
checks, eventually adapts and finally sets the image ROI size
Definition: ImgBase.h:556
int hasFullROI() const
returns ROISize == ImageSize
Definition: ImgBase.h:563
utils::Rect getImageRect() const
returns the image rect (0,0,width, height)
Definition: ImgBase.h:536
bool isEqual(const ImgParams ¶ms)
checks if the image has the given parameters
Definition: ImgBase.h:831
const Img< icl32f > * as32f() const
convenience shortcut version for asImg<icl32f>()
Definition: ImgBase.h:458
const Img< icl16s > * as16s() const
convenience shortcut version for asImg<icl16s>()
Definition: ImgBase.h:452
int getDim() const
returns the pixel count of each channel
Definition: ImgBase.h:486
scalemode
for scaling of Img images theses functions are provided
Definition: Types.h:84
bool hasMetaData() const
returns whether meta data has been associated to this image
Definition: ImgBase.h:857
depth
determines the pixel type of an image (8Bit-int or 32Bit-float)
Definition: Types.h:60
void clearMetaData()
removes all meta data
Definition: ImgBase.h:865
static void scale(const int deg, xcomplex *P)
Definition: PolynomialSolver.h:133
ImgParams m_oParams
all image params
Definition: ImgBase.h:892
Point class of the ICL used e.g. for the Images ROI offset.
Definition: Point.h:58
static const Point null
null Point is x=0, y=0
Definition: Point.h:61
int getROIXOffset() const
returns the images ROI XOffset
Definition: ImgBase.h:530
utils::Size getROISize() const
returns the images ROI size
Definition: ImgBase.h:521
int getChannels() const
returns the channel count of the image
Definition: ImgBase.h:489
ImgBase * selectChannels(const std::vector< int > &channelIndices, ImgBase **ppoDst=0)
Create a shallow copy of selected channels of an image.
Definition: ImgBase.h:242
void convert(const srcT *poSrcStart, const srcT *poSrcEnd, dstT *poDst)
moves value from source to destination array (with casting on demand)
Definition: CoreFunctions.h:252
const ImgBase * shallowCopy(const utils::Rect &roi) const
Create a shallow copy of a const source image.
Definition: ImgBase.h:226
ImgBase * shallowCopy(const utils::Rect &roi, ImgBase **ppoDst=NULL)
Create a shallow copy of the image.
Definition: ImgBase.h:209
const Img< icl64f > * as64f() const
convenience shortcut version for asImg<icl64f>()
Definition: ImgBase.h:461
#define FUNCTION_LOG(x)
Definition: Macros.h:123
const ImgBase * shallowCopy(const utils::Rect &roi, const std::vector< int > &channelIndices, format fmt, utils::Time time=utils::Time::null) const
Definition: ImgBase.h:168
axis
for flipping of images
Definition: Types.h:99
void setROI(const utils::Point &offset, const utils::Size &size)
set both image ROI offset and size
Definition: ImgBase.h:545
void setTime()
sets timestamp of the image to the current time
Definition: ImgBase.h:688
Rectangle class of the ICL used e.g. for the Images ROI-rect.
Definition: Rect.h:95
utils::Time getTime() const
returns the timestamp of the image
Definition: ImgBase.h:498
static const Time null
Definition: Time.h:59
void setMetaData(const std::string &data)
associates new meta data with this image
Definition: ImgBase.h:860
std::string & getMetaData()
returns associated meta data (unconst)
Definition: ImgBase.h:875
const ImgBase * selectChannel(int channelIndex) const
Create a shallow copy of a single image channel of a const image.
Definition: ImgBase.h:275
utils::Time m_timestamp
timestamp of the image
Definition: ImgBase.h:898
void print(const core::Img< T > &image)
print the images parameters to std::out
void setROIAdaptive(const utils::Rect &roi)
checks, eventually adapts and finally sets the image ROI size
Definition: ImgBase.h:560
ImgBase is the Image-Interface class that provides save access to underlying Img-template .
Definition: ImgBase.h:131
void setFullROI()
resets the image ROI to the whole image size with offset (0,0)
Definition: ImgBase.h:566
const Img< icl8u > * as8u() const
convenience shortcut version for asImg<icl8u>()
Definition: ImgBase.h:449
int getHeight() const
returns the images height
Definition: ImgBase.h:483
utils::Point getROIOffset() const
returns the images ROI offset (upper left corner)
Definition: ImgBase.h:518
#define ICLCore_API
Definition: CompatMacros.h:174
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 utils::Size & getSize() const
returns the size of the images
Definition: ImgBase.h:477