public class Picture extends ImageObject
Modifier and Type | Field and Description |
---|---|
static int |
OPTION_KEEP_ASPECT_RATIO
Deprecated.
use ImageData.CREATE_OPTION_KEEP_ASPECT_RATIO instead.
|
background, height, width
CREATE_OPTION_DONT_SCALE_UP, CREATE_OPTION_IGNORE_ALPHA, CREATE_OPTION_KEEP_ASPECT_RATIO, CREATE_OPTION_ROUGH_SCALING, SCAN_LINE_BYTE_ARRAY, SCAN_LINE_INT_ARRAY, TYPE_ARGB, TYPE_GRAY_SCALE_16, TYPE_GRAY_SCALE_2, TYPE_GRAY_SCALE_256, TYPE_GRAY_SCALE_4, TYPE_INDEXED_16, TYPE_INDEXED_2, TYPE_INDEXED_256, TYPE_INDEXED_4, TYPE_MASK, TYPE_MONO, TYPE_RGB, TYPE_UNKNOWN
Constructor and Description |
---|
Picture(FormattedDataSource source,
int options) |
Picture(FormattedDataSource source,
Object maskObject,
int options) |
Picture(FormattedDataSource source,
Rect sourceArea,
Dimension newSize,
int options) |
Picture(FormattedDataSource source,
Rect sourceArea,
int options) |
Picture(ImageData fromImage,
int options) |
Picture(ImageData fromImage,
Object maskObject,
int options) |
Picture(int options,
Object nativeObject) |
Picture(PictureMaker pm) |
Picture(String formattedImageResource) |
Picture(String formattedImageResource,
int options) |
Picture(String name,
Object maskObject,
int options) |
Picture(String formattedImageResource,
String maskName) |
Modifier and Type | Method and Description |
---|---|
void |
createImageFor(ImageDataInfo imageInfo,
Rect interestedArea)
This is called at the start of decoding - to let the ImageMaker know the parameters
of the image to be created.
|
void |
draw(Graphics g,
int x,
int y,
int options) |
protected void |
finalize()
This method (when overriden), will be called when the VM determines that the Object can be
garbage collected.
|
void |
free() |
int |
getImageScanLineLength()
If the scan line type is SCAN_LINE_BYTE_ARRAY then this indicates
the number of bytes is needed for one complete scan line.
|
void |
getImageScanLines(int startLine,
int numLines,
Object destArray,
int offset,
int destScanLineLength)
Place a set of scan lines into a destination array.
|
int |
getImageScanLineType()
Get the type of scan line used by the image - either SCAN_LINE_BYTE_ARRAY or SCAN_LINE_INT_ARRAY
|
int |
getImageType()
This returns one of the TYPE_XXX values
|
Object |
getNativeObject() |
static PictureMaker |
getPictureMaker(FormattedDataSource source) |
int[] |
getPixels(int[] dest,
int offset,
int x,
int y,
int width,
int height,
int rowStride)
Retrieve the pixels from the Image in encoded ARGB values.
|
boolean |
isWriteableImage()
This always returns false.
|
Picture |
makeGray() |
static Picture |
newPicture(FormattedDataSource source,
Rect srcArea,
int newWidth,
int newHeight,
int options)
Deprecated.
use the constructor instead.
|
void |
setImageScanLines(int startLine,
int numLines,
Object sourceArray,
int offset,
int sourceScanLineLength)
Place a set of scan lines from a source Array into the ImageData.
|
boolean |
setPixels(int[] src,
int offset,
int x,
int y,
int width,
int height,
int rowStride)
Set the pixels in the IImage in encoded ARGB values.
|
Image |
toImage(int imageCreationOptions)
A convenience method that creates an image and draws this Picture on it.
|
boolean |
usesAlpha()
Returns whether the image uses the Alpha channel.
|
draw, draw, freeImage, getBackground, getCompatibleImagePoints, getDPI, getHeight, getImageColorTable, getImageData, getImageHeight, getImageWidth, getNativeDrawable, getPixelsUsingScanLines, getScanLinesUsingPixels, getWidth, isReadableImage, scanLinesComplete, setPixelsUsingScanLines, setScanLinePixels, setScanLinesUsingPixels
public static final int OPTION_KEEP_ASPECT_RATIO
public Picture(String name, Object maskObject, int options) throws ImageDecodingException, SystemResourceException
public Picture(FormattedDataSource source, Rect sourceArea, int options) throws ImageDecodingException
ImageDecodingException
public Picture(PictureMaker pm) throws ImageDecodingException
ImageDecodingException
public Picture(FormattedDataSource source, Rect sourceArea, Dimension newSize, int options) throws ImageDecodingException
ImageDecodingException
public Picture(FormattedDataSource source, Object maskObject, int options) throws ImageDecodingException, SystemResourceException
public Picture(String formattedImageResource) throws ImageDecodingException
ImageDecodingException
public Picture(String formattedImageResource, String maskName) throws ImageDecodingException
ImageDecodingException
public Picture(FormattedDataSource source, int options)
public Picture(String formattedImageResource, int options)
public Picture(ImageData fromImage, int options)
public Picture(int options, Object nativeObject)
public static Picture newPicture(FormattedDataSource source, Rect srcArea, int newWidth, int newHeight, int options) throws ImageDecodingException
source
- srcArea
- newWidth
- newHeight
- options
- ImageDecodingException
public void draw(Graphics g, int x, int y, int options)
public void free()
free
in interface Drawable
free
in class ImageObject
public int[] getPixels(int[] dest, int offset, int x, int y, int width, int height, int rowStride)
ImageData
dest
- The destination int array. If this is null then a new array should be created.offset
- The offset into the array to start placing pixels.x
- the x co-ordinate within the image.y
- the y co-ordinate within the image.width
- the width of the pixel block to get.height
- the height of the pixel block to get.rowStride
- the number of int values between each row in the destination int array. If this is 0 it
will be assumed to be equal to width.public int getImageType()
ImageData
getImageType
in interface ImageData
getImageType
in class ImageObject
public int getImageScanLineType()
ImageData
getImageScanLineType
in interface ImageData
getImageScanLineType
in class ImageObject
public int getImageScanLineLength()
ImageData
getImageScanLineLength
in interface ImageData
getImageScanLineLength
in class ImageObject
public boolean usesAlpha()
IImage
public boolean isWriteableImage()
public void createImageFor(ImageDataInfo imageInfo, Rect interestedArea) throws IllegalArgumentException
ImageMaker
createImageFor
in interface ImageMaker
createImageFor
in class ImageObject
imageInfo
- information on the image to be decoded.interestedArea
- when the method is called this is set to be the
full area of the image (0,0,imageWidth,imageHeight). This method
can alter this Rect to be a sub-area within the image. In that case
the object that is providing pixel data will know that it need
not provide pixel data outside that area. However you should not
assume that this will strictly be adhered to. It is possible
that all pixels for the entire image may still be provided to
setScanLinePixels().IllegalArgumentException
- if the ImageMaker decides it cannot create the image.public boolean setPixels(int[] src, int offset, int x, int y, int width, int height, int rowStride)
ImageData
src
- The source int array.offset
- The offset into the array to start retrieving pixels.x
- the x co-ordinate within the image.y
- the y co-ordinate within the image.width
- the width of the pixel block to get.height
- the height of the pixel block to get.rowStride
- the number of int values between each row in the source int array. If this is 0 it
will be assumed to be equal to width.public Picture makeGray()
public Image toImage(int imageCreationOptions)
imageCreationOptions
- options for creating the image.protected void finalize()
Object
The finalize() method of a Class is only called if it overrides finalize() - the finalize() method java.lang.Object is never called by the Eve VM.
public void getImageScanLines(int startLine, int numLines, Object destArray, int offset, int destScanLineLength) throws IllegalStateException
ImageData
IllegalStateException
public void setImageScanLines(int startLine, int numLines, Object sourceArray, int offset, int sourceScanLineLength) throws IllegalStateException
ImageData
IllegalStateException
public static PictureMaker getPictureMaker(FormattedDataSource source) throws ImageDecodingException
ImageDecodingException
public Object getNativeObject()