|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--sub_arctic.output.loaded_image
A class to encapsulate a potentially asynchronously loaded image. This class does blocking for operations that need to wait until the image is fully loaded (such as requests for the image's size).
Field Summary | |
protected java.awt.Image |
_image
The image we encapsulate. |
protected boolean |
_is_loaded
Do we know that the image has been loaded |
Constructor Summary | |
loaded_image(java.awt.Image img)
Construct from an Image (this image is marked as not loaded yet). |
|
loaded_image(int[] data,
int w,
int h)
Construct from in memory data. |
|
loaded_image(int w,
int h)
Construct a blank in memory image of the given size and force it to be "loaded" (not clear what that means for in-memory images, but it seems to be required). |
|
loaded_image(loaded_image other,
int x,
int y,
int w,
int h)
Construct an in memory image from part of another image. |
Method Summary | |
drawable |
get_drawable()
Get a drawable that can be used to draw on this image (similar to getGraphics() on an AWT Image object). |
int |
height()
Get the image height, waiting for the image to load if necessary |
static loaded_image |
image_from_intensity_map(loaded_image map,
java.awt.Color color,
int ti)
This function creates a nice looking loaded_image from an an intensity image and a color. |
java.awt.Image |
image()
Get the image, but block if it is not completely loaded. |
boolean |
is_loaded()
Indicate whether the image is known to be loaded already. |
java.awt.Image |
raw_image()
Get access to the encapsulated image without blocking if it is not loaded yet. |
void |
set_is_loaded(boolean val)
Public write access to _is_loaded. |
int |
width()
Get the image width, waiting for the image to load if necessary |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
protected transient boolean _is_loaded
protected transient java.awt.Image _image
Constructor Detail |
public loaded_image(java.awt.Image img)
Image
- img the Image to create the loaded_image frompublic loaded_image(int w, int h)
int
- w the width of the image in pixels.int
- h the height of the image in pixels.public loaded_image(int[] data, int w, int h)
int[]
- the data to build the image fromint
- w the width of the imageint
- h the height of the imagepublic loaded_image(loaded_image other, int x, int y, int w, int h)
loaded_image
- other the image we take our subimage fromint
- x the left corner of the subimageint
- y the top corner of the subimageint
- w the width of the subimage in pixels.int
- h the height of the subimage in pixels.Method Detail |
public boolean is_loaded()
public void set_is_loaded(boolean val)
public java.awt.Image raw_image()
public java.awt.Image image()
public int width()
public int height()
public drawable get_drawable()
public static loaded_image image_from_intensity_map(loaded_image map, java.awt.Color color, int ti)
All shades of grey (other than the transparency intensity) are mapped to an intensity in of the color passed, proportional to their value (between 0 and 255).
Although these will get you "feathered" images, there is not a lot of dynamic range before your chosen color falls off to black. I would recommend making your intensity map have the values 180+ to get reasonable results.
loaded_image
- map the intensity map.Color
- color the target color.int
- ti this the intensity which should be transparent.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |