Show / Hide Table of Contents

Struct PixelFormat

Represents a pixel format that's used for RFB encodings.

Implements
IEquatable<PixelFormat>
Namespace: MarcusW.VncClient
Assembly: MarcusW.VncClient.dll
Syntax
public struct PixelFormat : IEquatable<PixelFormat>

Constructors

| Improve this Doc View Source

PixelFormat(String, Byte, Byte, Boolean, Boolean, Boolean, UInt16, UInt16, UInt16, UInt16, Byte, Byte, Byte, Byte)

Initializes a new instance of the PixelFormat structure.

Declaration
public PixelFormat(string name, byte bitsPerPixel, byte depth, bool bigEndian, bool trueColor, bool hasAlpha, ushort redMax, ushort greenMax, ushort blueMax, ushort alphaMax, byte redShift, byte greenShift, byte blueShift, byte alphaShift)
Parameters
Type Name Description
System.String name

The name of the pixel format.

System.Byte bitsPerPixel

The number of bits used for each pixel on the wire.

System.Byte depth

The number of useful bits in the pixel value. Must be greater than or equal to bitsPerPixel.

System.Boolean bigEndian

True if multi-byte pixels are interpreted as big endian, otherwise false.

System.Boolean trueColor

True if the pixel value is composed from the color values, or false if the color values serve as indices into a color map.

System.Boolean hasAlpha

True if this pixel format contains an alpha channel, otherwise false.

System.UInt16 redMax

The maximum value for the color red.

System.UInt16 greenMax

The maximum value for the color green.

System.UInt16 blueMax

The maximum value for the color blue.

System.UInt16 alphaMax

The maximum value for the alpha value.

System.Byte redShift

The number of right-shifts needed to get the red value in a pixel.

System.Byte greenShift

The number of right-shifts needed to get the green value in a pixel.

System.Byte blueShift

The number of right-shifts needed to get the blue value in a pixel.

System.Byte alphaShift

The number of right-shifts needed to get the alpha value in a pixel.

Fields

| Improve this Doc View Source

Plain

A very basic RGBA pixel format.

Declaration
public static readonly PixelFormat Plain
Field Value
Type Description
PixelFormat
| Improve this Doc View Source

Unknown

An invalid pixel format representing unknown values.

Declaration
public static readonly PixelFormat Unknown
Field Value
Type Description
PixelFormat

Properties

| Improve this Doc View Source

AlphaMax

Gets the maximum value for the alpha value.

Declaration
public ushort AlphaMax { get; }
Property Value
Type Description
System.UInt16
| Improve this Doc View Source

AlphaShift

Gets the number of right-shifts needed to get the alpha value in a pixel.

Declaration
public byte AlphaShift { get; }
Property Value
Type Description
System.Byte
| Improve this Doc View Source

BigEndian

Gets if multi-byte pixels are interpreted as big endian.

Declaration
public bool BigEndian { get; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

BitsPerPixel

Gets the number of bits used for each pixel on the wire.

Declaration
public byte BitsPerPixel { get; }
Property Value
Type Description
System.Byte
| Improve this Doc View Source

BlueMax

Gets the maximum value for the color blue.

Declaration
public ushort BlueMax { get; }
Property Value
Type Description
System.UInt16
| Improve this Doc View Source

BlueShift

Gets the number of right-shifts needed to get the blue value in a pixel.

Declaration
public byte BlueShift { get; }
Property Value
Type Description
System.Byte
| Improve this Doc View Source

BytesPerPixel

Gets the number of bytes used for each pixel on the wire.

Declaration
public byte BytesPerPixel { get; }
Property Value
Type Description
System.Byte
| Improve this Doc View Source

Depth

Gets the number of useful bits in the pixel value. Must be greater than or equal to BitsPerPixel.

Declaration
public byte Depth { get; }
Property Value
Type Description
System.Byte
| Improve this Doc View Source

GreenMax

Gets the maximum value for the color green.

Declaration
public ushort GreenMax { get; }
Property Value
Type Description
System.UInt16
| Improve this Doc View Source

GreenShift

Gets the number of right-shifts needed to get the green value in a pixel.

Declaration
public byte GreenShift { get; }
Property Value
Type Description
System.Byte
| Improve this Doc View Source

HasAlpha

Gets whether this pixel format contains an alpha channel.

Declaration
public bool HasAlpha { get; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

LittleEndian

Gets if multi-byte pixels are interpreted as little endian.

Declaration
public bool LittleEndian { get; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

Name

Gets the name of this pixel format.

Declaration
public string Name { get; }
Property Value
Type Description
System.String
| Improve this Doc View Source

RedMax

Gets the maximum value for the color red.

Declaration
public ushort RedMax { get; }
Property Value
Type Description
System.UInt16
| Improve this Doc View Source

RedShift

Gets the number of right-shifts needed to get the red value in a pixel.

Declaration
public byte RedShift { get; }
Property Value
Type Description
System.Byte
| Improve this Doc View Source

TrueColor

Gets whether the pixel value is composed from the color values (True), or if the color values serve as indices into a color map (False).

Declaration
public bool TrueColor { get; }
Property Value
Type Description
System.Boolean

Methods

| Improve this Doc View Source

Equals(PixelFormat)

Declaration
public bool Equals(PixelFormat other)
Parameters
Type Name Description
PixelFormat other
Returns
Type Description
System.Boolean
| Improve this Doc View Source

Equals(Nullable<Object>)

Declaration
public override bool Equals(object? obj)
Parameters
Type Name Description
System.Nullable<System.Object> obj
Returns
Type Description
System.Boolean
| Improve this Doc View Source

GetHashCode()

Declaration
public override int GetHashCode()
Returns
Type Description
System.Int32
| Improve this Doc View Source

IsBinaryCompatibleTo(PixelFormat, Boolean)

Checks if a pixel encoded using this pixel format would be binary compatible with one encoded using another one.

Declaration
public bool IsBinaryCompatibleTo(PixelFormat other, bool ignoreAlpha = false)
Parameters
Type Name Description
PixelFormat other

The other pixel format.

System.Boolean ignoreAlpha

If true, the presence and encoding of the alpha channel will be ignored during this check.

Returns
Type Description
System.Boolean

True if they are binary compatible, otherwise false.

Remarks

This method does not yet support comparisons because little-endian and big-endian pixel formats.

| Improve this Doc View Source

ToString()

Declaration
public override string ToString()
Returns
Type Description
System.String

Operators

| Improve this Doc View Source

Equality(PixelFormat, PixelFormat)

Checks for equality between two PixelFormats.

Declaration
public static bool operator ==(PixelFormat left, PixelFormat right)
Parameters
Type Name Description
PixelFormat left

The first pixel format.

PixelFormat right

The second pixel format.

Returns
Type Description
System.Boolean

True if the sizes are equal, otherwise false.

| Improve this Doc View Source

Inequality(PixelFormat, PixelFormat)

Checks for inequality between two PixelFormats.

Declaration
public static bool operator !=(PixelFormat left, PixelFormat right)
Parameters
Type Name Description
PixelFormat left

The first pixel format.

PixelFormat right

The second pixel format.

Returns
Type Description
System.Boolean

True if the sizes are unequal, otherwise false.

Implements

IEquatable<>
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX