Decode_PALETTE_T16() private method

private Decode_PALETTE_T16 ( ) : void
return void
Example #1
0
        static public void Decode(GuPixelFormats PixelFormat, void *Input, OutputPixel *Output, int Width, int Height, void *Palette = null, GuPixelFormats PaletteType = GuPixelFormats.NONE, int PaletteCount = 0, int PaletteStart = 0, int PaletteShift = 0, int PaletteMask = 0xFF, int StrideWidth = -1)
        {
            if (StrideWidth == -1)
            {
                StrideWidth = GetPixelsSize(PixelFormat, Width);
            }
            var PixelFormatInt     = (int)PixelFormat;
            var PixelFormatDecoder = new PixelFormatDecoder()
            {
                _Input       = Input,
                InputByte    = (byte *)Input,
                InputShort   = (ushort *)Input,
                InputInt     = (uint *)Input,
                Output       = Output,
                StrideWidth  = StrideWidth,
                Width        = Width,
                Height       = Height,
                Palette      = Palette,
                PaletteType  = PaletteType,
                PaletteCount = PaletteCount,
                PaletteStart = PaletteStart,
                PaletteShift = PaletteShift,
                PaletteMask  = PaletteMask,
            };

            //Console.WriteLine(PixelFormat);
            switch (PixelFormat)
            {
            case GuPixelFormats.RGBA_5650: PixelFormatDecoder.Decode_RGBA_5650(); break;

            case GuPixelFormats.RGBA_5551: PixelFormatDecoder.Decode_RGBA_5551(); break;

            case GuPixelFormats.RGBA_4444: PixelFormatDecoder.Decode_RGBA_4444(); break;

            case GuPixelFormats.RGBA_8888: PixelFormatDecoder.Decode_RGBA_8888(); break;

            case GuPixelFormats.PALETTE_T4: PixelFormatDecoder.Decode_PALETTE_T4(); break;

            case GuPixelFormats.PALETTE_T8: PixelFormatDecoder.Decode_PALETTE_T8(); break;

            case GuPixelFormats.PALETTE_T16: PixelFormatDecoder.Decode_PALETTE_T16(); break;

            case GuPixelFormats.PALETTE_T32: PixelFormatDecoder.Decode_PALETTE_T32(); break;

            case GuPixelFormats.COMPRESSED_DXT1: PixelFormatDecoder.Decode_COMPRESSED_DXT1(); break;

            case GuPixelFormats.COMPRESSED_DXT3: PixelFormatDecoder.Decode_COMPRESSED_DXT3(); break;

            case GuPixelFormats.COMPRESSED_DXT5: PixelFormatDecoder.Decode_COMPRESSED_DXT5(); break;

            default: throw(new InvalidOperationException());
            }
            //DecoderCallbackTable[PixelFormatInt](Input, Output, PixelCount, Width, Palette, PaletteType, PaletteCount, PaletteStart, PaletteShift, PaletteMask);
        }
Example #2
0
 public static void Decode(GuPixelFormats PixelFormat, void* Input, OutputPixel* Output, int Width, int Height, void* Palette = null, GuPixelFormats PaletteType = GuPixelFormats.NONE, int PaletteCount = 0, int PaletteStart = 0, int PaletteShift = 0, int PaletteMask = 0xFF, int StrideWidth = -1)
 {
     if (StrideWidth == -1) StrideWidth = GetPixelsSize(PixelFormat, Width);
     var PixelFormatInt = (int)PixelFormat;
     var PixelFormatDecoder = new PixelFormatDecoder()
     {
         _Input = Input,
         InputByte = (byte *)Input,
         InputShort = (ushort*)Input,
         InputInt = (uint*)Input,
         Output = Output,
         StrideWidth = StrideWidth,
         Width = Width,
         Height = Height,
         Palette = Palette,
         PaletteType = PaletteType,
         PaletteCount = PaletteCount,
         PaletteStart = PaletteStart,
         PaletteShift = PaletteShift,
         PaletteMask = PaletteMask,
     };
     //Console.WriteLine(PixelFormat);
     switch (PixelFormat)
     {
         case GuPixelFormats.RGBA_5650: PixelFormatDecoder.Decode_RGBA_5650(); break;
         case GuPixelFormats.RGBA_5551: PixelFormatDecoder.Decode_RGBA_5551(); break;
         case GuPixelFormats.RGBA_4444: PixelFormatDecoder.Decode_RGBA_4444(); break;
         case GuPixelFormats.RGBA_8888: PixelFormatDecoder.Decode_RGBA_8888(); break;
         case GuPixelFormats.PALETTE_T4: PixelFormatDecoder.Decode_PALETTE_T4(); break;
         case GuPixelFormats.PALETTE_T8: PixelFormatDecoder.Decode_PALETTE_T8(); break;
         case GuPixelFormats.PALETTE_T16: PixelFormatDecoder.Decode_PALETTE_T16(); break;
         case GuPixelFormats.PALETTE_T32: PixelFormatDecoder.Decode_PALETTE_T32(); break;
         case GuPixelFormats.COMPRESSED_DXT1: PixelFormatDecoder.Decode_COMPRESSED_DXT1(); break;
         case GuPixelFormats.COMPRESSED_DXT3: PixelFormatDecoder.Decode_COMPRESSED_DXT3(); break;
         case GuPixelFormats.COMPRESSED_DXT5: PixelFormatDecoder.Decode_COMPRESSED_DXT5(); break;
         default: throw(new InvalidOperationException());
     }
     //DecoderCallbackTable[PixelFormatInt](Input, Output, PixelCount, Width, Palette, PaletteType, PaletteCount, PaletteStart, PaletteShift, PaletteMask);
 }