SignDoc SDK (.NET without exceptions)
5.0.0
|
A bitmap image. More...
Public Member Functions | |
~SignDocImage () | |
Destructor. More... | |
!SignDocImage () | |
Finalizer. More... | |
SignDocImage () | |
Constructor. More... | |
SignDocImage (SignDocImage aSource) | |
Copy constructor. More... | |
SignDocImage | clone () |
Create a copy of this object. More... | |
void | clear () |
Remove the image from this object. More... | |
void | setEmpty (out ReturnCode aReturnCode, int aWidth, int aHeight, int aBitsPerPixel, int aColor) |
Replace this image with an empty one of the specified size. More... | |
void | loadFromMemory (out ReturnCode aReturnCode, byte[] aData, int aIndex) |
Load an image from a blob. More... | |
void | loadFromFile (out ReturnCode aReturnCode, string aPath, int aIndex) |
Load an image from a file. More... | |
int | getNumberOfPagesFromMemory (out ReturnCode aReturnCode, byte[] aData) |
Get the number of subimages (pages) in a blob. More... | |
int | getNumberOfPagesFromFile (out ReturnCode aReturnCode, string aPath) |
Get the number of subimages (pages) in a file. More... | |
int | getBitsPerPixel () |
Get the number of bits per pixel. More... | |
int | getNumberOfComponents () |
Get the number of components. More... | |
int | getBitsPerComponent () |
Get the number of bits per component. More... | |
int | getWidth () |
Get the width of the image. More... | |
int | getHeight () |
Get the height of the image. More... | |
int | getResolutionX () |
Get the horizontal resolution of the image. More... | |
int | getResolutionY () |
Get the vertical resolution of the image. More... | |
void | setResolution (out ReturnCode aReturnCode, int aResolutionX, int aResolutionY) |
Set the resolution of the image. More... | |
void | resizeToResolution (out ReturnCode aReturnCode, int aResolutionX, int aResolutionY, string aFilter) |
Resize the image. More... | |
void | crop (out ReturnCode aReturnCode, int aX, int aY, int aWidth, int aHeight) |
Crop the image. More... | |
void | convertToBiLevel (out ReturnCode aReturnCode, SignDocImageParameters aImageParameters) |
Convert the image to bi-level black and white. More... | |
void | convertToGrayscale (out ReturnCode aReturnCode) |
Convert the image to 8-bit grayscale. More... | |
void | convertToTrueColor (out ReturnCode aReturnCode) |
Convert the image to 24-bit RGB (8 bits per color channel). More... | |
void | invert (out ReturnCode aReturnCode, bool aAuto) |
Invert the image. More... | |
void | rotate (out ReturnCode aReturnCode, int aAngle, int aBackgroundColor) |
Rotate the image. More... | |
void | mirrorX (out ReturnCode aReturnCode) |
Mirror along the vertical axis (flip horizontally). More... | |
void | mirrorY (out ReturnCode aReturnCode) |
Mirror along the horizontal axis (flip vertically). More... | |
int | getPixelValue (out ReturnCode aReturnCode, int aX, int aY) |
Get the value of a pixel. More... | |
void | setPixelValue (out ReturnCode aReturnCode, int aX, int aY, int aValue) |
Set the value of a pixel. More... | |
int | getPixelRGB (out ReturnCode aReturnCode, int aX, int aY) |
Get the RGB color of a pixel. More... | |
void | setPixelRGB (out ReturnCode aReturnCode, int aX, int aY, int aColor) |
Set the RGB color of a pixel. More... | |
void | drawLine (out ReturnCode aReturnCode, int aX1, int aY1, int aX2, int aY2, double aStrokeWidth, int aColor) |
Draw a line. More... | |
void | drawRect (out ReturnCode aReturnCode, int aX1, int aY1, int aX2, int aY2, double aRadiusX, double aRadiusY, double aStrokeWidth, int aColor, bool aFill) |
Draw a rectangle (with both lines parallel to the axes). More... | |
void | drawRect (out ReturnCode aReturnCode, SignDocImageRect aRect, double aRadiusX, double aRadiusY, double aStrokeWidth, int aColor, bool aFill) |
Draw a rectangle (with both lines parallel to the axes). More... | |
int[] | getPalette (out ReturnCode aReturnCode) |
Get the palette. More... | |
void | setPaletteAt (out ReturnCode aReturnCode, int aIndex, int aColor) |
Set a palette entry. More... | |
int[] | getHistogram (out ReturnCode aReturnCode) |
Compute a histogram. More... | |
int | getComplexity (out ReturnCode aReturnCode, SignDocImageParameters aImageParameters) |
Compute the complexity of a signature image. More... | |
void | clean (out ReturnCode aReturnCode, SignDocImageParameters aImageParameters, SignDocCleanParameters aCleanParameters) |
Clean a signature image according to the provided parameters. More... | |
SignDocImageRect | cleanSignature (out ReturnCode aReturnCode, SignDocImageParameters aImageParameters) |
Clean a signature image. More... | |
void | cleanLines (out ReturnCode aReturnCode, SignDocImageParameters aImageParameters) |
Clean lines. More... | |
SignDocImageRect | cleanDate (out ReturnCode aReturnCode, SignDocImageParameters aImageParameters) |
Remove handwritten text from the signature image. More... | |
void | cleanFrames (out ReturnCode aReturnCode, SignDocImageParameters aImageParameters, double aTrust) |
Clean frames. More... | |
SignDocImageRect | removeMargins (out ReturnCode aReturnCode, SignDocImageParameters aImageParameters) |
Remove white margins. More... | |
SignDocWeightedFrame[] | getFrames (out ReturnCode aReturnCode, SignDocImageParameters aImageParameters) |
Get the frames of the image. More... | |
int[] | getSplitPositions (out ReturnCode aReturnCode, SignDocImageParameters aImageParameters) |
Get the vertical split positions of the image. More... | |
SignDocMatchResult | matchImage (out ReturnCode aReturnCode, SignDocImage aOther, SignDocMatchParameters aMatchParameters) |
Match against a signature image. More... | |
SignDocMatchResult | matchSignature (out ReturnCode aReturnCode, SignDocSignatureData aOther, SignDocMatchParameters aMatchParameters, SignDocImageParameters aImageParameters) |
Match against a signature. More... | |
SignDocMatchResult | matchReference (out ReturnCode aReturnCode, SignDocSignatureData aOther, SignDocMatchParameters aMatchParameters, SignDocImageParameters aImageParameters) |
Match against a reference. More... | |
byte[] | saveToMemory (out ReturnCode aReturnCode, SignDocImageParameters aParameters) |
Save this image as a blob. More... | |
byte[] | saveToMemory2 (out ReturnCode aReturnCode, string aFormat) |
Save this image as a blob. More... | |
void | saveToFile (out ReturnCode aReturnCode, string aPath, SignDocImageParameters aParameters) |
Save this image to a file. More... | |
void | saveToFile2 (out ReturnCode aReturnCode, string aPath, string aFormat) |
Save this image to a file. More... | |
string | getErrorMessage () |
Get an error message for the last function call. More... | |
A bitmap image.
This class supports images with 1 bit per pixel (bi-level, with RGB palette), 8 bits per pixel (indexed, with RGB palette), and 24 bits per pixel (RGB, 256 levels per color channel). RGB colors are specified as integers of the form 0x00rrggbb (rr is the red component, gg is the green component, bb is the blue component). All three components have values 0 (off) through 255 (on): 0x000000 is black, 0xffffff is white.
Some functions assume (for computing the intensity) that the color profile is sRGB.
Images that have transparent pixels are not supported.
The origin of the coordinate system is in the upper left corner, see Coordinate Systems.
~SignDocImage | ( | ) |
Destructor.
!SignDocImage | ( | ) |
Finalizer.
SignDocImage | ( | ) |
Constructor.
This object won't contain an image, getWidth() and getHeight() will return 0.
SignDocImage | ( | SignDocImage | aSource | ) |
Copy constructor.
[in] | aSource | The object to be copied. |
void clean | ( | out ReturnCode | aReturnCode, |
SignDocImageParameters | aImageParameters, | ||
SignDocCleanParameters | aCleanParameters | ||
) |
Clean a signature image according to the provided parameters.
This function performs multiple clean operations with a single call.
If the image is not a bi-level image, this function will create a bi-level image, clean the bi-level image, and then mask the original image with the cleaned bi-level image, making all parts white that are not considered part of the signature.
The width of the image must not exceed 1280 pixels, the height of the image must not exceed 960 pixels.
See Cleaning signature images for information about cleaning.
[out] | aReturnCode | The return code, ReturnCode.OK iff successful. |
[in] | aImageParameters | Parameters controlling how images are converted to bi-level black and white. If this argument is null, all parameters will be set to their respective default value. |
[in] | aCleanParameters | Actions and parameters. |
SignDocImageRect cleanDate | ( | out ReturnCode | aReturnCode, |
SignDocImageParameters | aImageParameters | ||
) |
Remove handwritten text from the signature image.
Handwritten text (such as a date) will be removed from the signature image. Dirt, lines, and machine-printed text must be removed before calling this function.
After cleaning, the image will be cropped to the signature region.
If the image is not a bi-level image, this function will create a bi-level image, clean the bi-level image, and then crop the original image to the cleaned bi-level image.
If the height or width would become zero, the image will be replaced by a single white pixel (if the image uses a palette, the brightest color in the palette will be used).
The width of the image must not exceed 1280 pixels, the height of the image must not exceed 960 pixels.
See Cleaning signature images for information about cleaning.
[out] | aReturnCode | The return code, ReturnCode.OK iff successful. |
[in] | aImageParameters | Parameters controlling how images are converted to bi-level black and white. If this argument is null, all parameters will be set to their respective default value. |
void cleanFrames | ( | out ReturnCode | aReturnCode, |
SignDocImageParameters | aImageParameters, | ||
double | aTrust | ||
) |
Clean frames.
This function removes all frames that have a weight smaller than aTrust.
If the image is not a bi-level image, this function will create a bi-level image, clean the bi-level image, and then mask the original image with the cleaned bi-level image, making all parts white that are not considered part of the signature.
The width of the image must not exceed 1280 pixels, the height of the image must not exceed 960 pixels.
See Cleaning signature images for information about cleaning.
[out] | aReturnCode | The return code, ReturnCode.OK iff successful. |
[in] | aImageParameters | Parameters controlling how images are converted to bi-level black and white. If this argument is null, all parameters will be set to their respective default value. |
[in] | aTrust | Minimum frame weight (0.0 through 1.0). 0.0 removes dirt, 1.0 removes all frames. |
void cleanLines | ( | out ReturnCode | aReturnCode, |
SignDocImageParameters | aImageParameters | ||
) |
Clean lines.
Horizontal and vertical lines will be removed.
If the image is not a bi-level image, this function will create a bi-level image, clean the bi-level image, and then mask the original image with the cleaned bi-level image, making all parts white that are not considered part of the signature.
The width of the image must not exceed 1280 pixels, the height of the image must not exceed 960 pixels.
See Cleaning signature images for information about cleaning.
[out] | aReturnCode | The return code, ReturnCode.OK iff successful. |
[in] | aImageParameters | Parameters controlling how images are converted to bi-level black and white. If this argument is null, all parameters will be set to their respective default value. |
SignDocImageRect cleanSignature | ( | out ReturnCode | aReturnCode, |
SignDocImageParameters | aImageParameters | ||
) |
Clean a signature image.
This function cleans horizontal Lines, printed text, and dirt not being part of a signature.
After cleaning, the image will be cropped to the signature region.
If the image is not a bi-level image, this function will create a bi-level image, clean the bi-level image, and then crop the original image to the cleaned bi-level image.
If the height or width would become zero, the image will be replaced by a single white pixel (if the image uses a palette, the brightest color in the palette will be used).
The width of the image must not exceed 1280 pixels, the height of the image must not exceed 960 pixels.
See Cleaning signature images for information about cleaning.
[out] | aReturnCode | The return code, ReturnCode.OK iff successful. |
[in] | aImageParameters | Parameters controlling how images are converted to bi-level black and white. If this argument is null, all parameters will be set to their respective default value. |
void clear | ( | ) |
Remove the image from this object.
SignDocImage clone | ( | ) |
Create a copy of this object.
void convertToBiLevel | ( | out ReturnCode | aReturnCode, |
SignDocImageParameters | aImageParameters | ||
) |
Convert the image to bi-level black and white.
This function uses thresholding.
Unlike SignWare's SPImageBinarize(), this function never inverts the image.
[out] | aReturnCode | The return code, ReturnCode.OK iff successful. |
[in] | aImageParameters | Parameters controlling how images are converted to bi-level black and white. If this argument is null, all parameters will be set to their respective default value. |
void convertToGrayscale | ( | out ReturnCode | aReturnCode | ) |
Convert the image to 8-bit grayscale.
[out] | aReturnCode | The return code, ReturnCode.OK iff successful. |
void convertToTrueColor | ( | out ReturnCode | aReturnCode | ) |
Convert the image to 24-bit RGB (8 bits per color channel).
[out] | aReturnCode | The return code, ReturnCode.OK iff successful. |
void crop | ( | out ReturnCode | aReturnCode, |
int | aX, | ||
int | aY, | ||
int | aWidth, | ||
int | aHeight | ||
) |
Crop the image.
The the rectangle to be preserved must lie completely within the current image.
[out] | aReturnCode | The return code, ReturnCode.OK iff successful. |
[in] | aX | The X coordinate of the upper left corner of the rectangle that will be preserved. |
[in] | aY | The Y coordinate of the upper left corner of the rectangle that will be preserved. |
[in] | aWidth | The width of the rectangle that will be preserved. Must be positive. |
[in] | aHeight | The height of the rectangle that will be preserved. Must be positive. |
void drawLine | ( | out ReturnCode | aReturnCode, |
int | aX1, | ||
int | aY1, | ||
int | aX2, | ||
int | aY2, | ||
double | aStrokeWidth, | ||
int | aColor | ||
) |
Draw a line.
[out] | aReturnCode | The return code, ReturnCode.OK iff successful. |
[in] | aX1 | X coordinate of the first endpoint of the line. |
[in] | aY1 | Y coordinate of the first endpoint of the line. |
[in] | aX2 | X coordinate of the second endpoint of the line. |
[in] | aY2 | Y coordinate of the second endpoint of the line. |
[in] | aStrokeWidth | Stroke width in pixels (need not be an integer, 0 for minimum width). |
[in] | aColor | The RGB color (0x00rrggbb). This function fails if the color does not exist in the palette of an indexed image. |
void drawRect | ( | out ReturnCode | aReturnCode, |
int | aX1, | ||
int | aY1, | ||
int | aX2, | ||
int | aY2, | ||
double | aRadiusX, | ||
double | aRadiusY, | ||
double | aStrokeWidth, | ||
int | aColor, | ||
bool | aFill | ||
) |
Draw a rectangle (with both lines parallel to the axes).
If aRadiusX and aRadiusY are positive, a quarter ellipse will be drawn in each corner. If aRadiusX or aRadiusY is zero, a normal rectangle will be drawn.
[out] | aReturnCode | The return code, ReturnCode.OK iff successful. |
[in] | aX1 | X coordinate of the first corner of the rectangle. |
[in] | aY1 | Y coordinate of the first corner of the rectangle. |
[in] | aX2 | X coordinate of the opposite corner of the rectangle. |
[in] | aY2 | Y coordinate of the opposite corner of the rectangle. |
[in] | aRadiusX | Horizontal radius of quarter ellipse. |
[in] | aRadiusY | Vertical radius of quarter ellipse. |
[in] | aStrokeWidth | Stroke width in pixels (need not be an integer, 0 for minimum width). |
[in] | aColor | The RGB color (0x00rrggbb). This function fails if the color does not exist in the palette of an indexed image. |
[in] | aFill | true to fill interior of rectangle, false to stroke border. For filling you might want do use 0 for aStrokeWidth as the stroked rectangle will be filled, that is, the outer dimensions of the rectangle don't depend on aFill. |
void drawRect | ( | out ReturnCode | aReturnCode, |
SignDocImageRect | aRect, | ||
double | aRadiusX, | ||
double | aRadiusY, | ||
double | aStrokeWidth, | ||
int | aColor, | ||
bool | aFill | ||
) |
Draw a rectangle (with both lines parallel to the axes).
If aRadiusX and aRadiusY are positive, a quarter ellipse will be drawn in each corner. If aRadiusX or aRadiusY is zero, a normal rectangle will be drawn.
[out] | aReturnCode | The return code, ReturnCode.OK iff successful. |
[in] | aRect | The rectangle (does not need to be normalized). |
[in] | aRadiusX | Horizontal radius of quarter ellipse. |
[in] | aRadiusY | Vertical radius of quarter ellipse. |
[in] | aStrokeWidth | Stroke width in pixels (need not be an integer, 0 for minimum width). |
[in] | aColor | The RGB color (0x00rrggbb). This function fails if the color does not exist in the palette of an indexed image. |
[in] | aFill | true to fill interior of rectangle, false to stroke border. For filling you might want do use 0 for aStrokeWidth as the stroked rectangle will be filled, that is, the outer dimensions of the rectangle don't depend on aFill. |
int getBitsPerComponent | ( | ) |
Get the number of bits per component.
int getBitsPerPixel | ( | ) |
Get the number of bits per pixel.
This function returns the product of the return values of getNumberOfComponents() and getBitsPerComponent().
int getComplexity | ( | out ReturnCode | aReturnCode, |
SignDocImageParameters | aImageParameters | ||
) |
Compute the complexity of a signature image.
The computed complexity is valid only if this object contains a clean signature image.
The width of the image must not exceed 1280 pixels, the height of the image must not exceed 960 pixels.
[out] | aReturnCode | The return code, ReturnCode.OK iff successful. |
[in] | aImageParameters | Parameters controlling how images are converted to bi-level black and white. If this argument is null, all parameters will be set to their respective default value. |
string getErrorMessage | ( | ) |
Get an error message for the last function call.
SignDocWeightedFrame [] getFrames | ( | out ReturnCode | aReturnCode, |
SignDocImageParameters | aImageParameters | ||
) |
Get the frames of the image.
This function computes the frames and their weights. Frame weights are floating-point numbers in the range 0.0 through 1.0: 0.0 identifies dirt, 1.0 identifies frames that are part of a signature.
If the image is not a bi-level image, this function will create a temporary bi-level image.
The width of the image must not exceed 1280 pixels, the height of the image must not exceed 960 pixels.
See Cleaning signature images for information about cleaning.
[out] | aReturnCode | The return code, ReturnCode.OK iff successful. |
[in] | aImageParameters | Parameters controlling how images are converted to bi-level black and white. If this argument is null, all parameters will be set to their respective default value. |
int getHeight | ( | ) |
Get the height of the image.
int [] getHistogram | ( | out ReturnCode | aReturnCode | ) |
Compute a histogram.
This function computes an array of integers the same size as the palette returned by getPalette(). Element i tells how many pixels use palette entry i.
[out] | aReturnCode | The return code, ReturnCode.OK iff successful. |
int getNumberOfComponents | ( | ) |
Get the number of components.
int getNumberOfPagesFromFile | ( | out ReturnCode | aReturnCode, |
string | aPath | ||
) |
Get the number of subimages (pages) in a file.
This function opens the file, gets the number of subimages from the file, and closes the file.
This SignDocImage object is used only for storing any error message.
[out] | aReturnCode | The return code, ReturnCode.OK iff successful. |
[in] | aPath | The pathname of the file to be read. |
int getNumberOfPagesFromMemory | ( | out ReturnCode | aReturnCode, |
byte[] | aData | ||
) |
Get the number of subimages (pages) in a blob.
This SignDocImage object is used only for storing any error message.
[out] | aReturnCode | The return code, ReturnCode.OK iff successful. |
[in] | aData | A blob containing an image in BMP (Windows bitmap), TIFF, PNG, or GIF format. |
int [] getPalette | ( | out ReturnCode | aReturnCode | ) |
Get the palette.
This function gets the palette of the image as an array of integers representing RGB colors (0x00rrggbb). The array will contain 2 elements if getBitsPerPixel() returns 1, 256 elements if getBitsPerPixel() returns 8, or 0 elements otherwise (the image does not use a palette).
[out] | aReturnCode | The return code, ReturnCode.OK iff successful. |
int getPixelRGB | ( | out ReturnCode | aReturnCode, |
int | aX, | ||
int | aY | ||
) |
Get the RGB color of a pixel.
[out] | aReturnCode | The return code, ReturnCode.OK iff successful. |
[in] | aX | X coordinate. |
[in] | aY | Y coordinate. |
int getPixelValue | ( | out ReturnCode | aReturnCode, |
int | aX, | ||
int | aY | ||
) |
Get the value of a pixel.
[out] | aReturnCode | The return code, ReturnCode.OK iff successful. |
[in] | aX | X coordinate. |
[in] | aY | Y coordinate. |
int getResolutionX | ( | ) |
Get the horizontal resolution of the image.
int getResolutionY | ( | ) |
Get the vertical resolution of the image.
int [] getSplitPositions | ( | out ReturnCode | aReturnCode, |
SignDocImageParameters | aImageParameters | ||
) |
Get the vertical split positions of the image.
If the image is not a bi-level image, this function will create a temporary bi-level image.
The width of the image must not exceed 1280 pixels, the height of the image must not exceed 960 pixels.
See Cleaning signature images for information about cleaning.
[out] | aReturnCode | The return code, ReturnCode.OK iff successful. |
[in] | aImageParameters | Parameters controlling how images are converted to bi-level black and white. If this argument is null, all parameters will be set to their respective default value. |
int getWidth | ( | ) |
Get the width of the image.
void invert | ( | out ReturnCode | aReturnCode, |
bool | aAuto | ||
) |
Invert the image.
It is unspecified whether inverting is done by modifying the palette or by modifying the pixels.
[out] | aReturnCode | The return code, ReturnCode.OK iff successful. |
[in] | aAuto | false to invert the image unconditionally, true to invert the image only if more than half the pixels have brightness (0 through 255) less than 128. |
void loadFromFile | ( | out ReturnCode | aReturnCode, |
string | aPath, | ||
int | aIndex | ||
) |
Load an image from a file.
This function opens the file, loads the image from the file, and closes the file.
[out] | aReturnCode | The return code, ReturnCode.OK iff successful. |
[in] | aPath | The pathname of the file to be read. |
[in] | aIndex | 0-based page number for selecting a subimage (page) of the source image. |
void loadFromMemory | ( | out ReturnCode | aReturnCode, |
byte[] | aData, | ||
int | aIndex | ||
) |
Load an image from a blob.
[out] | aReturnCode | The return code, ReturnCode.OK iff successful. |
[in] | aData | A blob containing an image in BMP (Windows bitmap), TIFF, PNG, or GIF format. |
[in] | aIndex | 0-based page number for selecting a subimage (page) of the source image. |
SignDocMatchResult matchImage | ( | out ReturnCode | aReturnCode, |
SignDocImage | aOther, | ||
SignDocMatchParameters | aMatchParameters | ||
) |
Match against a signature image.
The license must allow comparing signatures.
[out] | aReturnCode | The return code, ReturnCode.OK iff successful. |
[in] | aOther | The signature image to match against. |
[in] | aMatchParameters | Parameters controlling how signature are matched. If this argument is null, all parameters will be set to their respective default value. |
SignDocMatchResult matchReference | ( | out ReturnCode | aReturnCode, |
SignDocSignatureData | aOther, | ||
SignDocMatchParameters | aMatchParameters, | ||
SignDocImageParameters | aImageParameters | ||
) |
Match against a reference.
This function fails if aOther does not have type SignatureDataType.Reference.
The license must allow comparing signatures.
[out] | aReturnCode | The return code, ReturnCode.OK iff successful. |
[in] | aOther | The reference to match against. |
[in] | aMatchParameters | Parameters controlling how signature are matched. If this argument is null, all parameters will be set to their respective default value. |
[in] | aImageParameters | Parameters controlling how signature are rendered as images for static matching. If this argument is null, all parameters will be set to their respective default value. String parameter "Format" will be ignored. |
SignDocMatchResult matchSignature | ( | out ReturnCode | aReturnCode, |
SignDocSignatureData | aOther, | ||
SignDocMatchParameters | aMatchParameters, | ||
SignDocImageParameters | aImageParameters | ||
) |
Match against a signature.
If aOther has type SignatureDataType.Reference, SignDocSignatureData.selectSignature() must be called once for aOther before calling this function.
This function fails if aOther has type SignatureDataType.Empty.
The license must allow comparing signatures.
[out] | aReturnCode | The return code, ReturnCode.OK iff successful. |
[in] | aOther | The signature or reference to match against. |
[in] | aMatchParameters | Parameters controlling how signature are matched. If this argument is null, all parameters will be set to their respective default value. |
[in] | aImageParameters | Parameters controlling how signature are rendered as images for static matching. If this argument is null, all parameters will be set to their respective default value. String parameter "Format" will be ignored. |
void mirrorX | ( | out ReturnCode | aReturnCode | ) |
Mirror along the vertical axis (flip horizontally).
[out] | aReturnCode | The return code, ReturnCode.OK iff successful. |
void mirrorY | ( | out ReturnCode | aReturnCode | ) |
Mirror along the horizontal axis (flip vertically).
[out] | aReturnCode | The return code, ReturnCode.OK iff successful. |
SignDocImageRect removeMargins | ( | out ReturnCode | aReturnCode, |
SignDocImageParameters | aImageParameters | ||
) |
Remove white margins.
This function removes white margins ignoring single black pixels.
If the image is not a bi-level image, this function will create a bi-level image, clean the bi-level image, and then crop the original image to the cleaned bi-level image.
If the height or width would become zero, the image will be replaced by a single white pixel (if the image uses a palette, the brightest color in the palette will be used).
The width of the image must not exceed 1280 pixels, the height of the image must not exceed 960 pixels.
See Cleaning signature images for information about cleaning.
[out] | aReturnCode | The return code, ReturnCode.OK iff successful. |
[in] | aImageParameters | Parameters controlling how images are converted to bi-level black and white. If this argument is null, all parameters will be set to their respective default value. |
void resizeToResolution | ( | out ReturnCode | aReturnCode, |
int | aResolutionX, | ||
int | aResolutionY, | ||
string | aFilter | ||
) |
Resize the image.
This function may change the pixel format.
[out] | aReturnCode | The return code, ReturnCode.OK iff successful. |
[in] | aResolutionX | The new horizontal resolution of the image in DPI. Must be positive. |
[in] | aResolutionY | The new vertical resolution of the image in DPI. Must be positive. |
[in] | aFilter | The resampling filter, an empty string for the default filter. The following filters are available (case-sensitive):
|
void rotate | ( | out ReturnCode | aReturnCode, |
int | aAngle, | ||
int | aBackgroundColor | ||
) |
Rotate the image.
If the image has 1 bit per pixel, aAngle must be an integer multiple of 90.
The resolution of the image is adjusted only if aAngle is an even integer multiple of 90.
This function fails exception if aAngle is not an integer multiple of 90, the image uses a palette, and aBackgroundColor is not a color in the palette.
[out] | aReturnCode | The return code, ReturnCode.OK iff successful. |
[in] | aAngle | Rotation angle (degrees), positive for counter-clockwise, negative for clockwise. |
[in] | aBackgroundColor | The RGB color (0x00rrggbb) to be used for filling pixels that are not mapped from the source image. This value is used only if aAngle is not an integer multiple of 90. |
void saveToFile | ( | out ReturnCode | aReturnCode, |
string | aPath, | ||
SignDocImageParameters | aParameters | ||
) |
Save this image to a file.
The following parameters of aParameters are used:
[out] | aReturnCode | The return code, ReturnCode.OK iff successful. |
[in] | aPath | The pathname of the file to be created or overwritten. |
[in] | aParameters | Parameters controlling the format of the blob. |
void saveToFile2 | ( | out ReturnCode | aReturnCode, |
string | aPath, | ||
string | aFormat | ||
) |
Save this image to a file.
This is a simplified version of saveToFile().
[out] | aReturnCode | The return code, ReturnCode.OK iff successful. |
[in] | aPath | The pathname of the file to be created or overwritten. |
[in] | aFormat | The format to be used for the image file:
|
byte [] saveToMemory | ( | out ReturnCode | aReturnCode, |
SignDocImageParameters | aParameters | ||
) |
Save this image as a blob.
The following parameters of aParameters are used:
[out] | aReturnCode | The return code, ReturnCode.OK iff successful. |
[in] | aParameters | Parameters controlling the format of the blob. |
byte [] saveToMemory2 | ( | out ReturnCode | aReturnCode, |
string | aFormat | ||
) |
Save this image as a blob.
This is a simplified version of saveToMemory().
[out] | aReturnCode | The return code, ReturnCode.OK iff successful. |
[in] | aFormat | The format to be used for the image blob:
|
void setEmpty | ( | out ReturnCode | aReturnCode, |
int | aWidth, | ||
int | aHeight, | ||
int | aBitsPerPixel, | ||
int | aColor | ||
) |
Replace this image with an empty one of the specified size.
The resolution will be set to 72 dots per inch.
[out] | aReturnCode | The return code, ReturnCode.OK iff successful. |
[in] | aWidth | The width of the image (in pixels). Must be positive. |
[in] | aHeight | The height of the image (in pixels). Must be positive. |
[in] | aBitsPerPixel | Number of bits per pixel: 1 (bi-level black and white), 8 (grayscale), or 24 (RGB). |
[in] | aColor | All pixels will be set to this color. If aBitsPerPixel is 24, this is an RGB color (0x00rrggbb), otherwise this is an index into the palette (0 is black). |
void setPaletteAt | ( | out ReturnCode | aReturnCode, |
int | aIndex, | ||
int | aColor | ||
) |
Set a palette entry.
[out] | aReturnCode | The return code, ReturnCode.OK iff successful. |
[in] | aIndex | The 0-based index of the palette entry (0 through 1 if getBitsPerPixel() returns 1, 0 through 255 if getBitsPerPixel() returns 8). |
[in] | aColor | The new color for the palette entry (0x00rrggbb). |
void setPixelRGB | ( | out ReturnCode | aReturnCode, |
int | aX, | ||
int | aY, | ||
int | aColor | ||
) |
Set the RGB color of a pixel.
[out] | aReturnCode | The return code, ReturnCode.OK iff successful. |
[in] | aX | X coordinate. |
[in] | aY | Y coordinate. |
[in] | aColor | The new RGB color (0x00rrggbb) of the pixel. This function fails if the color does not exist in the palette of an indexed image. |
void setPixelValue | ( | out ReturnCode | aReturnCode, |
int | aX, | ||
int | aY, | ||
int | aValue | ||
) |
Set the value of a pixel.
[out] | aReturnCode | The return code, ReturnCode.OK iff successful. |
[in] | aX | X coordinate. |
[in] | aY | Y coordinate. |
[in] | aValue | The new value of the pixel. If getBitsPerPixel() returns 1 or 8, this is the index into the palette, if getBitsPerPixel() returns 24, this is the RGB color (0x00rrggbb). For bi-level images, any value greater than 1 has the same effect as 1. |
void setResolution | ( | out ReturnCode | aReturnCode, |
int | aResolutionX, | ||
int | aResolutionY | ||
) |
Set the resolution of the image.
This function does not modify the pixels of the image. Use resizeToResolution() to change the size of the image.
[out] | aReturnCode | The return code, ReturnCode.OK iff successful. |
[in] | aResolutionX | The new horizontal resolution of the image in DPI. Must be positive. |
[in] | aResolutionY | The new vertical resolution of the image in DPI. Must be positive. |