com.aspose.omr

## Class OmrImage

- java.lang.Object
- - com.aspose.omr.OmrImage

-     public class OmrImage
      extends Object

  Represents an image in a way that is suitable for marks recognition.

- - ### Field Summary

    Fields
    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 Summary

    Constructors
    Constructor and Description
    `OmrImage(int width, int height, double dpi, byte[] pixelData)` Initializes a new instance of the `OmrImage` class.

  - ### Method Summary

    Methods
    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.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### BUFFER_PIXEL_FORMAT

          public static final int BUFFER_PIXEL_FORMAT

      Pixel format of image data in the buffer

      See Also:
        Constant Field Values

    - #### BYTES_PER_PIXEL

          public static final int BYTES_PER_PIXEL

      Number of bytes per pixel

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### OmrImage

          public OmrImage(int width,
                  int height,
                  double dpi,
                  byte[] pixelData)

      Initializes a new instance of the `OmrImage` class.

      Parameters:
        `width` - The width, in pixels
        `height` - The height, in pixels.
        `dpi` - The resolution of the image, dots per inch.
        `pixelData` - The pixel data of the image.

  - ### Method Detail

    - #### asBitmap

          public BufferedImage asBitmap()

      Copies pixel data into a `BufferedImage`.

      Returns:
        A new BufferedImage.

    - #### copy

          public OmrImage copy()

      Creates a deep copy of the `OmrImage`.

      Returns:
        a deep copy of the `OmrImage`.

    - #### getBuffer

          public byte[] getBuffer()

      Gets the pixel data of the `OmrImage` object.

      Returns:
        the array of image pixels

    - #### getHeight

          public int getHeight()

      Gets the height, in pixels, of this `OmrImage`.

      Returns:
        height of this image

    - #### getResolution

          public double getResolution()

      Gets image DPI resolution

      Returns:
        resolution of this image

    - #### getWidth

          public int getWidth()

      Gets the width, in pixels, of this `OmrImage`.

      Returns:
        width of this image

    - #### load

          public static OmrImage load(String fileName)
                               throws IOException

      Loads an image from the specified file name.
      Parameters:
        `fileName` - The file name.
      Returns:
        An instance of that represents the image.
      Throws:
        `IOException` - the iO exception

Copyright © 2014. All rights reserved.