surface.h
Go to the documentation of this file.
/*******************************************************
* Copyright (c) 2015-2019, ArrayFire
* All rights reserved.
*
* This file is distributed under 3-clause BSD license.
* The complete license agreement can be obtained at:
* http://arrayfire.com/licenses/BSD-3-Clause
********************************************************/
#pragma once
#include <fg/defines.h>
#ifdef __cplusplus
extern "C" {
#endif
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);
FGAPI fg_err fg_retain_surface(fg_surface *pOut, fg_surface pIn);
FGAPI fg_err fg_release_surface(fg_surface pSurface);
FGAPI fg_err fg_set_surface_color(fg_surface pSurface,
const float pRed, const float pGreen,
const float pBlue, const float pAlpha);
FGAPI fg_err fg_set_surface_legend(fg_surface pSurface, const char* pLegend);
FGAPI fg_err fg_get_surface_vertex_buffer(unsigned* pOut, const fg_surface pSurface);
FGAPI fg_err fg_get_surface_color_buffer(unsigned* pOut, const fg_surface pSurface);
FGAPI fg_err fg_get_surface_alpha_buffer(unsigned* pOut, const fg_surface pSurface);
FGAPI fg_err fg_get_surface_vertex_buffer_size(unsigned* pOut, const fg_surface pSurface);
FGAPI fg_err fg_get_surface_color_buffer_size(unsigned* pOut, const fg_surface pSurface);
FGAPI fg_err fg_get_surface_alpha_buffer_size(unsigned* pOut, const fg_surface pSurface);
#ifdef __cplusplus
}
#endif
#ifdef __cplusplus
namespace forge
{
class Surface {
private:
fg_surface mValue;
public:
FGAPI Surface(const unsigned pNumXPoints, const unsigned pNumYPoints, const dtype pDataType,
const PlotType pPlotType=FG_PLOT_SURFACE, const MarkerType pMarkerType=FG_MARKER_NONE);
FGAPI Surface(const Surface& pOther);
FGAPI explicit Surface(const fg_surface pHandle);
FGAPI ~Surface();
FGAPI void setColor(const forge::Color pColor);
FGAPI void setColor(const float pRed, const float pGreen,
const float pBlue, const float pAlpha);
FGAPI void setLegend(const char* pLegend);
FGAPI unsigned vertices() const;
FGAPI unsigned colors() const;
FGAPI unsigned alphas() const;
FGAPI unsigned verticesSize() const;
FGAPI unsigned colorsSize() const;
FGAPI unsigned alphasSize() const;
FGAPI fg_surface get() const;
};
}
#endif
forge::Surface::vertices
FGAPI unsigned vertices() const
Get the buffer identifier for vertices.
forge::Surface::setColor
FGAPI void setColor(const float pRed, const float pGreen, const float pBlue, const float pAlpha)
Set the color of line graph(surface).
forge::Surface::verticesSize
FGAPI unsigned verticesSize() const
Get the vertex buffer size in bytes.
forge::Surface::setLegend
FGAPI void setLegend(const char *pLegend)
Set surface legend.
forge::Surface::setColor
FGAPI void setColor(const forge::Color pColor)
Set the color of line graph(surface).
forge::Surface::~Surface
FGAPI ~Surface()
surface Destructor
forge::Surface::Surface
FGAPI Surface(const unsigned pNumXPoints, const unsigned pNumYPoints, const dtype pDataType, const PlotType pPlotType=FG_PLOT_SURFACE, const MarkerType pMarkerType=FG_MARKER_NONE)
Creates a Surface object.
forge::Surface::Surface
FGAPI Surface(const Surface &pOther)
Copy constructor for surface.
forge::Surface::alphasSize
FGAPI unsigned alphasSize() const
Get the alpha values buffer size in bytes.
forge::Surface::colorsSize
FGAPI unsigned colorsSize() const
Get the colors buffer size in bytes.
forge::Surface::alphas
FGAPI unsigned alphas() const
Get the buffer identifier for alpha values per vertex.
forge::Surface::colors
FGAPI unsigned colors() const
Get the buffer identifier for color values per vertex.
forge::Surface::Surface
FGAPI Surface(const fg_surface pHandle)
Construct Surface ojbect from fg_surface resource handle.
forge::Surface::get
FGAPI fg_surface get() const
Get the handle to internal implementation of surface.
defines.h
FGAPI
#define FGAPI
Definition defines.h:28
fg_plot_type
fg_plot_type
Definition defines.h:160
FG_PLOT_SURFACE
@ FG_PLOT_SURFACE
Surface plot.
Definition defines.h:163
fg_marker_type
fg_marker_type
Definition defines.h:166
FG_MARKER_NONE
@ FG_MARKER_NONE
No marker.
Definition defines.h:167
fg_err
fg_err
Definition defines.h:49
fg_surface
void * fg_surface
Definition defines.h:46
fg_dtype
fg_dtype
Definition defines.h:150
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.
fg_release_surface
FGAPI fg_err fg_release_surface(fg_surface pSurface)
Destroy surface object.
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.
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.
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.
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.
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.
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.
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.
fg_retain_surface
FGAPI fg_err fg_retain_surface(fg_surface *pOut, fg_surface pIn)
Increase reference count of the resource.
fg_set_surface_legend
FGAPI fg_err fg_set_surface_legend(fg_surface pSurface, const char *pLegend)
Set surface legend.
forge
Definition chart.h:305
forge::Color
fg_color Color
Definition defines.h:184
forge::MarkerType
fg_marker_type MarkerType
Definition defines.h:186
forge::dtype
dtype
Definition defines.h:188
forge::PlotType
fg_plot_type PlotType
Definition defines.h:185