Exemplo n.º 1
0
        public override void WriteAsClearText(IClearTextWriter writer)
        {
            writer.Write($"  CELLARRAY {WritePoint(P)} {WritePoint(Q)} {WritePoint(R)}, {WriteInt(Nx)}, {WriteInt(Ny)}, ");

            if (LocalColorPrecision == 0)
            {
                if (_container.ColourSelectionMode == ColourSelectionMode.Type.INDEXED)
                {
                    writer.Write(ColourIndexPrecision.WriteValue(_container.ColourIndexPrecision));
                }
                else
                {
                    writer.Write(ColourPrecision.WritValue(_container.ColourPrecision));
                }
            }
            else
            {
                writer.Write(WriteInt(LocalColorPrecision));
            }

            for (var i = 0; i < Colors.Length; i++)
            {
                writer.Write($" {WriteColor(Colors[i])}");
                if (i < Colors.Length - 1)
                {
                    writer.Write(" ");
                }
            }

            writer.WriteLine(";");
        }
Exemplo n.º 2
0
Arquivo: Tile.cs Projeto: twenzel/CGM
        public override void WriteAsClearText(IClearTextWriter writer)
        {
            writer.Write($" TILE");
            writer.Write($" {WriteInt((int)CompressionType)}");
            writer.Write($" {WriteInt(RowPaddingIndicator)}");

            if (CellColorPrecision == 0)
            {
                if (_container.ColourSelectionMode == ColourSelectionMode.Type.INDEXED)
                {
                    writer.Write(ColourIndexPrecision.WriteValue(_container.ColourIndexPrecision));
                }
                else
                {
                    writer.Write(ColourPrecision.WritValue(_container.ColourPrecision));
                }
            }
            else
            {
                writer.Write(WriteInt(CellColorPrecision));
            }


            WriteSDR(writer, DataRecord);
            if (Image != null)
            {
                writer.Write($" {WriteBitStream(Image.ToArray())}");
            }

            writer.WriteLine(";");
        }
Exemplo n.º 3
0
        public override void WriteAsClearText(IClearTextWriter writer)
        {
            writer.Write($" PATTABLE {WriteIndex(Index)} {WriteInt(Nx)} {WriteInt(Ny)}");

            if (LocalColorPrecision == 0)
            {
                if (_container.ColourSelectionMode == ColourSelectionMode.Type.INDEXED)
                {
                    writer.Write(ColourIndexPrecision.WriteValue(_container.ColourIndexPrecision));
                }
                else
                {
                    writer.Write(ColourPrecision.WritValue(_container.ColourPrecision));
                }
            }
            else
            {
                writer.Write(WriteInt(LocalColorPrecision));
            }

            foreach (var color in Colors)
            {
                writer.Write($" {WriteColor(color)}");
            }

            writer.WriteLine(";");
        }