BufferImage class

An image object, pixel data stored in a Uint8List

Inheritance

Constructors

BufferImage(dynamic width, dynamic height)
create BufferImage with specified with and height
BufferImage.raw(Uint8List data, {required int width, required int height})

Properties

buffer Uint8List
the color data of this image
no setter
bytePerPixel int
no setteroverride
hashCode int
The hash code for this object.
no setterinherited
height int
no setteroverride
pixels List<int>
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
width int
no setteroverride

Methods

clip(int newWidth, int newHeight, [int offsetX = 0, int offsetY = 0]) → void
Clip the image to newWidth & newHeight from Offset(offsetX, offsetY)
override
clipPath(Path path, {bool doAntiAlias = true}) Future<void>
Clip this image with path, use a Canvas render
copy() BufferImage
A copy of this BufferImage
override
drawIcon(IconData icon, double size, Offset offset, Color color, [BlendMode mode = BlendMode.srcOver]) Future<void>
drawImage(BufferImage image, Offset offset, [BlendMode mode = BlendMode.srcOver]) → void
Draw the image on this image at offset, use the mode
drawPath(Path path, Color color, {BlendMode mode = BlendMode.srcOver, PaintingStyle style = PaintingStyle.fill, double strokeWidth = 0}) Future<void>
Draw the path on this image, use a Canvas render
drawRect(Rect rect, Color color, [BlendMode mode = BlendMode.srcOver]) → void
Draw a rect on this image with color, use the mode
override
drawText(String text, TextStyle style, Offset offset, [BlendMode mode = BlendMode.srcOver]) Future<void>
getChannel(int x, int y, [ImageChannel? channel]) int
override
getChannelSafe(int x, int y, [int? defaultValue, ImageChannel? channel]) int
override
getColor(int x, int y) Color
get the Color at Offset(x, y)
override
getColorSafe(int x, int y, [Color? defaultColor = const Color(0x00ffffff)]) Color
get the Color at Offset(x, y) with out error
override
getImage() Future<Image>
Get the Image Object from this image
getOffset(int x, int y) int
inherited
inverse() → void
inverse phase
override
mask(Color color, [BlendMode mode = BlendMode.color]) → void
Mask the image with color use mode(see BlendMode)
maskImage(BufferImage image, [BlendMode mode = BlendMode.color, Point<int>? offset, int repeat = RepeatMode.repeatAll]) → void
Mask the image with another image use mode(see BlendMode)
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
resize(double ratio, [SampleMode sample = SampleMode.nearest]) → void
scale by ratio width sample
override
resizeTo(int newWidth, int newHeight, [SampleMode sample = SampleMode.nearest]) → void
scale to specified size (newWidth and newHeight) with sample
override
rotate(double radian, {bool isAntialias = true, SampleMode sample = SampleMode.bilinear, Color bgColor = const Color.fromARGB(0, 255, 255, 255), bool isClip = false}) → void
Rotate image by the specified radian, The blank area is filled with the specified bgColor If isClip, hold the old width & height (clip the image data out of canvas) Else adjust the canvas to fit the rotated image isAntialias not implemented
override
scaleDown(double scale) → void
zoom out an image. calc the avg channels of the colors in area as the new color
override
setChannel(int x, int y, int value, [ImageChannel? channel]) → void
override
setChannelSafe(int x, int y, int value, [ImageChannel? channel]) → void
override
setColor(int x, int y, Color color) → void
set the Color at Offset(x, y)
override
setColorSafe(int x, int y, Color color) → void
set Color at Offset(x, y) without error
override
toGray([GrayScale? grayScale]) GrayImage
toString() String
A string representation of this object.
inherited

Operators

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

Static Methods

fromFile(Uint8List fileData) Future<BufferImage?>
load image from a image fileData use system codec(decodeImageFromList)
fromGray(GrayImage grayImage) BufferImage
fromImage(Image image) Future<BufferImage>
load data from an Image