Forge
plot.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
15#ifdef __cplusplus
16extern "C" {
17#endif
18
39 const unsigned pNPoints, const fg_dtype pType,
40 const fg_chart_type pChartType,
41 const fg_plot_type pPlotType,
42 const fg_marker_type pMarkerType);
43
53
62
75 const float pRed, const float pGreen,
76 const float pBlue, const float pAlpha);
77
86FGAPI fg_err fg_set_plot_legend(fg_plot pPlot, const char* pLegend);
87
99FGAPI fg_err fg_set_plot_marker_size(fg_plot pPlot, const float pMarkerSize);
100
109FGAPI fg_err fg_get_plot_vertex_buffer(unsigned* pOut, const fg_plot pPlot);
110
119FGAPI fg_err fg_get_plot_color_buffer(unsigned* pOut, const fg_plot pPlot);
120
129FGAPI fg_err fg_get_plot_alpha_buffer(unsigned* pOut, const fg_plot pPlot);
130
139FGAPI fg_err fg_get_plot_radii_buffer(unsigned* pOut, const fg_plot pPlot);
140
150
160
170
180
183#ifdef __cplusplus
184}
185#endif
186
187
188#ifdef __cplusplus
189
190namespace forge
191{
192
198class Plot {
199 private:
200 fg_plot mValue;
201
202 public:
215 FGAPI Plot(const unsigned pNumPoints, const dtype pDataType, const ChartType pChartType,
216 const PlotType pPlotType=FG_PLOT_LINE, const MarkerType pMarkerType=FG_MARKER_NONE);
217
223 FGAPI Plot(const Plot& pOther);
224
233 FGAPI explicit Plot(const fg_plot pHandle);
234
239
245 FGAPI void setColor(const forge::Color pColor);
246
255 FGAPI void setColor(const float pRed, const float pGreen,
256 const float pBlue, const float pAlpha);
257
263 FGAPI void setLegend(const char* pLegend);
264
273 FGAPI void setMarkerSize(const float pMarkerSize);
274
280 FGAPI unsigned vertices() const;
281
287 FGAPI unsigned colors() const;
288
294 FGAPI unsigned alphas() const;
295
301 FGAPI unsigned radii() const;
302
308 FGAPI unsigned verticesSize() const;
309
315 FGAPI unsigned colorsSize() const;
316
322 FGAPI unsigned alphasSize() const;
323
329 FGAPI unsigned radiiSize() const;
330
335};
336
337}
338
339#endif
Plot is a line graph to display two dimensional data.
Definition: plot.h:198
FGAPI unsigned vertices() const
Get the buffer identifier for vertices.
FGAPI Plot(const fg_plot pHandle)
Construct Plot ojbect from fg_plot resource handle.
FGAPI void setColor(const float pRed, const float pGreen, const float pBlue, const float pAlpha)
Set the color of line graph(plot)
FGAPI unsigned verticesSize() const
Get the vertex buffer size in bytes.
FGAPI void setLegend(const char *pLegend)
Set plot legend.
FGAPI Plot(const unsigned pNumPoints, const dtype pDataType, const ChartType pChartType, const PlotType pPlotType=FG_PLOT_LINE, const MarkerType pMarkerType=FG_MARKER_NONE)
Creates a Plot object.
FGAPI void setColor(const forge::Color pColor)
Set the color of line graph(plot)
FGAPI void setMarkerSize(const float pMarkerSize)
Set global marker size.
FGAPI unsigned radiiSize() const
Get the marker sizes buffer size in bytes.
FGAPI ~Plot()
Plot Destructor.
FGAPI Plot(const Plot &pOther)
Copy constructor for Plot.
FGAPI unsigned alphasSize() const
Get the alpha values buffer size in bytes.
FGAPI unsigned radii() const
Get the buffer identifier for per vertex marker sizes.
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 fg_plot get() const
Get the handle to internal implementation of plot.
#define FGAPI
Definition: defines.h:28
fg_plot_type
Definition: defines.h:160
@ FG_PLOT_LINE
Line plot.
Definition: defines.h:161
fg_marker_type
Definition: defines.h:166
@ FG_MARKER_NONE
No marker.
Definition: defines.h:167
fg_err
Definition: defines.h:49
void * fg_plot
Definition: defines.h:45
fg_dtype
Definition: defines.h:150
fg_color
Definition: defines.h:139
fg_chart_type
Definition: defines.h:117
FGAPI fg_err fg_set_plot_legend(fg_plot pPlot, const char *pLegend)
Set plot legend.
FGAPI fg_err fg_set_plot_color(fg_plot pPlot, const float pRed, const float pGreen, const float pBlue, const float pAlpha)
Set the color of line graph(plot)
FGAPI fg_err fg_get_plot_radii_buffer_size(unsigned *pOut, const fg_plot pPlot)
Get the markers buffer size in bytes.
FGAPI fg_err fg_get_plot_color_buffer_size(unsigned *pOut, const fg_plot pPlot)
Get the colors buffer size in bytes.
FGAPI fg_err fg_get_plot_vertex_buffer(unsigned *pOut, const fg_plot pPlot)
Get the resource identifier for vertices buffer.
FGAPI fg_err fg_get_plot_alpha_buffer(unsigned *pOut, const fg_plot pPlot)
Get the resource identifier for alpha values buffer.
FGAPI fg_err fg_set_plot_marker_size(fg_plot pPlot, const float pMarkerSize)
Set global marker size.
FGAPI fg_err fg_get_plot_vertex_buffer_size(unsigned *pOut, const fg_plot pPlot)
Get the vertices buffer size in bytes.
FGAPI fg_err fg_retain_plot(fg_plot *pOut, fg_plot pIn)
Increase reference count of the resource.
FGAPI fg_err fg_get_plot_radii_buffer(unsigned *pOut, const fg_plot pPlot)
Get the resource identifier for markers radii buffer.
FGAPI fg_err fg_get_plot_alpha_buffer_size(unsigned *pOut, const fg_plot pPlot)
Get the alpha values buffer size in bytes.
FGAPI fg_err fg_get_plot_color_buffer(unsigned *pOut, const fg_plot pPlot)
Get the resource identifier for colors buffer.
FGAPI fg_err fg_release_plot(fg_plot pPlot)
Destroy plot object.
FGAPI fg_err fg_create_plot(fg_plot *pPlot, const unsigned pNPoints, const fg_dtype pType, const fg_chart_type pChartType, const fg_plot_type pPlotType, const fg_marker_type pMarkerType)
Create a Plot object.
Definition: chart.h:305
dtype
Definition: defines.h:188