Twilight Princess
Remastered version of the GameCube game
Loading...
Searching...
No Matches
BinaryTextureImage Class Reference
+ Collaboration diagram for BinaryTextureImage:

Classes

class  Palette
 

Public Types

enum  TextureFormats {
  I4 = 0x00 , I8 = 0x01 , IA4 = 0x02 , IA8 = 0x03 ,
  RGB565 = 0x04 , RGB5A3 = 0x05 , RGBA32 = 0x06 , C4 = 0x08 ,
  C8 = 0x09 , C14X2 = 0x0a , CMPR = 0x0e
}
 
enum  WrapModes { ClampToEdge = 0 , Repeat = 1 , MirroredRepeat = 2 }
 
enum  PaletteFormats { IA8 = 0x00 , RGB565 = 0x01 , RGB5A3 = 0x02 }
 
enum  FilterMode {
  Nearest = 0x0 , Linear = 0x1 , NearestMipmapNearest = 0x2 , NearestMipmapLinear = 0x3 ,
  LinearMipmapNearest = 0x4 , LinearMipmapLinear = 0x5
}
 

Public Member Functions

 BinaryTextureImage ()
 
 BinaryTextureImage (string name)
 
void Load (EndianBinaryReader stream, long headerStart, int imageIndex=0)
 
void ReplaceHeaderInfo (BinaryTextureImage other)
 
void DetectAndSetFittingFormat ()
 
void SaveImageToDisk (string outputFile)
 
Texture2D SkiaToTexture ()
 
void WriteHeader (EndianBinaryWriter writer)
 

Static Public Member Functions

static byte[] DecodeData (EndianBinaryReader stream, uint width, uint height, TextureFormats format)
 

Public Attributes

short unknown2 = 0
 
byte unknown3 = 0
 

Properties

string Name [get, set]
 
TextureFormats Format [get, set]
 
byte AlphaSetting [get, set]
 
ushort Width [get, private set]
 
ushort Height [get, private set]
 
WrapModes WrapS [get, set]
 
WrapModes WrapT [get, set]
 
bool PalettesEnabled [get, set]
 
PaletteFormats PaletteFormat [get, set]
 
ushort PaletteCount [get, set]
 
int EmbeddedPaletteOffset [get, private set]
 
FilterMode MinFilter [get, set]
 
FilterMode MagFilter [get, set]
 
sbyte MinLOD [get, set]
 
sbyte MagLOD [get, set]
 
byte MipMapCount [get, private set]
 
short LodBias [get, set]
 
byte[] RGBAImageData [get, set]
 

Private Member Functions

Tuple< byte[], ushort[]> EncodeC4 ()
 
Tuple< byte[], ushort[]> EncodeC8 ()
 
void EncodeColor (Color32 col, List< ushort > rawColorData, Dictionary< Color32, byte > pixelColorIndexes)
 

Static Private Member Functions

static byte[] DecodeData (EndianBinaryReader stream, uint width, uint height, TextureFormats format, Palette imagePalette, PaletteFormats paletteFormat)
 
static byte[] DecodeRgba32 (EndianBinaryReader stream, uint width, uint height)
 
static byte[] DecodeC4 (EndianBinaryReader stream, uint width, uint height, Palette imagePalette, PaletteFormats paletteFormat)
 
static byte[] DecodeC8 (EndianBinaryReader stream, uint width, uint height, Palette imagePalette, PaletteFormats paletteFormat)
 
static byte[] DecodeRgb565 (EndianBinaryReader stream, uint width, uint height)
 
static byte[] DecodeCmpr (EndianBinaryReader stream, uint width, uint height)
 
static byte[] DecodeCmprSubBlock (EndianBinaryReader stream)
 
static void Swap (ref byte b1, ref byte b2)
 
static ushort Read16Swap (byte[] data, uint offset)
 
static uint Read32Swap (byte[] data, uint offset)
 
static byte S3TC1ReverseByte (byte b)
 
static byte[] DecodeIA8 (EndianBinaryReader stream, uint width, uint height)
 
static byte[] DecodeIA4 (EndianBinaryReader stream, uint width, uint height)
 
