CAM Library
API Reference
Display Functions

Available display options for CAM Library. Mostly used when generating image files. More...

Functions

int camlib_display_Filter (int nFlashes, int nPaths, int nPolygons, int nLines, int nText)
 Show or hide various figures by their types. More...
 
int camlib_display_FillMode (int value)
 Set the fill mode for the design. Typically fill mode is used when outputting an image. More...
 
int camlib_display_Polarity (int value)
 Set the display polarity for the design. Default is 0. More...
 
int camlib_display_Overlay (int value)
 Set the display overlay for the design. Default is 0 (no overlay). More...
 
int camlib_display_LevelOfDetail (int value)
 Allows CAM Library to only display figures in the exported images greater than the defined pixel size. Essientially whenever an image is exported if the figures appears smaller than the pixel value, they will be omitted from the image. More...
 
int camlib_display_ZoomIn (int mouseX, int mouseY)
 Zoom in 2X magnification using the give coordinates as the center. More...
 
int camlib_display_ZoomOut (int mouseX, int mouseY)
 Zoom out 0.5X magnification using the give coordinates as the center. More...
 
int camlib_display_ZoomWindow (int nLeft, int nBottom, int nRight, int nTop)
 Zoom to a defined rectangular region. More...
 
int camlib_display_ZoomAll ()
 Zoom out to the extents of the active design. More...
 
int camlib_display_ZoomPan (int XOffset, int YOffset)
 Zoom to a new center. The image magnification stays the same. More...
 
int camlib_display_RefreshScreenImage ()
 Generates a new "Screen Image" using the current viewport. Perfect for quickly generating an update snapshot screen image of the current viewport. Anytime the design viewport changes, such as zoom in/out, layers on/off, fill on/off use the command to quickly generate a new image. Requires that you first call camlib_display_RefreshScreenImage() and assign the refresh image path, width and height. More...
 
int camlib_display_InitializeScreenImage (char *png_image_path, int nWidth, int nHeight)
 Assigns the "Screen Image" path, width, and height.
Requires that you first initialize with camlib_display_RefreshScreenImage() before using camlib_display_RefreshScreenImage(). More...
 
int camlib_display_GetViewportScreenImage (float &fX, float &fY, float &fPixelScale, char *sUnits)
 Retrieves the current "Screen Image" viewport (center, scale, and units) used by camlib_display_RefreshScreenImage(). More...
 

Detailed Description

Available display options for CAM Library. Mostly used when generating image files.

Function Documentation

◆ camlib_display_FillMode()

int camlib_display_FillMode ( int  value)

Set the fill mode for the design. Typically fill mode is used when outputting an image.

Parameters
valueFill mode to use when figures are displayed - defined by CAM_FillType.
Returns
Returns 0 if successful, else -1.
See also
CAM_FillType

◆ camlib_display_Filter()

int camlib_display_Filter ( int  nFlashes,
int  nPaths,
int  nPolygons,
int  nLines,
int  nText 
)

Show or hide various figures by their types.

Parameters
nFlashesIf set to 0 Flashes will be hidden. If set to 1 Flashes will be visible.
nPathsIf set to 0 Flashes will be hidden. If set to 1 Flashes will be visible.
nPolygonsIf set to 0 Flashes will be hidden. If set to 1 Flashes will be visible.
nLinesIf set to 0 Flashes will be hidden. If set to 1 Flashes will be visible.
nTextIf set to 0 Text will be hidden. If set to 1 Text will be visible. Only works with Text figures. In many CAM files, Text is simply drawn as paths/lines; in those situations this parameter has no effect.
Returns
Returns 0 if successful, else -1.

◆ camlib_display_GetViewportScreenImage()

int camlib_display_GetViewportScreenImage ( float &  fX,
float &  fY,
float &  fPixelScale,
char *  sUnits 
)

Retrieves the current "Screen Image" viewport (center, scale, and units) used by camlib_display_RefreshScreenImage().

Parameters
fXX value for the viewport center of the Screen image.
fYY value for the center of the Screen image.
fPixelScaleViewport scale used for the Screen image.
sUnitsViewport units used for the Screen image.
Returns
Returns 0 if successful, else -1.
See also
camlib_display_InitializeScreenImage

◆ camlib_display_InitializeScreenImage()

int camlib_display_InitializeScreenImage ( char *  png_image_path,
int  nWidth,
int  nHeight 
)

