ImageUtils
final class ImageUtils
Package: dev.joid.lib.utils.image · Module: core · Source: ImageUtils.java
Decodes an image with a chosen reader and prepares pixels with transparent areas for filtering.
Description
Section titled “Description”The image decoders of JOID use it; a decoder of your own can too.
Learn more
Section titled “Learn more”Methods
Section titled “Methods”| Returns | Signature | Summary |
|---|---|---|
BufferedImage | read(InputStream stream, ImageReaderSpi spi) static | Decodes the first image of stream with the ImageIO reader of spi. |
void | bleedAlpha(int[] pixels, int width, int height) static | Gives each fully transparent pixel of pixels (ARGB, width × height, row after row) the color of the nearest pixel that is not, and keeps its alpha at 0. |
Method details
Section titled “Method details”BufferedImage read(InputStream stream, ImageReaderSpi spi) static
Decodes the first image of stream with the ImageIO reader of spi.
Throws an IOException when the stream cannot be read or decoded.
bleedAlpha
Section titled “bleedAlpha”void bleedAlpha(int[] pixels, int width, int height) static
Gives each fully transparent pixel of pixels (ARGB, width × height, row after row) the color of the nearest pixel that is not, and keeps its alpha at 0.
A filtered texture then shows no dark fringe around its transparent areas; an image fully opaque or fully transparent stays unchanged.
fluent returns the instance, typed for chaining · factory creates an instance · signal also accepts a value that follows signals, as a signal, an expression or a lambda (When does JOID compute this value again?) · hook called by JOID, override it · abstract you implement it · default interface method with a body · static called on the class · protected visible to subclasses
