Struct PixelFormat
Represents a pixel format with conversion methods.
Inherited Members
Namespace: Zaya.Primitives
Assembly: Zaya.Primitives.dll
Syntax
public readonly struct PixelFormat
Fields
| Edit this page View SourceBgr24
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 |
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 |
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 |
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 SourceBytesPerPixel
Gets the number of bytes per pixel.
Declaration
public int BytesPerPixel { get; }
Property Value
| Type | Description |
|---|---|
| int |
Name
Gets the name of the format.
Declaration
public string Name { get; }
Property Value
| Type | Description |
|---|---|
| string |
Methods
| Edit this page View SourceEquals(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
Operators
| Edit this page View Sourceoperator ==(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 |
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 |