* Add ImageRaster.getWidth() and getHeight()

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9874 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
This commit is contained in:
Sha..rd 2012-10-21 21:56:22 +00:00
parent 7ee0f9e07c
commit 4d01146519
3 changed files with 34 additions and 0 deletions

View File

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

View File

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

View File

@ -91,6 +91,20 @@ public abstract class ImageRaster {
public 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. * Sets the pixel at the given coordinate to the given color.
* <p> * <p>