mightymandel v16

GPU-based Mandelbrot set explorer

image.h File Reference

(v16)

Image related functions. More...

#include "logging.h"
+ Include dependency graph for image.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  pixel
 A pixel storage structure. More...

Functions

int cmp_pixel (const void *a, const void *b)
 Compare pixel iteration counts and error counts.
floatimage_get_glitched (int width, int height)
 Download image glitch flags from OpenGL.
floatimage_get_iterations (int width, int height)
 Download image iteration counts from OpenGL.
unsigned char * image_erode (const unsigned char *data, int width, int height)
 Erode a binary image.
struct pixelimage_find_peak_glitches (const float *glitched, const float *iterations, int width, int height, int *count)
 Find the highest iteration count glitched pixels.
enum result_t image_result (int width, int height, double *iterations, double *exterior, double *interior, double *glitch)

Detailed Description

Image related functions.

Definition in file image.h.


Data Structure Documentation

struct pixel

A pixel storage structure.

Definition at line 18 of file image.h.

Data Fields
float e Error count.
int i Pixel x coordinate.
int j Pixel y coordinate.
float n Iteration count.

Function Documentation

int cmp_pixel ( const void *  a,
const void *  b 
)

Compare pixel iteration counts and error counts.

For use in qsort(), larger iteration counts compare earlier, same iteration count has larger error count comparing earlier.

Parameters
aThe first pixel.
bThe second pixel.
Returns
Whether the first pixel is earlier than (-1), equal to (0), or later than (1) the second pixel.

Definition at line 28 of file image.c.

References pixel::e, and pixel::n.

Referenced by image_find_peak_glitches().

+ Here is the caller graph for this function:

unsigned char* image_erode ( const unsigned char *  data,
int  width,
int  height 
)

Erode a binary image.

See https://en.wikipedia.org/wiki/Erosion_%28morphology%29. The result should be free()d when no longer needed.

Parameters
dataThe input image.
widthThe image width.
heightThe image height.
Returns
The eroded image.

Definition at line 103 of file image.c.

References pixel::i, and pixel::j.

struct pixel* image_find_peak_glitches ( const float glitched,
const float iterations,
int  width,
int  height,
int *  count 
)
read

Find the highest iteration count glitched pixels.

The result should be free()d when no longer needed.

Parameters
glitchedThe glitch count image.
iterationsThe iteration count image.
widthThe image width.
heightThe image height.
countThe number of glitched pixels is stored here.
Returns
The glitched pixels sorted by error count, then by iteration count (highest first in both fields).

Definition at line 140 of file image.c.

References cmp_pixel(), pixel::e, pixel::i, pixel::j, and pixel::n.

+ Here is the call graph for this function:

float* image_get_glitched ( int  width,
int  height 
)

Download image glitch flags from OpenGL.

Uses the currently bound texture, assumes glitch is in alpha. The result should be free()d when no longer needed.

Parameters
widthThe width of the texture.
heightThe height of the texture.
Returns
The glitch count image, tightly packed in rows from top left to bottom right.

Definition at line 49 of file image.c.

References pixel::i, pixel::j, and TEX_RAW.

Referenced by find_ref().

+ Here is the caller graph for this function:

float* image_get_iterations ( int  width,
int  height 
)

Download image iteration counts from OpenGL.

Uses the currently bound textures, assumes iteration count is in red. The result should be free()d when no longer needed.

Parameters
widthThe width of the texture.
heightThe height of the texture.
Returns
The iteration count image, tightly packed in rows from top left to bottom right.

Definition at line 76 of file image.c.

References pixel::i, pixel::j, and TEX_RAW.

enum result_t image_result ( int  width,
int  height,
double *  iterations,
double *  exterior,
double *  interior,
double *  glitch 
)

Definition at line 161 of file image.c.

References pixel::i, pixel::j, result_glitch, result_ok, and TEX_RAW.

Referenced by collect_metadata_to_string(), and render_display().

+ Here is the caller graph for this function: