public class

Image

extends Object
java.lang.Object
   ↳ casmi.image.Image

Class Overview

Image class. Wrap javax.imageio.ImageIO and make it easy to use.

Summary

Fields
protected final int height
protected ImageMode mode
protected Texture texture
protected final int width
Public Constructors
Image(int width, int height)
Creates a new Image object using width and height.
Image(String path)
Creates a new Image object using the Image path.
Image(URL url)
Creates a new Image object using the Image url.
Image(BufferedImage image)
Creates a new Image object using BufferedImage.
Public Methods
static Image clone(Image image)
Returns the clone of the input image.
BufferedImage copyImage(BufferedImage image)
Copies a Image object using BuffedImage.
void disableTexture(GL2 gl)
Makes texture not to be used.
void enableTexture(GL2 gl)
Makes texture to be used.
final double getAlpha(int x, int y)
Returns the alpha value of the pixel data in this Image.
final double getBlue(int x, int y)
Returns the blue color value of the pixel data in this Image.
final Color getColor(int x, int y)
Returns the pixel color of this Image.
final double getGray(int x, int y)
Returns the gray-scale value of the pixel data in this Image.
final double getGreen(int x, int y)
Returns the green color value of the pixel data in this Image.
final int getHeight()
Returns the height of this Image.
BufferedImage getImg()
final ImageMode getMode()
Returns ImageMode of this Image.
final double getRed(int x, int y)
Returns the red color value of the pixel data in this Image.
final Texture getTexture()
Returns Texture binded this Image
final int getWidth()
Returns the width of this Image.
void imageMode(ImageMode mode)
Sets the ImageMode of this Image.
final void loadTexture()
Loads a texture using image data.
final void reloadTexture(GL2 gl)
final void setA(double alpha, int x, int y)
Sets the alpha value of the pixel data in this Image.
final void setColor(Color color, int x, int y)
Sets the color value of the pixel data in this Image.
final void setColors(Color[] colors)
Sets the color values to this Image.
final void setMode(ImageMode mode)
Sets ImageMode of this Image.
[Expand]
Inherited Methods
From class java.lang.Object

Fields

protected final int height

protected ImageMode mode

protected Texture texture

protected final int width

Public Constructors

public Image (int width, int height)

Creates a new Image object using width and height.

Parameters
width The width of the Image.
height The height of the Image.

public Image (String path)

Creates a new Image object using the Image path.

Parameters
path The path of this Image.

public Image (URL url)

Creates a new Image object using the Image url.

Parameters
url The URL of this Image.

public Image (BufferedImage image)

Creates a new Image object using BufferedImage.

Parameters
image <<<<<<< HEAD The BufferedImge of this Image. ======= The BufferedImge of this Image. >>>>>>> 16121fd9fe4eeaef3cb56619769a3119a9e6531a
See Also

Public Methods

public static Image clone (Image image)

Returns the clone of the input image.

Parameters
image The image you want to clone.
Returns
  • The clone image of the input image.

public BufferedImage copyImage (BufferedImage image)

Copies a Image object using BuffedImage.

Parameters
image <<<<<<< HEAD The BufferedImage of this Image. ======= The BufferedImage of this Image. >>>>>>> 16121fd9fe4eeaef3cb56619769a3119a9e6531a
Returns
  • The copy of this Image.

public void disableTexture (GL2 gl)

Makes texture not to be used. This function is similar to glDisable( GL_TEXTURE_2D ) in OpenGL

Parameters
gl The variable of GL2.

public void enableTexture (GL2 gl)

Makes texture to be used. This function is similar to glEnable( GL_TEXTURE_2D ) and glBindTexture() in OpenGL

Parameters
gl The variable of GL2.

public final double getAlpha (int x, int y)

Returns the alpha value of the pixel data in this Image.

Parameters
x The x-coordinate of the pixel.
y The y-coordinate of the pixel.
Returns
  • The alpha value of the pixel.

public final double getBlue (int x, int y)

Returns the blue color value of the pixel data in this Image.

Parameters
x The x-coordinate of the pixel.
y The y-coordinate of the pixel.
Returns
  • The blue color value of the pixel.

public final Color getColor (int x, int y)

Returns the pixel color of this Image.

Parameters
x The x-coordinate of the pixel.
y The y-coordinate of the pixel.
Returns
  • The color of the pixel.

public final double getGray (int x, int y)

Returns the gray-scale value of the pixel data in this Image.

Parameters
x The x-coordinate of the pixel.
y The y-coordinate of the pixel.
Returns
  • The gray-scale value of the pixel.

public final double getGreen (int x, int y)

Returns the green color value of the pixel data in this Image.

Parameters
x The x-coordinate of the pixel.
y The y-coordinate of the pixel.
Returns
  • The green color value of the pixel.

public final int getHeight ()

Returns the height of this Image.

Returns
  • The height of the Image.

public BufferedImage getImg ()

public final ImageMode getMode ()

Returns ImageMode of this Image.

Returns
  • <<<<<<< HEAD The ImageMode of the Image. ======= The ImageMode of the Image. >>>>>>> 16121fd9fe4eeaef3cb56619769a3119a9e6531a
See Also

public final double getRed (int x, int y)

Returns the red color value of the pixel data in this Image.

Parameters
x The x-coordinate of the pixel.
y The y-coordinate of the pixel.
Returns
  • The red color value of the pixel.

public final Texture getTexture ()

Returns Texture binded this Image

Returns
  • The Texture object binded this Image.

public final int getWidth ()

Returns the width of this Image.

Returns
  • The width of the Image.

public void imageMode (ImageMode mode)

Sets the ImageMode of this Image.

Parameters
mode The Image mode of this Image.
See Also

public final void loadTexture ()

Loads a texture using image data.

public final void reloadTexture (GL2 gl)

public final void setA (double alpha, int x, int y)

Sets the alpha value of the pixel data in this Image.

Parameters
alpha The alpha value of the pixel.
x The x-coordinate of the pixel.
y The y-coordinate of the pixel.

public final void setColor (Color color, int x, int y)

Sets the color value of the pixel data in this Image.

Parameters
color <<<<<<< HEAD The color value of the pixel. ======= The color value of the pixel. >>>>>>> 16121fd9fe4eeaef3cb56619769a3119a9e6531a
x The x-coordinate of the pixel.
y The y-coordinate of the pixel.

public final void setColors (Color[] colors)

Sets the color values to this Image.

Parameters
colors <<<<<<< HEAD The array of Color which size is width * height of this Image. ======= The array of Color which size is width * height of this Image. >>>>>>> 16121fd9fe4eeaef3cb56619769a3119a9e6531a

public final void setMode (ImageMode mode)

Sets ImageMode of this Image.

Parameters
mode <<<<<<< HEAD The ImageMode of the Image. ======= The ImageMode of the Image. >>>>>>> 16121fd9fe4eeaef3cb56619769a3119a9e6531a
See Also