Forge: surface.h Source File

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
37 FGAPI fg_err fg_create_surface(fg_surface *pSurface,
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
50 FGAPI fg_err fg_destroy_surface(fg_surface pSurface);
51
63 FGAPI fg_err fg_set_surface_color(fg_surface pSurface,
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
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.
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.
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_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_marker_type
fg_marker_type
Definition: defines.h:164
FG_MARKER_NONE
No marker.
Definition: defines.h:165
forge
Definition: chart.h:214
fg_color
fg_color
Definition: defines.h:137
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.
forge::Surface::verticesSize
FGAPI unsigned verticesSize() const
Get the vertex buffer size in bytes.
fg_plot_type
fg_plot_type
Definition: defines.h:158
forge::dtype
dtype
Definition: defines.h:187
forge::Surface::colors
FGAPI unsigned colors() const
Get the buffer identifier for color values per vertex.
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.
FGAPI
#define FGAPI
Definition: defines.h:28
fg_surface
void * fg_surface
Definition: defines.h:46
defines.h
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.
forge::Surface::setColor
FGAPI void setColor(const forge::Color pColor)
Set the color of line graph(surface)
forge::Surface::setLegend
FGAPI void setLegend(const char *pLegend)
Set surface legend.
fg_err
fg_err
Definition: defines.h:49
FG_PLOT_SURFACE
Surface plot.
Definition: defines.h:161
forge::Surface::colorsSize
FGAPI unsigned colorsSize() const
Get the colors buffer size in bytes.
fg_set_surface_legend
FGAPI fg_err fg_set_surface_legend(fg_surface pSurface, const char *pLegend)
Set surface legend.
forge::Surface
Surface is a graph to display three dimensional data.
Definition: surface.h:153
forge::Surface::~Surface
FGAPI ~Surface()
surface Destructor
forge::Surface::alphas
FGAPI unsigned alphas() const
Get the buffer identifier for alpha values per vertex.
forge::Surface::vertices
FGAPI unsigned vertices() const
Get the buffer identifier for vertices.
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_size
FGAPI fg_err fg_get_surface_vertex_buffer_size(unsigned *pOut, const fg_surface pSurface)
Get the vertices buffer size in bytes.
fg_destroy_surface
FGAPI fg_err fg_destroy_surface(fg_surface pSurface)
Destroy surface object.
forge::Surface::alphasSize
FGAPI unsigned alphasSize() const
Get the alpha values buffer size in bytes.
fg_dtype
fg_dtype
Definition: defines.h:148