Image Component Library (ICL)
|
General Image Converter. More...
#include <Converter.h>
Public Types | |
enum | oporder { orderScaleConvertCC = 12, orderScaleCCConvert = 21, orderConvertScaleCC = 102, orderConvertCCScale = 201, orderCCScaleConvert = 120, orderCCConvertScale = 210 } |
enum to define internal used operation order More... | |
Public Member Functions | |
Converter (bool applyToROIOnly=false) | |
constructor | |
Converter (oporder o, bool applyToROIOnly=false) | |
other constructor | |
Converter (const ImgBase *srcImage, ImgBase *dstImage, bool applyToROIOnly=false) | |
creates a converter, and converts the srcImage to dstImage immediately | |
~Converter () | |
destructor | |
void | apply (const ImgBase *src, ImgBase *dst) |
image conversion function | |
void | setApplyToROIOnly (bool applyToROIOnly) |
sets up the converter to apply operations on the source images roi only | |
void | setOperationOrder (oporder o) |
Sets up the operation order for this converter. | |
void | setScaleMode (scalemode scaleMode) |
sets a new scale interpolation method (default is interpolateNN) | |
Private Member Functions | |
void | dynamicConvert (const ImgBase *src, ImgBase *dst) |
converts dependent on the destination images depth | |
void | cc (const ImgBase *src, ImgBase *dst) |
internally used conversion function | |
Private Attributes | |
ImgBase * | m_poSizeBuffer |
Buffer for size conversion. | |
ImgBase * | m_poCCBuffer |
Buffer for emulated color conversin using Converter::cc(...) | |
ImgBase * | m_poDepthBuffer |
Buffer for depth conversion. | |
ImgBase * | m_poROIBuffer |
Buffer for ROI extraction. | |
ImgBase * | m_poColorBuffer |
Buffer for color conversion. | |
bool | m_bROIOnly |
flag that indicates whether to work on source images ROI or on the whole sorce image | |
oporder | m_eOpOrder |
currently set operation order | |
scalemode | m_scaleMode |
internal scalemode |
General Image Converter.
The Converter wraps and summarizes all image conversion routines, including depth change, scaling and color conversion. It provides all necessary buffers to do several of these changes in series. Simply provide the desired output format to dst of the apply function, and this method will select the appropriate conversion steps.
If demanded, the converter provides an interface to specify the order of the different operations.
icl::core::Converter::Converter | ( | bool | applyToROIOnly = false | ) |
constructor
applyToROIOnly | if true, the source images ROI only is used instead of the whole src image. |
icl::core::Converter::Converter | ( | oporder | o, |
bool | applyToROIOnly = false |
||
) |
other constructor
o | operation order |
applyToROIOnly | if true, the source images ROI only is used instead of the whole src image. |
icl::core::Converter::Converter | ( | const ImgBase * | srcImage, |
ImgBase * | dstImage, | ||
bool | applyToROIOnly = false |
||
) |
creates a converter, and converts the srcImage to dstImage immediately
destructor
void icl::core::Converter::apply | ( | const ImgBase * | src, |
ImgBase * | dst | ||
) |
image conversion function
Although this function looks like the iclcc function located in the iclcc.h, it brings some additional functionalities (see class description).
src | source image |
dst | destination image transfers the image data from the source image into the image data of the destination image |
src | source image |
dst | destination image |
void icl::core::Converter::cc | ( | const ImgBase * | src, |
ImgBase * | dst | ||
) | [private] |
internally used conversion function
This function wraps the icl::cc function and optimizes its performance by using the Converter objects internally hold color conversion buffer for "emulated" color conversions. (E.g. HLStoYUV, is emulated by HLSToRGB followed by RGBToYUV. icl::cc stores the result of HLSToRGB in a temporarily allocated and released image buffer. The Converter uses an persistent buffer of the Converter object.) This will speed up cross format conversions in looped applications.
src | source image |
dst | destination image |
void icl::core::Converter::dynamicConvert | ( | const ImgBase * | src, |
ImgBase * | dst | ||
) | [private] |
converts dependent on the destination images depth
void icl::core::Converter::setApplyToROIOnly | ( | bool | applyToROIOnly | ) | [inline] |
sets up the converter to apply operations on the source images roi only
void icl::core::Converter::setOperationOrder | ( | oporder | o | ) | [inline] |
Sets up the operation order for this converter.
In many cases it is necessary to apply two or three different operations after another to convert the source image into the given destination image. Possible operation are:
o | new operation order definition |
void icl::core::Converter::setScaleMode | ( | scalemode | scaleMode | ) |
sets a new scale interpolation method (default is interpolateNN)
bool icl::core::Converter::m_bROIOnly [private] |
flag that indicates whether to work on source images ROI or on the whole sorce image
oporder icl::core::Converter::m_eOpOrder [private] |
currently set operation order
ImgBase* icl::core::Converter::m_poCCBuffer [private] |
Buffer for emulated color conversin using Converter::cc(...)
ImgBase* icl::core::Converter::m_poColorBuffer [private] |
Buffer for color conversion.
ImgBase* icl::core::Converter::m_poDepthBuffer [private] |
Buffer for depth conversion.
ImgBase* icl::core::Converter::m_poROIBuffer [private] |
Buffer for ROI extraction.
ImgBase* icl::core::Converter::m_poSizeBuffer [private] |
Buffer for size conversion.
scalemode icl::core::Converter::m_scaleMode [private] |
internal scalemode