Returns the ARGB components for all pixels in this image
Returns the ARGB components for all pixels in this image
an array containing ARGB components in that order.
Returns the ARGB components for the pixel at the given coordinates
Returns the ARGB components for the pixel at the given coordinates
the x coordinate of the pixel component to grab
the y coordinate of the pixel component to grab
an array containing ARGB components in that order.
The centre coordinates for the image as an (x, y) tuple.
the pixels for the column identified by the x co-ordinate. 0 indexed.
Returns the color at the given coordinates.
Returns the color at the given coordinates.
the RGBColor value at the coords
Returns a set of the distinct colours used in this image.
Returns a set of the distinct colours used in this image.
the set of distinct Colors
Returns true if a pixel with the given color exists
Returns true if a pixel with the given color exists
the pixel colour to look for.
true if there exists at least one pixel that has the given pixels color
Counts the number of pixels that are true for the given predicate
Counts the number of pixels that are true for the given predicate
a predicate
the number of pixels that evaluated true
Counts the number of pixels with the given colour.
Counts the number of pixels with the given colour.
the colour to detect.
the number of pixels that matched the colour of the given pixel
Returns the number of pixels in the image.
Returns the number of pixels in the image.
the number of pixels
A tuple of the (width, height)
Returns a new AWT BufferedImage with the same dimensions and same AWT type.
Returns a new AWT BufferedImage with the same dimensions and same AWT type. The data is uninitialized.
Returns true if the predicate is true for at least one pixel on the image.
Returns true if the predicate is true for at least one pixel on the image.
a predicate
true if p holds for at least one pixel
Returns a new AWT Image scaled using nearest-neighbour.
Returns a new AWT Image scaled using nearest-neighbour.
Returns true if the predicate is true for all pixels in the image.
Returns true if the predicate is true for all pixels in the image.
a predicate function that accepts 3 parameters - the x,y coordinate and the pixel at that coordinate
true if f holds for at least one pixel
Executes the given side effecting function on each pixel.
Executes the given side effecting function on each pixel.
a function that accepts 3 parameters - the x,y coordinate and the pixel at that coordinate
Returns the pixels of the image as an iterator.
Returns the pixels of the image as an iterator. The iterator is the most efficient way to lazily iterator over the pixels as the pixels will only be fetched from the raster as needed.
the iterator
Returns all the patches of a given size in the image, assuming pixel alignment (no subpixel extraction).
Returns all the patches of a given size in the image, assuming pixel alignment (no subpixel extraction).
The patches are returned as a sequence of pixel matrices closures
Returns the pixel at the given coordinate.
Returns the pixel at the given coordinate.
the pixel as an integer tuple
the pixel
Returns the pixel at the given coordinates.
Returns the pixel at the given coordinates.
the x coordinate of the pixel to grab
the y coordinate of the pixel to grab
the Pixel at the location
Returns a rectangular region within the given boundaries as a single dimensional array of integers.
Returns a rectangular region within the given boundaries as a single dimensional array of integers.
Eg, pixels(10, 10, 30, 20) would result in an array of size 600 with the first row of the region in indexes 0,..,29, second row 30,..,59 etc.
the start x coordinate
the start y coordinate
the width of the region
the height of the region
an Array of pixels for the region
Returns all the pixels for the image
Returns all the pixels for the image
an array of pixels for this image
The radius of the image defined as the centre to the corners.
Returns the aspect ratio for this image.
Returns a new AWT Image rotated with the given angle (in degrees)
Returns a new AWT Image rotated with the given angle (in degrees)
the pixels in the row identified by the y coordinate. 0 indexed.
Uses linear interpolation to get a sub-pixel.
Uses linear interpolation to get a sub-pixel.
Legal values for x
and y
are in [0, width) and [0, height),
respectively.
Returns a new AWT BufferedImage from this image.
Returns a new AWT BufferedImage from this image.
the type of buffered image to create, if not specified then defaults to the current image type
a new, non-shared, BufferedImage with the same data as this Image.
Read only operations on a BufferedImage. You can think of this as a pimped-immutable-BufferedImage. None of the operations in this class will mutate the underlying awt buffer.