Forge
surface.h
Go to the documentation of this file.
1 /*******************************************************
2  * Copyright (c) 2015-2019, ArrayFire
3  * All rights reserved.
4  *
5  * This file is distributed under 3-clause BSD license.
6  * The complete license agreement can be obtained at:
7  * http://arrayfire.com/licenses/BSD-3-Clause
8  ********************************************************/
9 
10 #pragma once
11 
12 #include <fg/defines.h>
13 
14 #ifdef __cplusplus
15 extern "C" {
16 #endif
17 
38  const unsigned pXPoints, const unsigned pYPoints,
39  const fg_dtype pType,
40  const fg_plot_type pPlotType,
41  const fg_marker_type pMarkerType);
42 
51 
64  const float pRed, const float pGreen,
65  const float pBlue, const float pAlpha);
66 
75 FGAPI fg_err fg_set_surface_legend(fg_surface pSurface, const char* pLegend);
76 
85 FGAPI fg_err fg_get_surface_vertex_buffer(unsigned* pOut, const fg_surface pSurface);
86 
95 FGAPI fg_err fg_get_surface_color_buffer(unsigned* pOut, const fg_surface pSurface);
96 
105 FGAPI fg_err fg_get_surface_alpha_buffer(unsigned* pOut, const fg_surface pSurface);
106 
115 FGAPI fg_err fg_get_surface_vertex_buffer_size(unsigned* pOut, const fg_surface pSurface);
116 
125 FGAPI fg_err fg_get_surface_color_buffer_size(unsigned* pOut, const fg_surface pSurface);
126 
135 FGAPI fg_err fg_get_surface_alpha_buffer_size(unsigned* pOut, const fg_surface pSurface);
136 
139 #ifdef __cplusplus
140 }
141 #endif
142 
143 #ifdef __cplusplus
144 
145 namespace forge
146 {
147 
153 class Surface {
154  private:
155  fg_surface mValue;
156 
157  public:
169  FGAPI Surface(const unsigned pNumXPoints, const unsigned pNumYPoints, const dtype pDataType,
170  const PlotType pPlotType=FG_PLOT_SURFACE, const MarkerType pMarkerType=FG_MARKER_NONE);
171 
177  FGAPI Surface(const Surface& pOther);
178 
182  FGAPI ~Surface();
183 
189  FGAPI void setColor(const forge::Color pColor);
190 
199  FGAPI void setColor(const float pRed, const float pGreen,
200  const float pBlue, const float pAlpha);
201 
207  FGAPI void setLegend(const char* pLegend);
208 
214  FGAPI unsigned vertices() const;
215 
221  FGAPI unsigned colors() const;
222 
228  FGAPI unsigned alphas() const;
229 
235  FGAPI unsigned verticesSize() const;
236 
242  FGAPI unsigned colorsSize() const;
243 
249  FGAPI unsigned alphasSize() const;
250 
251 
255  FGAPI fg_surface get() const;
256 };
257 
258 }
259 
260 #endif
FGAPI fg_err fg_get_surface_vertex_buffer(unsigned *pOut, const fg_surface pSurface)
Get the resource identifier for vertices buffer.
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.
FGAPI fg_err fg_get_surface_alpha_buffer(unsigned *pOut, const fg_surface pSurface)
Get the resource identifier for alpha values buffer.
FGAPI fg_err fg_get_surface_alpha_buffer_size(unsigned *pOut, const fg_surface pSurface)
Get the alpha values buffer size in bytes.
fg_marker_type
Definition: defines.h:164
No marker.
Definition: defines.h:165
Definition: chart.h:214
fg_color
Definition: defines.h:137
FGAPI fg_err fg_get_surface_color_buffer_size(unsigned *pOut, const fg_surface pSurface)
Get the colors buffer size in bytes.
FGAPI unsigned verticesSize() const
Get the vertex buffer size in bytes.
fg_plot_type
Definition: defines.h:158
dtype
Definition: defines.h:187
FGAPI unsigned colors() const
Get the buffer identifier for color values per vertex.
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.
#define FGAPI
Definition: defines.h:28
void * fg_surface
Definition: defines.h:46
FGAPI fg_err fg_get_surface_color_buffer(unsigned *pOut, const fg_surface pSurface)
Get the resource identifier for colors buffer.
FGAPI void setColor(const forge::Color pColor)
Set the color of line graph(surface)
FGAPI void setLegend(const char *pLegend)
Set surface legend.
fg_err
Definition: defines.h:49
Surface plot.
Definition: defines.h:161
FGAPI unsigned colorsSize() const
Get the colors buffer size in bytes.
FGAPI fg_err fg_set_surface_legend(fg_surface pSurface, const char *pLegend)
Set surface legend.
Surface is a graph to display three dimensional data.
Definition: surface.h:153
FGAPI ~Surface()
surface Destructor
FGAPI unsigned alphas() const
Get the buffer identifier for alpha values per vertex.
FGAPI unsigned vertices() const
Get the buffer identifier for vertices.
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.
FGAPI fg_err fg_get_surface_vertex_buffer_size(unsigned *pOut, const fg_surface pSurface)
Get the vertices buffer size in bytes.
FGAPI fg_err fg_destroy_surface(fg_surface pSurface)
Destroy surface object.
FGAPI unsigned alphasSize() const
Get the alpha values buffer size in bytes.
fg_dtype
Definition: defines.h:148