Ejemplo n.º 1
0
        public Bitmap Decode(RoomBlock roomBlock, int objectIndex, int imageIndex)
        {
            var obj = roomBlock.GetOBIMs()[objectIndex];

            if (obj.GetIMxx()[imageIndex].GetSMAP() == null)
            {
                return(new Bitmap(1, 1));
            }

            var IMHD = obj.GetIMHD();

            _width        = IMHD.Width;
            _height       = IMHD.Height;
            _transparency = roomBlock.GetTRNS().Value;
            _strips       = obj.GetIMxx()[imageIndex].GetSMAP().Strips;

            if (PaletteIndex == 0)
            {
                _pallete = roomBlock.GetDefaultPalette();
            }
            else
            {
                _pallete = roomBlock.GetPALS().GetWRAP().GetAPALs()[PaletteIndex];
            }

            Decode();

            return(_resultBitmap);
        }
Ejemplo n.º 2
0
        public void Encode(RoomBlock blockToEncode, Bitmap imageToEncode)
        {
            _imageToEncode = imageToEncode;
            var RMHD = blockToEncode.GetRMHD();

            _width        = RMHD.Width;
            _height       = RMHD.Height;
            _transparency = blockToEncode.GetTRNS().Value;
            _strips       = blockToEncode.GetRMIM().GetIM00().GetSMAP();
            if (PaletteIndex == 0)
            {
                _pallete = blockToEncode.GetDefaultPalette();
            }
            else
            {
                _pallete = blockToEncode.GetPALS().GetWRAP().GetAPALs()[PaletteIndex];
            }

            Encode();
        }
Ejemplo n.º 3
0
        public Bitmap Decode(RoomBlock roomBlock)
        {
            var RMHD = roomBlock.GetRMHD();

            _width        = RMHD.Width;
            _height       = RMHD.Height;
            _transparency = roomBlock.GetTRNS().Value;
            _strips       = roomBlock.GetRMIM().GetIM00().GetSMAP().Strips;

            if (PaletteIndex == 0)
            {
                _pallete = roomBlock.GetDefaultPalette();
            }
            else
            {
                _pallete = roomBlock.GetPALS().GetWRAP().GetAPALs()[PaletteIndex];
            }

            Decode();

            return(_resultBitmap);
        }
Ejemplo n.º 4
0
        public void Encode(RoomBlock blockToEncode, int objectIndex, int imageIndex, Bitmap imageToEncode)
        {
            var obj = blockToEncode.GetOBIMs()[objectIndex];

            _imageToEncode = imageToEncode;

            ObjectImageHeader IMHD = obj.GetIMHD();

            _width        = IMHD.Width;
            _height       = IMHD.Height;
            _transparency = blockToEncode.GetTRNS().Value;
            _strips       = obj.GetIMxx()[imageIndex].GetSMAP();
            if (PaletteIndex == 0)
            {
                _pallete = blockToEncode.GetDefaultPalette();
            }
            else
            {
                _pallete = blockToEncode.GetPALS().GetWRAP().GetAPALs()[PaletteIndex];
            }
            Encode();
        }