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
15extern "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
85FGAPI fg_err fg_set_surface_legend(fg_surface pSurface, const char* pLegend);
86
95FGAPI fg_err fg_get_surface_vertex_buffer(unsigned* pOut, const fg_surface pSurface);
96
105FGAPI fg_err fg_get_surface_color_buffer(unsigned* pOut, const fg_surface pSurface);
106
115FGAPI fg_err fg_get_surface_alpha_buffer(unsigned* pOut, const fg_surface pSurface);
116
126
136
146
149#ifdef __cplusplus
150}
151#endif
152
153#ifdef __cplusplus
154
155namespace forge
156{
157
163class 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
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
276};
277
278}
279
280#endif
Surface is a graph to display three dimensional data.
Definition: surface.h:163
FGAPI unsigned vertices() const
Get the buffer identifier for vertices.
FGAPI void setColor(const float pRed, const float pGreen, const float pBlue, const float pAlpha)
Set the color of line graph(surface)
FGAPI unsigned verticesSize() const
Get the vertex buffer size in bytes.
FGAPI void setLegend(const char *pLegend)
Set surface legend.
FGAPI void setColor(const forge::Color pColor)
Set the color of line graph(surface)
FGAPI ~Surface()
surface Destructor
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 Surface(const Surface &pOther)
Copy constructor for surface.
FGAPI unsigned alphasSize() const
Get the alpha values buffer size in bytes.
FGAPI unsigned colorsSize() const
Get the colors buffer size in bytes.
FGAPI unsigned alphas() const
Get the buffer identifier for alpha values per vertex.
FGAPI unsigned colors() const
Get the buffer identifier for color values per vertex.
FGAPI Surface(const fg_surface pHandle)
Construct Surface ojbect from fg_surface resource handle.
FGAPI fg_surface get() const
Get the handle to internal implementation of surface.
#define FGAPI
Definition: defines.h:28
fg_plot_type
Definition: defines.h:160
@ FG_PLOT_SURFACE
Surface plot.
Definition: defines.h:163
fg_marker_type
Definition: defines.h:166
@ FG_MARKER_NONE
No marker.
Definition: defines.h:167
fg_err
Definition: defines.h:49
void * fg_surface
Definition: defines.h:46
fg_dtype
Definition: defines.h:150
fg_color
Definition: defines.h:139
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.
FGAPI fg_err fg_release_surface(fg_surface pSurface)
Destroy surface object.
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(unsigned *pOut, const fg_surface pSurface)
Get the resource identifier for vertices 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_get_surface_vertex_buffer_size(unsigned *pOut, const fg_surface pSurface)
Get the vertices buffer size in bytes.
FGAPI fg_err fg_get_surface_color_buffer_size(unsigned *pOut, const fg_surface pSurface)
Get the colors buffer size in bytes.
FGAPI fg_err fg_get_surface_color_buffer(unsigned *pOut, const fg_surface pSurface)
Get the resource identifier for colors buffer.
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_retain_surface(fg_surface *pOut, fg_surface pIn)
Increase reference count of the resource.
FGAPI fg_err fg_set_surface_legend(fg_surface pSurface, const char *pLegend)
Set surface legend.
Definition: chart.h:305
dtype
Definition: defines.h:188