Exemplo n.º 1
0
        /// <summary>
        /// Writes this component to the supplied output stream.
        /// </summary>
        /// <param name="outputStream">
        /// The output stream to write to.
        /// </param>
        public override void WriteToStream(Stream outputStream)
        {
            WriteByte(_blockSize, outputStream);

            PackedFields packed = new PackedFields();

            packed.SetBits(3, 3, (int)_disposalMethod);
            packed.SetBit(6, _expectsUserInput);
            packed.SetBit(7, _hasTransparentColour);
            WriteByte(packed.Byte, outputStream);

            WriteShort(_delayTime, outputStream);
            WriteByte(_transparentColourIndex, outputStream);
            WriteByte(0, outputStream); // block terminator
        }
Exemplo n.º 2
0
        /// <summary>
        /// Writes this component to the supplied output stream.
        /// </summary>
        /// <param name="outputStream">
        /// The output stream to write to.
        /// </param>
        public override void WriteToStream(Stream outputStream)
        {
            // Position and size of the image in this frame
            WriteShort(_position.X, outputStream);
            WriteShort(_position.Y, outputStream);
            WriteShort(_size.Width, outputStream);
            WriteShort(_size.Height, outputStream);

            PackedFields packed = new PackedFields();

            packed.SetBit(0, _hasLocalColourTable);
            packed.SetBit(1, _isInterlaced);
            packed.SetBit(2, _isSorted);
            packed.SetBits(5, 3, _localColourTableSizeBits);
            WriteByte(packed.Byte, outputStream);
        }
Exemplo n.º 3
0
 public void SetBitTestIndexTooSmall()
 {
     ReportStart();
     try
     {
         _pf.SetBit(-1, true);
     }
     catch (ArgumentOutOfRangeException ex)
     {
         string message
             = "Index must be between 0 and 7. Supplied index: -1";
         Assert.AreEqual("index", ex.ParamName);
         StringAssert.Contains(message, ex.Message);
         ReportEnd();
         throw;
     }
 }
Exemplo n.º 4
0
        /// <summary>
        /// Writes this component to the supplied output stream.
        /// </summary>
        /// <param name="outputStream">
        /// The output stream to write to.
        /// </param>
        public override void WriteToStream(Stream outputStream)
        {
            // logical screen size
            WriteShort(_screenSize.Width, outputStream);
            WriteShort(_screenSize.Height, outputStream);

            // Packed fields
            PackedFields packed = new PackedFields();

            packed.SetBit(0, _hasGlobalColourTable);
            packed.SetBits(1, 3, _colourResolution);
            packed.SetBit(4, _gctIsSorted);
            packed.SetBits(5, 3, _gctSizeBits);
            WriteByte(packed.Byte, outputStream);

            WriteByte(_backgroundColourIndex, outputStream);
            WriteByte(_pixelAspectRatio, outputStream);
        }
Exemplo n.º 5
0
 public void GetSetBitTest()
 {
     ReportStart();
     for (int i = 0; i < 8; i++)
     {
         _pf = new PackedFields();
         _pf.SetBit(i, true);
         Assert.AreEqual(true, _pf.GetBit(i));
     }
     ReportEnd();
 }
Exemplo n.º 6
0
		/// <summary>
		/// Writes this component to the supplied output stream.
		/// </summary>
		/// <param name="outputStream">
		/// The output stream to write to.
		/// </param>
		public override void WriteToStream( Stream outputStream )
		{
			WriteByte( _blockSize, outputStream );
			
			PackedFields packed = new PackedFields();
			packed.SetBits( 3, 3, (int) _disposalMethod );
			packed.SetBit( 6, _expectsUserInput );
			packed.SetBit( 7, _hasTransparentColour );
			WriteByte( packed.Byte, outputStream );
			
			WriteShort( _delayTime , outputStream);
			WriteByte( _transparentColourIndex, outputStream );
			WriteByte( 0, outputStream ); // block terminator
		}
Exemplo n.º 7
0
        /// <summary>
        /// Writes this component to the supplied output stream.
        /// </summary>
        /// <param name="outputStream">
        /// The output stream to write to.
        /// </param>
        public override void WriteToStream( Stream outputStream )
        {
            // logical screen size
            WriteShort( _screenSize.Width, outputStream );
            WriteShort( _screenSize.Height, outputStream );

            // Packed fields
            PackedFields packed = new PackedFields();
            packed.SetBit( 0, _hasGlobalColourTable );
            packed.SetBits( 1, 3, _colourResolution );
            packed.SetBit( 4, _gctIsSorted );
            packed.SetBits( 5, 3, _gctSizeBits );
            WriteByte( packed.Byte, outputStream );

            WriteByte( _backgroundColourIndex, outputStream );
            WriteByte( _pixelAspectRatio, outputStream );
        }
Exemplo n.º 8
0
		/// <summary>
		/// Writes this component to the supplied output stream.
		/// </summary>
		/// <param name="outputStream">
		/// The output stream to write to.
		/// </param>
		public override void WriteToStream( Stream outputStream )
		{
			// Position and size of the image in this frame
			WriteShort( _position.X, outputStream );
			WriteShort( _position.Y, outputStream );
			WriteShort( _size.Width, outputStream );
			WriteShort( _size.Height, outputStream );
			
			PackedFields packed = new PackedFields();
			packed.SetBit( 0, _hasLocalColourTable );
			packed.SetBit( 1, _isInterlaced );
			packed.SetBit( 2, _isSorted );
			packed.SetBits( 5, 3, _localColourTableSizeBits );
			WriteByte( packed.Byte, outputStream );
		}