Forge: Surface

Forge

Functions
Surface
C API functions

## Functions
FGAPI fg_err | fg_create_surface (fg_surface *pSurface, const unsigned pXPoints, const unsigned pYPoints, const fg_dtype pType, const fg_plot_type pPlotType, const fg_marker_type pMarkerType)
| Create a Surface object. More...
FGAPI fg_err | fg_destroy_surface (fg_surface pSurface)
| Destroy surface object. More...
FGAPI fg_err | fg_set_surface_color (fg_surface pSurface, const float pRed, const float pGreen, const float pBlue, const float pAlpha)
| Set the color of surface. More...
FGAPI fg_err | fg_set_surface_legend (fg_surface pSurface, const char *pLegend)
| Set surface legend. More...
FGAPI fg_err | fg_get_surface_vertex_buffer (unsigned *pOut, const fg_surface pSurface)
| Get the resource identifier for vertices buffer. More...
FGAPI fg_err | fg_get_surface_color_buffer (unsigned *pOut, const fg_surface pSurface)
| Get the resource identifier for colors buffer. More...
FGAPI fg_err | fg_get_surface_alpha_buffer (unsigned *pOut, const fg_surface pSurface)
| Get the resource identifier for alpha values buffer. More...
FGAPI fg_err | fg_get_surface_vertex_buffer_size (unsigned *pOut, const fg_surface pSurface)
| Get the vertices buffer size in bytes. More...
FGAPI fg_err | fg_get_surface_color_buffer_size (unsigned *pOut, const fg_surface pSurface)
| Get the colors buffer size in bytes. More...
FGAPI fg_err | fg_get_surface_alpha_buffer_size (unsigned *pOut, const fg_surface pSurface)
| Get the alpha values buffer size in bytes. More...

## Detailed Description

## Function Documentation

## § fg_create_surface()

FGAPI fg_err fg_create_surface | ( | fg_surface * | pSurface,
|  | const unsigned | pXPoints,
|  | const unsigned | pYPoints,
|  | const fg_dtype | pType,
|  | const fg_plot_type | pPlotType,
|  | const fg_marker_type | pMarkerType
| ) |  |

Create a Surface object.

Parameters

  [out] | pSurface | will be set to surface handle upon creating the surface object
  [in] | pXPoints | is number of data points along X dimension
  [in] | pYPoints | is number of data points along Y dimension
  [in] | pType | takes one of the values of fg_dtype that indicates the integral data type of surface data
  [in] | pPlotType | dictates the type of surface/graph, it can take one of the values of fg_plot_type
  [in] | pMarkerType | indicates which symbol is rendered as marker. It can take one of the values of fg_marker_type.

Returns
  fg_err error code

## § fg_destroy_surface()

FGAPI fg_err fg_destroy_surface | ( | fg_surface | pSurface | ) |

Destroy surface object.

Parameters

  [in] | pSurface | is the surface handle

Returns
  fg_err error code

## § fg_get_surface_alpha_buffer()

FGAPI fg_err fg_get_surface_alpha_buffer | ( | unsigned * | pOut,
|  | const fg_surface | pSurface
| ) |  |

Get the resource identifier for alpha values buffer.

Parameters

  [out] | pOut | will have the buffer identifier after this function is called
  [in] | pSurface | is the surface handle

Returns
  fg_err error code

## § fg_get_surface_alpha_buffer_size()

FGAPI fg_err fg_get_surface_alpha_buffer_size | ( | unsigned * | pOut,
|  | const fg_surface | pSurface
| ) |  |

Get the alpha values buffer size in bytes.

Parameters

  [out] | pOut | will have the buffer size in bytes after this function is called
  [in] | pSurface | is the surface handle

Returns
  fg_err error code

## § fg_get_surface_color_buffer()

FGAPI fg_err fg_get_surface_color_buffer | ( | unsigned * | pOut,
|  | const fg_surface | pSurface
| ) |  |

Get the resource identifier for colors buffer.

Parameters

  [out] | pOut | will have the buffer identifier after this function is called
  [in] | pSurface | is the surface handle

Returns
  fg_err error code

## § fg_get_surface_color_buffer_size()

FGAPI fg_err fg_get_surface_color_buffer_size | ( | unsigned * | pOut,
|  | const fg_surface | pSurface
| ) |  |

Get the colors buffer size in bytes.

Parameters

  [out] | pOut | will have the buffer size in bytes after this function is called
  [in] | pSurface | is the surface handle

Returns
  fg_err error code

## § fg_get_surface_vertex_buffer()

FGAPI fg_err fg_get_surface_vertex_buffer | ( | unsigned * | pOut,
|  | const fg_surface | pSurface
| ) |  |

Get the resource identifier for vertices buffer.

Parameters

  [out] | pOut | will have the buffer identifier after this function is called
  [in] | pSurface | is the surface handle

Returns
  fg_err error code

## § fg_get_surface_vertex_buffer_size()

FGAPI fg_err fg_get_surface_vertex_buffer_size | ( | unsigned * | pOut,
|  | const fg_surface | pSurface
| ) |  |

Get the vertices buffer size in bytes.

Parameters

  [out] | pOut | will have the buffer size in bytes after this function is called
  [in] | pSurface | is the surface handle

Returns
  fg_err error code

## § fg_set_surface_color()

FGAPI fg_err fg_set_surface_color | ( | fg_surface | pSurface,
|  | const float | pRed,
|  | const float | pGreen,
|  | const float | pBlue,
|  | const float | pAlpha
| ) |  |

Set the color of surface.

Parameters

  [in] | pSurface | is the surface handle
  [in] | pRed | is Red component in range [0, 1]
  [in] | pGreen | is Green component in range [0, 1]
  [in] | pBlue | is Blue component in range [0, 1]
  [in] | pAlpha | is Blue component in range [0, 1]

Returns
  fg_err error code

## § fg_set_surface_legend()

FGAPI fg_err fg_set_surface_legend | ( | fg_surface | pSurface,
|  | const char * | pLegend
| ) |  |

Set surface legend.

Parameters

  [in] | pSurface | is the surface handle
  [in] | pLegend |

Returns
  fg_err error code