Exemplo n.º 1
0
 // 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);
 }
Exemplo n.º 2
0
        protected VrPixelCodec pixelCodec; // Pixel codec
        #endregion

        #region Constructors & Initalizers
        internal VpPaletteEncoder(byte[][] palette, ushort numColors, VrPixelCodec pixelCodec)
        {
            decodedPalette  = palette;
            paletteEntries  = numColors;
            this.pixelCodec = pixelCodec;
        }
Exemplo n.º 3
0
 // 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));
 }
Exemplo n.º 4
0
 // Decode texture data
 public virtual byte[] Decode(byte[] input, int offset, int width, int height, VrPixelCodec PixelCodec)
 {
     return Decode(input, offset, width, height);
 }
Exemplo n.º 5
0
        protected VrPixelCodec pixelCodec; // Pixel codec

        #endregion Fields

        #region Constructors

        internal VpPaletteEncoder(byte[][] palette, ushort numColors, VrPixelCodec pixelCodec)
        {
            decodedPalette = palette;
            paletteEntries = numColors;
            this.pixelCodec = pixelCodec;
        }
Exemplo n.º 6
0
 // Decode texture data
 public virtual byte[] Decode(byte[] input, int offset, int width, int height, VrPixelCodec PixelCodec)
 {
     return(Decode(input, offset, width, height));
 }
Exemplo n.º 7
0
 // Set the clut from an external file
 public void SetClutExternal(byte[] clut, int entries, VrPixelCodec PixelCodec)
 {
     ClutData = PixelCodec.GetClut(clut, 0x00, entries);
 }
Exemplo n.º 8
0
 // Set the clut
 public void SetClut(byte[] clut, int offset, VrPixelCodec PixelCodec)
 {
     ClutData = PixelCodec.GetClut(clut, offset, GetNumClutEntries());
 }
Exemplo n.º 9
0
 public abstract int GetBpp(VrPixelCodec PixelCodec);
Exemplo n.º 10
0
 // Encode texture data
 public abstract byte[] Encode(byte[] input, int width, int height, VrPixelCodec PixelCodec);
Exemplo n.º 11
0
        /// <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;
        }