示例#1
0
        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
        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;
 }
            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);
            }
        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));
 }
 public static FourCc ReadFourCc(this BinaryReader reader)
 {
     return(FourCc.FromUInt32(reader.ReadUInt32()));
 }
示例#11
0
            public ProcedureSet(FourCc id,
				RiffChunkReadProcedure readProcedure = null,
				RiffChunkWriteProcedure writeProcedure = null,
				RiffChunkValidationProcedure validationProcedure = null)
            {
                Id = id;
                ReadProcedure = readProcedure;
                WriteProcedure = writeProcedure;
                ValidationProcedure = validationProcedure;
            }
示例#12
0
 private RiffChunk(FourCc id)
 {
     Id = id;
     _readProcedure = null;
     _writeProcedure = null;
     _validationProcedure = null;
 }
示例#13
0
 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
            public ListChunkProcedureSet(FourCc id, FourCc typeId,
				RiffChunkReadProcedure readProcedure = null,
				RiffChunkWriteProcedure writeProcedure = null,
				RiffChunkValidationProcedure validationProcedure = null)
                : base(id, readProcedure, writeProcedure, validationProcedure)
            {
                _typeId = typeId;
            }