CropRegion class

Pixel crop rectangle used by explicit crop-region operations.

Constructors

CropRegion({required int x, required int y, required int width, required int height, required double cornerRadius})
Creates a crop rectangle in source-image pixel coordinates.
const

Properties

cornerRadius → double
Rounded corner radius in source-image pixels.
final
hashCode → int
The hash code for this object.
no setteroverride
hasPositiveSize → bool
Whether width and height describe a non-empty rectangle.
no setter
height → int
Height of the crop rectangle in source-image pixels.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
width → int
Width of the crop rectangle in source-image pixels.
final
x → int
Left edge of the crop rectangle in source-image pixels.
final
y → int
Top edge of the crop rectangle in source-image pixels.
final

Methods

clampToBounds({required int sourceWidth, required int sourceHeight}) → CropRegion
Returns this region clamped to an image of sourceWidth x sourceHeight.
copyWith({int? x, int? y, int? width, int? height, double? cornerRadius}) → CropRegion
Returns a copy with selected values replaced.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toMap() → Map<String, Object?>
Converts this region to the map used by the background processor.
toString() → String
A string representation of this object.
inherited

Operators

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

Static Methods

fromMap(Map<Object?, Object?> map) → CropRegion
Creates a crop region from a map.