mightymandel v16

GPU-based Mandelbrot set explorer

blob_set.h File Reference

(v16)

Blob extraction and disjoint collection of blobs (specification). More...

#include <stdbool.h>
#include <stdint.h>
+ Include dependency graph for blob_set.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  blob
 Blob information. More...

Enumerations

enum  blob_strategy {
  blob_boolean,
  blob_positive
}
 Blob extraction strategy. More...

Functions

struct blob_setblob_set_new ()
 Create a new empty blob set.
void blob_set_delete (struct blob_set *s)
 Delete a blob set.
void blob_set_insert (struct blob_set *s, const struct blob *blob)
 Insert a blob into a blob set.
bool blob_set_contains (const struct blob_set *s, const struct blob *blob)
 Check if a blob is contained in a blob set.
struct blobfind_blobs0 (int *blob_count, int width, int height, const float *glitched, enum blob_strategy strategy, int i0, int i1, int j0, int j1)
 Extract blobs from an image region using a strategy.
struct blobfind_blobs1 (int *blob_count, int width, int height, const float *glitched)
 Extract blobs from a whole image using blob_boolean strategy.
struct blobfind_blobs2 (int *blob_count, int width, int height, const float *glitched, const struct blob *blob)
 Extract sub-blobs from an image using blob_positive strategy.

Detailed Description

Blob extraction and disjoint collection of blobs (specification).

Definition in file blob_set.h.


Data Structure Documentation

struct blob

Blob information.

Definition at line 19 of file blob_set.h.

Data Fields
int count Number of pixels in the blob.
float error Blob error count.
int64_t i Total of pixel i coordinates.
int64_t j Total of pixel j coordinates.
int label Label for union-find (internal use).
int max_i Maximum pixel i coordinate.
int max_j Maximum pixel j coordinate.
int min_i Minimum pixel i coordinate.
int min_j Minimum pixel j coordinate.

Enumeration Type Documentation

Blob extraction strategy.

Enumerator:
blob_boolean 

Consider all glitched pixels equal.

blob_positive 

Consider glitched pixels equal only if their glitch counts are equal too.

Definition at line 70 of file blob_set.h.

Function Documentation

bool blob_set_contains ( const struct blob_set s,
const struct blob blob 
)

Check if a blob is contained in a blob set.

Parameters
sA blob set.
blobA blob.
Returns
true if the blob is in the set, false otherwise.

Definition at line 61 of file blob_set.c.

References blob_set_node::blob, blob::count, blob::i, blob::j, blob_set_node::next, and blob_set::set.

Referenced by find_ref().

+ Here is the caller graph for this function:

void blob_set_delete ( struct blob_set s)

Delete a blob set.

Parameters
sA blob set.

Definition at line 39 of file blob_set.c.

References blob_set_node::next, and blob_set::set.

Referenced by fpxx_start().

+ Here is the caller graph for this function:

void blob_set_insert ( struct blob_set s,
const struct blob blob 
)

Insert a blob into a blob set.

Parameters
sA blob set.
blobA blob.

Definition at line 51 of file blob_set.c.

References blob_set_node::blob, blob::count, blob::i, blob::j, blob::label, blob_set_node::next, and blob_set::set.

Referenced by find_ref().

+ Here is the caller graph for this function:

struct blob_set* blob_set_new ( )
read

Create a new empty blob set.

Returns
A blob set.

Definition at line 35 of file blob_set.c.

Referenced by fpxx_start().

+ Here is the caller graph for this function:

struct blob* find_blobs0 ( int *  blob_count,
int  width,
int  height,
const float glitched,
enum blob_strategy  strategy,
int  i0,
int  i1,
int  j0,
int  j1 
)
read

Extract blobs from an image region using a strategy.

Parameters
blob_countThe number of extracted blobs is stored here.
widthThe glitch count image width.
heightThe glitch count image height.
glitchedThe glitch count image.
strategyThe strategy to use.
i0The lower i coordinate of the image region (eg: 0).
i1The upper i coordinate of the image region (eg: width).
j0The lower j coordinate of the image region (eg: 0).
j1The upper j coordinate of the image region (eg: height).
Returns
An array of blobs, sorted by count (blob_boolean) or glitch count (blob_positive), largest first.

Definition at line 170 of file blob_set.c.

References blob_boolean, cmp_blob_count_desc(), cmp_blob_error_desc(), cmp_label(), blob::count, blob::error, label::error, ufs::height, blob::i, label::i, blob::j, label::j, blob::label, label::label, ufs::labels, max(), blob::max_i, blob::max_j, min(), blob::min_i, blob::min_j, ufs::nodes, uf_find(), uf_singleton(), uf_union(), and ufs::width.

Referenced by find_blobs1(), and find_blobs2().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

struct blob* find_blobs1 ( int *  blob_count,
int  width,
int  height,
const float glitched 
)
read

Extract blobs from a whole image using blob_boolean strategy.

Parameters
blob_countThe number of extracted blobs is stored here.
widthThe glitch count image width.
heightThe glitch count image height.
glitchedThe glitch count image.
Returns
An array of blobs, sorted by count, largest first.

Definition at line 299 of file blob_set.c.

References blob_boolean, and find_blobs0().

Referenced by find_ref().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

struct blob* find_blobs2 ( int *  blob_count,
int  width,
int  height,
const float glitched,
const struct blob blob 
)
read

Extract sub-blobs from an image using blob_positive strategy.

Parameters
blob_countThe number of extracted blobs is stored here.
widthThe glitch count image width.
heightThe glitch count image height.
glitchedThe glitch count image.
blobThe blob determines the region to search within.
Returns
An array of sub-blobs, sorted by glitch count, largest first.

Definition at line 303 of file blob_set.c.

References blob_positive, find_blobs0(), blob::max_i, blob::max_j, blob::min_i, and blob::min_j.

Referenced by find_ref().

+ Here is the call graph for this function:

+ Here is the caller graph for this function: