Core Module
The Core module is defined in the namespace Dynamsoft.Core
. It consists of the classes CoreModule
, ImageSourceAdapter
and IntermediateResultManager
plus a few interfaces and enumerations.
CoreModule Class
This class defines common functionality in the Core module. At present, it has only one method.
Name | Description |
---|---|
static getVersion() |
Returns the version of the Core module. |
Code snippet
const version = Dynamsoft.Core.CoreModule.getVersion();
console.log(version);
ImageSourceAdapter Class
The ImageSourceAdapter
class defines how an image source should be defined for it to interact with the CaptureVisionRouter
class. Note that this is an abstract class and can’t be directly instantiated.
The APIs for this class are:
Name | Description |
---|---|
addImageToBuffer | Adds an image to the buffer of the adapter. |
hasNextImageToFetch | Determines whether there are more images left to fetch. |
startFetching | Starts fetching images. |
stopFetching | Stops fetching images. |
getImage | Returns a buffered image. |
setMaxImageCount | Sets how many images are allowed to be buffered. |
getMaxImageCount | Returns how many images can be buffered. |
setBufferOverflowProtectionMode | Sets a mode that determines the action to take when there is a new incoming image and the buffer is full. |
getBufferOverflowProtectionMode | Returns the current buffer overflow protection mode. |
hasImage | Determines whether the image is in the buffer or not. |
setNextImageToReturn | Sets the next image to return. |
getImageCount | Returns the actual count of buffered images. |
isBufferEmpty | Determines whether the buffer is empty. |
clearBuffer | Clears the image buffer. |
setColourChannelUsageType | Sets the usage type of a color channel in an image. |
getColourChannelUsageType | Gets the usage type of a color channel in an image. |
IntermediateResultManager Class
The IntermediateResultManager
class defines a user can interact with the CaptureVisionRouter
class about intermediate results.
The APIs for this class are:
Name | Description |
---|---|
addResultReceiver | Adds an intermediate result receiver. |
removeResultReceiver | Removes an intermediate result receiver. |
getOriginalImage | Gets the original image data using an image hash id. |
Interfaces and Enums
In order to make the code more predictable and readable, the library defines a series of supporting interfaces and enumerations:
Interfaces
The following are the basic interfaces often shared by more than one module:
- Arc
- CapturedResultItem
- CapturedResultReceiver
- CapturedResult
- Contour
- Corner
- DSImageData
- DSRect
- Edge
- ImageTag
- LineSegment
- Point
- Polygon
- Quadrilateral
- OriginalImageResultItem
-
Rect <!–
- FileImageTag
- PDFReadingParameter –>
The following interfaces facilitate the use of intermediate result functions:
- BinaryImageUnit
- ColourImageUnit
- ContoursUnit
- EnhancedGrayscaleImageUnit
- GrayscaleImageUnit
- IntermediateResultExtraInfo
- IntermediateResultReceiver
- IntermediateResultUnit
- IntermediateResult
- LineSegmentsUnit
- ObservationParameters
- PredetectedRegionElement
- PredetectedRegionsUnit
- RegionObjectElement
- ScaledDownColourImageUnit
- TextRemovedBinaryImageUnit
- TextZonesUnit
- TextureDetectionResultUnit
- TextureRemovedBinaryImageUnit
- TextureRemovedGrayscaleImageUnit
- TransformedGrayscaleImageUnit
Enums
The following are the basic enumerations often shared by more than one module:
- EnumBufferOverflowProtectionMode
- EnumCapturedResultItemType
- EnumColourChannelUsageType
- EnumCornerType
- EnumErrorCode
- EnumGrayscaleEnhancementMode
- EnumGrayscaleTransformationMode
- EnumImagePixelFormat
- EnumImageTagType <!– * EnumPDFReadingMode
- EnumRasterDataSource –>
The following enumerations facilitate the use of intermediate result functions: