Accusoft USB Scanner SDK
IScanImage Interface Reference

This interface provides methods to manipulate and save scanned images. More...

Inherited by ScanImage.

List of all members.

Public Member Functions

ScanError createBitmapALPHA_8 ()
 Create an Android Bitmap with the same width and height as this image, but with ALPHA_8 format.
ScanError createBitmapARGB_8888 ()
 Create an Android Bitmap with the same width and height as this image, but with ARGB_8888 format.
ScanError createBitmapRGB_565 ()
 Create an Android Bitmap with the same width and height as this image, but with RGB_565 format.
Bitmap getBitmap ()
 Return a reference to the most-recently created Bitmap for this image.
int getBitsPerPixel ()
 Obtain the number of bits per pixel in the image.
int getBytesPerLine ()
 Obtain the number of bytes per row (line) in the image.
int getNumCols ()
 Obtain the number of columns in the image.
int getNumRows ()
 Obtain the number of rows (lines) in the image.
int getResolution ()
 Obtain the resolution of the bitmap, measured in pixels per meter.
void release ()
 Release the memory containing image data.
IScanImage resizeImage (int numCols, int numRows) throws ScanException
 Create a new image from an existing image, resizing it to the specified width and height.
IScanImage rotateImage (int rotation) throws ScanException
 Construct a new image by rotating the image data of an existing image.
ScanError toBitmapFile (String filename)
 Save the image to a file in Windows Bitmap format with no compression.
ScanError toJPEGFile (String filename)
 Save the image to a file in JPEG format.
ScanError toPDFFile (String filename)
 Save the image to a file in PDF format.
ScanError toTIFFFile (String filename)
 Save the image to a file in TIFF format.

Detailed Description

This interface provides methods to manipulate and save scanned images.


Member Function Documentation

ScanError createBitmapALPHA_8 ( )

Create an Android Bitmap with the same width and height as this image, but with ALPHA_8 format.

A reference to the Bitmap will be stored in this image, and can be retrieved with a call to getBitmap().

Returns:
See ScanError.
Exceptions:
ScanException
ScanError createBitmapARGB_8888 ( )

Create an Android Bitmap with the same width and height as this image, but with ARGB_8888 format.

A reference to the Bitmap will be stored in this image, and can be retrieved with a call to getBitmap().

Returns:
See ScanError.
Exceptions:
ScanException
ScanError createBitmapRGB_565 ( )

Create an Android Bitmap with the same width and height as this image, but with RGB_565 format.

A reference to the Bitmap will be stored in this image, and can be retrieved with a call to getBitmap().

Returns:
See ScanError.
Exceptions:
ScanException
Bitmap getBitmap ( )

Return a reference to the most-recently created Bitmap for this image.

See createBitmapALPHA_8(), createBitmapARGB_8888(), and createBitmapRGB_565();

Returns:
A reference to the most-recently created Bitmap for this image.
int getBitsPerPixel ( )

Obtain the number of bits per pixel in the image.

Returns:
The number of bits per pixel in the image.
int getBytesPerLine ( )

Obtain the number of bytes per row (line) in the image.

Returns:
The number of bytes per row (line) in the image.
int getNumCols ( )

Obtain the number of columns in the image.

Returns:
The number of columns in the image.
int getNumRows ( )

Obtain the number of rows (lines) in the image.

Returns:
The number of rows (lines) in the image.
int getResolution ( )

Obtain the resolution of the bitmap, measured in pixels per meter.

Returns:
The number of pixels per meter.
void release ( )

Release the memory containing image data.

This is useful when a more direct approach to memory management is needed, instead of relying solely upon garbage collection. Native (non-JVM) memory will be released, and this object's reference to its Android Bitmap (if it had one) will be cleared. This object's other methods should not be called after release();

IScanImage resizeImage ( int  numCols,
int  numRows 
) throws ScanException

Create a new image from an existing image, resizing it to the specified width and height.

The pixel depth of the original is preserved.

Parameters:
numColsThe width of the new image, measured in pixels.
numRowsThe height of the new image, measured in pixels.
Returns:
A reference to a new image.
Exceptions:
ScanException
IScanImage rotateImage ( int  rotation) throws ScanException

Construct a new image by rotating the image data of an existing image.

The pixel depth of the original is preserved.

Parameters:
rotationHow many 90* increments to rotate by (Counter-clockwise)
Returns:
A reference to a new image.
Exceptions:
ScanException
ScanError toBitmapFile ( String  filename)

Save the image to a file in Windows Bitmap format with no compression.

Parameters:
filenameThe file name into which the image will be saved.
Returns:
See ScanError.
ScanError toJPEGFile ( String  filename)

Save the image to a file in JPEG format.

The image will be saved with high quality and only minor compression.

Parameters:
filenameThe file name into which the image will be saved.
Returns:
See ScanError.
ScanError toPDFFile ( String  filename)

Save the image to a file in PDF format.

The image will be slightly compressed with a JPEG encoder, providing a high quality image.

Parameters:
filenameThe file name into which the image will be saved.
Returns:
See ScanError.
ScanError toTIFFFile ( String  filename)

Save the image to a file in TIFF format.

Images with a 1 bit-per-pixel depth are compressed using CCITT 64 encoding, while images with other pixel depths are not compressed.

Parameters:
filenameThe file name into which the image will be saved.
Returns:
See ScanError.