public interface ImageMaker
An ImageDecoder Object is used to decode an Image via an ImageMaker using the
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.
|
ImageData |
getImageData()
After decoding is done this is used to retrieve the fully decoded image.
|
void |
scanLinesComplete()
This is called once all scan lines are complete.
|
boolean |
setScanLinePixels(int scanLine,
int[] pixels,
int offset,
int destX,
int destFrequency,
int numPixels,
int srcFrequency)
This is used when decoding images.
|
void createImageFor(ImageDataInfo imageInfo, Rect interestedArea) throws IllegalArgumentException
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.boolean setScanLinePixels(int scanLine, int[] pixels, int offset, int destX, int destFrequency, int numPixels, int srcFrequency)
Also scan lines may be presented in a random sequence and multiple times.
scanLine
- the scan line index relative to the area in the image the image maker
is interested in.pixels
- an array containing the scan line ARGB pixel values.offset
- the start of the pixel within the pixels array.destX
- the x location where the first pixel should be placed.destFrequency
- the distance between the pixels being provided. If this
value is 1, then the pixels are actually right next to each other. A value of
2 means that every other pixel is being done.numPixels
- the number of pixels being set.srcFrequency
- the distance between the pixels in the pixels array.
This will usually be 1 but may be any other distance.void scanLinesComplete()
ImageData getImageData()