Esempio n. 1
0
            public byte[] GetData()
            {
                switch (PixelFormat)
                {
                case PixelFormat.Rgba8888:
                case PixelFormat.Rgbx8888:
                    return(GetData32bpp(_data));

                case PixelFormat.Indexed8:
                    if (_uploadPixelFormat == Tm2.GsPSM.GS_PSMCT32)
                    {
                        return(Ps2.Decode8(Ps2.Encode32(_data, Size.Width / 128, Size.Height / 64), Size.Width / 128, Size.Height / 64));
                    }
                    return(_data);

                case PixelFormat.Indexed4:
                    if (_uploadPixelFormat == Tm2.GsPSM.GS_PSMCT32)
                    {
                        return(Ps2.Decode4(Ps2.Encode32(_data, Size.Width / 128, Size.Height / 128), Size.Width / 128, Size.Height / 128));
                    }
                    return(_data);

                default:
                    throw new NotSupportedException($"The format {PixelFormat} is not supported.");
                }
            }
Esempio n. 2
0
        public byte[] GetData()
		{
			switch (format)
            {
                case Format32bpp:
                    return GetData32bpp();
                case Format8bpp:
                    return IsSwizzled ? Ps2.Decode8(Ps2.Encode32(Data, Size.Width / 128, Size.Height / 64), Size.Width / 128, Size.Height / 64) : Data;
                case Format4bpp:
					return IsSwizzled ? Ps2.Decode4(Ps2.Encode32(Data, Size.Width / 128, Size.Height / 128), Size.Width / 128, Size.Height / 128) : Data;
				default:
					throw new NotSupportedException($"The format {format} is not supported.");
			}
        }
Esempio n. 3
0
            public byte[] GetBitmap()
            {
                var swizzled = 0;

                switch (format)
                {
                case 0x13:
                    return(GetBitmapFrom8bpp(
                               swizzled == 7 ? Ps2.Decode8(Ps2.Encode32(Data, Size.Width / 128, Size.Height / 64), Size.Width / 128, Size.Height / 64) : Data
                               , Palette, Size.Width, Size.Height));

                case 0x14:
                    return(GetBitmapFrom4bpp(
                               swizzled == 7 ? Ps2.Decode4(Ps2.Encode32(Data, Size.Width / 128, Size.Height / 128), Size.Width / 128, Size.Height / 128) : Data
                               , Palette, Size.Width, Size.Height));

                default:
                    throw new NotSupportedException($"The format {format} is not supported.");
                }
            }