MeshLib C Docs
Loading...
Searching...
No Matches
MRHistogram.h File Reference
#include <MRCMisc/common.h>
#include <MRCMisc/exports.h>
#include <stddef.h>

Go to the source code of this file.

Typedefs

typedef struct MR_std_pair_float_float MR_std_pair_float_float
 
typedef struct MR_std_vector_uint64_t MR_std_vector_uint64_t
 
typedef struct MR_Histogram MR_Histogram
 

Functions

MRC_API MR_HistogramMR_Histogram_DefaultConstruct (void)
 
MRC_API MR_HistogramMR_Histogram_DefaultConstructArray (size_t num_elems)
 
MRC_API const MR_HistogramMR_Histogram_OffsetPtr (const MR_Histogram *ptr, ptrdiff_t i)
 Offsets a pointer to an array element by i positions (not bytes). Use only if you're certain that the pointer points to an array element.
 
MRC_API MR_HistogramMR_Histogram_OffsetMutablePtr (MR_Histogram *ptr, ptrdiff_t i)
 Offsets a pointer to an array element by i positions (not bytes). Use only if you're certain that the pointer points to an array element.
 
MRC_API MR_HistogramMR_Histogram_ConstructFromAnother (MR_PassBy _other_pass_by, MR_Histogram *_other)
 
MRC_API MR_HistogramMR_Histogram_Construct (float min, float max, MR_uint64_t size)
 
MRC_API void MR_Histogram_Destroy (const MR_Histogram *_this)
 Destroys a heap-allocated instance of MR_Histogram. Does nothing if the pointer is null.
 
MRC_API void MR_Histogram_DestroyArray (const MR_Histogram *_this)
 Destroys a heap-allocated array of MR_Histogram. Does nothing if the pointer is null.
 
MRC_API MR_HistogramMR_Histogram_AssignFromAnother (MR_Histogram *_this, MR_PassBy _other_pass_by, MR_Histogram *_other)
 
MRC_API void MR_Histogram_addSample (MR_Histogram *_this, float sample, const MR_uint64_t *count)
 
MRC_API void MR_Histogram_addHistogram (MR_Histogram *_this, const MR_Histogram *hist)
 
MRC_API const MR_std_vector_uint64_tMR_Histogram_getBins (const MR_Histogram *_this)
 
MRC_API float MR_Histogram_getMin (const MR_Histogram *_this)
 
MRC_API float MR_Histogram_getMax (const MR_Histogram *_this)
 
MRC_API MR_uint64_t MR_Histogram_getBinId (const MR_Histogram *_this, float sample)
 
MRC_API MR_std_pair_float_floatMR_Histogram_getBinMinMax (const MR_Histogram *_this, MR_uint64_t binId)
 
MRC_API MR_uint64_t MR_Histogram_heapBytes (const MR_Histogram *_this)
 

Typedef Documentation

◆ MR_Histogram

typedef struct MR_Histogram MR_Histogram

Simple class for calculating histogram Generated from class MR::Histogram.

◆ MR_std_pair_float_float

◆ MR_std_vector_uint64_t

Function Documentation

◆ MR_Histogram_addHistogram()

MRC_API void MR_Histogram_addHistogram ( MR_Histogram * _this,
const MR_Histogram * hist )

Adds bins of input hist to this Generated from a method of class MR::Histogram named addHistogram. Parameter _this can not be null. It is a single object. Parameter hist can not be null. It is a single object.

◆ MR_Histogram_addSample()

MRC_API void MR_Histogram_addSample ( MR_Histogram * _this,
float sample,
const MR_uint64_t * count )

Adds sample to corresponding bin Generated from a method of class MR::Histogram named addSample. Parameter _this can not be null. It is a single object. Parameter count has a default argument: 1, pass a null pointer to use it.

◆ MR_Histogram_AssignFromAnother()

MRC_API MR_Histogram * MR_Histogram_AssignFromAnother ( MR_Histogram * _this,
MR_PassBy _other_pass_by,
MR_Histogram * _other )

Generated from a method of class MR::Histogram named operator=. Parameter _this can not be null. It is a single object. The returned pointer will never be null. It is non-owning, do NOT destroy it.

◆ MR_Histogram_Construct()

MRC_API MR_Histogram * MR_Histogram_Construct ( float min,
float max,
MR_uint64_t size )

