Image Component Library (ICL)
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
icl::core::Converter Class Reference

General Image Converter. More...

#include <Converter.h>

Inheritance diagram for icl::core::Converter:
icl::utils::Uncopyable

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 More...
 
 Converter (oporder o, bool applyToROIOnly=false)
 other constructor More...
 
 Converter (const ImgBase *srcImage, ImgBase *dstImage, bool applyToROIOnly=false)
 creates a converter, and converts the srcImage to dstImage immediately More...
 
 ~Converter ()
 destructor More...
 
void apply (const ImgBase *src, ImgBase *dst)
 image conversion function More...
 
void setApplyToROIOnly (bool applyToROIOnly)
 sets up the converter to apply operations on the source images roi only More...
 
void setOperationOrder (oporder o)
 Sets up the operation order for this converter. More...
 
void setScaleMode (scalemode scaleMode)
 sets a new scale interpolation method (default is interpolateNN) More...
 

Private Member Functions

void dynamicConvert (const ImgBase *src, ImgBase *dst)
 converts dependent on the destination images depth More...
 
void cc (const ImgBase *src, ImgBase *dst)
 internally used conversion function More...
 

Private Attributes

ImgBasem_poSizeBuffer
 Buffer for size conversion. More...
 
ImgBasem_poCCBuffer
 Buffer for emulated color conversin using Converter::cc(...) More...
 
ImgBasem_poDepthBuffer
 Buffer for depth conversion. More...
 
ImgBasem_poROIBuffer
 Buffer for ROI extraction. More...
 
ImgBasem_poColorBuffer
 Buffer for color conversion. More...
 
bool m_bROIOnly
 flag that indicates whether to work on source images ROI or on the whole sorce image More...
 
oporder m_eOpOrder
 currently set operation order More...
 
scalemode m_scaleMode
 internal scalemode More...
 

Additional Inherited Members

- Protected Member Functions inherited from icl::utils::Uncopyable
 Uncopyable ()
 Empty base constructor. More...
 

Detailed Description

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.

Member Enumeration Documentation

◆ oporder

enum to define internal used operation order

Enumerator
orderScaleConvertCC 
orderScaleCCConvert 
orderConvertScaleCC 
orderConvertCCScale 
orderCCScaleConvert 
orderCCConvertScale 

Constructor & Destructor Documentation

◆ Converter() [1/3]

icl::core::Converter::Converter ( bool  applyToROIOnly = false)

constructor

Parameters
applyToROIOnlyif true, the source images ROI only is used instead of the whole src image.

◆ Converter() [2/3]

icl::core::Converter::Converter ( oporder  o,
bool  applyToROIOnly = false 
)

other constructor

Parameters
ooperation order
applyToROIOnlyif true, the source images ROI only is used instead of the whole src image.

◆ Converter() [3/3]

icl::core::Converter::Converter ( const ImgBase srcImage,
ImgBase dstImage,
bool  applyToROIOnly = false 
)

creates a converter, and converts the srcImage to dstImage immediately

◆ ~Converter()

icl::core::Converter::~Converter ( )

destructor

Member Function Documentation

◆ apply()

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).

Parameters
srcsource image
dstdestination imagetransfers the image data from the source image into the image data of the destination image
srcsource image
dstdestination image

◆ cc()

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.

Parameters
srcsource image
dstdestination image

◆ dynamicConvert()

void icl::core::Converter::dynamicConvert ( const ImgBase src,
ImgBase dst 
)
private

converts dependent on the destination images depth

◆ setApplyToROIOnly()

void icl::core::Converter::setApplyToROIOnly ( bool  applyToROIOnly)
inline

sets up the converter to apply operations on the source images roi only

See also
Converter(bool,bool)

◆ setOperationOrder()

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:

  • scaling
  • depth conversion
  • color conversion In some cases it might be useful to force the Converter to begin the conversion procedure with scaling before e.g. a depth conversion is applied. This can speed up the performance much if the image is scaled down befor applying the depth conversion. In another scenario, the image is scaled up: In this case, the depth conversion should have been made before the scaling operation. Note: As the color conversion is able to apply an implicit depth conversion, this two step are ordered internally by regarding the currently given oporder.
    Parameters
    onew operation order definition

◆ setScaleMode()

void icl::core::Converter::setScaleMode ( scalemode  scaleMode)

sets a new scale interpolation method (default is interpolateNN)

Member Data Documentation

◆ m_bROIOnly

bool icl::core::Converter::m_bROIOnly
private

flag that indicates whether to work on source images ROI or on the whole sorce image

◆ m_eOpOrder

oporder icl::core::Converter::m_eOpOrder
private

currently set operation order

See also
setOperationOrder

◆ m_poCCBuffer

ImgBase* icl::core::Converter::m_poCCBuffer
private

Buffer for emulated color conversin using Converter::cc(...)

◆ m_poColorBuffer

ImgBase* icl::core::Converter::m_poColorBuffer
private

Buffer for color conversion.

◆ m_poDepthBuffer

ImgBase* icl::core::Converter::m_poDepthBuffer
private

Buffer for depth conversion.

◆ m_poROIBuffer

ImgBase* icl::core::Converter::m_poROIBuffer
private

Buffer for ROI extraction.

◆ m_poSizeBuffer

ImgBase* icl::core::Converter::m_poSizeBuffer
private

Buffer for size conversion.

◆ m_scaleMode

scalemode icl::core::Converter::m_scaleMode
private

internal scalemode


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