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(); }
public override void SetAndRefreshData(Structures.BlockBase blockBase) { base.SetAndRefreshData(blockBase); _stripTable = (ImageStripTable)blockBase; StripCount.Text = "Number of Strips: " + _stripTable.Strips.Count; Strips.Items.Clear(); foreach (StripData colorCycle in _stripTable.Strips) { ListViewItem item = Strips.Items.Add(colorCycle.OffSet.ToString()); item.SubItems.Add(string.Format("{0} (0x{1})", colorCycle.CodecId, colorCycle.CodecId.ToString("X").PadLeft(2, '0'))); item.SubItems.Add(colorCycle.ImageData.Length.ToString()); item.SubItems.Add(Enum.GetName(typeof(CompressionTypes), colorCycle.CompressionType)); item.SubItems.Add(Enum.GetName(typeof(RenderingDirections), colorCycle.RenderdingDirection)); item.SubItems.Add(colorCycle.Transparent.ToString()); item.SubItems.Add(string.Format("{0} (0x{1})", colorCycle.ParamSubtraction, colorCycle.ParamSubtraction.ToString("X").PadLeft(2, '0'))); } Strips.AutoResizeColumns(ColumnHeaderAutoResizeStyle.HeaderSize); }
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(); }