Definitions for Pressure Sensitive Ink.
Definitions and functions in this module are included in fs_psi_w.h.
Module: PSI
License Identifier: PSI/All
Available License Right: Writing.
More...
|
FS_RESULT | FSCRT_PSI_Create (FS_BOOL simulate, FSCRT_PSI *psi) |
| Create a pressure sensitive ink object. More...
|
|
FS_RESULT | FSCRT_PSI_Release (FSCRT_PSI psi) |
| Destroy a pressure sensitive ink object. More...
|
|
FS_RESULT | FSCRT_PSI_InitCanvas (FSCRT_PSI psi, FS_FLOAT width, FS_FLOAT height) |
| Initialize a canvas for pressure sensitive ink. More...
|
|
FS_RESULT | FSCRT_PSI_SetInkColor (FSCRT_PSI psi, FS_ARGB color) |
| Set ink color of a pressure sensitive ink object. More...
|
|
FS_RESULT | FSCRT_PSI_SetInkDiameter (FSCRT_PSI psi, FS_INT32 diameter) |
| Set ink diameter of a pressure sensitive ink object. More...
|
|
FS_RESULT | FSCRT_PSI_SetOpacity (FSCRT_PSI psi, FS_FLOAT opacity) |
| Set ink opacity of a pressure sensitive ink object. More...
|
|
FS_RESULT | FSCRT_PSI_GetContentsRect (FSCRT_PSI psi, FSCRT_RECTF *psiRect) |
| Get contents rectangle of a pressure sensitive ink object. More...
|
|
FS_RESULT | FSCRT_PSI_AddPoint (FSCRT_PSI psi, FS_FLOAT x, FS_FLOAT y, FS_FLOAT pressure, FS_DWORD pointType) |
| Add a point to a pressure sensitive ink object. More...
|
|
FS_RESULT | FSCRT_PSI_Render (FSCRT_PSI psi, FSCRT_RENDERER renderer, FS_INT32 xDes, FS_INT32 yDes, FS_INT32 width, FS_INT32 height, FS_FLOAT xSrc, FS_FLOAT ySrc) |
| Render a pressure sensitive ink object. More...
|
|
FS_RESULT | FSCRT_PSI_ConvertToPDFAnnot (FSCRT_PSI psi, const FSCRT_RECTF *psiRect, FSCRT_PAGE pdfPage, const FSCRT_RECTF *annotRect, FSCRT_ANNOT *annot) |
| Convert a pressure sensitive ink object to a PDF annotation. More...
|
|
Definitions for Pressure Sensitive Ink.
Definitions and functions in this module are included in fs_psi_w.h.
Module: PSI
License Identifier: PSI/All
Available License Right: Writing.
This module contains the following features:
-
1. Pressure sensitive ink (PSI):
-
a. Create a PSI object and initialize a canvas, set properties, add points data, render PSI or convert PSI objects to PDF annotations.
-
b. PSI is defined for manual signature especially, and usually works together with a handwriting board. PSI contains private coordinates, and a canvas is created in its coordinates. Canvas limits operating area and generates appearance of PSI.
-
c. Note: FSCRT_PSI_ConvertToPDFAnnot requires that PDF module is intialized and a PDF page object is available.
Add a point to a pressure sensitive ink object.
- Parameters
-
[in] | psi | Handle to a FSCRT_PSI object. |
[in] | x | The value of x-coordinate in canvas coordinate. |
[in] | y | The value of y-coordinate in canvas coordinate. |
[in] | pressure | Pressure value of current point, between 0 and 1. |
[in] | pointType | Point type. Please refer to macro definitions FSCRT_PSI_PT_XXX and this should be one of these macros. |
- Returns
- FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if the parameter psi is NULL.
FSCRT_ERRCODE_UNRECOVERABLE if an unrecoverable error occurs.
For more definitions please see macro definitions FSCRT_ERRCODE_XXX.
- Note
- Coordinate of canvas is the same with device coordinate.
- Attention
- Thread Safety: this function is thread safe.
OOM Information:
OOM handling is only for mobile platforms, not for server or desktop.
-
This function is short-term.
-
psi: this handle is long-term partially recoverable.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSCRT_PSI_ConvertToPDFAnnot |
( |
FSCRT_PSI |
psi, |
|
|
const FSCRT_RECTF * |
psiRect, |
|
|
FSCRT_PAGE |
pdfPage, |
|
|
const FSCRT_RECTF * |
annotRect, |
|
|
FSCRT_ANNOT * |
annot |
|
) |
| |
Convert a pressure sensitive ink object to a PDF annotation.
- Parameters
-
[in] | psi | Handle to a FSCRT_PSI handle. |
[in] | psiRect | Pointer to a FSCRT_RECTF structure which is a psi rect in device coordinate. |
[in] | pdfPage | Handle to a FSCRT_PAGE object which is a PDF page object. It should be valid. |
[in] | annotRect | Pointer to a FSCRT_RECTF structure which is a annot rect in page coordinate. |
[out] | annot | Pointer to a FSCRT_ANNOT handle that receives a newly added PSInk annotation. If there is any errors, it will be NULL. |
- Returns
- FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if the parameter psi, psiRect, annotRect or annotIndex is NULL.
FSCRT_ERRCODE_UNRECOVERABLE if an unrecoverable error occurs.
FSCRT_ERRCODE_ERROR if fail to generate Pressure Sensitive Ink information to a PDF page for other reasons.
For more definitions please see macro definitions FSCRT_ERRCODE_XXX.
- Attention
- Thread Safety: this function is thread safe.
OOM Information:
OOM handling is only for mobile platforms, not for server or desktop.
-
This function is short-term.
-
psi: this handle is long-term partially recoverable.
-
pdfPage: this handle is long-term partially recoverable.
-
annot: this handle is short-term.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
Create a pressure sensitive ink object.
- Parameters
-
[in] | simulate | Turn on/off simulation of Pressure Sensitive Ink: TRUE means to turn on simulation, and FALSE means to turn off simulation.
It can simulate handwriting weights by writing speed when simulation is on. |
[out] | psi | Pointer to a FSCRT_PSI handle that receives a handle of Pressure Sensitive Ink. |
- Returns
- FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if the parameter psi is NULL.
FSCRT_ERRCODE_OUTOFMEMORY if there is not enough memory or invalid memory access.
For more definitions please see macro definitions FSCRT_ERRCODE_XXX.
- Attention
- Thread Safety: this function is thread safe.
OOM Information:
OOM handling is only for mobile platforms, not for server or desktop.
-
This function is long-term recoverable.
-
psi: this handle is long-term partially recoverable.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
Get contents rectangle of a pressure sensitive ink object.
- Parameters
-
[in] | psi | Handle to a FSCRT_PSI object. |
[out] | psiRect | Pointer to a valid FSCRT_RECTF structure that receives a rectangle of a pressure sensitive ink object in device coordinate. |
- Returns
- FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if the parameter psi or psiRect is NULL.
For more definitions please see macro definitions FSCRT_ERRCODE_XXX.
- Attention
- Thread Safety: this function is thread safe.
OOM Information:
OOM handling is only for mobile platforms, not for server or desktop.
-
This function is short-term.
-
psi: this handle is long-term partially recoverable.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
Initialize a canvas for pressure sensitive ink.
- Parameters
-
[in] | psi | Handle to a FSCRT_PSI object. |
[in] | width | Width of pressure sensitive ink canvas. This shall be greater than 0. |
[in] | height | Height of pressure sensitive ink canvas. This shall be greater than 0. |
- Returns
- FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if the parameter psi is NULL, or width or height is invalid.
FSCRT_ERRCODE_UNSUPPORTED if the size of canvas(calculated as width*height*4) is greater than 2GB.
FSCRT_ERRCODE_ERROR if fail to initialize the given canvas for other reasons.
FSCRT_ERRCODE_UNRECOVERABLE if an unrecoverable error occurs.
For more definitions please see macro definitions FSCRT_ERRCODE_XXX.
- Attention
- Thread Safety: this function is thread safe..
OOM Information:
OOM handling is only for mobile platforms, not for server or desktop.
-
This function is long-term recoverable.
-
psi: this handle is long-term partially recoverable.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
Destroy a pressure sensitive ink object.
- Parameters
-
[in] | psi | Handle to a FSCRT_PSI object. |
- Returns
- FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if the parameter psi is NULL.
For more definitions please see macro definitions FSCRT_ERRCODE_XXX.
- Attention
- Thread Safety: this function is not thread safe. Applications need to make sure thread safety by themselves when accessing the same objects during multi-thread environments..
OOM Information:
OOM handling is only for mobile platforms, not for server or desktop.
-
This function is long-term recoverable.
-
psi: this handle is long-term partially recoverable.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
Render a pressure sensitive ink object.
- Parameters
-
[in] | psi | Handle to a FSCRT_PSI object. |
[in] | renderer | Handle to a FSCRT_RENDERER object. |
[in] | xDes | Left pixel position of the given area to render in coordinate of destination. |
[in] | yDes | Top pixel position of the given area to render in coordinate of destination. |
[in] | width | Width to render in coordinate of destination. |
[in] | height | Height to render in coordinate of destination. |
[in] | xSrc | Left pixel position of display area in coordinate of canvas. |
[in] | ySrc | Top pixel position of display area in coordinate of canvas. |
- Returns
- FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if the parameter psi or renderer is NULL.
FSCRT_ERRCODE_UNRECOVERABLE if an unrecoverable error occurs.
FSCRT_ERRCODE_ERROR if fail to render a pressure ink path for other reasons.
For more definitions please see macro definitions FSCRT_ERRCODE_XXX.
- Note
- Coordinate of canvas is the same as device coordinate.
- Attention
- Thread Safety: this function is thread safe.
OOM Information:
OOM handling is only for mobile platforms, not for server or desktop.
-
This function is long-term recoverable.
-
psi: this handle is long-term partially recoverable.
-
renderer: this handle is long-term recoverable.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
Set ink color of a pressure sensitive ink object.
- Parameters
-
[in] | psi | Handle to a FSCRT_PSI object. |
[in] | color | Ink color. It is constructed by 0xrrggbb. |
- Returns
- FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if the parameter psi is NULL.
FSCRT_ERRCODE_UNRECOVERABLE if an unrecoverable error occurs.
For more definitions please see macro definitions FSCRT_ERRCODE_XXX.
- Attention
- Thread Safety: this function is thread safe..
OOM Information:
OOM handling is only for mobile platforms, not for server or desktop.
-
This function is long-term recoverable.
-
psi: this handle is long-term partially recoverable.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
Set ink diameter of a pressure sensitive ink object.
- Parameters
-
[in] | psi | Handle to a FSCRT_PSI object. |
[in] | diameter | Ink diameter. This shall be a positive value. |
- Returns
- FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if the parameter psi is NULL.
FSCRT_ERRCODE_UNRECOVERABLE if an unrecoverable error occurs.
For more definitions please see macro definitions FSCRT_ERRCODE_XXX.
- Attention
- Thread Safety: this function is thread safe..
OOM Information:
OOM handling is only for mobile platforms, not for server or desktop.
-
This function is long-term recoverable.
-
psi: this handle is long-term partially recoverable.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
Set ink opacity of a pressure sensitive ink object.
- Parameters
-
[in] | psi | Handle to a FSCRT_PSI object. |
[in] | opacity | Ink opacity. Valid range: from 0.0 to 1.0 |
- Returns
- FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if the parameter psi is NULL.
FSCRT_ERRCODE_UNRECOVERABLE if an unrecoverable error occurs.
For more definitions please see macro definitions FSCRT_ERRCODE_XXX.
- Attention
- Thread Safety: this function is thread safe..
OOM Information:
OOM handling is only for mobile platforms, not for server or desktop.
-
This function is long-term recoverable.
-
psi: this handle is long-term partially recoverable.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.