|
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.asprise.util.jtwain.Source
The Source class represents a TWAIN data source.
The Source can be a scanner, digital camera or a image database.
The following code illustrates an image acquisition session:
There are many other ways to obtain a data source. To let the user select from
a dialog:
Source source =
SourceManager.instance().getDefaultSource(); // Get the default Source
try {
source.open();
... // Get/Set the Source's capabilities here ...
Image image = source.acuqireImage();
... // Use image here ...
}catch(Exception e) {
e.printStackTrace();
}finally{
SourceManager.instance().closeSourceManager();
}
Source source =
SourceManager.selectSourceUI();
SourceManager| Field Summary | |
static int |
EXCEPTION_THROW_ALL
|
static int |
EXCEPTION_THROW_MINIMUM
|
static int |
EXCEPTION_THROW_SOME
|
static int |
INVALID_NUMBER
|
| Constructor Summary | |
Source(DataTypeIdentity identity)
Creates a new Source with full identity. |
|
Source(String sourceName)
Creates a new Source. |
|
| Method Summary | |
Image |
acquireImage()
Acquires an image. |
BufferedImage |
acquireImageAsBufferedImage()
Acquires an image and returns it as a BufferedImage. |
void |
close()
Closes the Source. |
int[] |
getAlarms()
Get available alarms. |
int[] |
getAlarmVolume()
Get alarm volumes. |
String |
getAuthor()
Get author of acquired image (may include a copyright string). |
boolean |
getAutoBright()
Get status of the source's auto-brightness function. |
boolean[] |
getAutoFeed()
Get AutoFeed abilities. |
boolean |
getAutomaticBorderDetection()
Get automatic border detection status. |
int |
getAutomaticCapture()
Get number of images to automatically capture. |
boolean |
getAutomaticDeskew()
Get automatic deskew status. |
boolean |
getAutomaticRotate()
Get automatic rotate status. |
boolean |
getAutoScan()
Get status of auto scan. |
boolean |
getBarCodeDetectionEnabled()
Get status of bar code detection. |
int[] |
getBitDepth()
Get the bit depth values of ICAP_PIXELTYPE. |
int[] |
getBitOrder()
Get the bit orders (how the bytes in an image are filled by the Source). |
static boolean |
getBoolean(Object o)
Extract boolean value from an object. |
static boolean[] |
getBooleanArray(Object o)
Extract a boolean array from an object. |
double[] |
getBrightness()
The brightness values available within the Source. |
Object |
getCapability(int mesgType,
int capabilityCode,
int expectedContainerType)
Get a capability. |
String |
getCaption()
Get a general note about the acquired image. |
int |
getClearBuffers()
Reports the presence of data in the scanner’s buffers. |
boolean |
getClearPage()
Get clear page status. |
int[] |
getCompression()
Common compression schemes shared by both the source and the application for Buffered Memory and File Transfer. |
double[] |
getContrast()
The contrast values available within the Source. |
int |
getCurrentAlarmVolume()
Get current alarm volume. |
boolean |
getCurrentAutoFeed()
Get current AutoFeed status. |
boolean |
getCurrentAutomaticBorderDetection()
Get current automatic border detection status. |
int |
getCurrentAutomaticCapture()
Get current number of images to automatically capture. |
boolean |
getCurrentAutomaticDeskew()
Get current automatic deskew status. |
boolean |
getCurrentAutomaticRotate()
Get current automatic rotate status. |
int |
getCurrentBitDepth()
Get the current bit depth value of ICAP_PIXELTYPE. |
int |
getCurrentBitOrder()
Get the current bit orders (how the bytes in an image are filled by the Source). |
boolean |
getCurrentClearPage()
Get current clear page status. |
int |
getCurrentCompression()
Get current common compression schemes shared by both the source and the application for Buffered Memory and File Transfer [Current value]. |
boolean |
getCurrentFeederEnabled()
Get current feeder enabled status. |
boolean |
getCurrentFeederLoaded()
Get current feeder loaded status. |
boolean |
getCurrentFeedPage()
Get current feed page status. |
int |
getCurrentFlipRotation()
Get current flip rotation option. |
double[] |
getCurrentFrame()
Returns the size and location of the next frame to be acquired. |
double |
getCurrentPhyscialWidth()
Get the maximum physical width (Y-axis) the source can acquire measured in the unit of ICAP_UNITS [Current value]. |
double |
getCurrentPhysicalHeight()
Get the maximum physical height (Y-axis) the source can acquire measured in the unit of ICAP_UNITS [Current value]. |
int |
getCurrentPixelFlavor()
Get the current pixel flavor - sense of the pixel whose numeric value is zero. |
int |
getCurrentPixelType()
Get current type of pixel data that a source is capable of acquiring. |
int |
getCurrentPlanarChunky()
Get current color data format [Current value]. |
boolean |
getCurrentRewindPage()
Get current rewind page status. |
int |
getCurrentTransferCount()
Get the number of images to be transferred in this session [Current value]. |
int |
getCurrentTransferMechanism()
Get the current transfer mechanism. |
int[] |
getCurrentUnits()
Get the current unit of measure for all quantities. |
double |
getCurrentXResolution()
Get the current X-axis resolution, measured in ICAP_UNITS. |
double |
getCurrentYResolution()
Get the current Y-axis resolution, measured in ICAP_UNITS. |
boolean |
getDefaultAutoFeed()
Get default AutoFeed status. |
boolean |
getDefaultAutomaticBorderDetection()
Get default automatic border detection status. |
int |
getDefaultAutomaticCapture()
Get default number of images to automatically capture. |
boolean |
getDefaultAutomaticDeskew()
Get default automatic deskew status. |
boolean |
getDefaultAutomaticRotate()
Get default automatic rotate status. |
int |
getDefaultBitDepth()
Get the default bit depth value of ICAP_PIXELTYPE. |
int |
getDefaultBitOrder()
Get the default bit orders (how the bytes in an image are filled by the Source). |
boolean |
getDefaultClearPage()
Get default clear page status. |
int |
getDefaultCompression()
Get default common compression scheme shared by both the source and the application for Buffered Memory and File Transfer [Default value]. |
boolean |
getDefaultFeederEnabled()
Get default feeder enabled status. |
boolean |
getDefaultFeederLoaded()
Get default feeder loaded status. |
boolean |
getDefaultFeedPage()
Get default feed page status. |
int |
getDefaultFlipRotation()
Get default flip rotation option. |
double |
getDefaultPhyscialWidth()
Get the maximum physical width (Y-axis) the source can acquire measured in the unit of ICAP_UNITS [Default value]. |
double |
getDefaultPhysicalHeight()
Get the maximum physical height (Y-axis) the source can acquire measured in the unit of ICAP_UNITS [Default value]. |
int |
getDefaultPixelType()
Get default type of pixel data that a source is capable of acquiring. |
int |
getDefaultPlanarChunky()
Get the default color format [Default value]. |
boolean |
getDefaultRewindPage()
Get default rewind page status. |
int |
getDefaulttPixelFlavor()
Get the default pixel flavor - sense of the pixel whose numeric value is zero. |
int |
getDefaultTransferCount()
Get the number of images to be transferred in this session [Default value]. |
int |
getDefaultTransferMechanism()
Get the default transfer mechanism. |
int[] |
getDefaultUnits()
Get the default unit of measure for all quantities. |
double |
getDefaultXResolution()
Get the default X-axis resolution, measured in ICAP_UNITS. |
double |
getDefaultYResolution()
Get the default Y-axis resolution, measured in ICAP_UNITS. |
String |
getDeviceDateTime()
Get the date and time of a device's clock. |
boolean |
getDeviceOnline()
Determines if hardware in on and ready. |
static double |
getDouble(Object o)
Extract a double from an object. |
static double[] |
getDoubleArray(Object o)
Extract a double array from an object. |
int |
getDuplex()
Gets the duplex mode supported by the scanner. |
boolean |
getDuplexEnabled()
Get duplex status. |
int[] |
getExtendedCapabilities()
Get a list of extended capabilities that can be used in States 5 and 6. |
String[] |
getExtendedCapabilitiessStrings()
Get a human readable list of extended capabilities. |
boolean |
getFeederEnabled()
Get feeder enabled status. |
boolean |
getFeederLoaded()
Get feeder loaded status. |
boolean |
getFeedPage()
Get feed page status. |
int |
getFlipRotation()
Get flip rotation option. |
double[][] |
getFrames()
Returns the size and location of all the frames the Source will acquire image data from when acquiring from each page. |
double |
getGamma()
Get gamma correction value for image data. |
DataTypeIdentity |
getIdentity()
Get the identity of this source. |
boolean |
getIndicators()
Use the Source's progress indicator? |
static int |
getInt(Object o)
Extract an int from an object. |
static int[] |
getIntArray(Object o)
Extract an integer array from an object. |
Image |
getLastAcquiredImage()
Gets the last acquired image. |
int[] |
getMaxBatchBuffers()
Describes the number of pages that the scanner can buffer when CAP_AUTOSCAN is enabled. |
int |
getMaxFrames()
Gets the maximum number of frames the Source can provide or the application can accept per page. |
boolean |
getMinimumExceptionEnabled()
Gets the status of level of exception thrown. |
int |
getNumberOfPendingImages()
Gets number of pending images. |
boolean |
getPatchCodeDetectionEnabled()
Gets the status of patch code detection. |
double |
getPhyscialWidth()
Get the maximum physical width (Y-axis) the source can acquire measured in the unit of ICAP_UNITS. |
double |
getPhysicalHeight()
Get the maximum physical height (Y-axis) the source can acquire measured in the unit of ICAP_UNITS. |
int[] |
getPixelFlavor()
Get the pixel flavors - sense of the pixel whose numeric value is zero. |
int[] |
getPixelType()
Get types of pixel data that a source is capable of acquiring. |
int[] |
getPlanarChunky()
Get all available color data formats. |
int[] |
getPrinter()
Returns the current list of printer devices. |
boolean |
getPrinterEnabled()
Current printer device on/off? |
int |
getPrinterMode()
Returns the device mode of the current printer. |
String |
getPrinterString()
Returns the printer string. |
DataTypeImageLayout |
getRegion()
Returns the scanning region for next scan. |
boolean |
getRewindPage()
Get rewind page status. |
String |
getSourceName()
Gets name of the Source. |
int |
getState()
Gets the state of the source. |
int[] |
getSupportedCapabilities()
Get a list of all supported capabilities. |
String[] |
getSupportedCapabilitiesStrings()
Get a human readable list of all supported capabilities. |
int[] |
getSupportedSizes()
Gets the size(s) the Source can/should use to acquire image data. |
int |
getTransferCount()
Get the number of images to be transferred in this session. |
int[] |
getTransferMechanism()
Get transfer mechanisms supported by both the application and the source. |
boolean |
getUIControllable()
Check whether the source supports acquisition with the UI disabled. |
int[] |
getUnits()
Get the units of measure for all quantities. |
double[] |
getXResolution()
Get all the X-axis resolutions that the source can provide, measured in ICAP_UNITS. |
double[] |
getYResolution()
Get all the Y-axis resolutions that the source can provide, measured in ICAP_UNITS. |
boolean |
hasMoreImages()
Tests whether there are pending images to be acquired. |
boolean |
isUIEnabled()
Is the Source's user interface enabled? |
void |
open()
Opens this data source. |
InputStream |
outputLastAcquiredImageAsJPEG()
Returns the last acquired image in the JPEG format as a stream. |
void |
resetAutoFeed()
Reset auto feed option. |
void |
resetAutomaticBorderDetection()
Reset automatic border detection operation. |
void |
resetAutomaticCapture(int numberOfImages)
Reet number of images to automatically capture. |
void |
resetAutomaticDeskew()
Reset automatic rotate operation. |
void |
resetAutomaticRotate()
Reset automatic rotate operation. |
void |
resetBitDepth()
Reset the bit depth value of ICAP_PIXELTYPE. |
void |
resetBitOrder()
Reset the current bit orders (how the bytes in an image are filled by the Source). |
void |
resetCapability(int capabilityCode)
Reset a capability. |
void |
resetClearPage()
Reset clear page option. |
void |
resetFeedPage()
Reset feed page option. |
void |
resetFlipRotation()
Reset flip rotation option. |
void |
resetPixelType()
Reset the type of pixel data that a source is capable of acquiring. |
void |
resetRewindPage()
Reset rewind page option. |
int |
resetTransferCount()
Reset the number of images to be transferred in this session. |
void |
resetTransferMechanism()
Reset the transfer mechanism. |
void |
resetUnits()
Reset the unit of measure for all quantities. |
void |
resetXResolution()
Reset the X-axis resolution. |
void |
resetYResolution()
Reset the Y-axis resolution. |
void |
saveLastAcquiredImageIntoFile(File destination)
Saves the last acquired image as JPEG into the given file. |
void |
saveLastAcquiredImageIntoFile(String destination)
Saves the last acquired image as JPEG into the given file. |
File |
saveLastAcquiredImageIntoTemporaryFile()
Saves the last acquired image as JPEG into a temporary file. |
void |
setAlarms(int[] alarms)
Set alarms. |
void |
setAuthor(String author)
Set author of acquired image (may include a copyright string). |
void |
setAutoBright(boolean enableAutoBright)
Turn on or off the source's auto-brightness function. |
void |
setAutoFeed(boolean autoFeed)
Set auto feed option. |
void |
setAutomaticBorderDetection(boolean enabled)
Set automatic border detection operation. |
void |
setAutomaticCapture(int numberOfImages)
Set number of images to automatically capture. |
void |
setAutomaticDeskew(boolean enabled)
Set automatic rotate operation. |
void |
setAutomaticRotate(boolean enabled)
Set automatic rotate operation. |
void |
setAutoScan(boolean autoScan)
Set status of auto scan. |
void |
setBarCodeDetectionEnabled(boolean enableBarCodeDetection)
Set status of bar code detection. |
void |
setBitDepth(int bitDepth)
Set the bit depth value of ICAP_PIXELTYPE. |
void |
setBitOrder(int bitOrder)
Set the current bit orders (how the bytes in an image are filled by the Source). |
void |
setBrightness(double[] values)
Sets brightness values. |
void |
setCapability(int capabilityCode,
ValueContainer container)
Set a capability. |
void |
setCaption(String caption)
Set a general note about the acquired image. |
void |
setClearBuffers(int option)
Clears the buffers? |
void |
setClearPage(boolean clearPage)
Set clear page option. |
void |
setCompression(int compression)
Sets the compression [Not all compressions may be supported by the device!]. |
void |
setContrast(double[] values)
Sets constrast values. |
void |
setDuplexEnabled(boolean enable)
Enables/Disables duplex. |
void |
setExtendedCapabilities(int[] extendedCaps)
Set a list of extended capabilities that can be used in States 5 and 6. |
void |
setFeederEnabled(boolean feederEnabled)
Set feeder enabled. |
void |
setFeedPage(boolean feedPage)
Set feed page option. |
void |
setFlipRotation(int flipRotation)
Set flip rotation option. |
void |
setFrames(double[] singleFrame)
Specifies the single frame and its location to be used to acquire from future pages. |
void |
setFrames(double[][] multipleFrames)
Specifies the frames and their locations to be used to acquire from future pages. |
void |
setGamma(double gamma)
Set gamma correction value for image data. |
void |
setIndicators(boolean useProgressIndicator)
Turn on/off the Source's progress indicator. |
void |
setMaxBatchBuffers(int size)
Sets the current number pages to be buffered (if the Source allows this to be set) DG_CONTROL / DAT_CAPABILITY / MSG_SET -> CAP_MAXBATCHBUFFERS |
void |
setMaxFrames(int max)
Sets the maximum number of frames the Source can provide or the application can accept per page. |
void |
setMinimumExceptionEnabled(boolean enableMinimumException)
Allows only minimum set of exceptions to be thrown. |
void |
setPatchCodeDetectionEnabled(boolean enable)
Turns patch code detection on and off. |
void |
setPixelType(int pixelType)
Set the type of pixel data that a source is capable of acquiring. |
void |
setPrinter(int printer)
Selects the current printer. |
void |
setPrinterEnabled(boolean enable)
Turns current printer device on/off. |
void |
setPrinterString(String string)
Sets the string component. |
void |
setRegion(double left,
double top,
double right,
double bottom)
Sets the scanning region for next scan. |
void |
setRewindPage(boolean rewindPage)
Set rewind page option. |
void |
setSupportedSizes(int[] sizes)
Sets the size(s) the Source can/should use to acquire image data. |
void |
setTransferCount(int count)
Set the number of images to be transferred in this session. |
void |
setTransferMechanims(int transferMechanism)
Set the default transfer mechanism. |
void |
setUIEnabled(boolean enableUI)
Turns on/off the Source's user interface. |
void |
setUnits(int unitCode)
Set the unit of measure for all quantities. |
void |
setXResolution(double xresolution)
Set the X-axis resolution. |
void |
setYResolution(double Yresolution)
Set the Y-axis resolution. |
String |
toString()
String representation of the Source. |
String |
toString(boolean verbose)
String representation of the Source. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, |