The video surface tools class. More...

#include "murl_util_video_surface_tools.h"

Static Public Member Functions

static Bool IsSupportedImage (const String &fileName)
 Check if a file has a supported image format. More...
 
static Bool IsSupportedImage (const ConstData &imageData)
 Check if a data object has a supported image format. More...
 
static IEnums::ImageFormat GetImageFormat (const String &fileName)
 Get the image format of a file. More...
 
static IEnums::ImageFormat GetImageFormat (const ConstData &imageData)
 Get the image format of a data object. More...
 
static Bool GetImageInfo (const String &fileName, IImageDecoder::ImageInfo &imageInfo)
 Get the image information of a file. More...
 
static Bool GetImageInfo (const ConstData &imageData, IImageDecoder::ImageInfo &imageInfo)
 Get the image information of an image from a data object. More...
 
static String GetFileExtension (IEnums::ImageFormat imageFormat)
 Get the typical file extension of a specified image format. More...
 
static IVideoSurfaceReadImageFile (const String &fileName, IEnums::PixelFormat preferredPixelFormat)
 Read an image from a file and create a video surface. More...
 
static IVideoSurfaceReadImageFile (const String &fileName, IImageDecoder::ImageInfo &imageInfo, IEnums::PixelFormat preferredPixelFormat)
 Read an image from a file, create a video surface and return the image format type. More...
 
static IVideoSurfaceReadImage (const ConstData &imageData, IEnums::PixelFormat preferredPixelFormat)
 Read an image from a data object and create a video surface. More...
 
static IVideoSurfaceReadImage (const ConstData &imageData, IImageDecoder::ImageInfo &imageInfo, IEnums::PixelFormat preferredPixelFormat)
 Read an image from a data object, create a video surface and return the image information. More...
 
static Bool WritePngImageFile (const String &fileName, const IVideoSurface *source, IEnums::CompressionType compression)
 Write a video surface to a PNG encoded file. More...
 
static Bool WriteWebpImageFile (const String &fileName, const IVideoSurface *source, IEnums::CompressionType compression, Real quality)
 Write a video surface to a WEBP encoded file. More...
 
static Bool WriteJpgImageFile (const String &fileName, const IVideoSurface *source, Real quality)
 Write a video surface to a JPEG encoded file. More...
 
static Bool WriteDdsImageFile (const String &fileName, const IVideoSurface *source)
 Write a video surface to a DDS file. More...
 
static IVideoSurfaceDecodeRawImage (const ConstData &source, UInt32 flags, IEnums::PixelFormat pixelFormat, UInt32 sizeX, UInt32 sizeY, UInt32 pitch)
 Create a video surface with explicit pixel format and dimensions, and decode raw data into it. More...
 
static IVideoSurfaceDecodeZipImage (const ConstData &source, UInt32 flags, IEnums::PixelFormat pixelFormat, UInt32 sizeX, UInt32 sizeY, UInt32 pitch)
 Create a video surface with explicit pixel format and dimensions, and decode zipped raw data into it. More...
 
static Bool IsPngImage (const ConstData &source)
 Check if a data object contains a PNG image. More...
 
static Bool GetPngImageInfo (const ConstData &source, IImageDecoder::ImageInfo &info)
 Get the PNG image information. More...
 
static IVideoSurfaceDecodePngImage (const ConstData &source, UInt32 flags=0, IEnums::PixelFormat pixelFormat=IEnums::PIXEL_FORMAT_UNDEFINED)
 Decode a PNG image from given source data to a newly created video surface. More...
 
static IVideoSurfaceDecodePngImage (const IImageDecoder::ImageInfo &info, UInt32 flags=0, IEnums::PixelFormat pixelFormat=IEnums::PIXEL_FORMAT_UNDEFINED)
 Decode a PNG image from a given image info structure to a newly created video surface. More...
 
static Bool IsJpgImage (const ConstData &source)
 Check if a data object contains a JPG image. More...
 
static Bool GetJpgImageInfo (const ConstData &source, IImageDecoder::ImageInfo &info)
 Get the JPG image information. More...
 
static IVideoSurfaceDecodeJpgImage (const ConstData &source, UInt32 flags=0, IEnums::PixelFormat pixelFormat=IEnums::PIXEL_FORMAT_UNDEFINED)
 Decode a JPG image from given source data to a newly created video surface. More...
 
static IVideoSurfaceDecodeJpgImage (const IImageDecoder::ImageInfo &info, UInt32 flags=0, IEnums::PixelFormat pixelFormat=IEnums::PIXEL_FORMAT_UNDEFINED)
 Decode a JPG image from a given image info structure to a newly created video surface. More...
 
static Bool IsWebpImage (const ConstData &source)
 Check if a data object contains a WEBP image. More...
 
static Bool GetWebpImageInfo (const ConstData &source, IImageDecoder::ImageInfo &info)
 Get the WEBP image information. More...
 
static IVideoSurfaceDecodeWebpImage (const ConstData &source, UInt32 flags=0, IEnums::PixelFormat pixelFormat=IEnums::PIXEL_FORMAT_UNDEFINED)
 Decode a WEBP image from given source data to a newly created video surface. More...
 
static IVideoSurfaceDecodeWebpImage (const IImageDecoder::ImageInfo &info, UInt32 flags=0, IEnums::PixelFormat pixelFormat=IEnums::PIXEL_FORMAT_UNDEFINED)
 Decode a WEBP image from a given image info structure to a newly created video surface. More...
 
static Bool IsDdsImage (const ConstData &source)
 Check if a data object contains a DDS image. More...
 
static Bool GetDdsImageInfo (const ConstData &source, IImageDecoder::ImageInfo &info)
 Get the DDS image information. More...
 
static IVideoSurfaceDecodeDdsImage (const ConstData &source, UInt32 surfaceIndex=0, UInt32 mipLevel=0, UInt32 flags=0, IEnums::PixelFormat pixelFormat=IEnums::PIXEL_FORMAT_UNDEFINED)
 Decode a DDS image from given source data to a newly created video surface. More...
 
static IVideoSurfaceDecodeDdsImage (const IImageDecoder::ImageInfo &info, UInt32 surfaceIndex=0, UInt32 mipLevel=0, UInt32 flags=0, IEnums::PixelFormat pixelFormat=IEnums::PIXEL_FORMAT_UNDEFINED)
 Decode a DDS image from a given image info structure to a newly created video surface. More...
 
static Bool IsKtxImage (const ConstData &source)
 Check if a data object contains a KTX image. More...
 
static Bool GetKtxImageInfo (const ConstData &source, IImageDecoder::ImageInfo &info)
 Get the KTX image information. More...
 
static IVideoSurfaceDecodeKtxImage (const ConstData &source, UInt32 surfaceIndex=0, UInt32 mipLevel=0, UInt32 flags=0, IEnums::PixelFormat pixelFormat=IEnums::PIXEL_FORMAT_UNDEFINED)
 Decode a KTX image from given source data to a newly created video surface. More...
 
static IVideoSurfaceDecodeKtxImage (const IImageDecoder::ImageInfo &info, UInt32 surfaceIndex=0, UInt32 mipLevel=0, UInt32 flags=0, IEnums::PixelFormat pixelFormat=IEnums::PIXEL_FORMAT_UNDEFINED)
 Decode a KTX image from a given image info structure to a newly created video surface. More...
 
static Bool IsPvrImage (const ConstData &source)
 Check if a data object contains a PVR image. More...
 
static Bool GetPvrImageInfo (const ConstData &source, IImageDecoder::ImageInfo &info)
 Get the PVR image information. More...
 
static IVideoSurfaceDecodePvrImage (const ConstData &source, UInt32 surfaceIndex=0, UInt32 mipLevel=0, UInt32 flags=0, IEnums::PixelFormat pixelFormat=IEnums::PIXEL_FORMAT_UNDEFINED)
 Decode a PVR image from given source data to a newly created video surface. More...
 
static IVideoSurfaceDecodePvrImage (const IImageDecoder::ImageInfo &info, UInt32 surfaceIndex=0, UInt32 mipLevel=0, UInt32 flags=0, IEnums::PixelFormat pixelFormat=IEnums::PIXEL_FORMAT_UNDEFINED)
 Decode a PVR image from a given image info structure to a newly created video surface. More...
 
static Bool IsPkmImage (const ConstData &source)
 Check if a data object contains a PKM image. More...
 
static Bool GetPkmImageInfo (const ConstData &source, IImageDecoder::ImageInfo &info)
 Get the PKM image information. More...
 
static IVideoSurfaceDecodePkmImage (const ConstData &source, UInt32 flags=0, IEnums::PixelFormat pixelFormat=IEnums::PIXEL_FORMAT_UNDEFINED)
 Decode a PKM image from given source data to a newly created video surface. More...
 
static IVideoSurfaceDecodePkmImage (const IImageDecoder::ImageInfo &info, UInt32 flags=0, IEnums::PixelFormat pixelFormat=IEnums::PIXEL_FORMAT_UNDEFINED)
 Decode a PVR image from a given image info structure to a newly created video surface. More...
 
static Bool IsAstcImage (const ConstData &source)
 Check if a data object contains an ASTC image. More...
 
static Bool GetAstcImageInfo (const ConstData &source, IImageDecoder::ImageInfo &info)
 Get the ASTC image information. More...
 
static IVideoSurfaceDecodeAstcImage (const ConstData &source, UInt32 flags=0, IEnums::PixelFormat pixelFormat=IEnums::PIXEL_FORMAT_UNDEFINED)
 Decode an ASTC image from given source data to a newly created video surface. More...
 
static IVideoSurfaceDecodeAstcImage (const IImageDecoder::ImageInfo &info, UInt32 flags=0, IEnums::PixelFormat pixelFormat=IEnums::PIXEL_FORMAT_UNDEFINED)
 Decode a PVR image from a given image info structure to a newly created video surface. More...
 
static Bool IsTgaImage (const ConstData &source)
 Check if a data object contains a TGA image. More...
 
static Bool GetTgaImageInfo (const ConstData &source, IImageDecoder::ImageInfo &info)
 Get the TGA image information. More...
 
static IVideoSurfaceDecodeTgaImage (const ConstData &source, UInt32 flags=0, IEnums::PixelFormat pixelFormat=IEnums::PIXEL_FORMAT_UNDEFINED)
 Decode a TGA image from given source data to a newly created video surface. More...
 
static IVideoSurfaceDecodeTgaImage (const IImageDecoder::ImageInfo &info, UInt32 flags=0, IEnums::PixelFormat pixelFormat=IEnums::PIXEL_FORMAT_UNDEFINED)
 Decode a TGA image from a given image info structure to a newly created video surface. More...
 
static Bool IsHdrImage (const ConstData &source)
 Check if a data object contains an HDR image. More...
 
static Bool GetHdrImageInfo (const ConstData &source, IImageDecoder::ImageInfo &info)
 Get the HDR image information. More...
 
static IVideoSurfaceDecodeHdrImage (const ConstData &source, UInt32 flags=0, IEnums::PixelFormat pixelFormat=IEnums::PIXEL_FORMAT_UNDEFINED)
 Decode an HDR image from given source data to a newly created video surface. More...
 
static IVideoSurfaceDecodeHdrImage (const IImageDecoder::ImageInfo &info, UInt32 flags=0, IEnums::PixelFormat pixelFormat=IEnums::PIXEL_FORMAT_UNDEFINED)
 Decode an HDR image from a given image info structure to a newly created video surface. More...
 
static Bool IsPfmImage (const ConstData &source)
 Check if a data object contains a PFM image. More...
 
static Bool GetPfmImageInfo (const ConstData &source, IImageDecoder::ImageInfo &info)
 Get the PFM image information. More...
 
static IVideoSurfaceDecodePfmImage (const ConstData &source, UInt32 flags=0, IEnums::PixelFormat pixelFormat=IEnums::PIXEL_FORMAT_UNDEFINED)
 Decode a PFM image from given source data to a newly created video surface. More...
 
static IVideoSurfaceDecodePfmImage (const IImageDecoder::ImageInfo &info, UInt32 flags=0, IEnums::PixelFormat pixelFormat=IEnums::PIXEL_FORMAT_UNDEFINED)
 Decode a PFM image from a given image info structure to a newly created video surface. More...
 
static Bool EncodeImage (IEnums::ImageFormat imageFormat, Data &destination, const IVideoSurface *source, IEnums::CompressionType compression, Real quality)
 Encode a video surface to a data object. More...
 
static Bool EncodePngImage (Data &destination, const IVideoSurface *source, IEnums::CompressionType compression)
 Encode a video surface to a PNG data object. More...
 
static Bool EncodeWebpImage (Data &destination, const IVideoSurface *source, IEnums::CompressionType compression, Real quality)
 Encode a video surface to a WEBP data object. More...
 
static Bool EncodeJpgImage (Data &destination, const IVideoSurface *source, Real quality)
 Encode a video surface to a JPEG data object. More...
 
static Bool EncodeDdsImage (Data &destination, const IVideoSurface *source)
 Encode a video surface to a DDS data object. More...
 
static Bool EncodeRawImage (Data &destination, const IVideoSurface *source)
 Encode a video surface to a raw data object. More...
 
static Bool EncodeZipImage (Data &destination, const IVideoSurface *source)
 Encode a video surface to a zipped raw data object. More...
 
static Bool EncodeImageAs (IEnums::ImageFormat imageFormat, Data &destination, const IVideoSurface *source, IEnums::PixelFormat pixelFormat, const SInt32 components[4], IEnums::CompressionType compression, Real quality)
 Encode a video surface to a data object, using an explicit image pixel format. More...
 
static Bool EncodePngImageAs (Data &destination, const IVideoSurface *source, IEnums::PixelFormat pixelFormat, const SInt32 components[4], IEnums::CompressionType compression)
 Encode a video surface to a PNG data object, using an explicit image pixel format. More...
 
static Bool EncodeWebpImageAs (Data &destination, const IVideoSurface *source, IEnums::PixelFormat pixelFormat, const SInt32 components[4], IEnums::CompressionType compression, Real quality)
 Encode a video surface to a WEBP data object, using an explicit image pixel format. More...
 
static Bool EncodeJpgImageAs (Data &destination, const IVideoSurface *source, IEnums::PixelFormat pixelFormat, const SInt32 components[4], Real quality)
 Encode a video surface to a JPG data object, using an explicit image pixel format. More...
 
static Bool GetPixelFormatToEncodeImage (IEnums::ImageFormat outputImageFormat, IEnums::PixelFormat outputPixelFormat, IEnums::PixelFormat &surfacePixelFormat, IEnums::PixelFormat &intermediatePixelFormat, IEnums::PixelFormat &imagePixelFormat, SInt32 imageComponents[4])
 For a given output image format and desired pixel format to encode, get the best matching pixel format an image of the given type can store, and get the both the pixel formats needed for a surface to be correctly encoded, and an optional intermediate format. More...
 
static Bool GetPixelFormatToEncodePngImage (IEnums::PixelFormat outputPixelFormat, IEnums::PixelFormat &surfacePixelFormat, IEnums::PixelFormat &intermediatePixelFormat, IEnums::PixelFormat &imagePixelFormat, SInt32 imageComponents[4])
 Get the best matching pixel formats to encode a PNG image. More...
 
static Bool GetPixelFormatToEncodeWebpImage (IEnums::PixelFormat outputPixelFormat, IEnums::PixelFormat &surfacePixelFormat, IEnums::PixelFormat &intermediatePixelFormat, IEnums::PixelFormat &imagePixelFormat, SInt32 imageComponents[4])
 Get the best matching pixel formats to encode a WEBP image. More...
 
static Bool GetPixelFormatToEncodeJpgImage (IEnums::PixelFormat outputPixelFormat, IEnums::PixelFormat &surfacePixelFormat, IEnums::PixelFormat &intermediatePixelFormat, IEnums::PixelFormat &imagePixelFormat, SInt32 imageComponents[4])
 Get the best matching pixel formats to encode a JPG image. More...
 

Detailed Description

The video surface tools class.

The video surface tools can read and write several image formats from and to IVideoSurface objects.

Member Function Documentation

◆ IsSupportedImage() [1/2]

static Bool Murl::Util::VideoSurfaceTools::IsSupportedImage ( const String fileName)
static

Check if a file has a supported image format.

Parameters
fileNameThe file name.
Returns
true if the file exists and the image format is supported.

◆ IsSupportedImage() [2/2]

static Bool Murl::Util::VideoSurfaceTools::IsSupportedImage ( const ConstData imageData)
static

Check if a data object has a supported image format.

Parameters
imageDataThe data object containing the image.
Returns
true if the data object contains image data of a supported format.

◆ GetImageFormat() [1/2]

static IEnums::ImageFormat Murl::Util::VideoSurfaceTools::GetImageFormat ( const String fileName)
static

Get the image format of a file.

Parameters
fileNameThe file name.
Returns
The image format or IMAGE_FORMAT_UNKNOWN if reading the file failed.

◆ GetImageFormat() [2/2]

static IEnums::ImageFormat Murl::Util::VideoSurfaceTools::GetImageFormat ( const ConstData imageData)
static

Get the image format of a data object.

Parameters
imageDataThe data object containing the image.
Returns
The image format or IMAGE_FORMAT_UNKNOWN if the data object does not contain image data of a supported format.

◆ GetImageInfo() [1/2]

static Bool Murl::Util::VideoSurfaceTools::GetImageInfo ( const String fileName,
IImageDecoder::ImageInfo imageInfo 
)
static

Get the image information of a file.

Parameters
fileNameThe file name.
imageInfoThe image information return value.
Returns
true if successful.

◆ GetImageInfo() [2/2]

static Bool Murl::Util::VideoSurfaceTools::GetImageInfo ( const ConstData imageData,
IImageDecoder::ImageInfo imageInfo 
)
static

Get the image information of an image from a data object.

Parameters
imageDataThe data object containing the image.
imageInfoThe image information return value.
Returns
true if successful.

◆ GetFileExtension()

static String Murl::Util::VideoSurfaceTools::GetFileExtension ( IEnums::ImageFormat  imageFormat)
static

Get the typical file extension of a specified image format.

Parameters
imageFormatThe image format type.
Returns
The file extension string or an empty string if the image format is unknown.

◆ ReadImageFile() [1/2]

static IVideoSurface* Murl::Util::VideoSurfaceTools::ReadImageFile ( const String fileName,
IEnums::PixelFormat  preferredPixelFormat 
)
static

Read an image from a file and create a video surface.

Parameters
fileNameThe file name.
preferredPixelFormatThe preferred pixel format.
Returns
The video surface or null if reading the file failed.

◆ ReadImageFile() [2/2]

static IVideoSurface* Murl::Util::VideoSurfaceTools::ReadImageFile ( const String fileName,
IImageDecoder::ImageInfo imageInfo,
IEnums::PixelFormat  preferredPixelFormat 
)
static

Read an image from a file, create a video surface and return the image format type.

Parameters
fileNameThe file name.
imageInfoThe image information return value.
preferredPixelFormatThe preferred pixel format.
Returns
The video surface or null if reading the file failed.

◆ ReadImage() [1/2]

static IVideoSurface* Murl::Util::VideoSurfaceTools::ReadImage ( const ConstData imageData,
IEnums::PixelFormat  preferredPixelFormat 
)
static

Read an image from a data object and create a video surface.

Parameters
imageDataThe data object containing the image.
preferredPixelFormatThe preferred pixel format.
Returns
The video surface or null if reading the data failed.

◆ ReadImage() [2/2]

static IVideoSurface* Murl::Util::VideoSurfaceTools::ReadImage ( const ConstData imageData,
IImageDecoder::ImageInfo imageInfo,
IEnums::PixelFormat  preferredPixelFormat 
)
static

Read an image from a data object, create a video surface and return the image information.

Parameters
imageDataThe data object containing the image.
imageInfoThe image information return value.
preferredPixelFormatThe preferred pixel format.
Returns
The video surface or null if reading the data failed.

◆ WritePngImageFile()

static Bool Murl::Util::VideoSurfaceTools::WritePngImageFile ( const String fileName,
const IVideoSurface source,
IEnums::CompressionType  compression 
)
static

Write a video surface to a PNG encoded file.

Parameters
fileNameThe file name to write.
sourceThe video surface to encode from.
compressionThe type of compression. Use the zlib best compression if COMPRESSION_TYPE_BEST, otherwise the png-lib default compression is used.
Returns
true if successful.

◆ WriteWebpImageFile()

static Bool Murl::Util::VideoSurfaceTools::WriteWebpImageFile ( const String fileName,
const IVideoSurface source,
IEnums::CompressionType  compression,
Real  quality 
)
static

Write a video surface to a WEBP encoded file.

Parameters
fileNameThe file name to write.
sourceThe video surface to encode from.
compressionThe type of compression.
qualityThe quality of compression in range [0 .. 100] where 0 is the lowest quality and the highest compression and 100 is the highest quality and the lowest compression.
Returns
true if successful.

◆ WriteJpgImageFile()

static Bool Murl::Util::VideoSurfaceTools::WriteJpgImageFile ( const String fileName,
const IVideoSurface source,
Real  quality 
)
static

Write a video surface to a JPEG encoded file.

Parameters
fileNameThe file name to write.
sourceThe video surface to encode from.
qualityThe quality of compression in range [0 .. 100] where 0 is the lowest quality and the highest compression and 100 is the highest quality and the lowest compression.
Returns
true if successful.

◆ WriteDdsImageFile()

static Bool Murl::Util::VideoSurfaceTools::WriteDdsImageFile ( const String fileName,
const IVideoSurface source 
)
static

Write a video surface to a DDS file.

Parameters
fileNameThe file name to write.
sourceThe video surface to encode from.
Returns
true if successful.

◆ DecodeRawImage()

static IVideoSurface* Murl::Util::VideoSurfaceTools::DecodeRawImage ( const ConstData source,
UInt32  flags,
IEnums::PixelFormat  pixelFormat,
UInt32  sizeX,
UInt32  sizeY,
UInt32  pitch 
)
static

Create a video surface with explicit pixel format and dimensions, and decode raw data into it.

Source data must contain enough bytes to hold the full surface of given width, height and pixel format, which can be calculated via IEnums::GetPixelFormatBytesPerSurface(). See IEnums::GetPixelFormatBytesPerLine() for details regarding the line pitch of an uncompressed pixel format. See also IEnums::GetPixelFormatCompressedBlockSizeX(), IEnums::GetPixelFormatCompressedBlockSizeY() and IEnums::GetPixelFormatCompressedBytesPerBlock() for details regarding compressed pixel formats.

Parameters
sourceThe data object containing the raw data.
flagsA bitfield of decoder flags from the DecoderFlag enumeration.
pixelFormatThe pixel format represented by the given data.
sizeXThe horizontal size of the image in pixels.
sizeYThe vertical size of the image in pixels.
pitchThe line pitch (bytes per line) of the given data. Ignored for compressed formats.
Returns
The video surface or null if decoding failed.

◆ DecodeZipImage()

static IVideoSurface* Murl::Util::VideoSurfaceTools::DecodeZipImage ( const ConstData source,
UInt32  flags,
IEnums::PixelFormat  pixelFormat,
UInt32  sizeX,
UInt32  sizeY,
UInt32  pitch 
)
static

Create a video surface with explicit pixel format and dimensions, and decode zipped raw data into it.

Decompressed source data must contain enough bytes to hold the full surface of given width, height and pixel format, which can be calculated via IEnums::GetPixelFormatBytesPerSurface(). See IEnums::GetPixelFormatBytesPerLine() for details regarding the line pitch of an uncompressed pixel format. See also IEnums::GetPixelFormatCompressedBlockSizeX(), IEnums::GetPixelFormatCompressedBlockSizeY() and IEnums::GetPixelFormatCompressedBytesPerBlock() for details regarding compressed pixel formats.

Parameters
sourceThe data object containing the zipped raw data.
flagsA bitfield of decoder flags from the DecoderFlag enumeration.
pixelFormatThe pixel format represented by the given data.
sizeXThe horizontal size of the image in pixels.
sizeYThe vertical size of the image in pixels.
pitchThe line pitch (bytes per line) of the given data. Ignored for compressed formats.
Returns
The video surface or null if decoding failed.

◆ IsPngImage()

static Bool Murl::Util::VideoSurfaceTools::IsPngImage ( const ConstData source)
static

Check if a data object contains a PNG image.

Parameters
sourceThe data object containing the image.
Returns
true if the data object contains a PNG image.

◆ GetPngImageInfo()

static Bool Murl::Util::VideoSurfaceTools::GetPngImageInfo ( const ConstData source,
IImageDecoder::ImageInfo info 
)
static

Get the PNG image information.

Parameters
sourceThe data object containing the image.
infoThe image information structure return value.
Returns
true if information structure is valid.

◆ DecodePngImage() [1/2]

static IVideoSurface* Murl::Util::VideoSurfaceTools::DecodePngImage ( const ConstData source,
UInt32  flags = 0,
IEnums::PixelFormat  pixelFormat = IEnums::PIXEL_FORMAT_UNDEFINED 
)
static

Decode a PNG image from given source data to a newly created video surface.

Parameters
sourceThe data object containing the encoded PNG image.
flagsA bitfield of decoder flags from the DecoderFlag enumeration.
pixelFormatThe desired output pixel format.
Returns
The video surface or null if decoding failed.

◆ DecodePngImage() [2/2]

static IVideoSurface* Murl::Util::VideoSurfaceTools::DecodePngImage ( const IImageDecoder::ImageInfo info,
UInt32  flags = 0,
IEnums::PixelFormat  pixelFormat = IEnums::PIXEL_FORMAT_UNDEFINED 
)
static

Decode a PNG image from a given image info structure to a newly created video surface.

Parameters
infoThe image info structure.
flagsA bitfield of decoder flags from the DecoderFlag enumeration.
pixelFormatThe desired output pixel format.
Returns
The video surface or null if decoding failed.

◆ IsJpgImage()

static Bool Murl::Util::VideoSurfaceTools::IsJpgImage ( const ConstData source)
static

Check if a data object contains a JPG image.

Parameters
sourceThe data object containing the image.
Returns
true if the data object contains a JPG image.

◆ GetJpgImageInfo()

static Bool Murl::Util::VideoSurfaceTools::GetJpgImageInfo ( const ConstData source,
IImageDecoder::ImageInfo info 
)
static

Get the JPG image information.

Parameters
sourceThe data object containing the image.
infoThe image information structure return value.
Returns
true if information structure is valid.

◆ DecodeJpgImage() [1/2]

static IVideoSurface* Murl::Util::VideoSurfaceTools::DecodeJpgImage ( const ConstData source,
UInt32  flags = 0,
IEnums::PixelFormat  pixelFormat = IEnums::PIXEL_FORMAT_UNDEFINED 
)
static

Decode a JPG image from given source data to a newly created video surface.

Parameters
sourceThe data object containing the encoded JPG image.
flagsA bitfield of decoder flags from the DecoderFlag enumeration.
pixelFormatThe desired output pixel format.
Returns
The video surface or null if decoding failed.

◆ DecodeJpgImage() [2/2]

static IVideoSurface* Murl::Util::VideoSurfaceTools::DecodeJpgImage ( const IImageDecoder::ImageInfo info,
UInt32  flags = 0,
IEnums::PixelFormat  pixelFormat = IEnums::PIXEL_FORMAT_UNDEFINED 
)
static

Decode a JPG image from a given image info structure to a newly created video surface.

Parameters
infoThe image info structure.
flagsA bitfield of decoder flags from the DecoderFlag enumeration.
pixelFormatThe desired output pixel format.
Returns
The video surface or null if decoding failed.

◆ IsWebpImage()

static Bool Murl::Util::VideoSurfaceTools::IsWebpImage ( const ConstData source)
static

Check if a data object contains a WEBP image.

Parameters
sourceThe data object containing the image.
Returns
true if the data object contains a WEBP image.

◆ GetWebpImageInfo()

static Bool Murl::Util::VideoSurfaceTools::GetWebpImageInfo ( const ConstData source,
IImageDecoder::ImageInfo info 
)
static

Get the WEBP image information.

Parameters
sourceThe data object containing the image.
infoThe image information structure return value.
Returns
true if information structure is valid.

◆ DecodeWebpImage() [1/2]

static IVideoSurface* Murl::Util::VideoSurfaceTools::DecodeWebpImage ( const ConstData source,
UInt32  flags = 0,
IEnums::PixelFormat  pixelFormat = IEnums::PIXEL_FORMAT_UNDEFINED 
)
static

Decode a WEBP image from given source data to a newly created video surface.

Parameters
sourceThe data object containing the encoded WEBP image.
flagsA bitfield of decoder flags from the DecoderFlag enumeration.
pixelFormatThe desired output pixel format.
Returns
The video surface or null if decoding failed.

◆ DecodeWebpImage() [2/2]

static IVideoSurface* Murl::Util::VideoSurfaceTools::DecodeWebpImage ( const IImageDecoder::ImageInfo info,
UInt32  flags = 0,
IEnums::PixelFormat  pixelFormat = IEnums::PIXEL_FORMAT_UNDEFINED 
)
static

Decode a WEBP image from a given image info structure to a newly created video surface.

Parameters
infoThe image info structure.
flagsA bitfield of decoder flags from the DecoderFlag enumeration.
pixelFormatThe desired output pixel format.
Returns
The video surface or null if decoding failed.

◆ IsDdsImage()

static Bool Murl::Util::VideoSurfaceTools::IsDdsImage ( const ConstData source)
static

Check if a data object contains a DDS image.

Parameters
sourceThe data object containing the image.
Returns
true if the data object contains a DDS image.

◆ GetDdsImageInfo()

static Bool Murl::Util::VideoSurfaceTools::GetDdsImageInfo ( const ConstData source,
IImageDecoder::ImageInfo info 
)
static

Get the DDS image information.

Parameters
sourceThe data object containing the image.
infoThe image information structure return value.
Returns
true if information structure is valid.

◆ DecodeDdsImage() [1/2]

static IVideoSurface* Murl::Util::VideoSurfaceTools::DecodeDdsImage ( const ConstData source,
UInt32  surfaceIndex = 0,
UInt32  mipLevel = 0,
UInt32  flags = 0,
IEnums::PixelFormat  pixelFormat = IEnums::PIXEL_FORMAT_UNDEFINED 
)
static

Decode a DDS image from given source data to a newly created video surface.

Parameters
sourceThe data object containing the encoded DDS image.
surfaceIndexThe zero-based index of the surface within the DDS image. For single-layer images, this must be 0 for 2D images or in the range [0..5] for cube maps. For array images, this must be in the range [0..N-1] for 2D images or [0..6*N-1] for cube maps, with N being the number of array layers present.
mipLevelThe zero-based index into the surface's MIP chain.
flagsA bitfield of decoder flags from the DecoderFlag enumeration.
pixelFormatThe desired output pixel format.
Returns
The video surface or null if decoding failed.

◆ DecodeDdsImage() [2/2]

static IVideoSurface* Murl::Util::VideoSurfaceTools::DecodeDdsImage ( const IImageDecoder::ImageInfo info,
UInt32  surfaceIndex = 0,
UInt32  mipLevel = 0,
UInt32  flags = 0,
IEnums::PixelFormat  pixelFormat = IEnums::PIXEL_FORMAT_UNDEFINED 
)
static

Decode a DDS image from a given image info structure to a newly created video surface.

Parameters
infoThe image info structure.
surfaceIndexThe zero-based index of the surface within the DDS image. For single-layer images, this must be 0 for 2D images or in the range [0..5] for cube maps. For array images, this must be in the range [0..N-1] for 2D images or [0..6*N-1] for cube maps, with N being the number of array layers present.
mipLevelThe zero-based index into the surface's MIP chain.
flagsA bitfield of decoder flags from the DecoderFlag enumeration.
pixelFormatThe desired output pixel format.
Returns
The video surface or null if decoding failed.

◆ IsKtxImage()

static Bool Murl::Util::VideoSurfaceTools::IsKtxImage ( const ConstData source)
static

Check if a data object contains a KTX image.

Parameters
sourceThe data object containing the image.
Returns
true if the data object contains a KTX image.

◆ GetKtxImageInfo()

static Bool Murl::Util::VideoSurfaceTools::GetKtxImageInfo ( const ConstData source,
IImageDecoder::ImageInfo info 
)
static

Get the KTX image information.

Parameters
sourceThe data object containing the image.
infoThe image information structure return value.
Returns
true if information structure is valid.

◆ DecodeKtxImage() [1/2]

static IVideoSurface* Murl::Util::VideoSurfaceTools::DecodeKtxImage ( const ConstData source,
UInt32  surfaceIndex = 0,
UInt32  mipLevel = 0,
UInt32  flags = 0,
IEnums::PixelFormat  pixelFormat = IEnums::PIXEL_FORMAT_UNDEFINED 
)
static

Decode a KTX image from given source data to a newly created video surface.

Parameters
sourceThe data object containing the encoded KTX image.
surfaceIndexThe zero-based index of the surface within the KTX image. For single-layer images, this must be 0 for 2D images or in the range [0..5] for cube maps. For array images, this must be in the range [0..N-1] for 2D images or [0..6*N-1] for cube maps, with N being the number of array layers present.
mipLevelThe zero-based index into the surface's MIP chain.
flagsA bitfield of decoder flags from the DecoderFlag enumeration.
pixelFormatThe desired output pixel format.
Returns
The video surface or null if decoding failed.

◆ DecodeKtxImage() [2/2]

static IVideoSurface* Murl::Util::VideoSurfaceTools::DecodeKtxImage ( const IImageDecoder::ImageInfo info,
UInt32  surfaceIndex = 0,
UInt32  mipLevel = 0,
UInt32  flags = 0,
IEnums::PixelFormat  pixelFormat = IEnums::PIXEL_FORMAT_UNDEFINED 
)
static

Decode a KTX image from a given image info structure to a newly created video surface.

Parameters
infoThe image info structure.
surfaceIndexThe zero-based index of the surface within the KTX image. For single-layer images, this must be 0 for 2D images or in the range [0..5] for cube maps. For array images, this must be in the range [0..N-1] for 2D images or [0..6*N-1] for cube maps, with N being the number of array layers present.
mipLevelThe zero-based index into the surface's MIP chain.
flagsA bitfield of decoder flags from the DecoderFlag enumeration.
pixelFormatThe desired output pixel format.
Returns
The video surface or null if decoding failed.

◆ IsPvrImage()

static Bool Murl::Util::VideoSurfaceTools::IsPvrImage ( const ConstData source)
static

Check if a data object contains a PVR image.

Parameters
sourceThe data object containing the image.
Returns
true if the data object contains a PVR image.

◆ GetPvrImageInfo()

static Bool Murl::Util::VideoSurfaceTools::GetPvrImageInfo ( const ConstData source,
IImageDecoder::ImageInfo info 
)
static

Get the PVR image information.

Parameters
sourceThe data object containing the image.
infoThe image information structure return value.
Returns
true if information structure is valid.

◆ DecodePvrImage() [1/2]

static IVideoSurface* Murl::Util::VideoSurfaceTools::DecodePvrImage ( const ConstData source,
UInt32  surfaceIndex = 0,
UInt32  mipLevel = 0,
UInt32  flags = 0,
IEnums::PixelFormat  pixelFormat = IEnums::PIXEL_FORMAT_UNDEFINED 
)
static

Decode a PVR image from given source data to a newly created video surface.

Parameters
sourceThe data object containing the encoded PVR image.
surfaceIndexThe zero-based index of the surface within the PVR image. For single-layer images, this must be 0 for 2D images or in the range [0..5] for cube maps. For array images, this must be in the range [0..N-1] for 2D images or [0..6*N-1] for cube maps, with N being the number of array layers present.
mipLevelThe zero-based index into the surface's MIP chain.
flagsA bitfield of decoder flags from the DecoderFlag enumeration.
pixelFormatThe desired output pixel format.
Returns
The video surface or null if decoding failed.

◆ DecodePvrImage() [2/2]

static IVideoSurface* Murl::Util::VideoSurfaceTools::DecodePvrImage ( const IImageDecoder::ImageInfo info,
UInt32  surfaceIndex = 0,
UInt32  mipLevel = 0,
UInt32  flags = 0,
IEnums::PixelFormat  pixelFormat = IEnums::PIXEL_FORMAT_UNDEFINED 
)
static

Decode a PVR image from a given image info structure to a newly created video surface.

Parameters
infoThe image info structure.
surfaceIndexThe zero-based index of the surface within the PVR image. For single-layer images, this must be 0 for 2D images or in the range [0..5] for cube maps. For array images, this must be in the range [0..N-1] for 2D images or [0..6*N-1] for cube maps, with N being the number of array layers present.
mipLevelThe zero-based index into the surface's MIP chain.
flagsA bitfield of decoder flags from the DecoderFlag enumeration.
pixelFormatThe desired output pixel format.
Returns
The video surface or null if decoding failed.

◆ IsPkmImage()

static Bool Murl::Util::VideoSurfaceTools::IsPkmImage ( const ConstData source)
static

Check if a data object contains a PKM image.

Parameters
sourceThe data object containing the image.
Returns
true if the data object contains a PKM image.

◆ GetPkmImageInfo()

static Bool Murl::Util::VideoSurfaceTools::GetPkmImageInfo ( const ConstData source,
IImageDecoder::ImageInfo info 
)
static

Get the PKM image information.

Parameters
sourceThe data object containing the image.
infoThe image information structure return value.
Returns
true if information structure is valid.

◆ DecodePkmImage() [1/2]

static IVideoSurface* Murl::Util::VideoSurfaceTools::DecodePkmImage ( const ConstData source,
UInt32  flags = 0,
IEnums::PixelFormat  pixelFormat = IEnums::PIXEL_FORMAT_UNDEFINED 
)
static

Decode a PKM image from given source data to a newly created video surface.

Parameters
sourceThe data object containing the encoded PKM image.
flagsA bitfield of decoder flags from the DecoderFlag enumeration.
pixelFormatThe desired output pixel format.
Returns
The video surface or null if decoding failed.

◆ DecodePkmImage() [2/2]

static IVideoSurface* Murl::Util::VideoSurfaceTools::DecodePkmImage ( const IImageDecoder::ImageInfo info,
UInt32  flags = 0,
IEnums::PixelFormat  pixelFormat = IEnums::PIXEL_FORMAT_UNDEFINED 
)
static

Decode a PVR image from a given image info structure to a newly created video surface.

Parameters
infoThe image info structure.
flagsA bitfield of decoder flags from the DecoderFlag enumeration.
pixelFormatThe desired output pixel format.
Returns
The video surface or null if decoding failed.

◆ IsAstcImage()

static Bool Murl::Util::VideoSurfaceTools::IsAstcImage ( const ConstData source)
static

Check if a data object contains an ASTC image.

Parameters
sourceThe data object containing the image.
Returns
true if the data object contains an ASTC image.

◆ GetAstcImageInfo()

static Bool Murl::Util::VideoSurfaceTools::GetAstcImageInfo ( const ConstData source,
IImageDecoder::ImageInfo info 
)
static

Get the ASTC image information.

Parameters
sourceThe data object containing the image.
infoThe image information structure return value.
Returns
true if information structure is valid.

◆ DecodeAstcImage() [1/2]

static IVideoSurface* Murl::Util::VideoSurfaceTools::DecodeAstcImage ( const ConstData source,
UInt32  flags = 0,
IEnums::PixelFormat  pixelFormat = IEnums::PIXEL_FORMAT_UNDEFINED 
)
static

Decode an ASTC image from given source data to a newly created video surface.

Parameters
sourceThe data object containing the encoded ASTC image.
flagsA bitfield of decoder flags from the DecoderFlag enumeration.
pixelFormatThe desired output pixel format.
Returns
The video surface or null if decoding failed.

◆ DecodeAstcImage() [2/2]

static IVideoSurface* Murl::Util::VideoSurfaceTools::DecodeAstcImage ( const IImageDecoder::ImageInfo info,
UInt32  flags = 0,
IEnums::PixelFormat  pixelFormat = IEnums::PIXEL_FORMAT_UNDEFINED 
)
static

Decode a PVR image from a given image info structure to a newly created video surface.

Parameters
infoThe image info structure.
flagsA bitfield of decoder flags from the DecoderFlag enumeration.
pixelFormatThe desired output pixel format.
Returns
The video surface or null if decoding failed.

◆ IsTgaImage()

static Bool Murl::Util::VideoSurfaceTools::IsTgaImage ( const ConstData source)
static

Check if a data object contains a TGA image.

Parameters
sourceThe data object containing the image.
Returns
true if the data object contains a TGA image.

◆ GetTgaImageInfo()

static Bool Murl::Util::VideoSurfaceTools::GetTgaImageInfo ( const ConstData source,
IImageDecoder::ImageInfo info 
)
static

Get the TGA image information.

Parameters
sourceThe data object containing the image.
infoThe image information structure return value.
Returns
true if information structure is valid.

◆ DecodeTgaImage() [1/2]

static IVideoSurface* Murl::Util::VideoSurfaceTools::DecodeTgaImage ( const ConstData source,
UInt32  flags = 0,
IEnums::PixelFormat  pixelFormat = IEnums::PIXEL_FORMAT_UNDEFINED 
)
static

Decode a TGA image from given source data to a newly created video surface.

Parameters
sourceThe data object containing the encoded TGA image.
flagsA bitfield of decoder flags from the DecoderFlag enumeration.
pixelFormatThe desired output pixel format.
Returns
The video surface or null if decoding failed.

◆ DecodeTgaImage() [2/2]

static IVideoSurface* Murl::Util::VideoSurfaceTools::DecodeTgaImage ( const IImageDecoder::ImageInfo info,
UInt32  flags = 0,
IEnums::PixelFormat  pixelFormat = IEnums::PIXEL_FORMAT_UNDEFINED 
)
static

Decode a TGA image from a given image info structure to a newly created video surface.

Parameters
infoThe image info structure.
flagsA bitfield of decoder flags from the DecoderFlag enumeration.
pixelFormatThe desired output pixel format.
Returns
The video surface or null if decoding failed.

◆ IsHdrImage()

static Bool Murl::Util::VideoSurfaceTools::IsHdrImage ( const ConstData source)
static

Check if a data object contains an HDR image.

Parameters
sourceThe data object containing the image.
Returns
true if the data object contains an HDR image.

◆ GetHdrImageInfo()

static Bool Murl::Util::VideoSurfaceTools::GetHdrImageInfo ( const ConstData source,
IImageDecoder::ImageInfo info 
)
static

Get the HDR image information.

Parameters
sourceThe data object containing the image.
infoThe image information structure return value.
Returns
true if information structure is valid.

◆ DecodeHdrImage() [1/2]

static IVideoSurface* Murl::Util::VideoSurfaceTools::DecodeHdrImage ( const ConstData source,
UInt32  flags = 0,
IEnums::PixelFormat  pixelFormat = IEnums::PIXEL_FORMAT_UNDEFINED 
)
static

Decode an HDR image from given source data to a newly created video surface.

Parameters
sourceThe data object containing the encoded HDR image.
flagsA bitfield of decoder flags from the DecoderFlag enumeration.
pixelFormatThe desired output pixel format.
Returns
The video surface or null if decoding failed.

◆ DecodeHdrImage() [2/2]

static IVideoSurface* Murl::Util::VideoSurfaceTools::DecodeHdrImage ( const IImageDecoder::ImageInfo info,
UInt32  flags = 0,
IEnums::PixelFormat  pixelFormat = IEnums::PIXEL_FORMAT_UNDEFINED 
)
static

Decode an HDR image from a given image info structure to a newly created video surface.

Parameters
infoThe image info structure.
flagsA bitfield of decoder flags from the DecoderFlag enumeration.
pixelFormatThe desired output pixel format.
Returns
The video surface or null if decoding failed.

◆ IsPfmImage()

static Bool Murl::Util::VideoSurfaceTools::IsPfmImage ( const ConstData source)
static

Check if a data object contains a PFM image.

Parameters
sourceThe data object containing the image.
Returns
true if the data object contains a PFM image.

◆ GetPfmImageInfo()

static Bool Murl::Util::VideoSurfaceTools::GetPfmImageInfo ( const ConstData source,
IImageDecoder::ImageInfo info 
)
static

Get the PFM image information.

Parameters
sourceThe data object containing the image.
infoThe image information structure return value.
Returns
true if information structure is valid.

◆ DecodePfmImage() [1/2]

static IVideoSurface* Murl::Util::VideoSurfaceTools::DecodePfmImage ( const ConstData source,
UInt32  flags = 0,
IEnums::PixelFormat  pixelFormat = IEnums::PIXEL_FORMAT_UNDEFINED 
)
static

Decode a PFM image from given source data to a newly created video surface.

Parameters
sourceThe data object containing the encoded PFM image.
flagsA bitfield of decoder flags from the DecoderFlag enumeration.
pixelFormatThe desired output pixel format.
Returns
The video surface or null if decoding failed.

◆ DecodePfmImage() [2/2]

static IVideoSurface* Murl::Util::VideoSurfaceTools::DecodePfmImage ( const IImageDecoder::ImageInfo info,
UInt32  flags = 0,
IEnums::PixelFormat  pixelFormat = IEnums::PIXEL_FORMAT_UNDEFINED 
)
static

Decode a PFM image from a given image info structure to a newly created video surface.

Parameters
infoThe image info structure.
flagsA bitfield of decoder flags from the DecoderFlag enumeration.
pixelFormatThe desired output pixel format.
Returns
The video surface or null if decoding failed.

◆ EncodeImage()

static Bool Murl::Util::VideoSurfaceTools::EncodeImage ( IEnums::ImageFormat  imageFormat,
Data destination,
const IVideoSurface source,
IEnums::CompressionType  compression,
Real  quality 
)
static

Encode a video surface to a data object.

Parameters
imageFormatThe image format to encode.
destinationThe data object to write into.
sourceThe video surface to encode from.
compressionThe type of compression.
qualityThe quality of compression in range [0 .. 100] where 0 represents lowest quality and highest compression and 100 represents highest quality and lowest compression.
Returns
true if successful.

◆ EncodePngImage()

static Bool Murl::Util::VideoSurfaceTools::EncodePngImage ( Data destination,
const IVideoSurface source,
IEnums::CompressionType  compression 
)
static

Encode a video surface to a PNG data object.

Parameters
destinationThe data object to write into.
sourceThe video surface to encode from.
compressionThe type of compression. Use the zlib best compression if COMPRESSION_TYPE_BEST, otherwise the png-lib default compression is used.
Returns
true if successful.

◆ EncodeWebpImage()

static Bool Murl::Util::VideoSurfaceTools::EncodeWebpImage ( Data destination,
const IVideoSurface source,
IEnums::CompressionType  compression,
Real  quality 
)
static

Encode a video surface to a WEBP data object.

Parameters
destinationThe data object to write into.
sourceThe video surface to encode from.
compressionThe type of compression.
qualityThe quality of compression in range [0 .. 100] where 0 is the lowest quality and the highest compression and 100 is the highest quality and the lowest compression.
Returns
true if successful.

◆ EncodeJpgImage()

static Bool Murl::Util::VideoSurfaceTools::EncodeJpgImage ( Data destination,
const IVideoSurface source,
Real  quality 
)
static

Encode a video surface to a JPEG data object.

Parameters
destinationThe data object to write into.
sourceThe video surface to encode from.
qualityThe quality of compression in range [0 .. 100] where 0 is the lowest quality and the highest compression and 100 is the highest quality and the lowest compression.
Returns
true if successful.

◆ EncodeDdsImage()

static Bool Murl::Util::VideoSurfaceTools::EncodeDdsImage ( Data destination,
const IVideoSurface source 
)
static

Encode a video surface to a DDS data object.

Parameters
destinationThe data object to write into.
sourceThe video surface to encode from.
Returns
true if successful.

◆ EncodeRawImage()

static Bool Murl::Util::VideoSurfaceTools::EncodeRawImage ( Data destination,
const IVideoSurface source 
)
static

Encode a video surface to a raw data object.

Parameters
destinationThe data object to write into.
sourceThe video surface to encode from.
Returns
true if successful.

◆ EncodeZipImage()

static Bool Murl::Util::VideoSurfaceTools::EncodeZipImage ( Data destination,
const IVideoSurface source 
)
static

Encode a video surface to a zipped raw data object.

Parameters
destinationThe data object to write into.
sourceThe video surface to encode from.
Returns
true if successful.

◆ EncodeImageAs()

static Bool Murl::Util::VideoSurfaceTools::EncodeImageAs ( IEnums::ImageFormat  imageFormat,
Data destination,
const IVideoSurface source,
IEnums::PixelFormat  pixelFormat,
const SInt32  components[4],
IEnums::CompressionType  compression,
Real  quality 
)
static

Encode a video surface to a data object, using an explicit image pixel format.

This method tries to encode a given surface as an image of a given type, possibly shuffling the source surface's color components so that they can be stored in one of the image format's actually supported storage pixel format. Use GetPixelFormatToEncodeImage() to query necessary values for a given pixel format. The given surface must match the surfacePixelFormat retrieved from that method.

Parameters
imageFormatThe image format to encode.
destinationThe data object to write into.
sourceThe video surface to encode from.
pixelFormatThe actual image pixel format, retrieved from GetPixelFormatToEncodeImage().
componentsThe color component indices, retrieved from GetPixelFormatToEncodeImage().
compressionThe type of compression.
qualityThe quality of compression in range [0 .. 100] where 0 represents lowest quality and highest compression and 100 represents highest quality and lowest compression.
Returns
true if successful.

◆ EncodePngImageAs()

static Bool Murl::Util::VideoSurfaceTools::EncodePngImageAs ( Data destination,
const IVideoSurface source,
IEnums::PixelFormat  pixelFormat,
const SInt32  components[4],
IEnums::CompressionType  compression 
)
static

Encode a video surface to a PNG data object, using an explicit image pixel format.

See EncodeImageAs().

Parameters
destinationThe data object to write into.
sourceThe video surface to encode from.
pixelFormatThe actual image pixel format, retrieved from GetPixelFormatToEncodePngImage().
componentsThe color component indices, retrieved from GetPixelFormatToEncodePngImage().
compressionThe type of compression.
Returns
true if successful.

◆ EncodeWebpImageAs()

static Bool Murl::Util::VideoSurfaceTools::EncodeWebpImageAs ( Data destination,
const IVideoSurface source,
IEnums::PixelFormat  pixelFormat,
const SInt32  components[4],
IEnums::CompressionType  compression,
Real  quality 
)
static

Encode a video surface to a WEBP data object, using an explicit image pixel format.

See EncodeImageAs().

Parameters
destinationThe data object to write into.
sourceThe video surface to encode from.
pixelFormatThe actual image pixel format, retrieved from GetPixelFormatToEncodeWebpImage().
componentsThe color component indices, retrieved from GetPixelFormatToEncodeWebpImage().
compressionThe type of compression.
qualityThe quality of compression.
Returns
true if successful.

◆ EncodeJpgImageAs()

static Bool Murl::Util::VideoSurfaceTools::EncodeJpgImageAs ( Data destination,
const IVideoSurface source,
IEnums::PixelFormat  pixelFormat,
const SInt32  components[4],
Real  quality 
)
static

Encode a video surface to a JPG data object, using an explicit image pixel format.

See EncodeImageAs().

Parameters
destinationThe data object to write into.
sourceThe video surface to encode from.
pixelFormatThe actual image pixel format, retrieved from GetPixelFormatToEncodeJpgImage().
componentsThe color component indices, retrieved from GetPixelFormatToEncodeJpgImage().
qualityThe quality of compression.
Returns
true if successful.

◆ GetPixelFormatToEncodeImage()

static Bool Murl::Util::VideoSurfaceTools::GetPixelFormatToEncodeImage ( IEnums::ImageFormat  outputImageFormat,
IEnums::PixelFormat  outputPixelFormat,
IEnums::PixelFormat surfacePixelFormat,
IEnums::PixelFormat intermediatePixelFormat,
IEnums::PixelFormat imagePixelFormat,
SInt32  imageComponents[4] 
)
static

For a given output image format and desired pixel format to encode, get the best matching pixel format an image of the given type can store, and get the both the pixel formats needed for a surface to be correctly encoded, and an optional intermediate format.

Parameters
outputImageFormatThe image format for which to query the formats.
outputPixelFormatThe desired pixel format of the color values to encode.
surfacePixelFormatA reference receiving the pixel format needed to create a surface to be encoded.
intermediatePixelFormatA reference receiving the pixel format needed in sn intermediate encoding step, or IEnums::PIXEL_FORMAT_UNDEFINED if not needed.
imagePixelFormatThe actual pixel format to encode.
imageComponentsAn array of 4 integers receiving the component indices into the surface that are encoded.
Returns
true if successful.

◆ GetPixelFormatToEncodePngImage()

static Bool Murl::Util::VideoSurfaceTools::GetPixelFormatToEncodePngImage ( IEnums::PixelFormat  outputPixelFormat,
IEnums::PixelFormat surfacePixelFormat,
IEnums::PixelFormat intermediatePixelFormat,
IEnums::PixelFormat imagePixelFormat,
SInt32  imageComponents[4] 
)
static

Get the best matching pixel formats to encode a PNG image.

See GetPixelFormatToEncodeImage().

Parameters
outputPixelFormatThe desired pixel format of the color values to encode.
surfacePixelFormatA reference receiving the pixel format needed to create a surface to be encoded.
intermediatePixelFormatA reference receiving the pixel format needed in sn intermediate encoding step, or IEnums::PIXEL_FORMAT_UNDEFINED if not needed.
imagePixelFormatThe actual pixel format to encode.
imageComponentsAn array of 4 integers receiving the component indices into the surface that are encoded.
Returns
true if successful.

◆ GetPixelFormatToEncodeWebpImage()

static Bool Murl::Util::VideoSurfaceTools::GetPixelFormatToEncodeWebpImage ( IEnums::PixelFormat  outputPixelFormat,
IEnums::PixelFormat surfacePixelFormat,
IEnums::PixelFormat intermediatePixelFormat,
IEnums::PixelFormat imagePixelFormat,
SInt32  imageComponents[4] 
)
static

Get the best matching pixel formats to encode a WEBP image.

See GetPixelFormatToEncodeImage().

Parameters
outputPixelFormatThe desired pixel format of the color values to encode.
surfacePixelFormatA reference receiving the pixel format needed to create a surface to be encoded.
intermediatePixelFormatA reference receiving the pixel format needed in sn intermediate encoding step, or IEnums::PIXEL_FORMAT_UNDEFINED if not needed.
imagePixelFormatThe actual pixel format to encode.
imageComponentsAn array of 4 integers receiving the component indices into the surface that are encoded.
Returns
true if successful.

◆ GetPixelFormatToEncodeJpgImage()

static Bool Murl::Util::VideoSurfaceTools::GetPixelFormatToEncodeJpgImage ( IEnums::PixelFormat  outputPixelFormat,
IEnums::PixelFormat surfacePixelFormat,
IEnums::PixelFormat intermediatePixelFormat,
IEnums::PixelFormat imagePixelFormat,
SInt32  imageComponents[4] 
)
static

Get the best matching pixel formats to encode a JPG image.

See GetPixelFormatToEncodeImage().

Parameters
outputPixelFormatThe desired pixel format of the color values to encode.
surfacePixelFormatA reference receiving the pixel format needed to create a surface to be encoded.
intermediatePixelFormatA reference receiving the pixel format needed in sn intermediate encoding step, or IEnums::PIXEL_FORMAT_UNDEFINED if not needed.
imagePixelFormatThe actual pixel format to encode.
imageComponentsAn array of 4 integers receiving the component indices into the surface that are encoded.
Returns
true if successful.

The documentation for this class was generated from the following file:
  • murl_util_video_surface_tools.h


Copyright © 2011-2024 Spraylight GmbH.