Pixel class abstract

Implemented types
Implementers
Available Extensions

Constructors

Pixel()

Properties

a num
Alpha channel.
getter/setter pairinherited
aNormalized num
Normalized [0, 1] alpha.
getter/setter pairinherited
b num
Blue channel.
getter/setter pairinherited
bNormalized num
Normalized [0, 1] blue.
getter/setter pairinherited
current Pixel
The current pixel (this), for using Pixel as an iterator.
no setteroverride
first num
The first element.
no setterinherited
format Format
The Format of the color.
no setterinherited
g num
Green channel.
getter/setter pairinherited
gNormalized num
Normalized [0, 1] green.
getter/setter pairinherited
hashCode int
Calculate the hash code for this pixel.
no setteroverride
hasPalette bool
True if the color uses a palette.
no setterinherited
height int
The height in pixels of the image data this pixel refers to.
no setter
image ImageData
The ImageData this pixel refers to.
no setter
index num
Palette index value (or red channel if there is no palette).
getter/setter pairinherited
isEmpty bool
Whether this collection has no elements.
no setterinherited
isHdrFormat bool
True if the format is high dynamic range.
no setterinherited
isLdrFormat bool
True if the format is low dynamic range.
no setterinherited
isNotEmpty bool
Whether this collection has at least one element.
no setterinherited
isValid bool
True if this points to a valid pixel, otherwise false.
no setter
iterator Iterator<num>
A new Iterator that allows iterating the elements of this Iterable.
no setterinherited
last num
The last element.
no setterinherited
length int
The number of channels used by the color.
no setterinherited
luminance num
The luminance (grayscale) of the color.
no setterinherited
luminanceNormalized num
no setterinherited
maxChannelValue num
The maximum value for a color channel.
no setterinherited
maxIndexValue num
The maximum value for a palette index.
no setterinherited
palette Palette?
The palette used by the color, or null.
no setterinherited
r num
Red channel.
getter/setter pairinherited
rNormalized num
Normalized [0, 1] red.
getter/setter pairinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
single num
Checks that this iterable has only one element, and returns that element.
no setterinherited
width int
The width in pixels of the image data this pixel refers to.
no setter
x int
The x coordinate of the pixel.
no setter
xNormalized num
The normalized x coordinate of the pixel, in the range [0, 1].
no setter
y int
The y coordinate of the pixel.
no setter
yNormalized num
The normalized y coordinate of the pixel, in the range [0, 1].
no setter

Methods

any(bool test(num element)) bool
Checks whether any element of this iterable satisfies test.
inherited
cast<R>() Iterable<R>
A view of this iterable as an iterable of R instances.
inherited
clone() Color
Returns a copy of the color.
inherited
contains(Object? element) bool
Whether the collection contains an element equal to element.
inherited
convert({Format? format, int? numChannels, num? alpha}) Color
Convert the format and/or the numChannels of the color. If numChannels is 4 and the current color does not have an alpha value, then alpha can specify what value to use for the new alpha channel. If alpha is not given, then maxChannelValue will be used.
inherited
elementAt(int index) num
Returns the indexth element.
inherited
every(bool test(num element)) bool
Checks whether every element of this iterable satisfies test.
inherited
expand<T>(Iterable<T> toElements(num element)) Iterable<T>
Expands each element of this Iterable into zero or more elements.
inherited
firstWhere(bool test(num element), {num orElse()?}) num
The first element that satisfies the given predicate test.
inherited
fold<T>(T initialValue, T combine(T previousValue, num element)) → T
Reduces a collection to a single value by iteratively combining each element of the collection with an existing value
inherited
followedBy(Iterable<num> other) Iterable<num>
Creates the lazy concatenation of this iterable and other.
inherited
forEach(void action(num element)) → void
Invokes action on each element of this iterable in iteration order.
inherited
getChannel(Channel channel) num
Get a channel from the color. If the channel isn't available, 0 will be returned.
inherited
getChannelNormalized(Channel channel) num
Get the normalized [0, 1] value of a channel from the color. If the channel isn't available, 0 will be returned.
inherited
join([String separator = ""]) String
Converts each element to a String and concatenates the strings.
inherited
lastWhere(bool test(num element), {num orElse()?}) num
The last element that satisfies the given predicate test.
inherited
map<T>(T toElement(num e)) Iterable<T>
The current elements of this iterable modified by toElement.
inherited
moveNext() bool
Move to the next pixel, returning false if it moved past the end of the image data.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
reduce(num combine(num value, num element)) num
Reduces a collection to a single value by iteratively combining elements of the collection using the provided function.
inherited
set(Color color) → void
The the values of this color to the given color.
inherited
setPosition(int x, int y) → void
Set the coordinates of the pixel.
setPositionNormalized(num x, num y) → void
Set the normalized coordinates of the pixel, in the range [0, 1].
setRgb(num r, num g, num b) → void
Set the individual r, g, b channels of the color.
inherited
setRgba(num r, num g, num b, num a) → void
Set the individual r, g, b, a channels of the color.
inherited
singleWhere(bool test(num element), {num orElse()?}) num
The single element that satisfies test.
inherited
skip(int count) Iterable<num>
Creates an Iterable that provides all but the first count elements.
inherited
skipWhile(bool test(num value)) Iterable<num>
Creates an Iterable that skips leading elements while test is satisfied.
inherited
take(int count) Iterable<num>
Creates a lazy iterable of the count first elements of this iterable.
inherited
takeWhile(bool test(num value)) Iterable<num>
Creates a lazy iterable of the leading elements satisfying test.
inherited
toList({bool growable = true}) List<num>
Creates a List containing the elements of this Iterable.
inherited
toSet() Set<num>
Creates a Set containing the same elements as this iterable.
inherited
toString() String
A string representation of this object.
inherited
where(bool test(num element)) Iterable<num>
Creates a new lazy Iterable with all elements that satisfy the predicate test.
inherited
whereType<T>() Iterable<T>
Creates a new lazy Iterable with all elements that have type T.
inherited

Operators

operator ==(Object other) bool
Tests if this pixel has the same values as the given pixel or color.
override
operator [](int index) num
Gets a channel from the color by its index.
inherited
operator []=(int index, num value) → void
inherited

Static Properties

undefined Pixel
undefined is used to represent an invalid pixel.
no setter