Table of Contents

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 ushort

The bits for the channel 0.

channel1 ushort

The bits for the channel 1.

channel2 ushort

The bits for the channel 2.

channel3 ushort

The bits for the channel 3.

Properties

Channel0

Gets the bits for the channel 0.

public ushort Channel0 { get; }

Property Value

ushort

Channel1

Gets the bits for the channel 1.

public ushort Channel1 { get; }

Property Value

ushort

Channel2

Gets the bits for the channel 2.

public ushort Channel2 { get; }

Property Value

ushort

Channel3

Gets the bits for the alpha channel.

public ushort Channel3 { get; }

Property Value

ushort

Channels

Gets the number of channels.

public byte Channels { get; }

Property Value

byte

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

bool

Equals(object?)

public override bool Equals(object? obj)

Parameters

obj object

Returns

bool

GetHashCode()

public override int GetHashCode()

Returns

int

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

string

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 TiffBitsPerSample

The 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 TiffBitsPerSample

The left hand TiffBitsPerSample operand.

right TiffBitsPerSample

The right hand TiffBitsPerSample operand.

Returns

bool

True if the left parameter is equal to the right parameter; otherwise, false.

operator !=(TiffBitsPerSample, TiffBitsPerSample)

Checks whether two TiffBitsPerSample structures are not equal.

public static bool operator !=(TiffBitsPerSample left, TiffBitsPerSample right)

Parameters

left TiffBitsPerSample

The left hand TiffBitsPerSample operand.

right TiffBitsPerSample

The right hand TiffBitsPerSample operand.

Returns

bool

True if the left parameter is not equal to the right parameter; otherwise, false.