Pressure Sensitive Ink

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...

Classes

struct  FSCRT_PSI
 Handle type to Pressure Sensitive Ink. More...
 

Functions

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...
 

Macro Definitions for Point Flags

Note
These definitions is used in the function FSCRT_PSI_AddPoint.
#define FSCRT_PSI_PT_LINETO   FSCRT_POINTTYPE_LINETO
 Point adding flags of LINE TO.
 
#define FSCRT_PSI_PT_MOVETO   FSCRT_POINTTYPE_MOVETO
 Point adding flags of MOVE TO.
 
#define FSCRT_PSI_PT_ENDPATH   0x08
 Point adding flags of END PATH.
 

Detailed Description

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:

Function Documentation

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.

Parameters
[in]psiHandle to a FSCRT_PSI object.
[in]xThe value of x-coordinate in canvas coordinate.
[in]yThe value of y-coordinate in canvas coordinate.
[in]pressurePressure value of current point, between 0 and 1.
[in]pointTypePoint 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]psiHandle to a FSCRT_PSI handle.
[in]psiRectPointer to a FSCRT_RECTF structure which is a psi rect in device coordinate.
[in]pdfPageHandle to a FSCRT_PAGE object which is a PDF page object. It should be valid.
[in]annotRectPointer to a FSCRT_RECTF structure which is a annot rect in page coordinate.
[out]annotPointer 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.
FS_RESULT FSCRT_PSI_Create ( FS_BOOL  simulate,
FSCRT_PSI *  psi 
)

Create a pressure sensitive ink object.

Parameters
[in]simulateTurn 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]psiPointer 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.
FS_RESULT FSCRT_PSI_GetContentsRect ( FSCRT_PSI  psi,
FSCRT_RECTF psiRect 
)

Get contents rectangle of a pressure sensitive ink object.

Parameters
[in]psiHandle to a FSCRT_PSI object.
[out]psiRectPointer 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.
FS_RESULT FSCRT_PSI_InitCanvas ( FSCRT_PSI  psi,
FS_FLOAT  width,
FS_FLOAT  height 
)

Initialize a canvas for pressure sensitive ink.

Parameters
[in]psiHandle to a FSCRT_PSI object.
[in]widthWidth of pressure sensitive ink canvas. This shall be greater than 0.
[in]heightHeight 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.
FS_RESULT FSCRT_PSI_Release ( FSCRT_PSI  psi)

Destroy a pressure sensitive ink object.

Parameters
[in]psiHandle 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.
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.

Parameters
[in]psiHandle to a FSCRT_PSI object.
[in]rendererHandle to a FSCRT_RENDERER object.
[in]xDesLeft pixel position of the given area to render in coordinate of destination.
[in]yDesTop pixel position of the given area to render in coordinate of destination.
[in]widthWidth to render in coordinate of destination.
[in]heightHeight to render in coordinate of destination.
[in]xSrcLeft pixel position of display area in coordinate of canvas.
[in]ySrcTop 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.
FS_RESULT FSCRT_PSI_SetInkColor ( FSCRT_PSI  psi,
FS_ARGB  color 
)

Set ink color of a pressure sensitive ink object.

Parameters
[in]psiHandle to a FSCRT_PSI object.
[in]colorInk 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.
FS_RESULT FSCRT_PSI_SetInkDiameter ( FSCRT_PSI  psi,
FS_INT32  diameter 
)

Set ink diameter of a pressure sensitive ink object.

Parameters
[in]psiHandle to a FSCRT_PSI object.
[in]diameterInk 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.
FS_RESULT FSCRT_PSI_SetOpacity ( FSCRT_PSI  psi,
FS_FLOAT  opacity 
)

Set ink opacity of a pressure sensitive ink object.

Parameters
[in]psiHandle to a FSCRT_PSI object.
[in]opacityInk 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.

Foxit Corporation