bitlib_c  0.2.4
Classes | Typedefs | Functions
log_display.h File Reference

Go to the source code of this file.

Classes

struct  _bl_bl_log_display_data
 

Typedefs

typedef struct _bl_bl_log_display_data bl_log_display_data
 

Functions

bl_log_display_databl_make_log_display_data (double width, double height)
 
void bl_log_display_add (bl_log_display_data *data, double x, double y)
 
double bl_log_display_get_value (bl_log_display_data *data, double x, double y)
 

Typedef Documentation

◆ bl_log_display_data

A structure to hold information about quantitative draws to a bitmap.

Rather than directly drawing each pixel, you mark it as hit in this data struct. When you are done markeing pixels, you can get the value for each pixel which will be calculated on a logarithmic scale based on the pixel that got the most hits.

Function Documentation

◆ bl_log_display_add()

void bl_log_display_add ( bl_log_display_data data,
double  x,
double  y 
)

Marks a pixel as hit in a bl_log_display_data instance.

Hits are cumulative and will later be scaled logarithmically.

Parameters
bl_log_display_data*data The bl_log_display_data to add to.
doublex The x value of the pixel to add.
doubley The y value of the pixel to add.

Examples

bl_log_display_add(data, 100, 100);

◆ bl_log_display_get_value()

double bl_log_display_get_value ( bl_log_display_data data,
double  x,
double  y 
)

Gets the logarithmically scaled value for a pixel.

Parameters
bl_log_display_data*data The bl_log_display_data to retrieve a value from.
doublex The x value of the pixel.
doubley The y value of the pixel. returns double

Examples

double value = bl_log_display_get_value(data, 100, 100);

◆ bl_make_log_display_data()

bl_log_display_data* bl_make_log_display_data ( double  width,
double  height 
)

Creates an instance of bl_log_display_data.

Be sure to free the instance when you are done.

Parameters
doublewidth The width of the bitmap you will be drawing to.
doubleheight The height of the bitmap you will be drawing to.
Returns
bl_log_display_data*

Examples

bl_log_display_data *data = bl_make_log_display_data(400, 400);