This class defines a means to convert an image from one colour format to another.
![]() | PColourConverter ( const PString & srcColourFormat, const PString & dstColourFormat, unsigned width, unsigned height ) Create a new converter. |
![]() | SetFrameSize ( unsigned width, unsigned height ) Set the frame size to be used. |
![]() | SetSrcFrameSize ( unsigned width, unsigned height ) Set the source frame size to be used. |
![]() | SetDstFrameSize ( unsigned width, unsigned height, BOOL bScale ) Set the destination frame size to be used. |
![]() | GetSrcColourFormat () Get the source colour format |
![]() | GetDstColourFormat () Get the destination colour format |
![]() | GetMaxSrcFrameBytes () Get the maximum frame size in bytes for source frames. |
![]() | GetMaxDstFrameBytes () Get the maximum frame size in bytes for destination frames. |
![]() | Convert ( const BYTE * srcFrameBuffer, BYTE * dstFrameBuffer, PINDEX * bytesReturned = NULL ) Convert from one colour format to another. |
![]() | ConvertInPlace ( BYTE * frameBuffer, PINDEX * bytesReturned = NULL, BOOL noIntermediateFrame = FALSE ) Convert from one colour format to another. |
![]() | Create ( const PString & srcColourFormat, const PString & dstColourFormat, unsigned width, unsigned height ) Create an instance of a colour conversion function. |
![]() | GetDstFrameSize (unsigned &w, unsigned &h) const Return the output frame size |
![]() | GetSrcFrameSize (unsigned &w, unsigned &h) const Return the input frame size |
Run Time Type functions
Comparison functions
I/O functions
Miscellaneous functions
This class defines a means to convert an image from one colour format to another. It is an ancestor class for the individual formatting functions.
Default behaviour calls SetSrcFrameSize() and SetDstFrameSize().
Default behaviour sets the srcFrameWidth and srcFrameHeight variables and
recalculates the frame buffer size in bytes then returns TRUE if the size
was calculated correctly.
Default behaviour sets the dstFrameWidth and dstFrameHeight variables,
and the scale / crop preference. It then recalculates the frame buffer
size in bytes then returns TRUE if the size was calculated correctly.
Note a particular device may be able to provide variable length
frames (eg motion JPEG) so will be the maximum size of all frames.
Note a particular device may be able to provide variable length
frames (eg motion JPEG) so will be the maximum size of all frames.
The function should return FALSE if srcFrameBuffer and dstFrameBuffer
are the same and that form pf conversion is not allowed
Note that the frame should be large enough to take the destination
pixels. Default behaviour calls Convert() from the frameBuffer to itself, and
if that returns FALSE then calls it again (provided noIntermediateFrame
is FALSE) using an intermediate store, copying the intermediate store
back to the original frame store.
virtual BOOL SetFrameSize( unsigned width, unsigned height )
height - New height of framevirtual BOOL SetSrcFrameSize( unsigned width, unsigned height )
height - New height of framevirtual BOOL SetDstFrameSize( unsigned width, unsigned height, BOOL bScale )
height - New height of target frame
bScale - TRUE if scaling is preferred over cropconst PString& GetSrcColourFormat()
const PString& GetDstColourFormat()
PINDEX GetMaxSrcFrameBytes()
PINDEX GetMaxDstFrameBytes()
virtual BOOL Convert( const BYTE * srcFrameBuffer, BYTE * dstFrameBuffer, PINDEX * bytesReturned = NULL )
dstFrameBuffer - Frame store for destination pixels
bytesReturned - Bytes written to dstFrameBuffervirtual BOOL ConvertInPlace( BYTE * frameBuffer, PINDEX * bytesReturned = NULL, BOOL noIntermediateFrame = FALSE )
bytesReturned - Bytes written to frameBuffer
noIntermediateFrame - Flag to use intermediate storestatic PColourConverter* Create( const PString & srcColourFormat, const PString & dstColourFormat, unsigned width, unsigned height )
dstColourFormat - Name of destination colour format
width - Width of frame (used for both src and dst)
height - Height of frame (used for both src and dst)BOOL GetDstFrameSize(unsigned &w, unsigned &h) const
BOOL GetSrcFrameSize(unsigned &w, unsigned &h) const
Alphabetic index HTML hierarchy of classes or Java