Catchea
Topographic Data Browser
Macros | Functions | Variables
catchmenter.cpp File Reference
#include <utility>
#include <queue>
#include <cstdio>
#include <utils.h>
#include <cstdlib>
#include "catchmenter.h"
Include dependency graph for catchmenter.cpp:

Macros

#define CORD(x, y, w)   (y * w + x)
 
#define TCORD(x, y)   CORD(x, y, tile->width)
 
#define FROM_CORD_X(pos, w)   (pos % w)
 
#define FROM_CORD_Y(pos, w)   (pos / w)
 

Functions

bool is_valid (const RealTile *tile, const int &pos_x, const int &pos_y)
 
bool is_local_minimum (const RealTile *tile, const int &pos_x, const int &pos_y, const Kernel &kernel)
 
void Catchmenter__color_pixel (RealTile *tile, const int &x, const int &y, const Kernel &kernel)
 
bool can_expand (RealTile *tile, int pos_x, int pos_y, int dx, int dy, int jump_max=1)
 
void Catchmenter__from (RealTile *tile, bool *visi_matrix, const int &from_x, const int &from_y, const Kernel &kernel, int jump_max)
 
void Catchmenter__all (RealTile *tile, const Kernel &kernel, int jump_max)
 
void Catchmenter__color_all (RealTile *tile, const Kernel &kernel)
 
void Catchmenter__color_all_immediate (RealTile *tile, const Kernel &kernel)
 
void Catchmenter__color_all_immediate_heightwise (RealTile *tile, const Kernel &kernel)
 

Variables

Kernel K4
 
Kernel K4_HARD_MIN
 
Kernel K8
 
Kernel K8_HARD_MIN
 

Detailed Description

Author
JMendyk
Date
19.01.18

Function Documentation

void Catchmenter__all ( RealTile tile,
const Kernel kernel,
int  jump_max 
)

Color whole RealTile using "Disjunctive" algorithm

Parameters
tileRealTile to catchment
kernelKernel to use for coloring
jump_maxRadius of area to check for expansion possibility
void Catchmenter__color_all ( RealTile tile,
const Kernel kernel 
)
void Catchmenter__color_all_immediate ( RealTile tile,
const Kernel kernel 
)

Immediately color whole RealTile

Parameters
tileRealTile to catchment
kernelKernel to use for coloring
void Catchmenter__color_all_immediate_heightwise ( RealTile tile,
const Kernel kernel 
)

Immediately color whole RealTile performing coloring based on height order

Parameters
tileRealTile to catchment
kernelKernel to use for coloring
void Catchmenter__color_pixel ( RealTile tile,
const int &  x,
const int &  y,
const Kernel kernel 
)
void Catchmenter__from ( RealTile tile,
bool *  visi_matrix,
const int &  from_x,
const int &  from_y,
const Kernel kernel,
int  jump_max 
)

Color RealTile from given position

Parameters
tileRealTile to catchment
visi_matrixMatrix representing which positions have already been visited by Catchmeneter
from_xstarting position's x coordinate
from_ystarting position's y coordinate
kernelKernel to use for coloring
jump_maxRadius of area to check for expansion possibility
bool is_local_minimum ( const RealTile tile,
const int &  pos_x,
const int &  pos_y,
const Kernel kernel 
)

Check if given position is at local minimum

Parameters
tileRealTile to get height data from
pos_xposition's x coordinate
pos_yposition's y coordinate
kernelKernel to use for check
Returns
Is position at local minimum

Variable Documentation

Kernel K4
Initial value:
= {
4,
false,
{ -1, 0, 1, 0 },
{ 0,-1, 0, 1 }
}
Kernel K4_HARD_MIN
Initial value:
= {
4,
true,
{ -1, 0, 1, 0 },
{ 0,-1, 0, 1 }
}
Kernel K8
Initial value:
= {
8,
false,
{ -1, 0, 1, 1, 1, 0, -1, -1 },
{ -1, -1, -1, 0, 1, 1, 1, 0 }
}
Kernel K8_HARD_MIN
Initial value:
= {
8,
true,
{ -1, 0, 1, 1, 1, 0, -1, -1 },
{ -1, -1, -1, 0, 1, 1, 1, 0 }
}