Table of Contents

Class RGBLuminanceSource

Namespace
ZXing
Assembly
zxing.dll

Luminance source class which support different formats of images.

public class RGBLuminanceSource : BaseLuminanceSource
Inheritance
RGBLuminanceSource
Inherited Members

Constructors

RGBLuminanceSource(byte[], int, int)

Initializes a new instance of the RGBLuminanceSource class. It supports a byte array with 3 bytes per pixel (RGB24).

public RGBLuminanceSource(byte[] rgbRawBytes, int width, int height)

Parameters

rgbRawBytes byte[]

The RGB raw bytes.

width int

The width.

height int

The height.

RGBLuminanceSource(byte[], int, int, bool)

Initializes a new instance of the RGBLuminanceSource class. It supports a byte array with 1 byte per pixel (Gray8). That means the whole array consists of the luminance values (grayscale).

[Obsolete("Use RGBLuminanceSource(luminanceArray, width, height, BitmapFormat.Gray8)")]
public RGBLuminanceSource(byte[] luminanceArray, int width, int height, bool is8Bit)

Parameters

luminanceArray byte[]

The luminance array.

width int

The width.

height int

The height.

is8Bit bool

if set to true [is8 bit].

RGBLuminanceSource(byte[], int, int, BitmapFormat)

Initializes a new instance of the RGBLuminanceSource class. It supports a byte array with 3 bytes per pixel (RGB24).

public RGBLuminanceSource(byte[] rgbRawBytes, int width, int height, RGBLuminanceSource.BitmapFormat bitmapFormat)

Parameters

rgbRawBytes byte[]

The RGB raw bytes.

width int

The width.

height int

The height.

bitmapFormat RGBLuminanceSource.BitmapFormat

The bitmap format.

RGBLuminanceSource(int, int)

Initializes a new instance of the RGBLuminanceSource class.

protected RGBLuminanceSource(int width, int height)

Parameters

width int

The width.

height int

The height.

Methods

CalculateLuminance(byte[], BitmapFormat)

calculates the luminance values for the given byte array and bitmap format

protected void CalculateLuminance(byte[] rgbRawBytes, RGBLuminanceSource.BitmapFormat bitmapFormat)

Parameters

rgbRawBytes byte[]
bitmapFormat RGBLuminanceSource.BitmapFormat

CreateLuminanceSource(byte[], int, int)

Should create a new luminance source with the right class type. The method is used in methods crop and rotate.

protected override LuminanceSource CreateLuminanceSource(byte[] newLuminances, int width, int height)

Parameters

newLuminances byte[]

The new luminances.

width int

The width.

height int

The height.

Returns

LuminanceSource