コード例 #1
0
        private void GetInfo()
        {
            this.pltt = this.nitro.GetBlock <Pltt>(0);

            int numColors   = (this.pltt.Depth == ColorFormat.Indexed_8bpp) ? 0x100 : 0x10;
            int numPalettes = 0;

            ushort[] index = null;

            if (this.nitro.Blocks.ContainsType("PCMP"))
            {
                this.pcmp   = this.nitro.GetBlock <Pcmp>(0);
                index       = this.pcmp.PaletteIndex;
                numPalettes = this.pcmp.NumPalettes;
            }
            else
            {
                numPalettes = this.pltt.PaletteColors.Length / numColors;
                if (this.pltt.PaletteColors.Length % numColors != 0)
                {
                    numPalettes++;
                }
            }

            this.SetPalette(DividePalette(numColors, numPalettes, this.pltt.PaletteColors, index));
        }
コード例 #2
0
ファイル: Nclr.cs プロジェクト: pleonex/ninoimager
        private void GetInfo()
        {
            this.pltt = this.nitro.GetBlock<Pltt>(0);

            int numColors = (this.pltt.Depth == ColorFormat.Indexed_8bpp) ? 0x100 : 0x10;
            int numPalettes = 0;
            ushort[] index = null;

            if (this.nitro.Blocks.ContainsType("PCMP")) {
                this.pcmp = this.nitro.GetBlock<Pcmp>(0);
                index = this.pcmp.PaletteIndex;
                numPalettes = this.pcmp.NumPalettes;
            } else {
                numPalettes = this.pltt.PaletteColors.Length / numColors;
                if (this.pltt.PaletteColors.Length % numColors != 0) numPalettes++;
            }

            this.SetPalette(DividePalette(numColors, numPalettes, this.pltt.PaletteColors, index));
        }