Rgba<P, C> class
abstract
final
Pixel Formats
Base API for pixel formats that have red, green, blue, and alpha channels.
Additional RGBA-specific methods are provided:
- copyWith and copyWithNormalized for replacing channel values;
- maxRed, maxGreen, maxBlue, and maxAlpha for the maximum channel values;
- black, white, red, green, blue, yellow, cyan, and magenta for common colors.
In addition, fromFloatRgba is implemented using copyWithNormalized.
Properties
- black → P
-
Black color with full transparency.
no setteroverride
- blue → P
-
Blue color with full transparency.
no setterinherited
- bytesPerPixel → int
-
Number of bytes required to store a single pixel in memory.
no setterinherited
- cyan → P
-
Cyan color with full transparency.
no setterinherited
- green → P
-
Green color with full transparency.
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- magenta → P
-
Magenta color with full transparency.
no setterinherited
- max → P
-
The maximum value for the pixel format.
no setterinherited
- maxAlpha → C
-
The maximum value for the alpha channel.
no setter
- maxBlue → C
-
The maximum value for the blue channel.
no setterinherited
- maxGreen → C
-
The maximum value for the green channel.
no setterinherited
- maxRed → C
-
The maximum value for the red channel.
no setterinherited
- minAlpha → C
-
The minimum value for the alpha channel.
no setter
- minBlue → C
-
The minimum value for the blue channel.
no setterinherited
- minGreen → C
-
The minimum value for the green channel.
no setterinherited
- minRed → C
-
The minimum value for the red channel.
no setterinherited
- name → String
-
Human-readable name or description of the pixel format.
no setterinherited
- red → P
-
Red color with full transparency.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- white → P
-
White color with full transparency.
no setterinherited
- yellow → P
-
Yellow color with full transparency.
no setterinherited
- zero → P
-
The zero, or minimum, value for the pixel format.
no setterinherited
Methods
-
clamp(
P pixel) → P -
Clamps a
pixel
to the valid range of values for the pixel format.inherited -
compare(
P a, P b) → double -
Compares two pixels in the pixel format.
inherited
-
convert<
R> (R pixel, {required PixelFormat< R, void> from}) → P -
Converts a pixel
from
one another format tothis
format.inherited -
copyWith(
P pixel, {C? red, C? green, C? blue, C? alpha}) → P -
Returns a copy of the
pixel
.override -
copyWithNormalized(
P pixel, {double? red, double? green, double? blue, double? alpha}) → P -
Returns a copy of the
pixel
with normalized values.override -
create(
{C? red, C? green, C? blue, C? alpha}) → P -
Creates a new pixel with the given channel values.
override
-
createNormalized(
{double red = 0.0, double green = 0.0, double blue = 0.0, double alpha = 1.0}) → P -
Creates a new pixel with the given channel values normalized to the range
[0.0, 1.0]
.override -
describe(
P pixel) → String -
Returns a human-readable description of the pixel.
inherited
-
distance(
P a, P b) → double -
Returns the distance between two pixels in the pixel format.
inherited
-
fromAbgr8888(
int pixel) → P -
Converts a pixel in the abgr8888 pixel format to
this
pixel format.inherited -
fromFloatRgba(
Float32x4 pixel) → P -
Converts a pixel in the floatRgba pixel format to
this
pixel format.override -
getAlpha(
P pixel) → C -
Returns the alpha channel value of the
pixel
. -
getBlue(
P pixel) → C -
Returns the blue channel value of the
pixel
.inherited -
getGreen(
P pixel) → C -
Returns the green channel value of the
pixel
.inherited -
getRed(
P pixel) → C -
Returns the red channel value of the
pixel
.inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toAbgr8888(
P pixel) → int -
Converts a pixel in
this
pixel format to the abgr8888 pixel format.inherited -
toFloatRgba(
P pixel) → Float32x4 -
Converts a pixel in
this
pixel format to the floatRgba pixel format.inherited -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited