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 IVideoSurface * | ReadImageFile (const String &fileName, IEnums::PixelFormat preferredPixelFormat) |
Read an image from a file and create a video surface. More... | |
static IVideoSurface * | ReadImageFile (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 IVideoSurface * | ReadImage (const ConstData &imageData, IEnums::PixelFormat preferredPixelFormat) |
Read an image from a data object and create a video surface. More... | |
static IVideoSurface * | ReadImage (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 IVideoSurface * | DecodeRawImage (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 IVideoSurface * | DecodeZipImage (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 IVideoSurface * | DecodePngImage (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 IVideoSurface * | DecodePngImage (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 IVideoSurface * | DecodeJpgImage (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 IVideoSurface * | DecodeJpgImage (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 IVideoSurface * | DecodeWebpImage (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 IVideoSurface * | DecodeWebpImage (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 IVideoSurface * | DecodeDdsImage (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 IVideoSurface * | DecodeDdsImage (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 IVideoSurface * | DecodeKtxImage (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 IVideoSurface * | DecodeKtxImage (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 IVideoSurface * | DecodePvrImage (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 IVideoSurface * | DecodePvrImage (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 IVideoSurface * | DecodePkmImage (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 IVideoSurface * | DecodePkmImage (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 IVideoSurface * | DecodeAstcImage (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 IVideoSurface * | DecodeAstcImage (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 IVideoSurface * | DecodeTgaImage (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 IVideoSurface * | DecodeTgaImage (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 IVideoSurface * | DecodeHdrImage (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 IVideoSurface * | DecodeHdrImage (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 IVideoSurface * | DecodePfmImage (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 IVideoSurface * | DecodePfmImage (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]
Check if a file has a supported image format.
- Parameters
-
fileName The file name.
- Returns
- true if the file exists and the image format is supported.
◆ IsSupportedImage() [2/2]
Check if a data object has a supported image format.
- Parameters
-
imageData The data object containing the image.
- Returns
- true if the data object contains image data of a supported format.
◆ GetImageFormat() [1/2]
|
static |
Get the image format of a file.
- Parameters
-
fileName The file name.
- Returns
- The image format or IMAGE_FORMAT_UNKNOWN if reading the file failed.
◆ GetImageFormat() [2/2]
|
static |
Get the image format of a data object.
- Parameters
-
imageData The 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 |
Get the image information of a file.
- Parameters
-
fileName The file name. imageInfo The image information return value.
- Returns
- true if successful.
◆ GetImageInfo() [2/2]
|
static |
Get the image information of an image from a data object.
- Parameters
-
imageData The data object containing the image. imageInfo The image information return value.
- Returns
- true if successful.
◆ GetFileExtension()
|
static |
Get the typical file extension of a specified image format.
- Parameters
-
imageFormat The image format type.
- Returns
- The file extension string or an empty string if the image format is unknown.
◆ ReadImageFile() [1/2]
|
static |
Read an image from a file and create a video surface.
- Parameters
-
fileName The file name. preferredPixelFormat The preferred pixel format.
- Returns
- The video surface or null if reading the file failed.
◆ ReadImageFile() [2/2]
|
static |
Read an image from a file, create a video surface and return the image format type.
- Parameters
-
fileName The file name. imageInfo The image information return value. preferredPixelFormat The preferred pixel format.
- Returns
- The video surface or null if reading the file failed.
◆ ReadImage() [1/2]
|
static |
Read an image from a data object and create a video surface.
- Parameters
-
imageData The data object containing the image. preferredPixelFormat The preferred pixel format.
- Returns
- The video surface or null if reading the data failed.
◆ ReadImage() [2/2]
|
static |
Read an image from a data object, create a video surface and return the image information.
- Parameters
-
imageData The data object containing the image. imageInfo The image information return value. preferredPixelFormat The preferred pixel format.
- Returns
- The video surface or null if reading the data failed.
◆ WritePngImageFile()
|
static |
Write a video surface to a PNG encoded file.
- Parameters
-
fileName The file name to write. source The video surface to encode from. compression The 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 |
Write a video surface to a WEBP encoded file.
- Parameters
-
fileName The file name to write. source The video surface to encode from. compression The type of compression. quality The 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 |
Write a video surface to a JPEG encoded file.
- Parameters
-
fileName The file name to write. source The video surface to encode from. quality The 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 |
Write a video surface to a DDS file.
- Parameters
-
fileName The file name to write. source The video surface to encode from.
- Returns
- true if successful.
◆ DecodeRawImage()
|
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
-
source The data object containing the raw data. flags A bitfield of decoder flags from the DecoderFlag enumeration. pixelFormat The pixel format represented by the given data. sizeX The horizontal size of the image in pixels. sizeY The vertical size of the image in pixels. pitch The line pitch (bytes per line) of the given data. Ignored for compressed formats.
- Returns
- The video surface or null if decoding failed.
◆ DecodeZipImage()
|
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
-
source The data object containing the zipped raw data. flags A bitfield of decoder flags from the DecoderFlag enumeration. pixelFormat The pixel format represented by the given data. sizeX The horizontal size of the image in pixels. sizeY The vertical size of the image in pixels. pitch The line pitch (bytes per line) of the given data. Ignored for compressed formats.
- Returns
- The video surface or null if decoding failed.
◆ IsPngImage()
Check if a data object contains a PNG image.
- Parameters
-
source The data object containing the image.
- Returns
- true if the data object contains a PNG image.
◆ GetPngImageInfo()
|
static |
Get the PNG image information.
- Parameters
-
source The data object containing the image. info The image information structure return value.
- Returns
- true if information structure is valid.
◆ DecodePngImage() [1/2]
|
static |
Decode a PNG image from given source data to a newly created video surface.
- Parameters
-
source The data object containing the encoded PNG image. flags A bitfield of decoder flags from the DecoderFlag enumeration. pixelFormat The desired output pixel format.
- Returns
- The video surface or null if decoding failed.
◆ DecodePngImage() [2/2]
|
static |
Decode a PNG image from a given image info structure to a newly created video surface.
- Parameters
-
info The image info structure. flags A bitfield of decoder flags from the DecoderFlag enumeration. pixelFormat The desired output pixel format.
- Returns
- The video surface or null if decoding failed.
◆ IsJpgImage()
Check if a data object contains a JPG image.
- Parameters
-
source The data object containing the image.
- Returns
- true if the data object contains a JPG image.
◆ GetJpgImageInfo()
|
static |
Get the JPG image information.
- Parameters
-
source The data object containing the image. info The image information structure return value.
- Returns
- true if information structure is valid.
◆ DecodeJpgImage() [1/2]
|
static |
Decode a JPG image from given source data to a newly created video surface.
- Parameters
-
source The data object containing the encoded JPG image. flags A bitfield of decoder flags from the DecoderFlag enumeration. pixelFormat The desired output pixel format.
- Returns
- The video surface or null if decoding failed.
◆ DecodeJpgImage() [2/2]
|
static |
Decode a JPG image from a given image info structure to a newly created video surface.
- Parameters
-
info The image info structure. flags A bitfield of decoder flags from the DecoderFlag enumeration. pixelFormat The desired output pixel format.
- Returns
- The video surface or null if decoding failed.
◆ IsWebpImage()
Check if a data object contains a WEBP image.
- Parameters
-
source The data object containing the image.
- Returns
- true if the data object contains a WEBP image.
◆ GetWebpImageInfo()
|
static |
Get the WEBP image information.
- Parameters
-
source The data object containing the image. info The image information structure return value.
- Returns
- true if information structure is valid.
◆ DecodeWebpImage() [1/2]
|
static |
Decode a WEBP image from given source data to a newly created video surface.
- Parameters
-
source The data object containing the encoded WEBP image. flags A bitfield of decoder flags from the DecoderFlag enumeration. pixelFormat The desired output pixel format.
- Returns
- The video surface or null if decoding failed.
◆ DecodeWebpImage() [2/2]
|
static |
Decode a WEBP image from a given image info structure to a newly created video surface.
- Parameters
-
info The image info structure. flags A bitfield of decoder flags from the DecoderFlag enumeration. pixelFormat The desired output pixel format.
- Returns
- The video surface or null if decoding failed.
◆ IsDdsImage()
Check if a data object contains a DDS image.
- Parameters
-
source The data object containing the image.
- Returns
- true if the data object contains a DDS image.
◆ GetDdsImageInfo()
|
static |
Get the DDS image information.
- Parameters
-
source The data object containing the image. info The image information structure return value.
- Returns
- true if information structure is valid.
◆ DecodeDdsImage() [1/2]
|
static |
Decode a DDS image from given source data to a newly created video surface.
- Parameters
-
source The data object containing the encoded DDS image. surfaceIndex The 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. mipLevel The zero-based index into the surface's MIP chain. flags A bitfield of decoder flags from the DecoderFlag enumeration. pixelFormat The desired output pixel format.
- Returns
- The video surface or null if decoding failed.
◆ DecodeDdsImage() [2/2]
|
static |
Decode a DDS image from a given image info structure to a newly created video surface.
- Parameters
-
info The image info structure. surfaceIndex The 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. mipLevel The zero-based index into the surface's MIP chain. flags A bitfield of decoder flags from the DecoderFlag enumeration. pixelFormat The desired output pixel format.
- Returns
- The video surface or null if decoding failed.
◆ IsKtxImage()
Check if a data object contains a KTX image.
- Parameters
-
source The data object containing the image.
- Returns
- true if the data object contains a KTX image.
◆ GetKtxImageInfo()
|
static |
Get the KTX image information.
- Parameters
-
source The data object containing the image. info The image information structure return value.
- Returns
- true if information structure is valid.
◆ DecodeKtxImage() [1/2]
|
static |
Decode a KTX image from given source data to a newly created video surface.
- Parameters
-
source The data object containing the encoded KTX image. surfaceIndex The 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. mipLevel The zero-based index into the surface's MIP chain. flags A bitfield of decoder flags from the DecoderFlag enumeration. pixelFormat The desired output pixel format.
- Returns
- The video surface or null if decoding failed.
◆ DecodeKtxImage() [2/2]
|
static |
Decode a KTX image from a given image info structure to a newly created video surface.
- Parameters
-
info The image info structure. surfaceIndex The 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. mipLevel The zero-based index into the surface's MIP chain. flags A bitfield of decoder flags from the DecoderFlag enumeration. pixelFormat The desired output pixel format.
- Returns
- The video surface or null if decoding failed.
◆ IsPvrImage()
Check if a data object contains a PVR image.
- Parameters
-
source The data object containing the image.
- Returns
- true if the data object contains a PVR image.
◆ GetPvrImageInfo()
|
static |
Get the PVR image information.
- Parameters
-
source The data object containing the image. info The image information structure return value.
- Returns
- true if information structure is valid.
◆ DecodePvrImage() [1/2]
|
static |
Decode a PVR image from given source data to a newly created video surface.
- Parameters
-
source The data object containing the encoded PVR image. surfaceIndex The 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. mipLevel The zero-based index into the surface's MIP chain. flags A bitfield of decoder flags from the DecoderFlag enumeration. pixelFormat The desired output pixel format.
- Returns
- The video surface or null if decoding failed.
◆ DecodePvrImage() [2/2]
|
static |
Decode a PVR image from a given image info structure to a newly created video surface.
- Parameters
-
info The image info structure. surfaceIndex The 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. mipLevel The zero-based index into the surface's MIP chain. flags A bitfield of decoder flags from the DecoderFlag enumeration. pixelFormat The desired output pixel format.
- Returns
- The video surface or null if decoding failed.
◆ IsPkmImage()
Check if a data object contains a PKM image.
- Parameters
-
source The data object containing the image.
- Returns
- true if the data object contains a PKM image.
◆ GetPkmImageInfo()
|
static |
Get the PKM image information.
- Parameters
-
source The data object containing the image. info The image information structure return value.
- Returns
- true if information structure is valid.
◆ DecodePkmImage() [1/2]
|
static |
Decode a PKM image from given source data to a newly created video surface.
- Parameters
-
source The data object containing the encoded PKM image. flags A bitfield of decoder flags from the DecoderFlag enumeration. pixelFormat The desired output pixel format.
- Returns
- The video surface or null if decoding failed.
◆ DecodePkmImage() [2/2]
|
static |
Decode a PVR image from a given image info structure to a newly created video surface.
- Parameters
-
info The image info structure. flags A bitfield of decoder flags from the DecoderFlag enumeration. pixelFormat The desired output pixel format.
- Returns
- The video surface or null if decoding failed.
◆ IsAstcImage()
Check if a data object contains an ASTC image.
- Parameters
-
source The data object containing the image.
- Returns
- true if the data object contains an ASTC image.
◆ GetAstcImageInfo()
|
static |
Get the ASTC image information.
- Parameters
-
source The data object containing the image. info The image information structure return value.
- Returns
- true if information structure is valid.
◆ DecodeAstcImage() [1/2]
|
static |
Decode an ASTC image from given source data to a newly created video surface.
- Parameters
-
source The data object containing the encoded ASTC image. flags A bitfield of decoder flags from the DecoderFlag enumeration. pixelFormat The desired output pixel format.
- Returns
- The video surface or null if decoding failed.
◆ DecodeAstcImage() [2/2]
|
static |
Decode a PVR image from a given image info structure to a newly created video surface.
- Parameters
-
info The image info structure. flags A bitfield of decoder flags from the DecoderFlag enumeration. pixelFormat The desired output pixel format.
- Returns
- The video surface or null if decoding failed.
◆ IsTgaImage()
Check if a data object contains a TGA image.
- Parameters
-
source The data object containing the image.
- Returns
- true if the data object contains a TGA image.
◆ GetTgaImageInfo()
|
static |
Get the TGA image information.
- Parameters
-
source The data object containing the image. info The image information structure return value.
- Returns
- true if information structure is valid.
◆ DecodeTgaImage() [1/2]
|
static |
Decode a TGA image from given source data to a newly created video surface.
- Parameters
-
source The data object containing the encoded TGA image. flags A bitfield of decoder flags from the DecoderFlag enumeration. pixelFormat The desired output pixel format.
- Returns
- The video surface or null if decoding failed.
◆ DecodeTgaImage() [2/2]
|
static |
Decode a TGA image from a given image info structure to a newly created video surface.
- Parameters
-
info The image info structure. flags A bitfield of decoder flags from the DecoderFlag enumeration. pixelFormat The desired output pixel format.
- Returns
- The video surface or null if decoding failed.
◆ IsHdrImage()
Check if a data object contains an HDR image.
- Parameters
-
source The data object containing the image.
- Returns
- true if the data object contains an HDR image.
◆ GetHdrImageInfo()
|
static |
Get the HDR image information.
- Parameters
-
source The data object containing the image. info The image information structure return value.
- Returns
- true if information structure is valid.
◆ DecodeHdrImage() [1/2]
|
static |
Decode an HDR image from given source data to a newly created video surface.
- Parameters
-
source The data object containing the encoded HDR image. flags A bitfield of decoder flags from the DecoderFlag enumeration. pixelFormat The desired output pixel format.
- Returns
- The video surface or null if decoding failed.
◆ DecodeHdrImage() [2/2]
|
static |
Decode an HDR image from a given image info structure to a newly created video surface.
- Parameters
-
info The image info structure. flags A bitfield of decoder flags from the DecoderFlag enumeration. pixelFormat The desired output pixel format.
- Returns
- The video surface or null if decoding failed.
◆ IsPfmImage()
Check if a data object contains a PFM image.
- Parameters
-
source The data object containing the image.
- Returns
- true if the data object contains a PFM image.
◆ GetPfmImageInfo()
|
static |
Get the PFM image information.
- Parameters
-
source The data object containing the image. info The image information structure return value.
- Returns
- true if information structure is valid.
◆ DecodePfmImage() [1/2]
|
static |
Decode a PFM image from given source data to a newly created video surface.
- Parameters
-
source The data object containing the encoded PFM image. flags A bitfield of decoder flags from the DecoderFlag enumeration. pixelFormat The desired output pixel format.
- Returns
- The video surface or null if decoding failed.
◆ DecodePfmImage() [2/2]
|
static |
Decode a PFM image from a given image info structure to a newly created video surface.
- Parameters
-
info The image info structure. flags A bitfield of decoder flags from the DecoderFlag enumeration. pixelFormat The desired output pixel format.
- Returns
- The video surface or null if decoding failed.
◆ EncodeImage()
|
static |
Encode a video surface to a data object.
- Parameters
-
imageFormat The image format to encode. destination The data object to write into. source The video surface to encode from. compression The type of compression. quality The 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 |
Encode a video surface to a PNG data object.
- Parameters
-
destination The data object to write into. source The video surface to encode from. compression The 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 |
Encode a video surface to a WEBP data object.
- Parameters
-
destination The data object to write into. source The video surface to encode from. compression The type of compression. quality The 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 |
Encode a video surface to a JPEG data object.
- Parameters
-
destination The data object to write into. source The video surface to encode from. quality The 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 |
Encode a video surface to a DDS data object.
- Parameters
-
destination The data object to write into. source The video surface to encode from.
- Returns
- true if successful.
◆ EncodeRawImage()
|
static |
Encode a video surface to a raw data object.
- Parameters
-
destination The data object to write into. source The video surface to encode from.
- Returns
- true if successful.
◆ EncodeZipImage()
|
static |
Encode a video surface to a zipped raw data object.
- Parameters
-
destination The data object to write into. source The video surface to encode from.
- Returns
- true if successful.
◆ EncodeImageAs()
|
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
-
imageFormat The image format to encode. destination The data object to write into. source The video surface to encode from. pixelFormat The actual image pixel format, retrieved from GetPixelFormatToEncodeImage(). components The color component indices, retrieved from GetPixelFormatToEncodeImage(). compression The type of compression. quality The 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 |
Encode a video surface to a PNG data object, using an explicit image pixel format.
See EncodeImageAs().
- Parameters
-
destination The data object to write into. source The video surface to encode from. pixelFormat The actual image pixel format, retrieved from GetPixelFormatToEncodePngImage(). components The color component indices, retrieved from GetPixelFormatToEncodePngImage(). compression The type of compression.
- Returns
- true if successful.
◆ EncodeWebpImageAs()
|
static |
Encode a video surface to a WEBP data object, using an explicit image pixel format.
See EncodeImageAs().
- Parameters
-
destination The data object to write into. source The video surface to encode from. pixelFormat The actual image pixel format, retrieved from GetPixelFormatToEncodeWebpImage(). components The color component indices, retrieved from GetPixelFormatToEncodeWebpImage(). compression The type of compression. quality The quality of compression.
- Returns
- true if successful.
◆ EncodeJpgImageAs()
|
static |
Encode a video surface to a JPG data object, using an explicit image pixel format.
See EncodeImageAs().
- Parameters
-
destination The data object to write into. source The video surface to encode from. pixelFormat The actual image pixel format, retrieved from GetPixelFormatToEncodeJpgImage(). components The color component indices, retrieved from GetPixelFormatToEncodeJpgImage(). quality The quality of compression.
- Returns
- true if successful.
◆ GetPixelFormatToEncodeImage()
|
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
-
outputImageFormat The image format for which to query the formats. outputPixelFormat The desired pixel format of the color values to encode. surfacePixelFormat A reference receiving the pixel format needed to create a surface to be encoded. intermediatePixelFormat A reference receiving the pixel format needed in sn intermediate encoding step, or IEnums::PIXEL_FORMAT_UNDEFINED if not needed. imagePixelFormat The actual pixel format to encode. imageComponents An array of 4 integers receiving the component indices into the surface that are encoded.
- Returns
- true if successful.
◆ GetPixelFormatToEncodePngImage()
|
static |
Get the best matching pixel formats to encode a PNG image.
See GetPixelFormatToEncodeImage().
- Parameters
-
outputPixelFormat The desired pixel format of the color values to encode. surfacePixelFormat A reference receiving the pixel format needed to create a surface to be encoded. intermediatePixelFormat A reference receiving the pixel format needed in sn intermediate encoding step, or IEnums::PIXEL_FORMAT_UNDEFINED if not needed. imagePixelFormat The actual pixel format to encode. imageComponents An array of 4 integers receiving the component indices into the surface that are encoded.
- Returns
- true if successful.
◆ GetPixelFormatToEncodeWebpImage()
|
static |
Get the best matching pixel formats to encode a WEBP image.
See GetPixelFormatToEncodeImage().
- Parameters
-
outputPixelFormat The desired pixel format of the color values to encode. surfacePixelFormat A reference receiving the pixel format needed to create a surface to be encoded. intermediatePixelFormat A reference receiving the pixel format needed in sn intermediate encoding step, or IEnums::PIXEL_FORMAT_UNDEFINED if not needed. imagePixelFormat The actual pixel format to encode. imageComponents An array of 4 integers receiving the component indices into the surface that are encoded.
- Returns
- true if successful.
◆ GetPixelFormatToEncodeJpgImage()
|
static |
Get the best matching pixel formats to encode a JPG image.
See GetPixelFormatToEncodeImage().
- Parameters
-
outputPixelFormat The desired pixel format of the color values to encode. surfacePixelFormat A reference receiving the pixel format needed to create a surface to be encoded. intermediatePixelFormat A reference receiving the pixel format needed in sn intermediate encoding step, or IEnums::PIXEL_FORMAT_UNDEFINED if not needed. imagePixelFormat The actual pixel format to encode. imageComponents An 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