Package org.hildan.ocr
Class ImageHelpersKt
-
- All Implemented Interfaces:
public final class ImageHelpersKt
-
-
Method Summary
Modifier and Type Method Description final static BufferedImagereadImage(Path $self)Reads a BufferedImage from the file at this path. final static BufferedImagereadImage(InputStream $self)Reads a BufferedImage from this input stream. final static BufferedImagegetResourceImage(Class<?> $self, String resourcePath)Reads a BufferedImage from a resource at the given resourcePath relative to this instance's class. final static ByteArraytoByteArray(BufferedImage $self, String format)Converts this BufferedImage to bytes in the given format. -
-
Method Detail
-
readImage
final static BufferedImage readImage(Path $self)
Reads a BufferedImage from the file at this path.
-
readImage
final static BufferedImage readImage(InputStream $self)
Reads a BufferedImage from this input stream.
-
getResourceImage
final static BufferedImage getResourceImage(Class<?> $self, String resourcePath)
Reads a BufferedImage from a resource at the given resourcePath relative to this instance's class.
This is a helper on top of Class.getResourceAsStream. See that method for more information on the resolution.
-
toByteArray
final static ByteArray toByteArray(BufferedImage $self, String format)
Converts this BufferedImage to bytes in the given format.
-
-
-
-