PImage class

An image in Processing.

PImage provides APIs for accessing and altering bitmap data.

Use toFlutterImage to obtain a dart:ui Image to draw with Flutter.

Constructors

PImage.empty(int width, int height, ImageFileFormat format)
PImage.fromPixels(int width, int height, ByteData pixels, ImageFileFormat format)

Properties

format ImageFileFormat
no setter
hashCode int
The hash code for this object.
no setterinherited
height int
no setter
pixels ByteData
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
width int
no setter

Methods

blend(PImage other, {required Rect sourceRect, required Rect destRect, required SketchBlendMode mode}) → void
Blends pixels from the other image into this PImage, using the given blend mode.
copy([Rect? rect]) PImage
Copies and returns all, or part of, this PImage.
copyFrom({PImage? source, required Rect sourceRect, required Rect destRect}) → void
Copies pixels into this PImage from the given source, or replicates a region of this PImage within itself if no source is provided.
filter(ImageFilter filter, [double? value]) → void
get(int x, int y) Color
Returns the ARGB color of the pixel at the given (x, y).
getRegion({required int x, required int y, required int width, required int height}) Future<PImage>
Creates a returns a new PImage that replicates a region of this PImage, defined by the given (x,y) origin and the given width and height.
loadPixels() Future<void>
Loads this image's pixels into an pixel in-memory buffer.
mask({PImage? maskImage, List<int>? maskPixels}) → void
Masks this PImage with the given maskImage or the given maskPixels.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
resize({int? width, int? height}) → void
Resizes this PImage to the given width and height.
save(String filePath) Future<void>
Saves this PImage to a file at the given filePath.
set(int x, int y, Color color) → void
Sets the ARGB color of the pixel at the given (x,y).
setRegion({required PImage image, int x = 0, int y = 0}) → void
Copies the given image into this PImage at the given (x,y).
toFlutterImage() Future<Image>
Returns a dart:io Image version of this PImage so that it can be drawn with Flutter.
toString() String
A string representation of this object.
inherited
updatePixels() Future<void>
Applies all recent operations to the in-memory pixel buffer.

Operators

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

Static Methods

blendColor(Color c1, Color c2, SketchBlendMode mode) Color