Forge
Histogram Class Reference

Histogram is a bar graph to display data frequencey. More...

#include <histogram.h>

Public Member Functions

FGAPI Histogram (const unsigned pNBins, const dtype pDataType)
 Creates a Histogram object. More...
 
FGAPI Histogram (const Histogram &pOther)
 Copy constructor for Histogram. More...
 
FGAPI Histogram (const fg_histogram pHandle)
 Construct Histogram ojbect from fg_histogram resource handle. More...
 
FGAPI ~Histogram ()
 Histogram Destructor. More...
 
FGAPI void setColor (const Color pColor)
 Set the color of bar in the bar graph(histogram) More...
 
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) More...
 
FGAPI void setLegend (const char *pLegend)
 Set legend for histogram plot. More...
 
FGAPI unsigned vertices () const
 Get the buffer identifier for vertices. More...
 
FGAPI unsigned colors () const
 Get the buffer identifier for color values per vertex. More...
 
FGAPI unsigned alphas () const
 Get the buffer identifier for alpha values per vertex. More...
 
FGAPI unsigned verticesSize () const
 Get the vertex buffer size in bytes. More...
 
FGAPI unsigned colorsSize () const
 Get the colors buffer size in bytes. More...
 
FGAPI unsigned alphasSize () const
 Get the alpha values buffer size in bytes. More...
 
FGAPI fg_histogram get () const
 Get the handle to internal implementation of Histogram. More...
 

Detailed Description

Histogram is a bar graph to display data frequencey.

Examples
cpu/histogram.cpp, and opencl/histogram.cpp.

Constructor & Destructor Documentation

◆ Histogram() [1/3]

FGAPI Histogram ( const unsigned  pNBins,
const dtype  pDataType 
)

Creates a Histogram object.

Parameters
[in]pNBinsis number of bins the data is sorted out
[in]pDataTypetakes one of the values of fg_dtype that indicates the integral data type of histogram data

◆ Histogram() [2/3]

FGAPI Histogram ( const Histogram pOther)

Copy constructor for Histogram.

Parameters
[in]pOtheris the Histogram of which we make a copy of.

◆ Histogram() [3/3]

FGAPI Histogram ( const fg_histogram  pHandle)
explicit

Construct Histogram ojbect from fg_histogram resource handle.

Parameters
[in]pHandleis the input fg_histogram resource handle
Note
This kind of construction assumes ownership of the resource handle is released during the Histogram object's destruction.

◆ ~Histogram()

Histogram Destructor.

Member Function Documentation

◆ alphas()

FGAPI unsigned alphas ( ) const

Get the buffer identifier for alpha values per vertex.

Returns
alpha values buffer resource id.

◆ alphasSize()

FGAPI unsigned alphasSize ( ) const

Get the alpha values buffer size in bytes.

Returns
alpha buffer size in bytes

◆ colors()

FGAPI unsigned colors ( ) const

Get the buffer identifier for color values per vertex.

Returns
colors buffer resource id.
Examples
cpu/histogram.cpp, and opencl/histogram.cpp.

◆ colorsSize()

FGAPI unsigned colorsSize ( ) const

Get the colors buffer size in bytes.

Returns
colors buffer size in bytes
Examples
cpu/histogram.cpp, and opencl/histogram.cpp.

◆ get()

FGAPI fg_histogram get ( ) const

Get the handle to internal implementation of Histogram.

◆ setColor() [1/2]

FGAPI void setColor ( const Color  pColor)

Set the color of bar in the bar graph(histogram)

Parameters
[in]pColortakes values of type forge::Color to define bar color
Examples
cpu/histogram.cpp, and opencl/histogram.cpp.

◆ setColor() [2/2]

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)

This is global alpha value for the histogram rendering that takes effect if individual bar alphas are not set by calling the following member functions

Parameters
[in]pRedis Red component in range [0, 1]
[in]pGreenis Green component in range [0, 1]
[in]pBlueis Blue component in range [0, 1]
[in]pAlphais Alpha component in range [0, 1]

◆ setLegend()

FGAPI void setLegend ( const char *  pLegend)

Set legend for histogram plot.

Parameters
[in]pLegend

◆ vertices()

FGAPI unsigned vertices ( ) const

Get the buffer identifier for vertices.

Returns
vertex buffer resource id.
Examples
cpu/histogram.cpp, and opencl/histogram.cpp.

◆ verticesSize()

FGAPI unsigned verticesSize ( ) const

Get the vertex buffer size in bytes.

Returns
vertex buffer size in bytes
Examples
cpu/histogram.cpp, and opencl/histogram.cpp.

The documentation for this class was generated from the following file: