當前位置: 首頁>>代碼示例>>C#>>正文


C# Utilities.ByteReader類代碼示例

本文整理匯總了C#中libJT.Utilities.ByteReader的典型用法代碼示例。如果您正苦於以下問題:C# ByteReader類的具體用法?C# ByteReader怎麽用?C# ByteReader使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ByteReader類屬於libJT.Utilities命名空間,在下文中一共展示了ByteReader類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: JTFile

 public JTFile(string filename)
     : this()
 {
     this.filename = filename;
     //reader = new BinaryReader(new FileStream(filename, FileMode.Open, FileAccess.Read));
     reader = new ByteReader(new BinaryReader(new FileStream(filename, FileMode.Open, FileAccess.Read)));
 }
開發者ID:doug8679,項目名稱:libJT,代碼行數:7,代碼來源:JTFile.cs

示例2: Vers1ImageFormat

        public Vers1ImageFormat(ByteReader reader)
        {
            ImageTexelData = new List<byte>();
            _numBytes = reader.ReadI32();
            if ( _numBytes > 0 ) {
                PixelFormat = reader.ReadU32();
                PixelDataType = reader.ReadU32();
                Dimensionality = reader.ReadI16();
                Width = reader.ReadI32();
                Height = reader.ReadI32();
                MipmapsFlag = reader.ReadU32();
                SharedImageFlag = reader.ReadU32();

                for ( int i = 0; i < _numBytes; i++ ) {
                    ImageTexelData.Add( reader.ReadByte() );
                }

                MipmapMagnificationFilter = reader.ReadI32();
                MipmapMinificationFilter = reader.ReadI32();
                SDimenWrapMode = reader.ReadI32();
                TDimenWrapMode = reader.ReadI32();
                TextureFunctionData = reader.ReadI32();
                BlendColor = reader.ReadRGBA();
                TextureTransform = reader.ReadMx4F32();
            }
        }
開發者ID:doug8679,項目名稱:libJT,代碼行數:26,代碼來源:TextureImage.cs

示例3: ReadV8

        protected override void ReadV8(ByteReader reader)
        {
            // First, read the compression header (first element in segment data)
            ElementHeader head = new LogicalElementHeaderZlib();
            head.Read(reader, 8);
            Element e = Element.Create(head, reader, head.ObjectTypeID, 8);
            e.Read(reader, 8);
            Elements.Add(e);

            // Read Graph Elements
            head = new LogicalElementHeader();
            head.Read(reader, 8);
            while (!head.ObjectTypeID.Equals(Element.EndOfElements)) {
                e = Element.Create(head, reader, head.ObjectTypeID, 8);
                e.Read(reader, 8);
                Elements.Add(e);
                head = new LogicalElementHeader();
                head.Read( reader, 8 );
            }

            // Read Property Atoms
            head = new LogicalElementHeader();
            head.Read(reader, 8);
            while (!head.ObjectTypeID.Equals(Element.EndOfElements)) {
                e = Element.Create(head, reader, head.ObjectTypeID, 8);
                e.Read(reader, 8);
                Properties.Add(e);
                head = new LogicalElementHeader();
                head.Read( reader, 8 );
            }

            // Attempt to read property table:
            PropertyTable.Read(reader, 8);
            reader.Inflate();
        }
開發者ID:doug8679,項目名稱:libJT,代碼行數:35,代碼來源:LogicalSceneGraph.cs

示例4: ReadV8

        protected override void ReadV8(ByteReader reader)
        {
            base.ReadV8(reader);

            DataFlags = reader.ReadU16();
            if (( DataFlags & 0x0001 ) == 0x0001) {
                // Pattern bits are valid
                if (( DataFlags & 0x0002 ) == 0x0002) {
                    float c = reader.ReadF32();
                    AmbientColor = new[] {c, c, c, 1.0f};
                } else {
                    AmbientColor = reader.ReadRGBA();
                }
                DiffuseColor = reader.ReadRGBA();
                if ( ( DataFlags & 0x0004 ) == 0x0004 ) {
                    float c = reader.ReadF32();
                    SpecularColor = new[] { c, c, c, 1.0f };
                } else {
                    SpecularColor = reader.ReadRGBA();
                }
                if ( ( DataFlags & 0x0008 ) == 0x0008 ) {
                    float c = reader.ReadF32();
                    EmissionColor = new[] { c, c, c, 1.0f };
                } else {
                    EmissionColor = reader.ReadRGBA();
                }
            } else {
                AmbientColor = reader.ReadRGBA();
                DiffuseColor = reader.ReadRGBA();
                SpecularColor = reader.ReadRGBA();
                EmissionColor = reader.ReadRGBA();
            }
            Shininess = reader.ReadF32();
        }
開發者ID:doug8679,項目名稱:libJT,代碼行數:34,代碼來源:MaterialBaseAttribute.cs

示例5: QuantizationParameters

 public QuantizationParameters(ByteReader reader)
 {
     BitsPerVertex = reader.ReadU8();
     NormalBitsFactor = reader.ReadU8();
     BitsPerTextureCoord = reader.ReadU8();
     BitsPerColor = reader.ReadU8();
 }
開發者ID:doug8679,項目名稱:libJT,代碼行數:7,代碼來源:QuantizationParameters.cs

示例6: ReadV8

 protected override void ReadV8(ByteReader reader)
 {
     base.ReadV8( reader );
     VersionNumber = reader.ReadI16();
     DataFlags = reader.ReadU8();
     PointSize = reader.ReadF32();
 }
開發者ID:doug8679,項目名稱:libJT,代碼行數:7,代碼來源:PointStyleAttribute.cs

示例7: ReadV8

 protected override void ReadV8(ByteReader reader)
 {
     base.ReadV8(reader);
     int children = reader.ReadI32();
     for (int i = 0; i < children; i++) {
         Children.Add(reader.ReadI32());
     }
 }
開發者ID:doug8679,項目名稱:libJT,代碼行數:8,代碼來源:GroupNodeElement.cs

示例8: MaterialBaseAttribute

 public MaterialBaseAttribute(ElementHeader head, ByteReader reader, int version)
     : base(head, reader, version)
 {
     AmbientColor = new[] {0.5f, 0.5f, 0.5f, 1.0f};
     DiffuseColor = new[] { 0.5f, 0.5f, 0.5f, 1.0f };
     SpecularColor = new[] { 0.5f, 0.5f, 0.5f, 1.0f };
     EmissionColor = new[] { 0.5f, 0.5f, 0.5f, 1.0f };
 }
開發者ID:doug8679,項目名稱:libJT,代碼行數:8,代碼來源:MaterialBaseAttribute.cs

示例9: ReadV8

 protected override void ReadV8(ByteReader reader)
 {
     base.ReadV8(reader);
     NormalBinding = reader.ReadI32();
     TextureBinding = reader.ReadI32();
     ColorBinding = reader.ReadI32();
     QuantizationParameters = new QuantizationParameters(reader);
 }
開發者ID:doug8679,項目名稱:libJT,代碼行數:8,代碼來源:VertexShapeNodeElement.cs

示例10: ReadV8

 private void ReadV8(ByteReader reader)
 {
     VersionNumber = reader.ReadI16();
     NormalBinding = (Binding)reader.ReadByte();
     TextureCoordBinding = (Binding)reader.ReadByte();
     ColorBinding = (Binding)reader.ReadByte();
     QuantizationParameters = new QuantizationParameters(reader);
 }
開發者ID:doug8679,項目名稱:libJT,代碼行數:8,代碼來源:VertexBasedShapeCompressedRepData.cs

示例11: ReadV8

 protected override void ReadV8(ByteReader reader)
 {
     base.ReadV8( reader );
     LightCount = reader.ReadI32();
     for (int i = 0; i < LightCount; i++) {
         Lights.Add(reader.ReadI32());
     }
 }
開發者ID:doug8679,項目名稱:libJT,代碼行數:8,代碼來源:LightSetAttributeElement.cs

示例12: ReadV8

 protected override void ReadV8(ByteReader reader)
 {
     base.ReadV8(reader);
     ObjectID = reader.ReadI32();
     AmbientColor = reader.ReadRGBA();
     DiffuseColor = reader.ReadRGBA();
     SpecularColor = reader.ReadRGBA();
     Brightness = reader.ReadF32();
 }
開發者ID:doug8679,項目名稱:libJT,代碼行數:9,代碼來源:BaseLight.cs

示例13: ReadV9

 protected override void ReadV9(ByteReader reader)
 {
     VersionNumber = reader.ReadI16();
     NodeFlagsPMI = reader.ReadU32();
     var aCount = reader.ReadI32();
     for ( int i = 0; i < aCount; i++ ) {
         Attributes.Add( reader.ReadI32() );
     }
 }
開發者ID:doug8679,項目名稱:libJT,代碼行數:9,代碼來源:BaseNodeElement.cs

示例14: FileSegment

 protected FileSegment(ByteReader reader, TocEntry entry, int version)
     : this()
 {
     // Postion the file stream:
     reader.Position = (long)entry.SegmentOffset;
     // Read the segment header:
     Header.Read(reader);
     //Read(reader, version);
 }
開發者ID:doug8679,項目名稱:libJT,代碼行數:9,代碼來源:FileSegment.cs

示例15: VertexBasedShapeCompressedRepData

 public VertexBasedShapeCompressedRepData(ByteReader reader, int version)
 {
     if (version < 9)
         ReadV8(reader);
     else if (version < 10)
         ReadV9(reader);
     else
         ReadV10(reader);
 }
開發者ID:doug8679,項目名稱:libJT,代碼行數:9,代碼來源:VertexBasedShapeCompressedRepData.cs


注:本文中的libJT.Utilities.ByteReader類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。