Assigns the "Screen Image" path, width, and height.
Requires that you first initialize with camlib_display_RefreshScreenImage() before using camlib_display_RefreshScreenImage().

Parameters
png_image_pathLocation of refresh image.
nWidthWidth of refresh image.
nHeightHeight of refresh image.
Returns
Returns 0 if successful, else -1.
Note
This feature works well for online viewers by refreshing any changes made to the design state.
See also
camlib_display_RefreshScreenImage

◆ camlib_display_LevelOfDetail()

int camlib_display_LevelOfDetail ( int  value)

Allows CAM Library to only display figures in the exported images greater than the defined pixel size. Essientially whenever an image is exported if the figures appears smaller than the pixel value, they will be omitted from the image.

Parameters
valueAssign the minimum size (in pixels) of an figure to be displayed in an exported image. Set to 0 for all figures to pass.
Returns
Returns 0 if successful, else -1.
Note
The primary purpose of camlib_display_LevelOfDetail is to allow CAM Library to quickly process large/dense designs very well.

◆ camlib_display_Overlay()

int camlib_display_Overlay ( int  value)

Set the display overlay for the design. Default is 0 (no overlay).

Essientially whenever there are multiple layers, any regions where overlap occurs will either be translucent (i.e see-through) or solid (opaque).

Parameters
valueSet to 0 for Solid Opaque overlay. Set to 1 for a Translucent (see-through) overlay.
Returns
Returns 0 if successful, else -1.

◆ camlib_display_Polarity()

int camlib_display_Polarity ( int  value)

Set the display polarity for the design. Default is 0.

Parameters
valueSet to 0 for a Black background on exported images. Set to 1 for a White background on exported images.
Returns
Returns 0 if successful, else -1.

◆ camlib_display_RefreshScreenImage()

int camlib_display_RefreshScreenImage ( )

Generates a new "Screen Image" using the current viewport. Perfect for quickly generating an update snapshot screen image of the current viewport. Anytime the design viewport changes, such as zoom in/out, layers on/off, fill on/off use the command to quickly generate a new image. Requires that you first call camlib_display_RefreshScreenImage() and assign the refresh image path, width and height.

Returns
Returns 0 if successful, else -1.
Note
This feature works well for online viewers by refreshing any changes made to the design state.
See also
camlib_display_InitializeScreenImage

◆ camlib_display_ZoomAll()

int camlib_display_ZoomAll ( )

Zoom out to the extents of the active design.

Returns
Returns 0 if successful, else -1.
Note
Perfect when exporting images and the entire extents are required.

◆ camlib_display_ZoomIn()

int camlib_display_ZoomIn ( int  mouseX,
int  mouseY 
)

Zoom in 2X magnification using the give coordinates as the center.

Parameters
mouseXX value (in pixels) used for the center of the zoomed in region.
mouseYY value (in pixels) used for the center of the zoomed in region.
Returns
Returns 0 if successful, else -1.
Note
Perfect when exporting images and a zoom magnification is required.

◆ camlib_display_ZoomOut()

int camlib_display_ZoomOut ( int  mouseX,
int  mouseY 
)

Zoom out 0.5X magnification using the give coordinates as the center.

Parameters
mouseXX value (in pixels) used for the center of the zoomed out region.
mouseYY value (in pixels) used for the center of the zoomed out region.
Returns
Returns 0 if successful, else -1.
Note
Perfect when exporting images and a zoom out is required.

◆ camlib_display_ZoomPan()

int camlib_display_ZoomPan ( int  XOffset,
int  YOffset 
)

Zoom to a new center. The image magnification stays the same.

Parameters
XOffsetX value for the new center.
YOffsetY value for the new center.
Returns
Returns 0 if successful, else -1.

◆ camlib_display_ZoomWindow()

int camlib_display_ZoomWindow ( int  nLeft,
int  nBottom,
int  nRight,
int  nTop 
)

Zoom to a defined rectangular region.

Parameters
nLeftLeft value (in pixels) used for the rectangular region.
nBottomBottom value (in pixels) used for the rectangular region.
nRightRight value (in pixels) used for the rectangular region.
nTopTop value (in pixels) used for the rectangular region.
Returns
Returns 0 if successful, else -1.
Note
Perfect when exporting images and a specific rectangular region is required.