"L. Spiro Engine"
Public Types | Static Public Member Functions | Static Protected Member Functions

lsi::CImageLib Class Reference

Image-related functions. More...

#include <LSIImageLib.h>

List of all members.

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)

Detailed Description

Image-related functions.

Class CImageLib Description: Generalized image-related functions and template functions.


Member Typedef Documentation

typedef CVectorPoD<LSUINT8, LSUINT32> lsi::CImageLib::CTexelBuffer

A loaded pixel buffer in which each row is tightly packed and padded to 4 bytes.


Member Function Documentation

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.

Parameters:
_pfSrcFormatThe source texel format.
_pvSrcBufferThe source buffer. Must be over-allocated by 8 bytes.
_pfDstFormatThe destination texel format.
_pvDstBufferThe destination buffer. Must be over-allocated by 8 bytes.
_ui32TotalThe 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.

Parameters:
_pvSrcBufferThe source buffer.
_pfDstFormatThe destination texel format.
_pvDstBufferThe destination buffer. Must be over-allocated by 8 bytes.
_ui32TotalThe 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.

Parameters:
_pvSrcBufferThe source buffer.
_pfDstFormatThe destination texel format.
_pvDstBufferThe destination buffer. Must be over-allocated by 8 bytes.
_ui32TotalThe 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.

Parameters:
_pfSrcFormatThe source texel format.
_pvSrcBufferThe source buffer. Must be over-allocated by 8 bytes.
_pfDstFormatThe destination texel format.
_pvDstBufferThe destination buffer. Must be over-allocated by 8 bytes.
_ui32TotalThe 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.

Parameters:
_pfSrcFormatThe source texel format.
_pvSrcBufferThe source buffer. Must be over-allocated by 8 bytes.
_pvDstBufferThe destination buffer.
_ui32TotalThe 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.

Parameters:
_pfSrcFormatThe source texel format.
_pvSrcBufferThe source buffer. Must be over-allocated by 8 bytes.
_pvDstBufferThe destination buffer.
_ui32TotalThe 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.

Parameters:
_pfSrcFormatThe source texel format.
_pvSrcBufferThe source buffer. Must be over-allocated by 8 bytes.
_pfDstFormatThe destination texel format.
_pvDstBufferThe destination buffer. Must be over-allocated by 8 bytes.
_ui32TotalThe 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.

Parameters:
_pfFormatThe texel format.
_ui32IndexIndex of the component to translate to a component type.
Returns:
Returns the component type of the given component index.
template<unsigned _tSrcBits, unsigned _tDstBits, unsigned _tTreat0BitsAsFF>
LSE_INLINE LSUINT32 LSE_FCALL lsi::CImageLib::ConvComp ( LSUINT32  _ui32Src) [static, protected]

Convert a single component from one integer form to another.

Parameters:
_ui32SrcThe source component.
Returns:
Returns the normalized converted 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.

Parameters:
_pfSrcFormatThe source texel format.
_pfDstFormatThe destination texel format.
_ppCompThe index of the component to convert.
_ui32ComponentThe component to convert.
Returns:
Returns the converted component.
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.

Parameters:
_pfDstFormatThe destination texel format.
_f16ValueThe 4-element array of texels in 16-bit floating format to convert.
Returns:
Returns the converted texel. The number of bytes within the return that are valid is equal to the number of bytes in the destination format.
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.

Parameters:
_pfDstFormatThe destination texel format.
_fValueThe 4-element array of texels in 32-bit floating format to convert.
Returns:
Returns the converted texel. The number of bytes within the return that are valid is equal to the number of bytes in the destination format.
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.

Parameters:
_pfDstFormatThe destination texel format.
_fRThe red component.
_fGThe green component.
_fBThe blue component.
_fAThe alpha component.
Returns:
Returns the converted texel. The number of bytes within the return that are valid is equal to the number of bytes in the destination format.
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.

Parameters:
_pfFormatFormat of the texel data.
_ui32WidthNumber of texels wide the image is.
_ui32HeightNumber of texels tall the image is.
Returns:
Returns the total number of bytes that need to be allocated to safely hold the buffered image with the given dimensions and format.
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.

Parameters:
_pfFormatThe texel format.
_ppCompThe component whose bit count is to be gotten.
Returns:
Returns the number of bits for a component of the given format.
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.

Parameters:
_pfFormatThe texel format.
_ppCompThe component whose bit offset is to be gotten.
Returns:
Returns the offset, in bits, for a component of the given format.
LSE_INLINE const LSUINT32 LSE_FCALL lsi::CImageLib::GetFormatSize ( LSI_PIXEL_FORMAT  _pfFormat) [static]

Get the size, in bytes, of a texel format.

Parameters:
_pfFormatThe texel format.
Returns:
Returns the size of the given format in bytes.
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.

Parameters:
_pfFormatFormat of the texel data.
_ui32TotalNumber of texels in a row.
Returns:
Returns the number of bytes in a row of tightly packed texel data.
LSE_INLINE const LSUINT32 LSE_FCALL lsi::CImageLib::GetTotalComponents ( LSI_PIXEL_FORMAT  _pfFormat) [static]

Get the number of components in the given format.

Parameters:
_pfFormatThe texel format.
Returns:
Returns the number of components in the given 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.

Parameters:
_pfSrcFormatThe source texel format.
_ui64ColorThe texel to convert.
_f16ReturnHolds 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.

Parameters:
_pfSrcFormatThe source texel format.
_ui64ColorThe texel to convert.
_fReturnHolds 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.

Parameters:
_pfSrcFormatThe source texel format.
_pfDstFormatThe destination texel format.
_ui64ColorThe texel to convert.
Returns:
Returns the converted texel. The number of bytes within the return that are valid is equal to the number of bytes in the destination format.

The documentation for this class was generated from the following file:
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator