C# Класс ZXing.PlanarYUVLuminanceSource

This object extends LuminanceSource around an array of YUV data returned from the camera driver, with the option to crop to a rectangle within the full data. This can be used to exclude superfluous pixels around the perimeter and speed up decoding. It works for any pixel format where the Y channel is planar and appears first, including YCbCr_420_SP and YCbCr_422_SP. @author [email protected] (Daniel Switkin)
Наследование: ZXing.BaseLuminanceSource
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
PlanarYUVLuminanceSource ( byte yuvData, int dataWidth, int dataHeight, int left, int top, int width, int height, bool reverseHoriz ) : System

Initializes a new instance of the PlanarYUVLuminanceSource class.

crop ( int left, int top, int width, int height ) : ZXing.LuminanceSource

Returns a new object with cropped image data. Implementations may keep a reference to the original data rather than a copy. Only callable if CropSupported is true.

getRow ( int y, byte row ) : byte[]

Fetches one row of luminance data from the underlying platform's bitmap. Values range from 0 (black) to 255 (white). Because Java does not have an unsigned byte type, callers will have to bitwise and with 0xff for each value. It is preferable for implementations of this method to only fetch this row rather than the whole image, since no 2D Readers may be installed and getMatrix() may never be called.

renderThumbnail ( ) : int[]

Renders the cropped greyscale bitmap.

Защищенные методы

Метод Описание
CreateLuminanceSource ( byte newLuminances, int width, int height ) : ZXing.LuminanceSource

Приватные методы

Метод Описание
PlanarYUVLuminanceSource ( byte luminances, int width, int height ) : System

Initializes a new instance of the PlanarYUVLuminanceSource class.

reverseHorizontal ( int width, int height ) : void

Описание методов

CreateLuminanceSource() защищенный Метод

protected CreateLuminanceSource ( byte newLuminances, int width, int height ) : ZXing.LuminanceSource
newLuminances byte
width int
height int
Результат ZXing.LuminanceSource

PlanarYUVLuminanceSource() публичный Метод

Initializes a new instance of the PlanarYUVLuminanceSource class.
public PlanarYUVLuminanceSource ( byte yuvData, int dataWidth, int dataHeight, int left, int top, int width, int height, bool reverseHoriz ) : System
yuvData byte The yuv data.
dataWidth int Width of the data.
dataHeight int Height of the data.
left int The left.
top int The top.
width int The width.
height int The height.
reverseHoriz bool if set to true [reverse horiz].
Результат System

crop() публичный Метод

Returns a new object with cropped image data. Implementations may keep a reference to the original data rather than a copy. Only callable if CropSupported is true.
public crop ( int left, int top, int width, int height ) : ZXing.LuminanceSource
left int The left coordinate, 0 <= left < Width.
top int The top coordinate, 0 <= top <= Height.
width int The width of the rectangle to crop.
height int The height of the rectangle to crop.
Результат ZXing.LuminanceSource

getRow() публичный Метод

Fetches one row of luminance data from the underlying platform's bitmap. Values range from 0 (black) to 255 (white). Because Java does not have an unsigned byte type, callers will have to bitwise and with 0xff for each value. It is preferable for implementations of this method to only fetch this row rather than the whole image, since no 2D Readers may be installed and getMatrix() may never be called.
public getRow ( int y, byte row ) : byte[]
y int The row to fetch, 0 <= y < Height.
row byte An optional preallocated array. If null or too small, it will be ignored. /// Always use the returned object, and ignore the .length of the array.
Результат byte[]

renderThumbnail() публичный Метод

Renders the cropped greyscale bitmap.
public renderThumbnail ( ) : int[]
Результат int[]