DUNE: Uniform Navigational Environment  2017.01.0
DUNE::Media::JPEGCompressor Class Reference

Public Types

enum  ColorSpace { CS_GRAYSCALE, CS_RGB, CS_CMYK, CS_YUV }
 

Public Member Functions

 JPEGCompressor (void)
 
 ~JPEGCompressor (void)
 
JPEGCompressorsetOptimize (bool optimize)
 
JPEGCompressorsetInputDimensions (uint32_t width, uint32_t height)
 
JPEGCompressorsetInputColorSpace (ColorSpace cspace)
 
JPEGCompressorsetOutputColorSpace (ColorSpace cspace)
 
bool compress (uint8_t *raw, uint8_t quality=90)
 
const uint8_t * imageData (void) const
 
uint32_t imageSize (void) const
 

Member Enumeration Documentation

Image color space.

Enumerator
CS_GRAYSCALE 

Grayscale.

CS_RGB 

Red, Green and Blue.

CS_CMYK 

Cyan, Magenta, Yellow and Black.

CS_YUV 

YCbCr.

Constructor & Destructor Documentation

DUNE::Media::JPEGCompressor::JPEGCompressor ( void  )
DUNE::Media::JPEGCompressor::~JPEGCompressor ( void  )

Destroy a JPEGCompressor object.

References DestinationManager::bfr.

Member Function Documentation

bool DUNE::Media::JPEGCompressor::compress ( uint8_t *  raw,
uint8_t  quality = 90 
)

Compress a raw image in JPEG.

Parameters
rawraw image.
qualityJPEG image quality.
Returns
true on success, false otherwise.
const uint8_t * DUNE::Media::JPEGCompressor::imageData ( void  ) const

Retrieve the compressed image.

Returns
compressed image.

References DestinationManager::bfr.

uint32_t DUNE::Media::JPEGCompressor::imageSize ( void  ) const

Retrieve the size of the compressed image.

Returns
size in bytes of the compressed image.

References DestinationManager::bfr_size, and DestinationManager::mgr.

JPEGCompressor & DUNE::Media::JPEGCompressor::setInputColorSpace ( ColorSpace  cspace)

Set input color space.

Parameters
cspacecolor space.
Returns
JPEGCompressor object.

References CS_CMYK, CS_GRAYSCALE, CS_RGB, and CS_YUV.

Referenced by JPEGCompressor().

JPEGCompressor & DUNE::Media::JPEGCompressor::setInputDimensions ( uint32_t  width,
uint32_t  height 
)

Set dimensions of input image.

Parameters
widthwidth of input image.
heightheight of input image.
Returns
JPEGCompressor object.
JPEGCompressor & DUNE::Media::JPEGCompressor::setOptimize ( bool  optimize)

Set entropy encoding optimization.

Parameters
optimizetrue enables optimization.
Returns
JPEGCompressor object.
JPEGCompressor & DUNE::Media::JPEGCompressor::setOutputColorSpace ( ColorSpace  cspace)

Set output image color space.

Parameters
cspacecolor space.
Returns
JPEGCompressor object.

References CS_CMYK, CS_GRAYSCALE, CS_RGB, and CS_YUV.

Collaboration diagram for DUNE::Media::JPEGCompressor:
Collaboration graph