public void ShouldReturnTrueWhenObjectIsEqual() { var first = new ExifLong(ExifTag.SubIFDOffset); var second = new ExifLong(ExifTag.SubIFDOffset); Assert.True(first.Equals(second)); }
public void ShouldReturnFalseWhenObjectIsNotEqual() { var first = new ExifLong(ExifTag.SubIFDOffset); var second = new ExifLong(ExifTag.CodingMethods); Assert.False(first.Equals(second)); }
public void ShouldReturnTrueWhenInstanceIsEqual() { var first = new ExifLong(ExifTag.SubIFDOffset); var second = ExifTag.SubIFDOffset; Assert.IsTrue(first.Equals(second)); }
public void ShouldReturnFalseWhenInstanceIsNotEqual() { var first = new ExifLong(ExifTag.SubIFDOffset); var second = ExifTag.CodingMethods; Assert.IsFalse(first.Equals(second)); }
public void ShouldReturnTheCorrectValueWhenValuesAreNotEqual() { var first = new ExifLong(ExifTag.SubIFDOffset); var second = ExifTag.CodingMethods; Assert.False(first == second); Assert.True(first != second); }
public void ShouldReturnTheCorrectValueWhenValuesAreEqual() { var first = new ExifLong(ExifTag.SubIFDOffset); var second = ExifTag.SubIFDOffset; Assert.IsTrue(first == second); Assert.IsFalse(first != second); }
public void ShouldReturnTheCorrectValueWhenInstanceIsNull() { var value = new ExifLong(ExifTag.SubIFDOffset); Assert.False(value == null); Assert.True(value != null); Assert.False(null == value); Assert.True(null != value); }
public void Process(TiffEncoderCore encoder) { var planarConfig = new ExifShort(ExifTagValue.PlanarConfiguration) { Value = (ushort)TiffPlanarConfiguration.Chunky }; var samplesPerPixel = new ExifLong(ExifTagValue.SamplesPerPixel) { Value = GetSamplesPerPixel(encoder) }; ushort[] bitsPerSampleValue = GetBitsPerSampleValue(encoder); var bitPerSample = new ExifShortArray(ExifTagValue.BitsPerSample) { Value = bitsPerSampleValue }; ushort compressionType = GetCompressionType(encoder); var compression = new ExifShort(ExifTagValue.Compression) { Value = compressionType }; var photometricInterpretation = new ExifShort(ExifTagValue.PhotometricInterpretation) { Value = (ushort)encoder.PhotometricInterpretation }; this.Collector.AddOrReplace(planarConfig); this.Collector.AddOrReplace(samplesPerPixel); this.Collector.AddOrReplace(bitPerSample); this.Collector.AddOrReplace(compression); this.Collector.AddOrReplace(photometricInterpretation); if (encoder.HorizontalPredictor == TiffPredictor.Horizontal) { if (encoder.PhotometricInterpretation == TiffPhotometricInterpretation.Rgb || encoder.PhotometricInterpretation == TiffPhotometricInterpretation.PaletteColor || encoder.PhotometricInterpretation == TiffPhotometricInterpretation.BlackIsZero) { var predictor = new ExifShort(ExifTagValue.Predictor) { Value = (ushort)TiffPredictor.Horizontal }; this.Collector.AddOrReplace(predictor); } } }
public void ShouldReturnTrueWhenObjectIsTheSame() { var value = new ExifLong(ExifTag.SubIFDOffset); Assert.True(value.Equals(value)); }
public void ShouldReturnFalseWhenInstanceIsNull() { var value = new ExifLong(ExifTag.SubIFDOffset); Assert.False(value.Equals(null)); }
/// <summary> /// Gets a new <see cref="ExifLong"/> instance for the <see cref="ExifTag.ImageLayer"/> tag. /// </summary> /// <param name="value">The value.</param> /// <returns>A new <see cref="ExifLong"/> instance.</returns> public static ExifLong ImageLayer(uint value) => ExifLong.Create(ExifTag.ImageLayer, value);
/// <summary> /// Gets a new <see cref="ExifLong"/> instance for the <see cref="ExifTag.TileByteCounts"/> tag. /// </summary> /// <param name="value">The value.</param> /// <returns>A new <see cref="ExifLong"/> instance.</returns> public static ExifLong TileByteCounts(uint value) => ExifLong.Create(ExifTag.TileByteCounts, value);
/// <summary> /// Gets a new <see cref="ExifLong"/> instance for the <see cref="ExifTag.StripOffsets"/> tag. /// </summary> /// <param name="value">The value.</param> /// <returns>A new <see cref="ExifLong"/> instance.</returns> public static ExifLong StripOffsets(uint value) => ExifLong.Create(ExifTag.StripOffsets, value);