Struct TiffBitsPerSample
- Namespace
- SixLabors.ImageSharp.Formats.Tiff
- Assembly
- SixLabors.ImageSharp.dll
The number of bits per component.
public readonly struct TiffBitsPerSample : IEquatable<TiffBitsPerSample>
- Implements
- Inherited Members
Constructors
TiffBitsPerSample(ushort, ushort, ushort, ushort)
Initializes a new instance of the TiffBitsPerSample struct.
public TiffBitsPerSample(ushort channel0, ushort channel1, ushort channel2, ushort channel3 = 0)
Parameters
channel0ushortThe bits for the channel 0.
channel1ushortThe bits for the channel 1.
channel2ushortThe bits for the channel 2.
channel3ushortThe bits for the channel 3.
Properties
Channel0
Gets the bits for the channel 0.
public ushort Channel0 { get; }
Property Value
Channel1
Gets the bits for the channel 1.
public ushort Channel1 { get; }
Property Value
Channel2
Gets the bits for the channel 2.
public ushort Channel2 { get; }
Property Value
Channel3
Gets the bits for the alpha channel.
public ushort Channel3 { get; }
Property Value
Channels
Gets the number of channels.
public byte Channels { get; }
Property Value
Methods
BitsPerPixel()
Gets the bits per pixel for the given bits per sample.
public TiffBitsPerPixel BitsPerPixel()
Returns
- TiffBitsPerPixel
Bits per pixel.
Equals(TiffBitsPerSample)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(TiffBitsPerSample other)
Parameters
otherTiffBitsPerSampleAn object to compare with this object.
Returns
Equals(object?)
Indicates whether this instance and a specified object are equal.
public override bool Equals(object? obj)
Parameters
objobjectThe object to compare with the current instance.
Returns
- bool
true if
objand this instance are the same type and represent the same value; otherwise, false.
GetHashCode()
Returns the hash code for this instance.
public override int GetHashCode()
Returns
- int
A 32-bit signed integer that is the hash code for this instance.
ToArray()
Converts the bits per sample struct to an ushort array.
public ushort[] ToArray()
Returns
- ushort[]
Bits per sample as ushort array.
ToString()
Returns the fully qualified type name of this instance.
public override string ToString()
Returns
- string
The fully qualified type name.
TryParse(ushort[]?, out TiffBitsPerSample)
Tries to parse a ushort array and convert it into a TiffBitsPerSample struct.
public static bool TryParse(ushort[]? value, out TiffBitsPerSample sample)
Parameters
valueushort[]The value to parse.
sampleTiffBitsPerSampleThe tiff bits per sample.
Returns
- bool
True, if the value could be parsed.
Operators
operator ==(TiffBitsPerSample, TiffBitsPerSample)
Checks whether two TiffBitsPerSample structures are equal.
public static bool operator ==(TiffBitsPerSample left, TiffBitsPerSample right)
Parameters
leftTiffBitsPerSampleThe left hand TiffBitsPerSample operand.
rightTiffBitsPerSampleThe right hand TiffBitsPerSample operand.
Returns
- bool
True if the
leftparameter is equal to therightparameter; otherwise, false.
operator !=(TiffBitsPerSample, TiffBitsPerSample)
Checks whether two TiffBitsPerSample structures are not equal.
public static bool operator !=(TiffBitsPerSample left, TiffBitsPerSample right)
Parameters
leftTiffBitsPerSampleThe left hand TiffBitsPerSample operand.
rightTiffBitsPerSampleThe right hand TiffBitsPerSample operand.
Returns
- bool
True if the
leftparameter is not equal to therightparameter; otherwise, false.