Interpolation enum

Interpolation in is a method used to calculate new pixel values when resizing images. It is used to make sure that the resulting image looks as smooth and natural as possible. Different interpolation methods are available, each with its own trade-offs in terms of quality and computational expense.

Interpolation will only be used if scale is specified.

Inheritance
Available extensions

Values

nearest → const Interpolation

Nearest-neighbor interpolation is a simple method that selects the color of the nearest pixel to the one being calculated. It is fast but produces aliasing and jagged edges. This method is very fast and it's recommended for cases where the resolution doesn't need to be very high or where the performance is critical.

bilinear → const Interpolation

Bilinear interpolation is an extension of nearest-neighbor interpolation that takes the average color of the 4 nearest pixels. It produces better results than nearest-neighbor but it can still produce some jagged edges. This method is faster than bicubic and Lanczos interpolation and it's recommended for cases where the resolution needs to be higher than nearest-neighbor but the performance is still critical.

bicubic → const Interpolation

Bicubic interpolation is a more complex method that takes into account the 16 nearest pixels to the one being calculated. It produces smoother results than bilinear interpolation but it also requires more processing power. This method is slower than bilinear interpolation but faster than Lanczos and spline. It's recommended for cases where the resolution needs to be higher than bilinear and the performance can afford the extra calculation time.

lanczos → const Interpolation

Lanczos interpolation is a high-quality method that uses a Lanczos kernel to calculate the new pixel values. It produces the best results among all interpolation methods but it also requires the most processing power. This method is the slowest one and is recommended for cases where the quality is more important than the performance.

spline → const Interpolation

Spline interpolation is a method that uses a spline function to calculate the new pixel values. It produces good results but it's slower than bicubic interpolation. This method is slower than bicubic and faster than Lanczos interpolation. It's recommended for cases where the quality needs to be higher than bicubic but the performance can't afford Lanczos.

gauss → const Interpolation

Gaussian interpolation is a method that uses a Gaussian kernel to calculate the new pixel values. It's similar to bicubic interpolation but it's not as widely supported. This method is similar in performance and quality to bicubic interpolation, but it's not as widely supported. It's recommended for cases where specific software or libraries are being used that support this method.

sinc → const Interpolation

Sinc interpolation is a method that uses a Sinc kernel to calculate the new pixel values. It's similar to Lanczos interpolation but it's not as widely supported. This method is similar in performance and quality to Lanczos interpolation, but it's not as widely supported. It's recommended for cases where specific software or libraries are being used that support this method.

Properties

hashCode int
The hash code for this object.
no setterinherited
index int
A numeric identifier for the enumerated value.
no setterinherited
name String

Available on Enum, provided by the EnumName extension

The name of the enum value.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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

Constants

values → const List<Interpolation>
A constant List of the values in this enum, in order of their declaration.