"L. Spiro Engine"
|
Image-related functions. More...
#include <LSIImageLib.h>
Public Types | |
typedef CVectorPoD< LSUINT8, LSUINT32 > | CTexelBuffer |
Static Public Member Functions | |
static LSE_INLINE const LSUINT32 LSE_FCALL | GetComponentBits (LSI_PIXEL_FORMAT _pfFormat, LSI_PIXEL_COMPONENTS _ppComp) |
static LSE_INLINE const LSUINT32 LSE_FCALL | GetComponentOffset (LSI_PIXEL_FORMAT _pfFormat, LSI_PIXEL_COMPONENTS _ppComp) |
static LSE_INLINE const LSUINT32 LSE_FCALL | GetTotalComponents (LSI_PIXEL_FORMAT _pfFormat) |
static LSE_INLINE LSI_PIXEL_COMPONENTS LSE_FCALL | ComponentIndexToComponentType (LSI_PIXEL_FORMAT _pfFormat, LSUINT32 _ui32Index) |
static LSE_INLINE const LSUINT32 LSE_FCALL | ConvComponent (LSI_PIXEL_FORMAT _pfSrcFormat, LSI_PIXEL_FORMAT _pfDstFormat, LSI_PIXEL_COMPONENTS _ppComp, LSUINT32 _ui32Component) |
static LSE_INLINE const LSUINT32 LSE_FCALL | GetFormatSize (LSI_PIXEL_FORMAT _pfFormat) |
static LSE_INLINE LSUINT32 LSE_FCALL | GetRowSize (LSI_PIXEL_FORMAT _pfFormat, LSUINT32 _ui32Total) |
static LSUINT32 LSE_FCALL | GetBufferSizeWithPadding (LSI_PIXEL_FORMAT _pfFormat, LSUINT32 _ui32Width, LSUINT32 _ui32Height) |
static LSUINT64 LSE_FCALL | IntegerTexelToIntegerTexel (LSI_PIXEL_FORMAT _pfSrcFormat, LSI_PIXEL_FORMAT _pfDstFormat, LSUINT64 _ui64Color) |
static LSVOID LSE_FCALL | IntegerTexelToFloat32Texel (LSI_PIXEL_FORMAT _pfSrcFormat, LSUINT64 _ui64Color, LSFLOAT _fReturn[4]) |
static LSUINT64 LSE_FCALL | Float32TexelToIntegerTexel (LSI_PIXEL_FORMAT _pfDstFormat, const LSFLOAT _fValue[4]) |
static LSVOID LSE_FCALL | IntegerTexelToFloat16Texel (LSI_PIXEL_FORMAT _pfSrcFormat, LSUINT64 _ui64Color, CFloat16 _f16Return[4]) |
static LSUINT64 LSE_FCALL | Float16TexelToIntegerTexel (LSI_PIXEL_FORMAT _pfDstFormat, const CFloat16 _f16Value[4]) |
static LSUINT64 LSE_FCALL | Float32TexelToIntegerTexel (LSI_PIXEL_FORMAT _pfDstFormat, LSFLOAT _fR, LSFLOAT _fG, LSFLOAT _fB, LSFLOAT _fA) |
static LSE_INLINE LSVOID LSE_CALL | BatchIntegerTexelToIntegerTexel (LSI_PIXEL_FORMAT _pfSrcFormat, const LSVOID *_pvSrcBuffer, LSI_PIXEL_FORMAT _pfDstFormat, LSVOID *_pvDstBuffer, LSUINT32 _ui32Total) |
static LSE_INLINE LSVOID LSE_CALL | BatchIntegerTexelToFloat32Texel (LSI_PIXEL_FORMAT _pfSrcFormat, const LSVOID *_pvSrcBuffer, LSVOID *_pvDstBuffer, LSUINT32 _ui32Total) |
static LSE_INLINE LSVOID LSE_CALL | BatchIntegerTexelToFloat16Texel (LSI_PIXEL_FORMAT _pfSrcFormat, const LSVOID *_pvSrcBuffer, LSVOID *_pvDstBuffer, LSUINT32 _ui32Total) |
static LSE_INLINE LSVOID LSE_CALL | BatchFloat32TexelToIntegerTexel (const LSVOID *_pvSrcBuffer, LSI_PIXEL_FORMAT _pfDstFormat, LSVOID *_pvDstBuffer, LSUINT32 _ui32Total) |
static LSE_INLINE LSVOID LSE_CALL | BatchFloat16TexelToIntegerTexel (const LSVOID *_pvSrcBuffer, LSI_PIXEL_FORMAT _pfDstFormat, LSVOID *_pvDstBuffer, LSUINT32 _ui32Total) |
static LSE_INLINE LSVOID LSE_CALL | BatchFloatTexelToFloatTexel (LSI_PIXEL_FORMAT _pfSrcFormat, const LSVOID *_pvSrcBuffer, LSI_PIXEL_FORMAT _pfDstFormat, LSVOID *_pvDstBuffer, LSUINT32 _ui32Total) |
static LSE_INLINE LSVOID LSE_CALL | BatchAnyTexelToAnytexel (LSI_PIXEL_FORMAT _pfSrcFormat, const LSVOID *_pvSrcBuffer, LSI_PIXEL_FORMAT _pfDstFormat, LSVOID *_pvDstBuffer, LSUINT32 _ui32Total) |
Static Protected Member Functions | |
template<unsigned _tSrcBits, unsigned _tDstBits, unsigned _tTreat0BitsAsFF> | |
static LSE_INLINE LSUINT32 LSE_FCALL | ConvComp (LSUINT32 _ui32Src) |
Image-related functions.
Class CImageLib Description: Generalized image-related functions and template functions.
typedef CVectorPoD<LSUINT8, LSUINT32> lsi::CImageLib::CTexelBuffer |
A loaded pixel buffer in which each row is tightly packed and padded to 4 bytes.
LSE_INLINE LSVOID LSE_CALL lsi::CImageLib::BatchAnyTexelToAnytexel | ( | LSI_PIXEL_FORMAT | _pfSrcFormat, |
const LSVOID * | _pvSrcBuffer, | ||
LSI_PIXEL_FORMAT | _pfDstFormat, | ||
LSVOID * | _pvDstBuffer, | ||
LSUINT32 | _ui32Total | ||
) | [static] |
Convert from any format to any other format. Both buffers should be over-allocated by 8 bytes. Texels are assumed to be tightly packed in the source buffer, and will be tightly packed in the output buffer.
_pfSrcFormat | The source texel format. |
_pvSrcBuffer | The source buffer. Must be over-allocated by 8 bytes. |
_pfDstFormat | The destination texel format. |
_pvDstBuffer | The destination buffer. Must be over-allocated by 8 bytes. |
_ui32Total | The total number of texels to convert. |
LSE_INLINE LSVOID LSE_CALL lsi::CImageLib::BatchFloat16TexelToIntegerTexel | ( | const LSVOID * | _pvSrcBuffer, |
LSI_PIXEL_FORMAT | _pfDstFormat, | ||
LSVOID * | _pvDstBuffer, | ||
LSUINT32 | _ui32Total | ||
) | [static] |
Convert from a 16-bit-per-component floating-point format to any integer format. The destination buffer must be large enough to hold the converted texels, and the source buffer must be over-allocated by 8 bytes. Texels are assumed to be tightly packed in the source buffer, and will be tightly packed in the output buffer.
_pvSrcBuffer | The source buffer. |
_pfDstFormat | The destination texel format. |
_pvDstBuffer | The destination buffer. Must be over-allocated by 8 bytes. |
_ui32Total | The total number of texels to convert. |
LSE_INLINE LSVOID LSE_CALL lsi::CImageLib::BatchFloat32TexelToIntegerTexel | ( | const LSVOID * | _pvSrcBuffer, |
LSI_PIXEL_FORMAT | _pfDstFormat, | ||
LSVOID * | _pvDstBuffer, | ||
LSUINT32 | _ui32Total | ||
) | [static] |
Convert from a 32-bit-per-component floating-point format to any integer format. The destination buffer must be large enough to hold the converted texels, and the source buffer must be over-allocated by 8 bytes. Texels are assumed to be tightly packed in the source buffer, and will be tightly packed in the output buffer.
_pvSrcBuffer | The source buffer. |
_pfDstFormat | The destination texel format. |
_pvDstBuffer | The destination buffer. Must be over-allocated by 8 bytes. |
_ui32Total | The total number of texels to convert. |
LSE_INLINE LSVOID LSE_CALL lsi::CImageLib::BatchFloatTexelToFloatTexel | ( | LSI_PIXEL_FORMAT | _pfSrcFormat, |
const LSVOID * | _pvSrcBuffer, | ||
LSI_PIXEL_FORMAT | _pfDstFormat, | ||
LSVOID * | _pvDstBuffer, | ||
LSUINT32 | _ui32Total | ||
) | [static] |
Convert from a floating-point format to another floating-point format.
_pfSrcFormat | The source texel format. |
_pvSrcBuffer | The source buffer. Must be over-allocated by 8 bytes. |
_pfDstFormat | The destination texel format. |
_pvDstBuffer | The destination buffer. Must be over-allocated by 8 bytes. |
_ui32Total | The total number of texels to convert. |
LSE_INLINE LSVOID LSE_CALL lsi::CImageLib::BatchIntegerTexelToFloat16Texel | ( | LSI_PIXEL_FORMAT | _pfSrcFormat, |
const LSVOID * | _pvSrcBuffer, | ||
LSVOID * | _pvDstBuffer, | ||
LSUINT32 | _ui32Total | ||
) | [static] |
Convert a batch of texels from any integer format to a 16-bit-per-component floating-point format. The destination buffer must be large enough to hold the converted texels. Texels are assumed to be tightly packed in the source buffer, and will be tightly packed in the output buffer.
_pfSrcFormat | The source texel format. |
_pvSrcBuffer | The source buffer. Must be over-allocated by 8 bytes. |
_pvDstBuffer | The destination buffer. |
_ui32Total | The total number of texels to convert. |
LSE_INLINE LSVOID LSE_CALL lsi::CImageLib::BatchIntegerTexelToFloat32Texel | ( | LSI_PIXEL_FORMAT | _pfSrcFormat, |
const LSVOID * | _pvSrcBuffer, | ||
LSVOID * | _pvDstBuffer, | ||
LSUINT32 | _ui32Total | ||
) | [static] |
Convert a batch of texels from any integer format to a 32-bit-per-component floating-point format. The destination buffer must be large enough to hold the converted texels. Texels are assumed to be tightly packed in the source buffer, and will be tightly packed in the output buffer.
_pfSrcFormat | The source texel format. |
_pvSrcBuffer | The source buffer. Must be over-allocated by 8 bytes. |
_pvDstBuffer | The destination buffer. |
_ui32Total | The total number of texels to convert. |
LSE_INLINE LSVOID LSE_CALL lsi::CImageLib::BatchIntegerTexelToIntegerTexel | ( | LSI_PIXEL_FORMAT | _pfSrcFormat, |
const LSVOID * | _pvSrcBuffer, | ||
LSI_PIXEL_FORMAT | _pfDstFormat, | ||
LSVOID * | _pvDstBuffer, | ||
LSUINT32 | _ui32Total | ||
) | [static] |
Convert a batch of texels from any integer format to any other integer format. The destination buffer must be large enough to hold the converted texels plus 8 more bytes. Texels are assumed to be tightly packed in the source buffer, and will be tightly packed in the output buffer.
_pfSrcFormat | The source texel format. |
_pvSrcBuffer | The source buffer. Must be over-allocated by 8 bytes. |
_pfDstFormat | The destination texel format. |
_pvDstBuffer | The destination buffer. Must be over-allocated by 8 bytes. |
_ui32Total | The total number of texels to convert. |
LSE_INLINE LSI_PIXEL_COMPONENTS LSE_FCALL lsi::CImageLib::ComponentIndexToComponentType | ( | LSI_PIXEL_FORMAT | _pfFormat, |
LSUINT32 | _ui32Index | ||
) | [static] |
Converts the component index to a component type. For example, for the LSI_PF_R8G8B8A8 format, index 0 is translated to LSI_PC_A because the alpha component comes first in memory.
_pfFormat | The texel format. |
_ui32Index | Index of the component to translate to a component type. |
LSE_INLINE LSUINT32 LSE_FCALL lsi::CImageLib::ConvComp | ( | LSUINT32 | _ui32Src | ) | [static, protected] |
Convert a single component from one integer form to another.
_ui32Src | The source component. |
LSE_INLINE const LSUINT32 LSE_FCALL lsi::CImageLib::ConvComponent | ( | LSI_PIXEL_FORMAT | _pfSrcFormat, |
LSI_PIXEL_FORMAT | _pfDstFormat, | ||
LSI_PIXEL_COMPONENTS | _ppComp, | ||
LSUINT32 | _ui32Component | ||
) | [static] |
Convert from any integer component to any other integer component.
_pfSrcFormat | The source texel format. |
_pfDstFormat | The destination texel format. |
_ppComp | The index of the component to convert. |
_ui32Component | The component to convert. |
static LSUINT64 LSE_FCALL lsi::CImageLib::Float16TexelToIntegerTexel | ( | LSI_PIXEL_FORMAT | _pfDstFormat, |
const CFloat16 | _f16Value[4] | ||
) | [static] |
Convert from a 16-bit-per-component floating-point format to any integer format.
_pfDstFormat | The destination texel format. |
_f16Value | The 4-element array of texels in 16-bit floating format to convert. |
static LSUINT64 LSE_FCALL lsi::CImageLib::Float32TexelToIntegerTexel | ( | LSI_PIXEL_FORMAT | _pfDstFormat, |
const LSFLOAT | _fValue[4] | ||
) | [static] |
Convert from a 32-bit-per-component floating-point format to any integer format.
_pfDstFormat | The destination texel format. |
_fValue | The 4-element array of texels in 32-bit floating format to convert. |
static LSUINT64 LSE_FCALL lsi::CImageLib::Float32TexelToIntegerTexel | ( | LSI_PIXEL_FORMAT | _pfDstFormat, |
LSFLOAT | _fR, | ||
LSFLOAT | _fG, | ||
LSFLOAT | _fB, | ||
LSFLOAT | _fA | ||
) | [static] |
Convert from 4 floating-point values to any integer format.
_pfDstFormat | The destination texel format. |
_fR | The red component. |
_fG | The green component. |
_fB | The blue component. |
_fA | The alpha component. |
static LSUINT32 LSE_FCALL lsi::CImageLib::GetBufferSizeWithPadding | ( | LSI_PIXEL_FORMAT | _pfFormat, |
LSUINT32 | _ui32Width, | ||
LSUINT32 | _ui32Height | ||
) | [static] |
Get the total number of bytes that need to be allocated for an image buffer with the given dimensions. Acccounts for the 8-bit overflow area that is necessary for conversion functions.
_pfFormat | Format of the texel data. |
_ui32Width | Number of texels wide the image is. |
_ui32Height | Number of texels tall the image is. |
LSE_INLINE const LSUINT32 LSE_FCALL lsi::CImageLib::GetComponentBits | ( | LSI_PIXEL_FORMAT | _pfFormat, |
LSI_PIXEL_COMPONENTS | _ppComp | ||
) | [static] |
Get the number of bits for a component of the given format.
_pfFormat | The texel format. |
_ppComp | The component whose bit count is to be gotten. |
LSE_INLINE const LSUINT32 LSE_FCALL lsi::CImageLib::GetComponentOffset | ( | LSI_PIXEL_FORMAT | _pfFormat, |
LSI_PIXEL_COMPONENTS | _ppComp | ||
) | [static] |
Get the offset, in bits, for a component of the given format.
_pfFormat | The texel format. |
_ppComp | The component whose bit offset is to be gotten. |
LSE_INLINE const LSUINT32 LSE_FCALL lsi::CImageLib::GetFormatSize | ( | LSI_PIXEL_FORMAT | _pfFormat | ) | [static] |
Get the size, in bytes, of a texel format.
_pfFormat | The texel format. |
LSE_INLINE LSUINT32 LSE_FCALL lsi::CImageLib::GetRowSize | ( | LSI_PIXEL_FORMAT | _pfFormat, |
LSUINT32 | _ui32Total | ||
) | [static] |
Get the width of a row of texels in bytes.
_pfFormat | Format of the texel data. |
_ui32Total | Number of texels in a row. |
LSE_INLINE const LSUINT32 LSE_FCALL lsi::CImageLib::GetTotalComponents | ( | LSI_PIXEL_FORMAT | _pfFormat | ) | [static] |
Get the number of components in the given format.
_pfFormat | The texel format. |
static LSVOID LSE_FCALL lsi::CImageLib::IntegerTexelToFloat16Texel | ( | LSI_PIXEL_FORMAT | _pfSrcFormat, |
LSUINT64 | _ui64Color, | ||
CFloat16 | _f16Return[4] | ||
) | [static] |
Convert any integer format to a 64-bit floating-point format with 16 bits in each component.
_pfSrcFormat | The source texel format. |
_ui64Color | The texel to convert. |
_f16Return | Holds the converted color value. Must be a 4-element array. |
static LSVOID LSE_FCALL lsi::CImageLib::IntegerTexelToFloat32Texel | ( | LSI_PIXEL_FORMAT | _pfSrcFormat, |
LSUINT64 | _ui64Color, | ||
LSFLOAT | _fReturn[4] | ||
) | [static] |
Convert any integer format to a 128-bit floating-point format with 32 bits in each component.
_pfSrcFormat | The source texel format. |
_ui64Color | The texel to convert. |
_fReturn | Holds the converted color value. Must be a 4-element array. |
static LSUINT64 LSE_FCALL lsi::CImageLib::IntegerTexelToIntegerTexel | ( | LSI_PIXEL_FORMAT | _pfSrcFormat, |
LSI_PIXEL_FORMAT | _pfDstFormat, | ||
LSUINT64 | _ui64Color | ||
) | [static] |
Convert any integer format to any other integer format.
_pfSrcFormat | The source texel format. |
_pfDstFormat | The destination texel format. |
_ui64Color | The texel to convert. |