plot.h
Go to the documentation of this file.
/*******************************************************
* Copyright (c) 2015-2019, ArrayFire
* All rights reserved.
*
* This file is distributed under 3-clause BSD license.
* The complete license agreement can be obtained at:
* http://arrayfire.com/licenses/BSD-3-Clause
********************************************************/
#pragma once
#include <fg/defines.h>
#ifdef __cplusplus
extern "C" {
#endif
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);
FGAPI fg_err fg_retain_plot(fg_plot *pOut, fg_plot pIn);
FGAPI fg_err fg_release_plot(fg_plot pPlot);
FGAPI fg_err fg_set_plot_color(fg_plot pPlot,
const float pRed, const float pGreen,
const float pBlue, const float pAlpha);
FGAPI fg_err fg_set_plot_legend(fg_plot pPlot, const char* pLegend);
FGAPI fg_err fg_set_plot_marker_size(fg_plot pPlot, const float pMarkerSize);
FGAPI fg_err fg_get_plot_vertex_buffer(unsigned* pOut, const fg_plot pPlot);
FGAPI fg_err fg_get_plot_color_buffer(unsigned* pOut, const fg_plot pPlot);
FGAPI fg_err fg_get_plot_alpha_buffer(unsigned* pOut, const fg_plot pPlot);
FGAPI fg_err fg_get_plot_radii_buffer(unsigned* pOut, const fg_plot pPlot);
FGAPI fg_err fg_get_plot_vertex_buffer_size(unsigned* pOut, const fg_plot pPlot);
FGAPI fg_err fg_get_plot_color_buffer_size(unsigned* pOut, const fg_plot pPlot);
FGAPI fg_err fg_get_plot_alpha_buffer_size(unsigned* pOut, const fg_plot pPlot);
FGAPI fg_err fg_get_plot_radii_buffer_size(unsigned* pOut, const fg_plot pPlot);
#ifdef __cplusplus
}
#endif
#ifdef __cplusplus
namespace forge
{
class Plot {
private:
fg_plot mValue;
public:
FGAPI Plot(const unsigned pNumPoints, const dtype pDataType, const ChartType pChartType,
const PlotType pPlotType=FG_PLOT_LINE, const MarkerType pMarkerType=FG_MARKER_NONE);
FGAPI Plot(const Plot& pOther);
FGAPI explicit Plot(const fg_plot pHandle);
FGAPI ~Plot();
FGAPI void setColor(const forge::Color pColor);
FGAPI void setColor(const float pRed, const float pGreen,
const float pBlue, const float pAlpha);
FGAPI void setLegend(const char* pLegend);
FGAPI void setMarkerSize(const float pMarkerSize);
FGAPI unsigned vertices() const;
FGAPI unsigned colors() const;
FGAPI unsigned alphas() const;
FGAPI unsigned radii() const;
FGAPI unsigned verticesSize() const;
FGAPI unsigned colorsSize() const;
FGAPI unsigned alphasSize() const;
FGAPI unsigned radiiSize() const;
FGAPI fg_plot get() const;
};
}
#endif
forge::Plot::vertices
FGAPI unsigned vertices() const
Get the buffer identifier for vertices.
forge::Plot::Plot
FGAPI Plot(const fg_plot pHandle)
Construct Plot ojbect from fg_plot resource handle.
forge::Plot::setColor
FGAPI void setColor(const float pRed, const float pGreen, const float pBlue, const float pAlpha)
Set the color of line graph(plot).
forge::Plot::verticesSize
FGAPI unsigned verticesSize() const
Get the vertex buffer size in bytes.
forge::Plot::setLegend
FGAPI void setLegend(const char *pLegend)
Set plot legend.
forge::Plot::Plot
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.
forge::Plot::setColor
FGAPI void setColor(const forge::Color pColor)
Set the color of line graph(plot).
forge::Plot::setMarkerSize
FGAPI void setMarkerSize(const float pMarkerSize)
Set global marker size.
forge::Plot::radiiSize
FGAPI unsigned radiiSize() const
Get the marker sizes buffer size in bytes.
forge::Plot::~Plot
FGAPI ~Plot()
Plot Destructor.
forge::Plot::Plot
FGAPI Plot(const Plot &pOther)
Copy constructor for Plot.
forge::Plot::alphasSize
FGAPI unsigned alphasSize() const
Get the alpha values buffer size in bytes.
forge::Plot::radii
FGAPI unsigned radii() const
Get the buffer identifier for per vertex marker sizes.
forge::Plot::colorsSize
FGAPI unsigned colorsSize() const
Get the colors buffer size in bytes.
forge::Plot::alphas
FGAPI unsigned alphas() const
Get the buffer identifier for alpha values per vertex.
forge::Plot::colors
FGAPI unsigned colors() const
Get the buffer identifier for color values per vertex.
forge::Plot::get
FGAPI fg_plot get() const
Get the handle to internal implementation of plot.
defines.h
FGAPI
#define FGAPI
Definition defines.h:28
fg_plot_type
fg_plot_type
Definition defines.h:160
FG_PLOT_LINE
@ FG_PLOT_LINE
Line plot.
Definition defines.h:161
fg_marker_type
fg_marker_type
Definition defines.h:166
FG_MARKER_NONE
@ FG_MARKER_NONE
No marker.
Definition defines.h:167
fg_err
fg_err
Definition defines.h:49
fg_plot
void * fg_plot
Definition defines.h:45
fg_dtype
fg_dtype
Definition defines.h:150
fg_chart_type
fg_chart_type
Definition defines.h:117
fg_set_plot_legend
FGAPI fg_err fg_set_plot_legend(fg_plot pPlot, const char *pLegend)
Set plot legend.
fg_set_plot_color
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).
fg_get_plot_radii_buffer_size
FGAPI fg_err fg_get_plot_radii_buffer_size(unsigned *pOut, const fg_plot pPlot)
Get the markers buffer size in bytes.
fg_get_plot_color_buffer_size
FGAPI fg_err fg_get_plot_color_buffer_size(unsigned *pOut, const fg_plot pPlot)
Get the colors buffer size in bytes.
fg_get_plot_vertex_buffer
FGAPI fg_err fg_get_plot_vertex_buffer(unsigned *pOut, const fg_plot pPlot)
Get the resource identifier for vertices buffer.
fg_get_plot_alpha_buffer
FGAPI fg_err fg_get_plot_alpha_buffer(unsigned *pOut, const fg_plot pPlot)
Get the resource identifier for alpha values buffer.
fg_set_plot_marker_size
FGAPI fg_err fg_set_plot_marker_size(fg_plot pPlot, const float pMarkerSize)
Set global marker size.
fg_get_plot_vertex_buffer_size
FGAPI fg_err fg_get_plot_vertex_buffer_size(unsigned *pOut, const fg_plot pPlot)
Get the vertices buffer size in bytes.
fg_retain_plot
FGAPI fg_err fg_retain_plot(fg_plot *pOut, fg_plot pIn)
Increase reference count of the resource.
fg_get_plot_radii_buffer
FGAPI fg_err fg_get_plot_radii_buffer(unsigned *pOut, const fg_plot pPlot)
Get the resource identifier for markers radii buffer.
fg_get_plot_alpha_buffer_size
FGAPI fg_err fg_get_plot_alpha_buffer_size(unsigned *pOut, const fg_plot pPlot)
Get the alpha values buffer size in bytes.
fg_get_plot_color_buffer
FGAPI fg_err fg_get_plot_color_buffer(unsigned *pOut, const fg_plot pPlot)
Get the resource identifier for colors buffer.
fg_release_plot
FGAPI fg_err fg_release_plot(fg_plot pPlot)
Destroy plot object.
fg_create_plot
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.
forge
Definition chart.h:305
forge::Color
fg_color Color
Definition defines.h:184
forge::ChartType
fg_chart_type ChartType
Definition defines.h:182
forge::MarkerType
fg_marker_type MarkerType
Definition defines.h:186
forge::dtype
dtype
Definition defines.h:188
forge::PlotType
fg_plot_type PlotType
Definition defines.h:185