Esempio 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);
 }
Esempio 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;
        }
Esempio 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));
 }
Esempio 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);
 }
Esempio 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;
        }
Esempio 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));
 }
Esempio 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);
 }
Esempio n. 8
0
 // Set the clut
 public void SetClut(byte[] clut, int offset, VrPixelCodec PixelCodec)
 {
     ClutData = PixelCodec.GetClut(clut, offset, GetNumClutEntries());
 }
Esempio n. 9
0
 public abstract int GetBpp(VrPixelCodec PixelCodec);
Esempio n. 10
0
 // Encode texture data
 public abstract byte[] Encode(byte[] input, int width, int height, VrPixelCodec PixelCodec);
Esempio 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;
        }