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 
52 
61 
74  const float pRed, const float pGreen,
75  const float pBlue, const float pAlpha);
76 
85 FGAPI fg_err fg_set_surface_legend(fg_surface pSurface, const char* pLegend);
86 
95 FGAPI fg_err fg_get_surface_vertex_buffer(unsigned* pOut, const fg_surface pSurface);
96 
105 FGAPI fg_err fg_get_surface_color_buffer(unsigned* pOut, const fg_surface pSurface);
106 
115 FGAPI fg_err fg_get_surface_alpha_buffer(unsigned* pOut, const fg_surface pSurface);
116 
125 FGAPI fg_err fg_get_surface_vertex_buffer_size(unsigned* pOut, const fg_surface pSurface);
126 
135 FGAPI fg_err fg_get_surface_color_buffer_size(unsigned* pOut, const fg_surface pSurface);
136 
145 FGAPI fg_err fg_get_surface_alpha_buffer_size(unsigned* pOut, const fg_surface pSurface);
146 
149 #ifdef __cplusplus
150 }
151 #endif
152 
153 #ifdef __cplusplus
154 
155 namespace forge
156 {
157 
163 class Surface {
164  private:
165  fg_surface mValue;
166 
167  public:
179  FGAPI Surface(const unsigned pNumXPoints, const unsigned pNumYPoints, const dtype pDataType,
180  const PlotType pPlotType=FG_PLOT_SURFACE, const MarkerType pMarkerType=FG_MARKER_NONE);
181 
187  FGAPI Surface(const Surface& pOther);
188 
197  FGAPI explicit Surface(const fg_surface pHandle);
198 
202  FGAPI ~Surface();
203 
209  FGAPI void setColor(const forge::Color pColor);
210 
219  FGAPI void setColor(const float pRed, const float pGreen,
220  const float pBlue, const float pAlpha);
221 
227  FGAPI void setLegend(const char* pLegend);
228 
234  FGAPI unsigned vertices() const;
235 
241  FGAPI unsigned colors() const;
242 
248  FGAPI unsigned alphas() const;
249 
255  FGAPI unsigned verticesSize() const;
256 
262  FGAPI unsigned colorsSize() const;
263 
269  FGAPI unsigned alphasSize() const;
270 
271 
275  FGAPI fg_surface get() const;
276 };
277 
278 }
279 
280 #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.
FGAPI fg_err fg_release_surface(fg_surface pSurface)
Destroy surface object.
fg_marker_type
Definition: defines.h:166
No marker.
Definition: defines.h:167
Definition: chart.h:304
fg_color
Definition: defines.h:139
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:160
dtype
Definition: defines.h:188
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 fg_err fg_retain_surface(fg_surface *pOut, fg_surface pIn)
Increase reference count of the resource.
FGAPI void setLegend(const char *pLegend)
Set surface legend.
fg_err
Definition: defines.h:49
Surface plot.
Definition: defines.h:163
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:163
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 unsigned alphasSize() const
Get the alpha values buffer size in bytes.
fg_dtype
Definition: defines.h:150