Ocean
Ocean::Media::Android::Image Class Reference

Static Public Member Functions

static Frame decodeImage (const void *buffer, const size_t size, const std::string &imageBufferTypeIn=std::string(), std::string *imageBufferTypeOut=nullptr)
 Decodes (reads/loads) an image from a given binary buffer. More...
 
static Frame readImage (const std::string &filename)
 Reads/loads an image from a specified file. More...
 

Protected Types

using ScopedFileDescriptor = ScopedObjectCompileTimeT< int, int, int, close, 0, true, -1 >
 Definition of a scoped file based on a file descriptor. More...
 
using ScopedAImageDecoder = ScopedObjectCompileTimeVoidT< AImageDecoder *, AImageDecoder_delete >
 Definition of a scoped object wrapping an AImageDecoder object. More...
 

Static Protected Member Functions

static Frame decodeImage (AImageDecoder *aImageDecoder)
 Decodes an image from a given Android image decoder object. More...
 

Member Typedef Documentation

◆ ScopedAImageDecoder

using Ocean::Media::Android::Image::ScopedAImageDecoder = ScopedObjectCompileTimeVoidT<AImageDecoder*, AImageDecoder_delete>
protected

Definition of a scoped object wrapping an AImageDecoder object.

◆ ScopedFileDescriptor

using Ocean::Media::Android::Image::ScopedFileDescriptor = ScopedObjectCompileTimeT<int, int, int, close, 0, true, -1>
protected

Definition of a scoped file based on a file descriptor.

Member Function Documentation

◆ decodeImage() [1/2]

static Frame Ocean::Media::Android::Image::decodeImage ( AImageDecoder *  aImageDecoder)
staticprotected

Decodes an image from a given Android image decoder object.

Parameters
aImageDecoderThe Android image decoder from which the image will be decoded, must be valid
Returns
The resulting frame, invalid in case of an error

◆ decodeImage() [2/2]

static Frame Ocean::Media::Android::Image::decodeImage ( const void *  buffer,
const size_t  size,
const std::string &  imageBufferTypeIn = std::string(),
std::string *  imageBufferTypeOut = nullptr 
)
static

Decodes (reads/loads) an image from a given binary buffer.

Parameters
bufferThe buffer from which the image will be loaded, must be valid
sizeThe size of the given buffer in bytes, with range [1, infinity)
imageBufferTypeInType of the given image that is stored in the buffer, should be specified if known (e.g. the file extension of a corresponding image file)
imageBufferTypeOutOptional type of the given image that is stored in the buffer, as determined by the decoder (if possible)
Returns
The frame containing the image information, an invalid frame if the image could not be loaded
See also
writeImage().

◆ readImage()

static Frame Ocean::Media::Android::Image::readImage ( const std::string &  filename)
static

Reads/loads an image from a specified file.

Parameters
filenameThe name of the file from which the image will be loaded, must be valid
Returns
The frame containing the image information, an invalid frame if the image could not be loaded
See also
writeImage().

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