Beispiel #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);
 }
Beispiel #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;
        }
Beispiel #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));
 }
Beispiel #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);
 }
        protected VrPixelCodec pixelCodec; // Pixel codec

        #endregion Fields

        #region Constructors

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