public void ShouldReturnTheValueAsString() { var value = new ExifShort(ExifTag.GPSDifferential); value.Value = 42; Assert.Equal("42", value.ToString()); }
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); } } }
/// <summary> /// Gets a new <see cref="ExifShort"/> instance for the <see cref="ExifTag.TileByteCounts"/> tag. /// </summary> /// <param name="value">The value.</param> /// <returns>A new <see cref="ExifShort"/> instance.</returns> public static ExifShort TileByteCounts(ushort value) => ExifShort.Create(ExifTag.TileByteCounts, value);
/// <summary> /// Gets a new <see cref="ExifShort"/> instance for the <see cref="ExifTag.ImageLayer"/> tag. /// </summary> /// <param name="value">The value.</param> /// <returns>A new <see cref="ExifShort"/> instance.</returns> public static ExifShort ImageLayer(ushort value) => ExifShort.Create(ExifTag.ImageLayer, value);
/// <summary> /// Gets a new <see cref="ExifShort"/> instance for the <see cref="ExifTag.StripOffsets"/> tag. /// </summary> /// <param name="value">The value.</param> /// <returns>A new <see cref="ExifShort"/> instance.</returns> public static ExifShort StripOffsets(ushort value) => ExifShort.Create(ExifTag.StripOffsets, value);