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