Ocean
Ocean::Media::Special::ImageBmp Class Reference

This class implements read and write functions for BMP images. More...

Static Public Member Functions

static Frame decodeImage (const void *buffer, const size_t size)
 Decodes a BMP image from a given binary buffer. More...
 
static bool encodeImage (const Frame &frame, std::vector< uint8_t > &buffer, const bool allowConversion=true, bool *hasBeenConverted=nullptr)
 Encodes a given frame as BMP image to a resulting buffer. More...
 
static bool isPixelFormatSupported (const FrameType::PixelFormat pixelFormat)
 Returns whether a given pixel format is supported natively. More...
 
static bool isPixelOriginSupported (const FrameType::PixelOrigin pixelOrigin)
 Returns whether a given pixel origin is supported natively. More...
 
static bool isFrameTypeSupported (const FrameType::PixelFormat pixelFormat, const FrameType::PixelOrigin pixelOrigin)
 Returns whether a given pixel format together with a given pixel origin is supported natively. More...
 

Detailed Description

This class implements read and write functions for BMP images.

Member Function Documentation

◆ decodeImage()

static Frame Ocean::Media::Special::ImageBmp::decodeImage ( const void *  buffer,
const size_t  size 
)
static

Decodes a BMP 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)
Returns
The frame containing the image information, an invalid frame if the image could not be loaded

◆ encodeImage()

static bool Ocean::Media::Special::ImageBmp::encodeImage ( const Frame frame,
std::vector< uint8_t > &  buffer,
const bool  allowConversion = true,
bool *  hasBeenConverted = nullptr 
)
static

Encodes a given frame as BMP image to a resulting buffer.

Parameters
frameThe frame to be written, must be valid
bufferThe resulting buffer storing the binary information of the BMP image
allowConversionTrue, to allow an internal conversion of the frame if BMP does not support the given frame type; False, to prevent a conversion and to stop creating the buffer
hasBeenConvertedOptional resulting statement whether the frame had to be converted to a different pixel format before it could be written; True, if so; False, if not
Returns
True, if succeeded; False, if the frame could not be written as BMP image e.g., if the frame contained an alpha channel

◆ isFrameTypeSupported()

bool Ocean::Media::Special::ImageBmp::isFrameTypeSupported ( const FrameType::PixelFormat  pixelFormat,
const FrameType::PixelOrigin  pixelOrigin 
)
inlinestatic

Returns whether a given pixel format together with a given pixel origin is supported natively.

Parameters
pixelFormatThe pixel format to be checked
pixelOriginThe pixel origin to be checked
Returns
True, if so; False, if a conversion will be necessary

◆ isPixelFormatSupported()

bool Ocean::Media::Special::ImageBmp::isPixelFormatSupported ( const FrameType::PixelFormat  pixelFormat)
inlinestatic

Returns whether a given pixel format is supported natively.

Parameters
pixelFormatThe pixel format to be checked
Returns
True, if so; False, if a conversion will be necessary

◆ isPixelOriginSupported()

bool Ocean::Media::Special::ImageBmp::isPixelOriginSupported ( const FrameType::PixelOrigin  pixelOrigin)
inlinestatic

Returns whether a given pixel origin is supported natively.

Parameters
pixelOriginThe pixel origin to be checked
Returns
True, if so; False, if a conversion will be necessary

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