// Decode a mipmap in the texture data //public virtual byte[] DecodeMipmap(byte[] input, int offset, int mipmap, int width, int height, VrPixelCodec PixelCodec) //{ // return Decode(input, offset, width, height, PixelCodec); //} // Encode texture data public virtual byte[] Encode(byte[] input, int width, int height, VrPixelCodec PixelCodec) { return Encode(input, 0, width, height); }
protected VrPixelCodec pixelCodec; // Pixel codec #endregion #region Constructors & Initalizers internal VpPaletteEncoder(byte[][] palette, ushort numColors, VrPixelCodec pixelCodec) { decodedPalette = palette; paletteEntries = numColors; this.pixelCodec = pixelCodec; }
// Decode a mipmap in the texture data //public virtual byte[] DecodeMipmap(byte[] input, int offset, int mipmap, int width, int height, VrPixelCodec PixelCodec) //{ // return Decode(input, offset, width, height, PixelCodec); //} // Encode texture data public virtual byte[] Encode(byte[] input, int width, int height, VrPixelCodec PixelCodec) { return(Encode(input, 0, width, height)); }
// Decode texture data public virtual byte[] Decode(byte[] input, int offset, int width, int height, VrPixelCodec PixelCodec) { return Decode(input, offset, width, height); }
protected VrPixelCodec pixelCodec; // Pixel codec #endregion Fields #region Constructors internal VpPaletteEncoder(byte[][] palette, ushort numColors, VrPixelCodec pixelCodec) { decodedPalette = palette; paletteEntries = numColors; this.pixelCodec = pixelCodec; }
// Decode texture data public virtual byte[] Decode(byte[] input, int offset, int width, int height, VrPixelCodec PixelCodec) { return(Decode(input, offset, width, height)); }
// Set the clut from an external file public void SetClutExternal(byte[] clut, int entries, VrPixelCodec PixelCodec) { ClutData = PixelCodec.GetClut(clut, 0x00, entries); }
// Set the clut public void SetClut(byte[] clut, int offset, VrPixelCodec PixelCodec) { ClutData = PixelCodec.GetClut(clut, offset, GetNumClutEntries()); }
public abstract int GetBpp(VrPixelCodec PixelCodec);
// Encode texture data public abstract byte[] Encode(byte[] input, int width, int height, VrPixelCodec PixelCodec);
/// <summary> /// Get the clut data. /// </summary> /// <param name="PixelCodec">Pixel Codec used for the clut.</param> /// <returns></returns> public byte[] GetClut(VrPixelCodec PixelCodec) { if (!InitSuccess) return new byte[0]; byte[] clut = new byte[NumClutEntries * (PixelCodec.GetBpp() / 8)]; Array.Copy(ClutData, 0x10, clut, 0x00, clut.Length); return clut; }