PixelBuffer class final

Raw pixels to read barcodes from: a video frame, a frame from another camera plugin, a rendered widget, a decoded image.

// Y plane of a YUV camera frame:
PixelBuffer(plane.bytes, width: w, height: h, rowStride: plane.bytesPerRow)

// A dart:ui image:
final rgba = await image.toByteData(format: ui.ImageByteFormat.rawRgba);
PixelBuffer(rgba!.buffer.asUint8List(), width: image.width, height: image.height, layout: PixelLayout.rgba)
Annotations

Constructors

PixelBuffer(Uint8List bytes, {required int width, required int height, PixelLayout layout = PixelLayout.luminance, int? rowStride, Rect? crop})
Wraps bytes (not copied until sent to the engine).
const

Properties

bytes → Uint8List
The pixel data.
final
crop → Rect?
Only search this region, in pixels. Positions in the result are still relative to the whole buffer. The part outside the image is left out: a region outside the image, or an empty one, finds nothing.
final
hashCode → int
The hash code for this object.
no setterinherited
height → int
Height in pixels.
final
layout → PixelLayout
Byte layout of one pixel.
final
rowStride → int?
Bytes per row, if rows are padded. Defaults to width * bytesPerPixel.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
width → int
Width in pixels.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited