Image Component Library (ICL)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Types | Public Member Functions | Private Member Functions | Private Attributes
icl::core::Converter Class Reference

General Image Converter. More...

#include <Converter.h>

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

List of all members.

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

ImgBasem_poSizeBuffer
 Buffer for size conversion.
ImgBasem_poCCBuffer
 Buffer for emulated color conversin using Converter::cc(...)
ImgBasem_poDepthBuffer
 Buffer for depth conversion.
ImgBasem_poROIBuffer
 Buffer for ROI extraction.
ImgBasem_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

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

enum to define internal used operation order

Enumerator:
orderScaleConvertCC 
orderScaleCCConvert 
orderConvertScaleCC 
orderConvertCCScale 
orderCCScaleConvert 
orderCCConvertScale 

Constructor & Destructor Documentation

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

constructor

Parameters:
applyToROIOnlyif 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

Parameters:
ooperation order
applyToROIOnlyif 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


Member Function Documentation

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 image transfers the image data from the source image into the image data of the destination image
srcsource image
dstdestination 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.

Parameters:
srcsource image
dstdestination 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

See also:
Converter(bool,bool)

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

sets a new scale interpolation method (default is interpolateNN)


Member Data Documentation

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

currently set operation order

See also:
setOperationOrder

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

Buffer for color conversion.

Buffer for depth conversion.

Buffer for ROI extraction.

Buffer for size conversion.

internal scalemode


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines