Pixels<T> class abstract final Buffers Blending

A 2-dimensional buffer of pixel data in memory.

Pixels is a concrete representation of pixel data in memory, and is a lightweight wrapper around the raw bytes represented by a TypedDataList; but cannot be extended or implemented (similar to TypedDataList).

In most cases either IntPixels or Float32x4Pixels will be used directly.

Mixed in types
Implementers

Properties

bounds Rect
Returns the buffer as a bounding rectangle.
no setterinherited
data Iterable<T>
Pixel data in the buffer.
no setterinherited
format PixelFormat<T, void>
Format of the pixel data in the buffer.
final
hashCode int
The hash code for this object.
no setterinherited
height int
Height of the buffer in pixels.
final
length int
Length of the buffer in pixels.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
width int
Width of the buffer in pixels.
final

Methods

blit<S>(Buffer<S> from, {Rect? source, Pos? target, BlendMode blend = BlendMode.srcOver}) → void
Blits, or copies with blending, the pixel data from a source buffer to this buffer.
blitUnsafe<S>(Buffer<S> from, {Rect? source, Pos? target, BlendMode blend = BlendMode.srcOver}) → void
Blits, or copies with blending, the pixel data from a source buffer to this buffer.
clear([Rect? target]) → void
Clears the buffer to the PixelFormat.zero value.
clearUnsafe([Rect? target]) → void
Clears the buffer to the PixelFormat.zero value.
compare(Buffer<T> other, {double epsilon = 1e-10}) ComparisonResult<T>
Compares the buffer to another buffer and returns the result.
inherited
contains(Pos pos) bool
Returns whether the given position is within the bounds of the buffer.
inherited
copyFrom(Buffer<T> from, {Rect? source, Pos? target}) → void
Copies the pixel data from a source buffer to this buffer.
copyFromUnsafe(Buffer<T> from, {Rect? source, Pos? target}) → void
Copies the pixel data from a source buffer to this buffer.
fill(T pixel, [Rect? target]) → void
Fill the buffer with the given pixel.
fillFrom(Iterable<T> pixels, [Rect? target]) → void
Fill the buffer with the given pixels.
fillFromUnsafe(Iterable<T> pixels, [Rect? target]) → void
Fill the buffer with the given pixels.
fillUnsafe(T pixel, [Rect? target]) → void
Fill the buffer with the given pixel.
get(Pos pos) → T
Returns the pixel at the given position.
inherited
getRect(Rect rect) Iterable<T>
Returns a lazy iterable of pixels in the rectangle defined by rect.
inherited
getRectUnsafe(Rect rect) Iterable<T>
Returns a lazy iterable of pixels in the rectangle defined by rect.
inherited
getUnsafe(Pos pos) → T
Returns the pixel at the given position without bounds checking.
inherited
map(T convert(T)) Buffer<T>
Returns a lazy buffer buffer that converts pixels with the given function.
inherited
mapConvert<R>(PixelFormat<R, void> format) Buffer<R>
Returns a lazy buffer that converts pixels to the given format.
inherited
mapIndexed(T convert(Pos, T)) Buffer<T>
Returns a lazy buffer that converts pixels with the given function.
inherited
mapRect(Rect bounds) Buffer<T>
Returns a lazy buffer that clips the buffer to the given bounds.
inherited
mapScaled(int scale) Buffer<T>
Returns a lazy buffer that scales the buffer by the given factor.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
set(Pos pos, T pixel) → void
Sets the pixel at the given position.
setUnsafe(Pos pos, T pixel) → void
Sets the pixel at the given position without bounds checking.
toString() String
A string representation of this object.
inherited

Operators

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