コード例 #1
0
ファイル: ListChunk.cs プロジェクト: jonathanruisi/Utility
        public ListChunk(FourCc id, FourCc typeId, BinaryReader reader,
			RiffChunkReadProcedure readProcedure = null,
			RiffChunkWriteProcedure writeProcedure = null,
			RiffChunkValidationProcedure validationProcedure = null)
            : this(id, typeId, readProcedure, writeProcedure, validationProcedure)
        {
            Read(reader);
        }
コード例 #2
0
ファイル: ListChunk.cs プロジェクト: jonathanruisi/Utility
        public ListChunk(FourCc id, FourCc typeId,
			RiffChunkReadProcedure readProcedure = null,
			RiffChunkWriteProcedure writeProcedure = null,
			RiffChunkValidationProcedure validationProcedure = null)
            : this(id, typeId)
        {
            _readProcedure = readProcedure;
            _writeProcedure = writeProcedure;
            _validationProcedure = validationProcedure;
        }
コード例 #3
0
 public static bool SeekNextFourCc(this BinaryReader reader, FourCc value)
 {
     var initialPosition = reader.BaseStream.Position;
     while (reader.BaseStream.Position < reader.BaseStream.Length)
     {
         if (reader.ReadFourCc() == value)
             return true;
         if (reader.BaseStream.Length - reader.BaseStream.Position < 4)
             break;
     }
     reader.BaseStream.Position = initialPosition;
     return false;
 }
コード例 #4
0
            public override int GetHashCode()
            {
                var result = 17;

                result = result * 13 + FormatType.GetHashCode();
                result = result * 13 + BitsPerPixel.GetHashCode();
                result = result * 13 + RBitMask.GetHashCode();
                result = result * 13 + GBitMask.GetHashCode();
                result = result * 13 + BBitMask.GetHashCode();
                result = result * 13 + ABitMask.GetHashCode();
                result = result * 13 + FourCc.GetHashCode();
                result = result * 13 + D3D10Format.GetHashCode();
                return(result);
            }
コード例 #5
0
        public static bool SeekNextFourCc(this BinaryReader reader, FourCc value)
        {
            var initialPosition = reader.BaseStream.Position;

            while (reader.BaseStream.Position < reader.BaseStream.Length)
            {
                if (reader.ReadFourCc() == value)
                {
                    return(true);
                }
                if (reader.BaseStream.Length - reader.BaseStream.Position < 4)
                {
                    break;
                }
            }

            reader.BaseStream.Position = initialPosition;
            return(false);
        }
コード例 #6
0
 /// <summary>
 /// Compares this instance with a specified <see cref="TagFourCc"/> object and indicates whether this instance preceds, follows, or appears in the same position as in the sort order as the specified tag.
 /// </summary>
 /// <param name="tag">The tag to compare with this instance.</param>
 /// <returns>A 32-bit signed integer that indicates whether this instance precedes, follows, or appears in the same position in the sort order as the <paramref name="tag"/> parameter.</returns>
 public int CompareTo(TagFourCc tag)
 {
     return(FourCc.CompareTo(tag.FourCc));
 }
コード例 #7
0
 /// <summary>
 /// Determines whether this instance and another specified <see cref="string"/> object have the same value.
 /// </summary>
 /// <param name="value">The string to compare to this instance.</param>
 /// <returns>true if the value of the <paramref name="value"/> parameter is the same as the value of this instance; otherwise, false. If <paramref name="value"/> is null, the method returns false.</returns>
 public bool Equals(string value)
 {
     return(FourCc.Equals(value));
 }
コード例 #8
0
 /// <summary>
 /// Determines whether this instance and another specified <see cref="TagFourCc"/> object have the same value.
 /// </summary>
 /// <param name="value">The tag to compare to this instance.</param>
 /// <returns>true if the value of the <paramref name="value"/> parameter is the same as the value of this instance; otherwise, false. If <paramref name="value"/> is null, the method returns false.</returns>
 public bool Equals(TagFourCc value)
 {
     return(FourCc.Equals(value.FourCc));
 }
コード例 #9
0
 /// <summary>
 /// Compares this instance with a specified <see cref="string"/> object and indicates whether this instance preceds, follows, or appears in the same position as in the sort order as the specified string.
 /// </summary>
 /// <param name="str">The string to compare with this instance.</param>
 /// <returns>A 32-bit signed integer that indicates whether this instance precedes, follows, or appears in the same position in the sort order as the <paramref name="str"/> parameter.</returns>
 public int CompareTo(string str)
 {
     return(FourCc.CompareTo(str));
 }
コード例 #10
0
 public static FourCc ReadFourCc(this BinaryReader reader)
 {
     return(FourCc.FromUInt32(reader.ReadUInt32()));
 }
コード例 #11
0
ファイル: RiffChunk.cs プロジェクト: jonathanruisi/Utility
            public ProcedureSet(FourCc id,
				RiffChunkReadProcedure readProcedure = null,
				RiffChunkWriteProcedure writeProcedure = null,
				RiffChunkValidationProcedure validationProcedure = null)
            {
                Id = id;
                ReadProcedure = readProcedure;
                WriteProcedure = writeProcedure;
                ValidationProcedure = validationProcedure;
            }
コード例 #12
0
ファイル: RiffChunk.cs プロジェクト: jonathanruisi/Utility
 private RiffChunk(FourCc id)
 {
     Id = id;
     _readProcedure = null;
     _writeProcedure = null;
     _validationProcedure = null;
 }
コード例 #13
0
ファイル: ListChunk.cs プロジェクト: jonathanruisi/Utility
 private ListChunk(FourCc id, FourCc typeId)
     : base(id, ReadChunk, WriteChunk, ValidateChunk)
 {
     TypeId = typeId;
     _readProcedure = null;
     _writeProcedure = null;
     _validationProcedure = null;
     _subchunkProcedures = new List<ProcedureSet>();
 }
コード例 #14
0
ファイル: ListChunk.cs プロジェクト: jonathanruisi/Utility
            public ListChunkProcedureSet(FourCc id, FourCc typeId,
				RiffChunkReadProcedure readProcedure = null,
				RiffChunkWriteProcedure writeProcedure = null,
				RiffChunkValidationProcedure validationProcedure = null)
                : base(id, readProcedure, writeProcedure, validationProcedure)
            {
                _typeId = typeId;
            }