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
channel0
ushortThe bits for the channel 0.
channel1
ushortThe bits for the channel 1.
channel2
ushortThe bits for the channel 2.
channel3
ushortThe 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
other
TiffBitsPerSample
Returns
Equals(object?)
public override bool Equals(object? obj)
Parameters
obj
object
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
value
ushort[]The value to parse.
sample
TiffBitsPerSampleThe 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
left
TiffBitsPerSampleThe left hand TiffBitsPerSample operand.
right
TiffBitsPerSampleThe right hand TiffBitsPerSample operand.
Returns
- bool
True if the
left
parameter is equal to theright
parameter; otherwise, false.
operator !=(TiffBitsPerSample, TiffBitsPerSample)
Checks whether two TiffBitsPerSample structures are not equal.
public static bool operator !=(TiffBitsPerSample left, TiffBitsPerSample right)
Parameters
left
TiffBitsPerSampleThe left hand TiffBitsPerSample operand.
right
TiffBitsPerSampleThe right hand TiffBitsPerSample operand.
Returns
- bool
True if the
left
parameter is not equal to theright
parameter; otherwise, false.