Initialize histogram with minimum and maximum values, and number of bins Generated from a constructor of class MR::Histogram. Never returns null. Returns an instance allocated on the heap! Must call MR_Histogram_Destroy() to free it when you're done using it.

◆ MR_Histogram_ConstructFromAnother()

MRC_API MR_Histogram * MR_Histogram_ConstructFromAnother ( MR_PassBy _other_pass_by,
MR_Histogram * _other )

Generated from a constructor of class MR::Histogram. Never returns null. Returns an instance allocated on the heap! Must call MR_Histogram_Destroy() to free it when you're done using it.

◆ MR_Histogram_DefaultConstruct()

MRC_API MR_Histogram * MR_Histogram_DefaultConstruct ( void )

Constructs an empty (default-constructed) instance. Never returns null. Returns an instance allocated on the heap! Must call MR_Histogram_Destroy() to free it when you're done using it.

◆ MR_Histogram_DefaultConstructArray()

MRC_API MR_Histogram * MR_Histogram_DefaultConstructArray ( size_t num_elems)

Constructs an array of empty (default-constructed) instances, of the specified size. Will never return null. The array must be destroyed using MR_Histogram_DestroyArray(). Use MR_Histogram_OffsetMutablePtr() and MR_Histogram_OffsetPtr() to access the array elements.

◆ MR_Histogram_Destroy()

MRC_API void MR_Histogram_Destroy ( const MR_Histogram * _this)

Destroys a heap-allocated instance of MR_Histogram. Does nothing if the pointer is null.

◆ MR_Histogram_DestroyArray()

MRC_API void MR_Histogram_DestroyArray ( const MR_Histogram * _this)

Destroys a heap-allocated array of MR_Histogram. Does nothing if the pointer is null.

◆ MR_Histogram_getBinId()

MRC_API MR_uint64_t MR_Histogram_getBinId ( const MR_Histogram * _this,
float sample )

Gets id of bin that inherits sample Generated from a method of class MR::Histogram named getBinId. Parameter _this can not be null. It is a single object.

◆ MR_Histogram_getBinMinMax()

MRC_API MR_std_pair_float_float * MR_Histogram_getBinMinMax ( const MR_Histogram * _this,
MR_uint64_t binId )

Gets minimum and maximum of diapason inherited by bin Generated from a method of class MR::Histogram named getBinMinMax. Parameter _this can not be null. It is a single object. Never returns null. Returns an instance allocated on the heap! Must call MR_std_pair_float_float_Destroy() to free it when you're done using it.

◆ MR_Histogram_getBins()

MRC_API const MR_std_vector_uint64_t * MR_Histogram_getBins ( const MR_Histogram * _this)

Gets bins Generated from a method of class MR::Histogram named getBins. Parameter _this can not be null. It is a single object. The returned pointer will never be null. It is non-owning, do NOT destroy it.

◆ MR_Histogram_getMax()

MRC_API float MR_Histogram_getMax ( const MR_Histogram * _this)

Gets maximum value of histogram Generated from a method of class MR::Histogram named getMax. Parameter _this can not be null. It is a single object.

◆ MR_Histogram_getMin()

MRC_API float MR_Histogram_getMin ( const MR_Histogram * _this)

Gets minimum value of histogram Generated from a method of class MR::Histogram named getMin. Parameter _this can not be null. It is a single object.

◆ MR_Histogram_heapBytes()

MRC_API MR_uint64_t MR_Histogram_heapBytes ( const MR_Histogram * _this)

returns the amount of memory this object occupies on heap Generated from a method of class MR::Histogram named heapBytes. Parameter _this can not be null. It is a single object.

◆ MR_Histogram_OffsetMutablePtr()

MRC_API MR_Histogram * MR_Histogram_OffsetMutablePtr ( MR_Histogram * ptr,
ptrdiff_t i )

Offsets a pointer to an array element by i positions (not bytes). Use only if you're certain that the pointer points to an array element.

◆ MR_Histogram_OffsetPtr()

MRC_API const MR_Histogram * MR_Histogram_OffsetPtr ( const MR_Histogram * ptr,
ptrdiff_t i )

Offsets a pointer to an array element by i positions (not bytes). Use only if you're certain that the pointer points to an array element.