public class ImageUtils
extends java.lang.Object
Constructor and Description |
---|
ImageUtils() |
Modifier and Type | Method and Description |
---|---|
static java.awt.image.BufferedImage |
createBWImage(int width,
int height,
boolean zeroBlack)
Create new BW image.
|
static java.awt.image.BufferedImage |
createBWImage(int width,
int height,
boolean zeroBlack,
byte[] backed)
Create new BW image backed by existing data.
|
static java.awt.image.BufferedImage |
createBWImage(int width,
int height,
int stride,
boolean zeroBlack)
Create new BW image.
|
static java.awt.image.BufferedImage |
createBWImage(int width,
int height,
int stride,
boolean zeroBlack,
byte[] backed)
Create new BW image backed by existing data.
|
static java.awt.image.BufferedImage |
createXRGBImage(int w,
int h)
Create new ev3dev-compatible XRGB image.
|
static java.awt.image.BufferedImage |
createXRGBImage(int w,
int h,
int stride)
Create new XRGB image.
|
static java.awt.image.BufferedImage |
createXRGBImage(int width,
int height,
int stride,
byte[] buffer)
Create new XRGB image.
|
static java.awt.image.BufferedImage |
createXRGBImage(int width,
int height,
int stride,
int[] offsets,
byte[] buffer)
Create new XRGB image.
|
static int[] |
getDefaultComponentOffsets()
Get default XRGB component offsets.
|
static byte[] |
getImageBytes(java.awt.image.BufferedImage image)
Convert image to the underlying byte buffer.
|
public static java.awt.image.BufferedImage createXRGBImage(int w, int h)
w
- Image widthh
- Image heightpublic static java.awt.image.BufferedImage createXRGBImage(int w, int h, int stride)
w
- Image widthh
- Image heightstride
- Image scanline stride, i.e. how long the row is in bytes.public static java.awt.image.BufferedImage createXRGBImage(int width, int height, int stride, byte[] buffer)
width
- Image widthheight
- Image heightstride
- Image scanline stride, i.e. how long the row is in bytes.buffer
- Backing buffer.public static java.awt.image.BufferedImage createXRGBImage(int width, int height, int stride, int[] offsets, byte[] buffer)
width
- Image widthheight
- Image heightstride
- Image scanline stride, i.e. how long the row is in bytes.offsets
- Array of size 4 describing the offsets of color bands: { R, G, B, A }buffer
- Backing buffer.public static int[] getDefaultComponentOffsets()
public static java.awt.image.BufferedImage createBWImage(int width, int height, boolean zeroBlack)
width
- Image width.height
- Image height.zeroBlack
- Whether black color is represented by the 0 bit value.public static java.awt.image.BufferedImage createBWImage(int width, int height, boolean zeroBlack, byte[] backed)
width
- Image width.height
- Image height.zeroBlack
- Whether black color is represented by the 0 bit value.backed
- Backing byte buffer.public static java.awt.image.BufferedImage createBWImage(int width, int height, int stride, boolean zeroBlack)
width
- Image width.height
- Image height.stride
- Image scanline stride, i.e. how long the row is in bytes.zeroBlack
- Whether black color is represented by the 0 bit value.public static java.awt.image.BufferedImage createBWImage(int width, int height, int stride, boolean zeroBlack, byte[] backed)
width
- Image width.height
- Image height.stride
- Image scanline stride, i.e. how long the row is in bytes.zeroBlack
- Whether black color is represented by the 0 bit value.backed
- Backing byte buffer.public static byte[] getImageBytes(java.awt.image.BufferedImage image)
image
- Configured BufferedImage.