C# Class VrSharp.VrTexture

Show file Open project: nickworonekin/puyotools

Protected Properties

Property Type Description
canDecode bool
dataCodec VrSharp.VrDataCodec
dataOffset int
encodedData byte[]
gbixOffset int
globalIndex uint
initalized bool
mipmapOffsets int[]
paletteEntries int
paletteOffset int
pixelCodec VrSharp.VrPixelCodec
pvrtOffset int
textureHeight ushort
textureWidth ushort

Public Methods

Method Description
MipmapsToArray ( ) : byte[][]

Returns the mipmaps of a texture as an array of byte arrays. The first index will contain the largest, original sized texture and the last index will contain the smallest texture.

MipmapsToBitmap ( ) : System.Drawing.Bitmap[]

Returns the mipmaps of a texture as an array of bitmaps. The first index will contain the largest, original sized texture and the last index will contain the smallest texture.

MipmapsToStream ( ) : System.IO.MemoryStream[]

Returns the mipmaps of a texture as an array of streams. The first index will contain the largest, original sized texture and the last index will contain the smallest texture.

Save ( Stream destination ) : void

Saves the decoded texture to the specified stream.

Save ( string file ) : void

Saves the decoded texture to the specified file.

ToArray ( ) : byte[]

Returns the decoded texture as an array containg raw 32-bit ARGB data.

ToBitmap ( ) : Bitmap

Returns the decoded texture as a bitmap.

ToStream ( ) : MemoryStream

Returns the decoded texture as a stream containg a PNG.

VrTexture ( Stream source ) : System
VrTexture ( Stream source, int length ) : System
VrTexture ( byte source ) : System
VrTexture ( byte source, int offset, int length ) : System
VrTexture ( string file ) : System

Protected Methods

Method Description
Initalize ( ) : void
SetPalette ( VrSharp.VpPalette palette ) : void

Set the palette data from an external palette file.

Private Methods

Method Description
DecodeMipmaps ( ) : byte[][]
DecodeTexture ( ) : byte[]

Method Details

Initalize() protected abstract method

protected abstract Initalize ( ) : void
return void

MipmapsToArray() public method

Returns the mipmaps of a texture as an array of byte arrays. The first index will contain the largest, original sized texture and the last index will contain the smallest texture.
public MipmapsToArray ( ) : byte[][]
return byte[][]

MipmapsToBitmap() public method

Returns the mipmaps of a texture as an array of bitmaps. The first index will contain the largest, original sized texture and the last index will contain the smallest texture.
public MipmapsToBitmap ( ) : System.Drawing.Bitmap[]
return System.Drawing.Bitmap[]

MipmapsToStream() public method

Returns the mipmaps of a texture as an array of streams. The first index will contain the largest, original sized texture and the last index will contain the smallest texture.
public MipmapsToStream ( ) : System.IO.MemoryStream[]
return System.IO.MemoryStream[]

Save() public method

Saves the decoded texture to the specified stream.
public Save ( Stream destination ) : void
destination Stream The stream to save the texture to.
return void

Save() public method

Saves the decoded texture to the specified file.
public Save ( string file ) : void
file string Name of the file to save the data to.
return void

SetPalette() protected method

Set the palette data from an external palette file.
protected SetPalette ( VrSharp.VpPalette palette ) : void
palette VrSharp.VpPalette A VpPalette object
return void

ToArray() public method

Returns the decoded texture as an array containg raw 32-bit ARGB data.
public ToArray ( ) : byte[]
return byte[]

ToBitmap() public method

Returns the decoded texture as a bitmap.
public ToBitmap ( ) : Bitmap
return System.Drawing.Bitmap

ToStream() public method

Returns the decoded texture as a stream containg a PNG.
public ToStream ( ) : MemoryStream
return System.IO.MemoryStream

VrTexture() public method

public VrTexture ( Stream source ) : System
source Stream
return System

VrTexture() public method

public VrTexture ( Stream source, int length ) : System
source Stream
length int
return System

VrTexture() public method

public VrTexture ( byte source ) : System
source byte
return System

VrTexture() public method

public VrTexture ( byte source, int offset, int length ) : System
source byte
offset int
length int
return System

VrTexture() public method

public VrTexture ( string file ) : System
file string
return System

Property Details

canDecode protected property

protected bool canDecode
return bool

dataCodec protected property

protected VrDataCodec,VrSharp dataCodec
return VrSharp.VrDataCodec

dataOffset protected property

protected int dataOffset
return int

encodedData protected property

protected byte[] encodedData
return byte[]

gbixOffset protected property

protected int gbixOffset
return int

globalIndex protected property

protected uint globalIndex
return uint

initalized protected property

protected bool initalized
return bool

mipmapOffsets protected property

protected int[] mipmapOffsets
return int[]

paletteEntries protected property

protected int paletteEntries
return int

paletteOffset protected property

protected int paletteOffset
return int

pixelCodec protected property

protected VrPixelCodec,VrSharp pixelCodec
return VrSharp.VrPixelCodec

pvrtOffset protected property

protected int pvrtOffset
return int

textureHeight protected property

protected ushort textureHeight
return ushort

textureWidth protected property

protected ushort textureWidth
return ushort