C# Class CSPspEmu.Core.Utils.PixelFormatDecoder

Show file Open project: soywiz/cspspemu Class Usage Examples

Public Methods

Method Description
ColorFormatFromPixelFormat ( GuPixelFormats PixelFormat ) : ColorFormat
Decode ( GuPixelFormats PixelFormat, void Input, CSPspEmu.Core.Utils.OutputPixel Output, int Width, int Height, void Palette = null, GuPixelFormats PaletteType = GuPixelFormats.NONE, int PaletteCount, int PaletteStart, int PaletteShift, int PaletteMask = 0xFF, int StrideWidth = -1, bool IgnoreAlpha = false ) : void
Decode_RGBA_4444_Pixel ( ushort Value ) : CSPspEmu.Core.Utils.OutputPixel
Decode_RGBA_5551_Pixel ( ushort Value ) : CSPspEmu.Core.Utils.OutputPixel
Decode_RGBA_5650_Pixel ( ushort Value ) : CSPspEmu.Core.Utils.OutputPixel
Decode_RGBA_8888_Pixel ( uint Value ) : CSPspEmu.Core.Utils.OutputPixel
Encode ( GuPixelFormats GuPixelFormat, CSPspEmu.Core.Utils.OutputPixel Input, byte _Output, int Count ) : void
Encode ( GuPixelFormats GuPixelFormat, CSPspEmu.Core.Utils.OutputPixel Input, byte Output, int BufferWidth, int Width, int Height ) : void
Encode_RGBA_4444_Pixel ( CSPspEmu.Core.Utils.OutputPixel Pixel ) : ushort
Encode_RGBA_5551_Pixel ( CSPspEmu.Core.Utils.OutputPixel Pixel ) : ushort
Encode_RGBA_5650_Pixel ( CSPspEmu.Core.Utils.OutputPixel Pixel ) : ushort
Encode_RGBA_8888_Pixel ( CSPspEmu.Core.Utils.OutputPixel Pixel ) : uint
GetPixelsBits ( GuPixelFormats PixelFormat ) : int
GetPixelsSize ( GuPixelFormats PixelFormat, int PixelCount ) : int
Hash ( GuPixelFormats PixelFormat, void Input, int Width, int Height ) : ulong
Unswizzle ( byte Input, byte Output, int RowWidth, int TextureHeight ) : void

Unswizzle ( void Input, void Output, int RowWidth, int TextureHeight ) : void
UnswizzleInline ( GuPixelFormats Format, void Data, int Width, int Height ) : void
UnswizzleInline ( void Data, int RowWidth, int TextureHeight ) : void

Private Methods

Method Description
Decode_COMPRESSED_DXT1 ( ) : void
Decode_COMPRESSED_DXT3 ( ) : void

DXT2 and DXT3 (collectively also known as Block Compression 2 or BC2) converts 16 input pixels (corresponding to a 4x4 pixel block) into 128 bits of output, consisting of 64 bits of alpha channel data (4 bits for each pixel) followed by 64 bits of color data, encoded the same way as DXT1 (with the exception that the 4 color version of the DXT1 algorithm is always used instead of deciding which version to use based on the relative values of and ). In DXT2, the color data is interpreted as being premultiplied by alpha, in DXT3 it is interpreted as not having been premultiplied by alpha. Typically DXT2/3 are well suited to images with sharp alpha transitions, between translucent and opaque areas.

Decode_COMPRESSED_DXT5 ( ) : void
Decode_PALETTE_T16 ( ) : void
Decode_PALETTE_T32 ( ) : void
Decode_PALETTE_T4 ( ) : void
Decode_PALETTE_T8 ( ) : void
Decode_RGBA_4444 ( ) : void
Decode_RGBA_5551 ( ) : void
Decode_RGBA_5650 ( ) : void
Decode_RGBA_8888 ( ) : void
PixelFormatDecoder ( ) : System
_Decode_RGBA_XXXX_uint ( OutputPixel>.Func DecodePixel ) : void
_Decode_RGBA_XXXX_ushort ( OutputPixel>.Func DecodePixel ) : void
_Decode_Unimplemented ( ) : void

Method Details

ColorFormatFromPixelFormat() public static method

public static ColorFormatFromPixelFormat ( GuPixelFormats PixelFormat ) : ColorFormat
PixelFormat GuPixelFormats
return CSharpUtils.ColorFormat

Decode() public static method

public static Decode ( GuPixelFormats PixelFormat, void Input, CSPspEmu.Core.Utils.OutputPixel Output, int Width, int Height, void Palette = null, GuPixelFormats PaletteType = GuPixelFormats.NONE, int PaletteCount, int PaletteStart, int PaletteShift, int PaletteMask = 0xFF, int StrideWidth = -1, bool IgnoreAlpha = false ) : void
PixelFormat GuPixelFormats
Input void
Output CSPspEmu.Core.Utils.OutputPixel
Width int
Height int
Palette void
PaletteType GuPixelFormats
PaletteCount int
PaletteStart int
PaletteShift int
PaletteMask int
StrideWidth int
IgnoreAlpha bool
return void

Decode_RGBA_4444_Pixel() public static method

public static Decode_RGBA_4444_Pixel ( ushort Value ) : CSPspEmu.Core.Utils.OutputPixel
Value ushort
return CSPspEmu.Core.Utils.OutputPixel

Decode_RGBA_5551_Pixel() public static method

public static Decode_RGBA_5551_Pixel ( ushort Value ) : CSPspEmu.Core.Utils.OutputPixel
Value ushort
return CSPspEmu.Core.Utils.OutputPixel

Decode_RGBA_5650_Pixel() public static method

public static Decode_RGBA_5650_Pixel ( ushort Value ) : CSPspEmu.Core.Utils.OutputPixel
Value ushort
return CSPspEmu.Core.Utils.OutputPixel

Decode_RGBA_8888_Pixel() public static method

public static Decode_RGBA_8888_Pixel ( uint Value ) : CSPspEmu.Core.Utils.OutputPixel
Value uint
return CSPspEmu.Core.Utils.OutputPixel

Encode() public static method

public static Encode ( GuPixelFormats GuPixelFormat, CSPspEmu.Core.Utils.OutputPixel Input, byte _Output, int Count ) : void
GuPixelFormat GuPixelFormats
Input CSPspEmu.Core.Utils.OutputPixel
_Output byte
Count int
return void

Encode() public static method

public static Encode ( GuPixelFormats GuPixelFormat, CSPspEmu.Core.Utils.OutputPixel Input, byte Output, int BufferWidth, int Width, int Height ) : void
GuPixelFormat GuPixelFormats
Input CSPspEmu.Core.Utils.OutputPixel
Output byte
BufferWidth int
Width int
Height int
return void

Encode_RGBA_4444_Pixel() public static method

public static Encode_RGBA_4444_Pixel ( CSPspEmu.Core.Utils.OutputPixel Pixel ) : ushort
Pixel CSPspEmu.Core.Utils.OutputPixel
return ushort

Encode_RGBA_5551_Pixel() public static method

public static Encode_RGBA_5551_Pixel ( CSPspEmu.Core.Utils.OutputPixel Pixel ) : ushort
Pixel CSPspEmu.Core.Utils.OutputPixel
return ushort

Encode_RGBA_5650_Pixel() public static method

public static Encode_RGBA_5650_Pixel ( CSPspEmu.Core.Utils.OutputPixel Pixel ) : ushort
Pixel CSPspEmu.Core.Utils.OutputPixel
return ushort

Encode_RGBA_8888_Pixel() public static method

public static Encode_RGBA_8888_Pixel ( CSPspEmu.Core.Utils.OutputPixel Pixel ) : uint
Pixel CSPspEmu.Core.Utils.OutputPixel
return uint

GetPixelsBits() public static method

public static GetPixelsBits ( GuPixelFormats PixelFormat ) : int
PixelFormat GuPixelFormats
return int

GetPixelsSize() public static method

public static GetPixelsSize ( GuPixelFormats PixelFormat, int PixelCount ) : int
PixelFormat GuPixelFormats
PixelCount int
return int

Hash() public static method

public static Hash ( GuPixelFormats PixelFormat, void Input, int Width, int Height ) : ulong
PixelFormat GuPixelFormats
Input void
Width int
Height int
return ulong

Unswizzle() public static method

public static Unswizzle ( byte Input, byte Output, int RowWidth, int TextureHeight ) : void
Input byte
Output byte
RowWidth int Width of the texture. In bytes? In pixels? Maybe bytes?
TextureHeight int Height of the texture
return void

Unswizzle() public static method

public static Unswizzle ( void Input, void Output, int RowWidth, int TextureHeight ) : void
Input void
Output void
RowWidth int
TextureHeight int
return void

UnswizzleInline() public static method

public static UnswizzleInline ( GuPixelFormats Format, void Data, int Width, int Height ) : void
Format GuPixelFormats
Data void
Width int
Height int
return void

UnswizzleInline() public static method

public static UnswizzleInline ( void Data, int RowWidth, int TextureHeight ) : void
Data void
RowWidth int
TextureHeight int
return void