public class OmrImage extends Object
Represents an image in a way that is suitable for marks recognition.
| Modifier and Type | Field and Description |
|---|---|
static int |
BUFFER_PIXEL_FORMAT
Pixel format of image data in the buffer
|
static int |
BYTES_PER_PIXEL
Number of bytes per pixel
|
| Constructor and Description |
|---|
OmrImage(int width,
int height,
double dpi,
byte[] pixelData)
Initializes a new instance of the
OmrImage class. |
| Modifier and Type | Method and Description |
|---|---|
BufferedImage |
asBitmap()
Copies pixel data into a
BufferedImage. |
OmrImage |
copy()
Creates a deep copy of the
OmrImage. |
byte[] |
getBuffer()
Gets the pixel data of the
OmrImage object. |
int |
getHeight()
Gets the height, in pixels, of this
OmrImage. |
double |
getResolution()
Gets image DPI resolution
|
int |
getWidth()
Gets the width, in pixels, of this
OmrImage. |
static OmrImage |
load(String fileName)
Loads an image from the specified file name.
|
public static final int BUFFER_PIXEL_FORMAT
Pixel format of image data in the buffer
public static final int BYTES_PER_PIXEL
Number of bytes per pixel
public OmrImage(int width,
int height,
double dpi,
byte[] pixelData)
Initializes a new instance of the OmrImage class.
width - The width, in pixelsheight - The height, in pixels.dpi - The resolution of the image, dots per inch.pixelData - The pixel data of the image.public BufferedImage asBitmap()
Copies pixel data into a BufferedImage.
public OmrImage copy()
Creates a deep copy of the OmrImage.
OmrImage.public byte[] getBuffer()
Gets the pixel data of the OmrImage object.
public int getHeight()
Gets the height, in pixels, of this OmrImage.
public double getResolution()
Gets image DPI resolution
public int getWidth()
Gets the width, in pixels, of this OmrImage.
public static OmrImage load(String fileName) throws IOException
fileName - The file name.IOException - the iO exceptionCopyright © 2014. All rights reserved.