public class ScaledImageMaker extends Object implements ImageMaker
Modifier and Type | Field and Description |
---|---|
boolean |
highQualityOnly
Deprecated.
|
boolean |
ignoreAlpha
Deprecated.
|
ImageDataInfo |
imageInfo
Deprecated.
|
boolean |
keepAspectRatio
Deprecated.
|
int |
newHeight
Deprecated.
|
int |
newWidth
Deprecated.
|
int |
requestedNewHeight
Deprecated.
|
int |
requestedNewWidth
Deprecated.
|
boolean |
scaleDownOnly
Deprecated.
|
Rect |
sourceRect
Deprecated.
This is initially null.
|
boolean |
useRoughScaling
Deprecated.
|
Constructor and Description |
---|
ScaledImageMaker()
Deprecated.
|
ScaledImageMaker(int newWidth,
int newHeight,
boolean keepAspectRatio)
Deprecated.
After using this constructor use ImageDecoder.decode(source,this) to decode the
image, and then getImageData() or getPicture() or getPixelBuffer() to get
the decoded image.
|
ScaledImageMaker(Rect srcArea,
int newWidth,
int newHeight,
boolean keepAspectRatio)
Deprecated.
After using this constructor use ImageDecoder.decode(source,this) to decode the
image, and then getImageData() or getPicture() or getPixelBuffer() to get
the decoded image.
|
Modifier and Type | Method and Description |
---|---|
void |
createImageFor(ImageDataInfo imageInfo,
Rect interestedArea)
Deprecated.
You can override this method and then determine what will be the source area
of the image you want to decode and what the final dimension will be.
|
IImage |
decode(FormattedDataSource source,
boolean loadAsPixelBuffer)
Deprecated.
Decode the formatted image using a new ImageDecoder().
|
IImage |
decode(String imageName,
boolean loadAsPixelBuffer)
Deprecated.
Decode the formatted image using a new ImageDecoder().
|
void |
free()
Deprecated.
|
ImageData |
getImageData()
Deprecated.
After decoding is done this is used to retrieve the fully decoded image.
|
Picture |
getPicture()
Deprecated.
Return the Image as a Picture.
|
PixelBuffer |
getPixelBuffer(boolean copyData)
Deprecated.
|
void |
scanLinesComplete()
Deprecated.
This is called once all scan lines are complete.
|
void |
setBuffer(IntArray bufferToUse)
Deprecated.
|
protected void |
setFor(int srcX,
int srcY,
int srcWidth,
int srcHeight,
int newWidth,
int newHeight)
Deprecated.
Only call this if you override createImageFor(). createImageFor()
is provided with the dimensions for the image.
|
boolean |
setScanLinePixels(int scanLine,
int[] pixels,
int offset,
int destX,
int destFrequency,
int numPixels,
int srcFrequency)
Deprecated.
This is used when decoding images.
|
public boolean ignoreAlpha
public boolean useRoughScaling
public boolean highQualityOnly
public boolean keepAspectRatio
public boolean scaleDownOnly
public int requestedNewWidth
public int requestedNewHeight
public int newWidth
public int newHeight
public ImageDataInfo imageInfo
public Rect sourceRect
public ScaledImageMaker()
public ScaledImageMaker(int newWidth, int newHeight, boolean keepAspectRatio)
newWidth
- the requested new width of the scaled image.newHeight
- the requested new height of the scaled iamge.keepAspectRatio
- whether to keep the aspect ratio of the image.public ScaledImageMaker(Rect srcArea, int newWidth, int newHeight, boolean keepAspectRatio)
srcArea
- the source area within the image that will be decoded.newWidth
- the requested new width of the scaled image.newHeight
- the requested new height of the scaled iamge.keepAspectRatio
- whether to keep the aspect ratio of the sourceArea.public void setBuffer(IntArray bufferToUse)
protected void setFor(int srcX, int srcY, int srcWidth, int srcHeight, int newWidth, int newHeight)
srcX
- The x co-ordinate within the image to start.srcY
- The y co-ordinate within the image to start.srcWidth
- The width of the sub-area.srcHeight
- The height of the sub-area.newWidth
- The new width of the sub-area which will be the
final width for the image produced.newHeight
- The new height of the sub-area which will be the
fial height for the image produced.public void createImageFor(ImageDataInfo imageInfo, Rect interestedArea) throws IllegalArgumentException
createImageFor
in interface ImageMaker
imageInfo
- information on the image to be decoded.interestedArea
- this will be modified to provide only
the area this ScaledImageMaker is interested in.IllegalArgumentException
- if the ImageMaker decides it cannot create the image.public boolean setScanLinePixels(int scanLine, int[] pixels, int offset, int destX, int destFrequency, int numPixels, int srcFrequency)
ImageMaker
Also scan lines may be presented in a random sequence and multiple times.
setScanLinePixels
in interface ImageMaker
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.public void scanLinesComplete()
ImageMaker
scanLinesComplete
in interface ImageMaker
public ImageData getImageData()
ImageMaker
getImageData
in interface ImageMaker
public Picture getPicture()
public PixelBuffer getPixelBuffer(boolean copyData)
public void free()
public IImage decode(FormattedDataSource source, boolean loadAsPixelBuffer) throws ImageDecodingException
source
- the image source.loadAsPixelBuffer
- if true the image is returned as a PixelBuffer()
otherwise it is returned as a picture.ImageDecodingException