Properties
bitsPerChannel
→ int
The number of bits per color channel. Can be 1, 2, 4, 8, 16, 32, or 64.
no setter
buffer
→ ByteBuffer
The ByteBuffer storage of the image.
no setter
first
→ Pixel
The first element.
no setter inherited
format
→ Format
The channel Format of the image.
no setter
formatType
→ FormatType
Whether th image has uint, int, or float data.
no setter
hashCode
→ int
The hash code for this object.
no setter inherited
hasPalette
→ bool
True if the image has a palette. If the image has a palette, then the
image data has 1 channel for the palette index of the pixel.
no setter
height
→ int
final
isEmpty
→ bool
Whether this collection has no elements.
no setter inherited
isHdrFormat
→ bool
True if the image format is "high dynamic range." HDR formats include:
float16, float32, float64, int8, int16, and int32.
no setter
isLdrFormat
→ bool
True if the image format is "low dynamic range." LDR formats include:
uint1, uint2, uint4, and uint8.
no setter
isNotEmpty
→ bool
Whether this collection has at least one element.
no setter inherited
iterator
→ Iterator <Pixel >
A new Iterator
that allows iterating the elements of this Iterable
.
no setter inherited
last
→ Pixel
The last element.
no setter inherited
length
→ int
The size of the image data in bytes.
no setter override
lengthInBytes
→ int
The size of the image data in bytes
no setter
maxChannelValue
→ num
The maximum value of a pixel channel, based on the format of the image.
If the image has a palette , this will be the maximum value of a palette
color channel. Float format images will have a maxChannelValue of 1.0,
though they can have values above that.
no setter
maxIndexValue
→ num
The maximum value of a palette index, based on the format of the image.
This differs from maxChannelValue in that it will not be affected by
the format of the palette .
no setter
numChannels
→ int
final
palette
↔ Palette ?
The Palette of the image, or null if the image does not have one.
getter/setter pair
rowStride
→ int
The size, in bytes, of a row if pixels in the data.
no setter
runtimeType
→ Type
A representation of the runtime type of the object.
no setter inherited
single
→ Pixel
Checks that this iterable has only one element, and returns that element.
no setter inherited
width
→ int
final
Methods
any (bool test (Pixel 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
clear ([Color ? c ])
→ void
Set all of the pixels to the Color c
, or all values to 0 if c
is not
given.
clone ({bool noPixels = false })
→ ImageData
contains (Object ? element )
→ bool
Whether the collection contains an element equal to element
.
inherited
elementAt (int index )
→ Pixel
Returns the index
th element.
inherited
every (bool test (Pixel element ) )
→ bool
Checks whether every element of this iterable satisfies test
.
inherited
expand <T > (Iterable <T > toElements (Pixel element ) )
→ Iterable <T >
Expands each element of this Iterable into zero or more elements.
inherited
firstWhere (bool test (Pixel element ), {Pixel orElse ()? })
→ Pixel
The first element that satisfies the given predicate test
.
inherited
fold <T > (T initialValue , T combine (T previousValue , Pixel element ) )
→ T
Reduces a collection to a single value by iteratively combining each
element of the collection with an existing value
inherited
followedBy (Iterable <Pixel > other )
→ Iterable <Pixel >
Creates the lazy concatenation of this iterable and other
.
inherited
forEach (void action (Pixel element ) )
→ void
Invokes action
on each element of this iterable in iteration order.
inherited
getBytes ({ChannelOrder ? order , bool inPlace = false })
→ Uint8List
Similar to toUint8List, but will convert the channels of the image pixels
to the given order
. If that happens, the returned bytes will be a copy
and not a direct view of the image data.
getColor (num r , num g , num b , [num ? a ])
→ Color
Create a Color object with the format and number of channels of the
image.
getPixel (int x , int y , [Pixel ? pixel ])
→ Pixel
Return the Pixel at the given coordinates. If pixel
is provided,
it will be updated and returned rather than allocating a new Pixel .
getRange (int x , int y , int width , int height )
→ Iterator <Pixel >
Returns a pixel iterator for iterating over a rectangular range of pixels
in the image.
join ([String separator = "" ])
→ String
Converts each element to a String and concatenates the strings.
inherited
lastWhere (bool test (Pixel element ), {Pixel orElse ()? })
→ Pixel
The last element that satisfies the given predicate test
.
inherited
map <T > (T toElement (Pixel e ) )
→ Iterable <T >
The current elements of this iterable modified by toElement
.
inherited
noSuchMethod (Invocation invocation )
→ dynamic
Invoked when a nonexistent method or property is accessed.
inherited
reduce (Pixel combine (Pixel value , Pixel element ) )
→ Pixel
Reduces a collection to a single value by iteratively combining elements
of the collection using the provided function.
inherited
setPixel (int x , int y , Color c )
→ void
Set the color of the pixel at the given coordinates to the color of the
given Color c
.
setPixelR (int x , int y , num i )
→ void
Set the red channel of the pixel, or the index value for palette images.
setPixelRgb (int x , int y , num r , num g , num b )
→ void
Set the color of the Pixel at the given coordinates to the given
color values r
, g
, b
.
setPixelRgba (int x , int y , num r , num g , num b , num a )
→ void
Set the color of the Pixel at the given coordinates to the given
color values r
, g
, b
, and a
.
setPixelRgbaSafe (int x , int y , num r , num g , num b , num a )
→ void
Calls setPixelRgba, but ensures x
and y
are within the extents
of the image, otherwise it returns without setting the pixel.
setPixelRgbSafe (int x , int y , num r , num g , num b )
→ void
Calls setPixelRgb, but ensures x
and y
are within the extents
of the image, otherwise it returns without setting the pixel.
singleWhere (bool test (Pixel element ), {Pixel orElse ()? })
→ Pixel
The single element that satisfies test
.
inherited
skip (int count )
→ Iterable <Pixel >
Creates an Iterable that provides all but the first count
elements.
inherited
skipWhile (bool test (Pixel value ) )
→ Iterable <Pixel >
Creates an Iterable
that skips leading elements while test
is satisfied.
inherited
take (int count )
→ Iterable <Pixel >
Creates a lazy iterable of the count
first elements of this iterable.
inherited
takeWhile (bool test (Pixel value ) )
→ Iterable <Pixel >
Creates a lazy iterable of the leading elements satisfying test
.
inherited
toList ({bool growable = true })
→ List <Pixel >
Creates a List containing the elements of this Iterable .
inherited
toSet ()
→ Set <Pixel >
Creates a Set containing the same elements as this iterable.
inherited
toString ()
→ String
Returns a string representation of (some of) the elements of this
.
inherited
toUint8List ()
→ Uint8List
The storage data of the image.
where (bool test (Pixel element ) )
→ Iterable <Pixel >
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