static byte[] DecodeI4 (EndianBinaryReader stream, uint width, uint height)
 
static byte[] DecodeI8 (EndianBinaryReader stream, uint width, uint height)
 
static byte[] DecodeRgb5A3 (EndianBinaryReader stream, uint width, uint height)
 
static void UnpackPixelFromPalette (int paletteIndex, ref byte[] dest, int offset, byte[] paletteData, PaletteFormats format)
 
static void RGB565ToRGBA8 (ushort sourcePixel, ref byte[] dest, int destOffset)
 
static void RGB5A3ToRGBA8 (ushort sourcePixel, ref byte[] dest, int destOffset)
 

Private Attributes

Palette m_imagePalette
 
byte[] m_rgbaImageData
 

Member Enumeration Documentation

◆ FilterMode

Enumerator
Nearest 
Linear 
NearestMipmapNearest 
NearestMipmapLinear 
LinearMipmapNearest 
LinearMipmapLinear 

◆ PaletteFormats

Enumerator
IA8 
RGB565 
RGB5A3 

◆ TextureFormats

Enumerator
I4 
I8 
IA4 
IA8 
RGB565 
RGB5A3 
RGBA32 
C4 
C8 
C14X2 
CMPR 

◆ WrapModes

Enumerator
ClampToEdge 
Repeat 
MirroredRepeat 

Constructor & Destructor Documentation

◆ BinaryTextureImage() [1/2]

BinaryTextureImage.BinaryTextureImage ( )

◆ BinaryTextureImage() [2/2]

BinaryTextureImage.BinaryTextureImage ( string name)

Member Function Documentation

◆ DecodeC4()

static byte[] BinaryTextureImage.DecodeC4 ( EndianBinaryReader stream,
uint width,
uint height,
Palette imagePalette,
PaletteFormats paletteFormat )
staticprivate

◆ DecodeC8()

static byte[] BinaryTextureImage.DecodeC8 ( EndianBinaryReader stream,
uint width,
uint height,
Palette imagePalette,
PaletteFormats paletteFormat )
staticprivate

◆ DecodeCmpr()

static byte[] BinaryTextureImage.DecodeCmpr ( EndianBinaryReader stream,
uint width,
uint height )
staticprivate

◆ DecodeCmprSubBlock()

static byte[] BinaryTextureImage.DecodeCmprSubBlock ( EndianBinaryReader stream)
staticprivate

◆ DecodeData() [1/2]

static byte[] BinaryTextureImage.DecodeData ( EndianBinaryReader stream,
uint width,
uint height,
TextureFormats format )
static

◆ DecodeData() [2/2]

static byte[] BinaryTextureImage.DecodeData ( EndianBinaryReader stream,
uint width,
uint height,
TextureFormats format,
Palette imagePalette,
PaletteFormats paletteFormat )
staticprivate

◆ DecodeI4()

static byte[] BinaryTextureImage.DecodeI4 ( EndianBinaryReader stream,
uint width,
uint height )
staticprivate

◆ DecodeI8()

static byte[] BinaryTextureImage.DecodeI8 ( EndianBinaryReader stream,
uint width,
uint height )
staticprivate

◆ DecodeIA4()

static byte[] BinaryTextureImage.DecodeIA4 ( EndianBinaryReader stream,
uint width,
uint height )
staticprivate

◆ DecodeIA8()

static byte[] BinaryTextureImage.DecodeIA8 ( EndianBinaryReader stream,
uint width,
uint height )
staticprivate

◆ DecodeRgb565()

static byte[] BinaryTextureImage.DecodeRgb565 ( EndianBinaryReader stream,
uint width,
uint height )
staticprivate

◆ DecodeRgb5A3()

static byte[] BinaryTextureImage.DecodeRgb5A3 ( EndianBinaryReader stream,
uint width,
uint height )
staticprivate

◆ DecodeRgba32()

static byte[] BinaryTextureImage.DecodeRgba32 ( EndianBinaryReader stream,
uint width,
uint height )
staticprivate

◆ DetectAndSetFittingFormat()

void BinaryTextureImage.DetectAndSetFittingFormat ( )

◆ EncodeC4()

Tuple< byte[], ushort[]> BinaryTextureImage.EncodeC4 ( )
private

◆ EncodeC8()

Tuple< byte[], ushort[]> BinaryTextureImage.EncodeC8 ( )
private

◆ EncodeColor()

void BinaryTextureImage.EncodeColor ( Color32 col,
List< ushort > rawColorData,
Dictionary< Color32, byte > pixelColorIndexes )
private

◆ Load()

void BinaryTextureImage.Load ( EndianBinaryReader stream,
long headerStart,
int imageIndex = 0 )

◆ Read16Swap()

static ushort BinaryTextureImage.Read16Swap ( byte[] data,
uint offset )
staticprivate

◆ Read32Swap()

static uint BinaryTextureImage.Read32Swap ( byte[] data,
uint offset )
staticprivate

◆ ReplaceHeaderInfo()

void BinaryTextureImage.ReplaceHeaderInfo ( BinaryTextureImage other)

◆ RGB565ToRGBA8()

static void BinaryTextureImage.RGB565ToRGBA8 ( ushort sourcePixel,
ref byte[] dest,
int destOffset )
staticprivate

◆ RGB5A3ToRGBA8()

static void BinaryTextureImage.RGB5A3ToRGBA8 ( ushort sourcePixel,
ref byte[] dest,
int destOffset )
staticprivate

◆ S3TC1ReverseByte()

static byte BinaryTextureImage.S3TC1ReverseByte ( byte b)
staticprivate

◆ SaveImageToDisk()

void BinaryTextureImage.SaveImageToDisk ( string outputFile)

◆ SkiaToTexture()

Texture2D BinaryTextureImage.SkiaToTexture ( )

◆ Swap()

static void BinaryTextureImage.Swap ( ref byte b1,
ref byte b2 )
staticprivate

◆ UnpackPixelFromPalette()

static void BinaryTextureImage.UnpackPixelFromPalette ( int paletteIndex,
ref byte[] dest,
int offset,
byte[] paletteData,
PaletteFormats format )
staticprivate

◆ WriteHeader()

void BinaryTextureImage.WriteHeader ( EndianBinaryWriter writer)

Member Data Documentation

◆ m_imagePalette

Palette BinaryTextureImage.m_imagePalette
private

◆ m_rgbaImageData

byte [] BinaryTextureImage.m_rgbaImageData
private

◆ unknown2

short BinaryTextureImage.unknown2 = 0

◆ unknown3

byte BinaryTextureImage.unknown3 = 0

Property Documentation

◆ AlphaSetting

byte BinaryTextureImage.AlphaSetting
getset

◆ EmbeddedPaletteOffset

int BinaryTextureImage.EmbeddedPaletteOffset
getprivate set

◆ Format

TextureFormats BinaryTextureImage.Format
getset

◆ Height

ushort BinaryTextureImage.Height
getprivate set

◆ LodBias

short BinaryTextureImage.LodBias
getset

◆ MagFilter

FilterMode BinaryTextureImage.MagFilter
getset

◆ MagLOD

sbyte BinaryTextureImage.MagLOD
getset

◆ MinFilter

FilterMode BinaryTextureImage.MinFilter
getset

◆ MinLOD

sbyte BinaryTextureImage.MinLOD
getset

◆ MipMapCount

byte BinaryTextureImage.MipMapCount
getprivate set

◆ Name

string BinaryTextureImage.Name
getset

◆ PaletteCount

ushort BinaryTextureImage.PaletteCount
getset

◆ PaletteFormat

PaletteFormats BinaryTextureImage.PaletteFormat
getset

◆ PalettesEnabled

bool BinaryTextureImage.PalettesEnabled
getset

◆ RGBAImageData

byte [] BinaryTextureImage.RGBAImageData
getset

◆ Width

ushort BinaryTextureImage.Width
getprivate set

◆ WrapS

WrapModes BinaryTextureImage.WrapS
getset

◆ WrapT

WrapModes BinaryTextureImage.WrapT
getset

The documentation for this class was generated from the following file: