draw

draw — Render iterated function systems.

Synopsis




void        ifs_draw_int                    (const IFS *ifs,
                                             size_t ntab,
                                             const size_t *tab,
                                             uint64_t niter,
                                             size_t rows,
                                             size_t cols,
                                             uint32_t *canvas);
void        ifs_int2gray16_converg          (uint16_t *pixmap,
                                             const uint32_t *canvas,
                                             size_t rows,
                                             size_t cols,
                                             uint32_t max,
                                             double qgamma);
void        ifs_int2gray8_bw                (unsigned char *pixmap,
                                             const uint32_t *canvas,
                                             size_t rows,
                                             size_t cols,
                                             uint32_t threshold);
void        ifs_int2gray8_converg           (unsigned char *pixmap,
                                             const uint32_t *canvas,
                                             size_t rows,
                                             size_t cols,
                                             uint32_t max,
                                             double qgamma);
uint32_t*   ifs_int_get_histogram           (size_t rows,
                                             size_t cols,
                                             const uint32_t *canvas,
                                             uint32_t m);
uint32_t    ifs_int_get_max                 (size_t rows,
                                             size_t cols,
                                             const uint32_t *canvas);
size_t      ifs_int_get_nonzero             (size_t rows,
                                             size_t cols,
                                             const uint32_t *canvas);
double      ifs_int_get_sqavg               (size_t rows,
                                             size_t cols,
                                             const uint32_t *canvas);

Description

In IFSgr the rendering is two-phase. In the first phase iterations are performed, counting the number of times each pixel was hit during the iterations. This is done by ifs_draw_int(). This pixel hit count canvas can be analysed then and optimal mapping to gray levels found. The final mapping can be then performed in second phase by functions like ifs_int2gray8_converg() or ifs_int2gray8_bw().

Details

ifs_draw_int ()

void        ifs_draw_int                    (const IFS *ifs,
                                             size_t ntab,
                                             const size_t *tab,
                                             uint64_t niter,
                                             size_t rows,
                                             size_t cols,
                                             uint32_t *canvas);

Render an iterated function system ifs to canvas.

On returns the canvas contains the numbers how many times each pixel was hit during the iterations.

ifs: An iterated function system.
ntab: The size of ntab.
tab: A precomputed transformation relative occurence table.
niter: The number of iterations to perform.
rows: Height of canvas.
cols: Width of canvas.
canvas: 32bit-integer canvas to draw pixel hit counts to.

ifs_int2gray16_converg ()

void        ifs_int2gray16_converg          (uint16_t *pixmap,
                                             const uint32_t *canvas,
                                             size_t rows,
                                             size_t cols,
                                             uint32_t max,
                                             double qgamma);

Render pixel hit counts as grayscale image with 2 bytes per pixel.

pixmap: Grayscale 2 bytes per pixel pixmap to render canvas to.
canvas: 32bit integer canvas with pixel hit counts.
rows: Height of canvas.
cols: Width of canvas.
max: The maximum pixel hit count.
qgamma: Gamma value, value 1.0 means linear mapping. Usual gamma values lie in wide range approximately from 1/10 to 1000. See the TeX files in the source distribution for some discussion of good gamma choice.

ifs_int2gray8_bw ()

void        ifs_int2gray8_bw                (unsigned char *pixmap,
                                             const uint32_t *canvas,
                                             size_t rows,
                                             size_t cols,
                                             uint32_t threshold);

Render pixel hit counts as black-and-white image.

pixmap: Grayscale 1 byte per pixel pixmap to render canvas to.
canvas: 32bit integer canvas with pixel hit counts.
rows: Height of canvas.
cols: Width of canvas.
threshold: Black-white threshold, pixels with lower hit counts than threshold are drawn black (0) others are drawn white (255).

ifs_int2gray8_converg ()

void        ifs_int2gray8_converg           (unsigned char *pixmap,
                                             const uint32_t *canvas,
                                             size_t rows,
                                             size_t cols,
                                             uint32_t max,
                                             double qgamma);

Render pixel hit counts as grayscale image with 1 byte per pixel.

pixmap: Grayscale 1 byte per pixel pixmap to render canvas to.
canvas: 32bit integer canvas with pixel hit counts.
rows: Height of canvas.
cols: Width of canvas.
max: The maximum pixel hit count.
qgamma: Gamma value, value 1.0 means linear mapping. Usual gamma values lie in wide range approximately from 1/10 to 1000. See the TeX files in the source distribution for some discussion of good gamma choice.

ifs_int_get_histogram ()

uint32_t*   ifs_int_get_histogram           (size_t rows,
                                             size_t cols,
                                             const uint32_t *canvas,
                                             uint32_t m);

Create a histogram of pixel hit counts.

Note m has to be greater or equal to the real maximum pixel hit count, no boundary checking is done.

rows: Height of canvas.
cols: Width of canvas.
canvas: 32bit-integer canvas with pixel hit counts.
m: Histogram size (the maximum pixel hit count).
Returns : A newly allocated array of size m+1 with the pixel hit count histogram.

ifs_int_get_max ()

uint32_t    ifs_int_get_max                 (size_t rows,
                                             size_t cols,
                                             const uint32_t *canvas);

Find the maximum pixel hit count.

rows: Height of canvas.
cols: Width of canvas.
canvas: 32bit-integer canvas with pixel hit counts.
Returns : The maximum pixel hit count.

ifs_int_get_nonzero ()

size_t      ifs_int_get_nonzero             (size_t rows,
                                             size_t cols,
                                             const uint32_t *canvas);

Count pixels with nonzero hit count.

rows: Height of canvas.
cols: Width of canvas.
canvas: 32bit integer canvas with pixel hit counts.
Returns : The number of pixels with nonzero hit count in canvas.

ifs_int_get_sqavg ()

double      ifs_int_get_sqavg               (size_t rows,
                                             size_t cols,
                                             const uint32_t *canvas);

Compute average of squared pixel hit counts.

rows: Height of canvas.
cols: Width of canvas.
canvas: 32bit-integer canvas with pixel hit counts.
Returns : The average of pixel hit count squares.