histogram.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_histogram(fg_histogram *pHistogram,
const unsigned pNBins, const fg_dtype pDataType);
FGAPI fg_err fg_retain_histogram(fg_histogram *pOut, fg_histogram pIn);
FGAPI fg_err fg_release_histogram(fg_histogram pHistogram);
FGAPI fg_err fg_set_histogram_color(fg_histogram pHistogram,
const float pRed, const float pGreen,
const float pBlue, const float pAlpha);
FGAPI fg_err fg_set_histogram_legend(fg_histogram pHistogram, const char* pLegend);
FGAPI fg_err fg_get_histogram_vertex_buffer(unsigned* pOut, const fg_histogram pHistogram);
FGAPI fg_err fg_get_histogram_color_buffer(unsigned* pOut, const fg_histogram pHistogram);
FGAPI fg_err fg_get_histogram_alpha_buffer(unsigned* pOut, const fg_histogram pHistogram);
FGAPI fg_err fg_get_histogram_vertex_buffer_size(unsigned* pOut, const fg_histogram pHistogram);
FGAPI fg_err fg_get_histogram_color_buffer_size(unsigned* pOut, const fg_histogram pHistogram);
FGAPI fg_err fg_get_histogram_alpha_buffer_size(unsigned* pOut, const fg_histogram pHistogram);
#ifdef __cplusplus
}
#endif
#ifdef __cplusplus
namespace forge
{
class Histogram {
private:
fg_histogram mValue;
public:
FGAPI Histogram(const unsigned pNBins, const dtype pDataType);
FGAPI Histogram(const Histogram& pOther);
FGAPI explicit Histogram(const fg_histogram pHandle);
FGAPI ~Histogram();
FGAPI void setColor(const Color pColor);
FGAPI void setColor(const float pRed, const float pGreen,
const float pBlue, const float pAlpha);
FGAPI void setLegend(const char* pLegend);
FGAPI unsigned vertices() const;
FGAPI unsigned colors() const;
FGAPI unsigned alphas() const;
FGAPI unsigned verticesSize() const;
FGAPI unsigned colorsSize() const;
FGAPI unsigned alphasSize() const;
FGAPI fg_histogram get() const;
};
}
#endif
forge::Histogram::vertices
FGAPI unsigned vertices() const
Get the buffer identifier for vertices.
forge::Histogram::setColor
FGAPI void setColor(const float pRed, const float pGreen, const float pBlue, const float pAlpha)
Set the color of bar in the bar graph(histogram).
forge::Histogram::get
FGAPI fg_histogram get() const
Get the handle to internal implementation of Histogram.
forge::Histogram::setColor
FGAPI void setColor(const Color pColor)
Set the color of bar in the bar graph(histogram).
forge::Histogram::verticesSize
FGAPI unsigned verticesSize() const
Get the vertex buffer size in bytes.
forge::Histogram::~Histogram
FGAPI ~Histogram()
Histogram Destructor.
forge::Histogram::setLegend
FGAPI void setLegend(const char *pLegend)
Set legend for histogram plot.
forge::Histogram::Histogram
FGAPI Histogram(const fg_histogram pHandle)
Construct Histogram ojbect from fg_histogram resource handle.
forge::Histogram::Histogram
FGAPI Histogram(const unsigned pNBins, const dtype pDataType)
Creates a Histogram object.
forge::Histogram::alphasSize
FGAPI unsigned alphasSize() const
Get the alpha values buffer size in bytes.
forge::Histogram::colorsSize
FGAPI unsigned colorsSize() const
Get the colors buffer size in bytes.
forge::Histogram::alphas
FGAPI unsigned alphas() const
Get the buffer identifier for alpha values per vertex.
forge::Histogram::colors
FGAPI unsigned colors() const
Get the buffer identifier for color values per vertex.
forge::Histogram::Histogram
FGAPI Histogram(const Histogram &pOther)
Copy constructor for Histogram.
defines.h
FGAPI
#define FGAPI
Definition defines.h:28
fg_err
fg_err
Definition defines.h:49
fg_dtype
fg_dtype
Definition defines.h:150
fg_histogram
void * fg_histogram
Definition defines.h:44
fg_get_histogram_vertex_buffer
FGAPI fg_err fg_get_histogram_vertex_buffer(unsigned *pOut, const fg_histogram pHistogram)
Get the resource identifier for vertices buffer.
fg_set_histogram_legend
FGAPI fg_err fg_set_histogram_legend(fg_histogram pHistogram, const char *pLegend)
Set legend for histogram plot.
fg_release_histogram
FGAPI fg_err fg_release_histogram(fg_histogram pHistogram)
Destroy Histogram object.
fg_get_histogram_vertex_buffer_size
FGAPI fg_err fg_get_histogram_vertex_buffer_size(unsigned *pOut, const fg_histogram pHistogram)
Get the vertices buffer size in bytes.
fg_get_histogram_alpha_buffer
FGAPI fg_err fg_get_histogram_alpha_buffer(unsigned *pOut, const fg_histogram pHistogram)
Get the resource identifier for alpha values buffer.
fg_get_histogram_alpha_buffer_size
FGAPI fg_err fg_get_histogram_alpha_buffer_size(unsigned *pOut, const fg_histogram pHistogram)
Get the alpha values buffer size in bytes.
fg_create_histogram
FGAPI fg_err fg_create_histogram(fg_histogram *pHistogram, const unsigned pNBins, const fg_dtype pDataType)
Creates a Histogram object.
fg_retain_histogram
FGAPI fg_err fg_retain_histogram(fg_histogram *pOut, fg_histogram pIn)
Increase reference count of the resource.
fg_set_histogram_color
FGAPI fg_err fg_set_histogram_color(fg_histogram pHistogram, const float pRed, const float pGreen, const float pBlue, const float pAlpha)
Set the color of bar in the bar graph(histogram).
fg_get_histogram_color_buffer_size
FGAPI fg_err fg_get_histogram_color_buffer_size(unsigned *pOut, const fg_histogram pHistogram)
Get the colors buffer size in bytes.
fg_get_histogram_color_buffer
FGAPI fg_err fg_get_histogram_color_buffer(unsigned *pOut, const fg_histogram pHistogram)
Get the resource identifier for colors buffer.
forge
Definition chart.h:305
forge::Color
fg_color Color
Definition defines.h:184
forge::dtype
dtype
Definition defines.h:188