Pixels class final
An image's pixels: width × height RGBA, 8 bits a channel, alpha not multiplied in, rows top to bottom.
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- height → int
-
The image's size, in pixels.
final
- rgba → Uint8List
-
The pixels, four bytes each — red, green, blue, alpha — row by row
from the top left.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- width → int
-
The image's size, in pixels.
final
Methods
-
at(
int x, int y, int c) → int -
The channel
c(0 red … 3 alpha) atx,y. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
png(
) → Future< Uint8List> - These pixels as a PNG file's bytes.
-
toString(
) → String -
A string representation of this object.
inherited
-
writePng(
String path) → Future< void> -
Writes these pixels to
pathas a PNG file, whole or not at all (its folder made when missing).
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
decode(
Uint8List bytes, {int? width, int? height}) → Future< Pixels> -
bytes(PNG, JPEG, …) decoded, scaled towidth×heightwhen given. -
read(
String path, {int? width, int? height}) → Future< Pixels> -
The image file at
path, its pixels — scaled towidth×heightwhen given. Throws when it can't be read as an image. -
sizeOf(
String path) → Future< (int, int)> -
How big the image file at
pathis, without decoding all of it.