* Add ImageRaster.getWidth() and getHeight()

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9874 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
Sha..rd 12 years ago
parent 7ee0f9e07c
commit 4d01146519
  1. 10
      engine/src/android/com/jme3/asset/AndroidImageInfo.java
  2. 10
      engine/src/core/com/jme3/texture/image/DefaultImageRaster.java
  3. 14
      engine/src/core/com/jme3/texture/image/ImageRaster.java

@ -59,6 +59,16 @@ public class AndroidImageInfo extends ImageRaster {
return format;
}
@Override
public int getWidth() {
return getBitmap().getWidth();
}
@Override
public int getHeight() {
return getBitmap().getHeight();
}
@Override
public void setPixel(int x, int y, ColorRGBA color) {
getBitmap().setPixel(x, y, color.asIntARGB());

@ -65,6 +65,16 @@ public class DefaultImageRaster extends ImageRaster {
}
}
@Override
public int getWidth() {
return width;
}
@Override
public int getHeight() {
return height;
}
@Override
public void setPixel(int x, int y, ColorRGBA color) {
rangeCheck(x, y);

@ -91,6 +91,20 @@ public abstract class ImageRaster {
public ImageRaster() {
}
/**
* Returns the pixel width of the underlying image.
*
* @return the pixel width of the underlying image.
*/
public abstract int getWidth();
/**
* Returns the pixel height of the underlying image.
*
* @return the pixel height of the underlying image.
*/
public abstract int getHeight();
/**
* Sets the pixel at the given coordinate to the given color.
* <p>

Loading…
Cancel
Save