C# Class GimSharp.GimTextureEncoder

ファイルを表示 Open project: nickworonekin/puyotools Class Usage Examples

Public Methods

Method Description
GimTextureEncoder ( Bitmap source, GimPaletteFormat paletteFormat, GimDataFormat dataFormat ) : System

Opens a texture to encode from a bitmap.

GimTextureEncoder ( Stream source, GimPaletteFormat paletteFormat, GimDataFormat dataFormat ) : System

Opens a texture to encode from a stream.

GimTextureEncoder ( Stream source, int length, GimPaletteFormat paletteFormat, GimDataFormat dataFormat ) : System

Opens a texture to encode from a stream.

GimTextureEncoder ( byte source, GimPaletteFormat paletteFormat, GimDataFormat dataFormat ) : System

Opens a texture to encode from a byte array.

GimTextureEncoder ( byte source, int offset, int length, GimPaletteFormat paletteFormat, GimDataFormat dataFormat ) : System

Opens a texture to encode from a byte array.

GimTextureEncoder ( string file, GimPaletteFormat paletteFormat, GimDataFormat dataFormat ) : System

Opens a texture to encode from a file.

Save ( Stream destination ) : void

Saves the encoded texture to the specified stream.

Save ( string path ) : void

Saves the encoded texture to the specified path.

ToArray ( ) : byte[]

Returns the encoded texture as a byte array.

ToStream ( ) : MemoryStream

Returns the encoded texture as a stream.

Private Methods

Method Description
BitmapToRaw ( Bitmap source ) : byte[]
BitmapToRawIndexed ( Bitmap source, int maxColors, byte &palette ) : byte[]
EncodeTexture ( ) : MemoryStream
HasValidDimensions ( int width, int height ) : bool
Initalize ( Bitmap source, GimPaletteFormat paletteFormat, GimDataFormat dataFormat ) : bool

Method Details

GimTextureEncoder() public method

Opens a texture to encode from a bitmap.
public GimTextureEncoder ( Bitmap source, GimPaletteFormat paletteFormat, GimDataFormat dataFormat ) : System
source System.Drawing.Bitmap Bitmap to encode.
paletteFormat GimPaletteFormat
dataFormat GimDataFormat Data format to encode the texture to.
return System

GimTextureEncoder() public method

Opens a texture to encode from a stream.
public GimTextureEncoder ( Stream source, GimPaletteFormat paletteFormat, GimDataFormat dataFormat ) : System
source Stream Stream that contains the texture data.
paletteFormat GimPaletteFormat
dataFormat GimDataFormat Data format to encode the texture to.
return System

GimTextureEncoder() public method

Opens a texture to encode from a stream.
public GimTextureEncoder ( Stream source, int length, GimPaletteFormat paletteFormat, GimDataFormat dataFormat ) : System
source Stream Stream that contains the texture data.
length int Number of bytes to read.
paletteFormat GimPaletteFormat
dataFormat GimDataFormat Data format to encode the texture to.
return System

GimTextureEncoder() public method

Opens a texture to encode from a byte array.
public GimTextureEncoder ( byte source, GimPaletteFormat paletteFormat, GimDataFormat dataFormat ) : System
source byte Byte array that contains the texture data.
paletteFormat GimPaletteFormat
dataFormat GimDataFormat Data format to encode the texture to.
return System

GimTextureEncoder() public method

Opens a texture to encode from a byte array.
public GimTextureEncoder ( byte source, int offset, int length, GimPaletteFormat paletteFormat, GimDataFormat dataFormat ) : System
source byte Byte array that contains the texture data.
offset int Offset of the texture in the array.
length int Number of bytes to read.
paletteFormat GimPaletteFormat
dataFormat GimDataFormat Data format to encode the texture to.
return System

GimTextureEncoder() public method

Opens a texture to encode from a file.
public GimTextureEncoder ( string file, GimPaletteFormat paletteFormat, GimDataFormat dataFormat ) : System
file string Filename of the file that contains the texture data.
paletteFormat GimPaletteFormat
dataFormat GimDataFormat Data format to encode the texture to.
return System

Save() public method

Saves the encoded 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 encoded texture to the specified path.
public Save ( string path ) : void
path string Name of the file to save the data to.
return void

ToArray() public method

Returns the encoded texture as a byte array.
public ToArray ( ) : byte[]
return byte[]

ToStream() public method

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