Show / Hide Table of Contents

Struct PixelFormat

Represents a pixel format with conversion methods.

Inherited Members
ValueType.ToString()
object.Equals(object, object)
object.GetType()
object.ReferenceEquals(object, object)
Namespace: Zaya.Primitives
Assembly: Zaya.Primitives.dll
Syntax
public readonly struct PixelFormat

Fields

| Edit this page View Source

Bgr24

24-bit BGR: 8 bits each for Blue, Green, Red. No alpha. Some OCR libraries (like PaddleOCR) expect BGR order.

Declaration
public static readonly PixelFormat Bgr24
Field Value
Type Description
PixelFormat
| Edit this page View Source

Bgra32

32-bit BGRA: 8 bits each for Blue, Green, Red, Alpha. Standard format returned by DirectX capture.

Declaration
public static readonly PixelFormat Bgra32
Field Value
Type Description
PixelFormat
| Edit this page View Source

Gray8

8-bit grayscale: 1 byte per pixel. Fastest for OCR, reduces memory usage by 75% compared to BGRA.

Declaration
public static readonly PixelFormat Gray8
Field Value
Type Description
PixelFormat
| Edit this page View Source

Rgb24

24-bit RGB: 8 bits each for Red, Green, Blue. No alpha. Common format for OCR and image processing.

Declaration
public static readonly PixelFormat Rgb24
Field Value
Type Description
PixelFormat

Properties

| Edit this page View Source

BytesPerPixel

Gets the number of bytes per pixel.

Declaration
public int BytesPerPixel { get; }
Property Value
Type Description
int
| Edit this page View Source

Name

Gets the name of the format.

Declaration
public string Name { get; }
Property Value
Type Description
string

Methods

| Edit this page View Source

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 obj and this instance are the same type and represent the same value; otherwise, false.

Overrides
ValueType.Equals(object)
| Edit this page View Source

GetHashCode()

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
ValueType.GetHashCode()

Operators

| Edit this page View Source

operator ==(PixelFormat, PixelFormat)

Determines whether two PixelFormat values are equal.

Declaration
public static bool operator ==(PixelFormat left, PixelFormat right)
Parameters
Type Name Description
PixelFormat left
PixelFormat right
Returns
Type Description
bool
| Edit this page View Source

operator !=(PixelFormat, PixelFormat)

Determines whether two PixelFormat values are not equal.

Declaration
public static bool operator !=(PixelFormat left, PixelFormat right)
Parameters
Type Name Description
PixelFormat left
PixelFormat right
Returns
Type Description
bool
  • Edit this page
  • View Source
In this article
Back to top Generated by DocFX