Hist_functions

## Functions

FGAPI fg_err | fg_create_histogram (fg_histogram *pHistogram, const unsigned pNBins, const fg_dtype pDataType)
| Creates a Histogram object.
FGAPI fg_err | fg_retain_histogram (fg_histogram *pOut, fg_histogram pIn)
| Increase reference count of the resource.
FGAPI fg_err | fg_release_histogram (fg_histogram pHistogram)
| Destroy Histogram object.
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).
FGAPI fg_err | fg_set_histogram_legend (fg_histogram pHistogram, const char *pLegend)
| Set legend for histogram plot.
FGAPI fg_err | fg_get_histogram_vertex_buffer (unsigned *pOut, const fg_histogram pHistogram)
| Get the resource identifier for vertices buffer.
FGAPI fg_err | fg_get_histogram_color_buffer (unsigned *pOut, const fg_histogram pHistogram)
| Get the resource identifier for colors buffer.
FGAPI fg_err | fg_get_histogram_alpha_buffer (unsigned *pOut, const fg_histogram pHistogram)
| Get the resource identifier for alpha values buffer.
FGAPI fg_err | fg_get_histogram_vertex_buffer_size (unsigned *pOut, const fg_histogram pHistogram)
| Get the vertices buffer size in bytes.
FGAPI fg_err | fg_get_histogram_color_buffer_size (unsigned *pOut, const fg_histogram pHistogram)
| Get the colors buffer size in bytes.
FGAPI fg_err | fg_get_histogram_alpha_buffer_size (unsigned *pOut, const fg_histogram pHistogram)
| Get the alpha values buffer size in bytes.

## Detailed Description

## Function Documentation

## fg_create_histogram()

FGAPI fg_err fg_create_histogram | ( | fg_histogram * | pHistogram,
|  | const unsigned | pNBins,
|  | const fg_dtype | pDataType )

Creates a Histogram object.

Parameters

  [out] | pHistogram | will point to the histogram object created after this function call
  [in] | pNBins | is number of bins the data is sorted out
  [in] | pDataType | takes one of the values of fg_dtype that indicates the integral data type of histogram data

Returns
  fg_err error code

## 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.

Parameters

  [out] | pOut | will have the buffer identifier after this function is called
  [in] | pHistogram | is the histogram handle

Returns
  fg_err error code

## 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.

Parameters

  [out] | pOut | will have the buffer size in bytes after this function is called
  [in] | pHistogram | is the histogram handle

Returns
  fg_err error code

## 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.

Parameters

  [out] | pOut | will have the buffer identifier after this function is called
  [in] | pHistogram | is the histogram handle

Returns
  fg_err error code

## 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.

Parameters

  [out] | pOut | will have the buffer size in bytes after this function is called
  [in] | pHistogram | is the histogram handle

Returns
  fg_err error code

## 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.

Parameters

  [out] | pOut | will have the buffer identifier after this function is called
  [in] | pHistogram | is the histogram handle

Returns
  fg_err error code

## 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.

Parameters

  [out] | pOut | will have the buffer size in bytes after this function is called
  [in] | pHistogram | is the histogram handle

Returns
  fg_err error code

## fg_release_histogram()

FGAPI fg_err fg_release_histogram | ( | fg_histogram | pHistogram | ) |

Destroy Histogram object.

Parameters

  [in] | pHistogram | is the histogram handle

Returns
  fg_err error code

## fg_retain_histogram()

FGAPI fg_err fg_retain_histogram | ( | fg_histogram * | pOut,
|  | fg_histogram | pIn )

Increase reference count of the resource.

Parameters

  [out] | pOut | is the new handle to existing resource
  [in] | pIn | is the existing resource handle

Returns
  fg_err error code

## 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).

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

- Histogram::alphas()
- Histogram::alphasSize()

Parameters

  [in] | pHistogram | is the histogram handle
  [in] | pRed | is Red component in range [0, 1]
  [in] | pGreen | is Green component in range [0, 1]
  [in] | pBlue | is Blue component in range [0, 1]
  [in] | pAlpha | is Alpha component in range [0, 1]

Returns
  fg_err error code

## fg_set_histogram_legend()

FGAPI fg_err fg_set_histogram_legend | ( | fg_histogram | pHistogram,
|  | const char * | pLegend )

Set legend for histogram plot.

Parameters

  [in] | pHistogram | is the histogram handle
  [in] | pLegend |

Returns
  fg_err error code