示例#1
0
文件: CellArray.cs 项目: twenzel/CGM
        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(";");
        }
示例#2
0
文件: Tile.cs 项目: 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(";");
        }
示例#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(";");
        }