mirror of
https://github.com/AppleCommander/AppleCommander.git
synced 2025-02-28 09:29:53 +00:00
Added getPoint, getWidth, getHeight.
This commit is contained in:
parent
ac2d621645
commit
d662a42c0d
@ -114,8 +114,20 @@ public abstract class AppleImage {
|
||||
* Set a color point.
|
||||
*/
|
||||
public abstract void setPoint(int x, int y, int color);
|
||||
/**
|
||||
* Get a color point.
|
||||
*/
|
||||
public abstract int getPoint(int x, int y);
|
||||
/**
|
||||
* Save the image.
|
||||
*/
|
||||
public abstract void save(OutputStream outputStream) throws IOException;
|
||||
/**
|
||||
* Return the width of the image.
|
||||
*/
|
||||
public abstract int getWidth();
|
||||
/**
|
||||
* Return the height of the image.
|
||||
*/
|
||||
public abstract int getHeight();
|
||||
}
|
||||
|
@ -50,10 +50,28 @@ public class ImageIoImage extends AppleImage {
|
||||
public void setPoint(int x, int y, int color) {
|
||||
image.setRGB(x, y, color);
|
||||
}
|
||||
/**
|
||||
* Get a color point.
|
||||
*/
|
||||
public int getPoint(int x, int y) {
|
||||
return image.getRGB(x,y);
|
||||
}
|
||||
/**
|
||||
* Save the image.
|
||||
*/
|
||||
public void save(OutputStream outputStream) throws IOException {
|
||||
ImageIO.write(image, getFileExtension(), outputStream);
|
||||
}
|
||||
/**
|
||||
* Return the width of the image.
|
||||
*/
|
||||
public int getWidth() {
|
||||
return image.getWidth();
|
||||
}
|
||||
/**
|
||||
* Return the height of the image.
|
||||
*/
|
||||
public int getHeight() {
|
||||
return image.getHeight();
|
||||
}
|
||||
}
|
||||
|
@ -50,10 +50,28 @@ public class SunJpegImage extends AppleImage {
|
||||
public void setPoint(int x, int y, int color) {
|
||||
image.setRGB(x, y, color);
|
||||
}
|
||||
/**
|
||||
* Get a color point.
|
||||
*/
|
||||
public int getPoint(int x, int y) {
|
||||
return image.getRGB(x,y);
|
||||
}
|
||||
/**
|
||||
* Save the image.
|
||||
*/
|
||||
public void save(OutputStream outputStream) throws IOException {
|
||||
JPEGCodec.createJPEGEncoder(outputStream).encode(image);
|
||||
}
|
||||
/**
|
||||
* Return the width of the image.
|
||||
*/
|
||||
public int getWidth() {
|
||||
return image.getWidth();
|
||||
}
|
||||
/**
|
||||
* Return the height of the image.
|
||||
*/
|
||||
public int getHeight() {
|
||||
return image.getHeight();
|
||||
}
|
||||
}
|
||||
|
@ -58,6 +58,12 @@ public class SwtImage extends AppleImage {
|
||||
public void setPoint(int x, int y, int color) {
|
||||
imageData.setPixel(x, y, color);
|
||||
}
|
||||
/**
|
||||
* Get a color point.
|
||||
*/
|
||||
public int getPoint(int x, int y) {
|
||||
return imageData.getPixel(x,y);
|
||||
}
|
||||
/**
|
||||
* Save the image.
|
||||
*/
|
||||
@ -76,4 +82,16 @@ public class SwtImage extends AppleImage {
|
||||
}
|
||||
imageLoader.save(outputStream, format);
|
||||
}
|
||||
/**
|
||||
* Return the width of the image.
|
||||
*/
|
||||
public int getWidth() {
|
||||
return imageData.width;
|
||||
}
|
||||
/**
|
||||
* Return the height of the image.
|
||||
*/
|
||||
public int getHeight() {
|
||||
return imageData.height;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user