ImageDataUint1 class

Inheritance
Available Extensions

Constructors

ImageDataUint1(int width, int height, int numChannels)
ImageDataUint1.from(ImageDataUint1 other, {bool skipPixels = false})
ImageDataUint1.palette(int width, int height, Palette? palette)

Properties

bitsPerChannel int
The number of bits per color channel. Can be 1, 2, 4, 8, 16, 32, or 64.
no setteroverride
buffer ByteBuffer
The ByteBuffer storage of the image.
no setteroverride
data Uint8List
latefinal
first Pixel
The first element.
no setterinherited
format Format
The channel Format of the image.
no setteroverride
formatType FormatType
Whether th image has uint, int, or float data.
no setteroverride
hashCode int
The hash code for this object.
no setterinherited
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 setterinherited
height int
finalinherited
isEmpty bool
Whether this collection has no elements.
no setterinherited
isHdrFormat bool
True if the image format is "high dynamic range." HDR formats include: float16, float32, float64, int8, int16, and int32.
no setteroverride
isLdrFormat bool
True if the image format is "low dynamic range." LDR formats include: uint1, uint2, uint4, and uint8.
no setterinherited
isNotEmpty bool
Whether this collection has at least one element.
no setterinherited
iterator PixelUint1
A new Iterator that allows iterating the elements of this Iterable.
no setteroverride
last Pixel
The last element.
no setterinherited
length int
The size of the image data in bytes.
no setteroverride
lengthInBytes int
The size of the image data in bytes
no setteroverride
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 setteroverride
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 setteroverride
numChannels int
finalinherited
palette Palette?
The Palette of the image, or null if the image does not have one.
getter/setter pairoverride
rowStride int
The size, in bytes, of a row if pixels in the data.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
single Pixel
Checks that this iterable has only one element, and returns that element.
no setterinherited
width int
finalinherited

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.
override
clone({bool noPixels = false}) ImageDataUint1
override
contains(Object? element) bool
Whether the collection contains an element equal to element.
inherited
elementAt(int index) Pixel
Returns the indexth 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.
inherited
getColor(num r, num g, num b, [num? a]) Color
Create a Color object with the format and number of channels of the image.
override
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.
override
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.
override
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.
inherited
setPixelR(int x, int y, num i) → void
Set the red channel of the pixel, or the index value for palette images.
override
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.
override
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.
override
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.
inherited
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.
inherited
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.
override
toUint8List() Uint8List
The storage data of the image.
inherited
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

Operators

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