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)
public bool Equals(TiffBitsPerSample other)
Parameters
otherTiffBitsPerSample
Returns
Equals(object?)
public override bool Equals(object? obj)
Parameters
objobject
Returns
GetHashCode()
public override int GetHashCode()
Returns
ToArray()
Converts the bits per sample struct to an ushort array.
public ushort[] ToArray()
Returns
- ushort[]
Bits per sample as ushort array.
ToString()
public override string ToString()
Returns
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.