flood_fill_line: call user callback as well
This commit is contained in:
parent
38f882b3d6
commit
0b69940876
1 changed files with 7 additions and 5 deletions
|
@ -126,6 +126,7 @@ typedef void (*span_func_t)(void *user_data, int y, int left, int right);
|
||||||
|
|
||||||
static void flood_fill_line(struct quirc *q, int x, int y,
|
static void flood_fill_line(struct quirc *q, int x, int y,
|
||||||
int from, int to,
|
int from, int to,
|
||||||
|
span_func_t func, void *user_data,
|
||||||
int *leftp, int *rightp)
|
int *leftp, int *rightp)
|
||||||
{
|
{
|
||||||
quirc_pixel_t *row;
|
quirc_pixel_t *row;
|
||||||
|
@ -152,6 +153,9 @@ static void flood_fill_line(struct quirc *q, int x, int y,
|
||||||
/* Return the processed range */
|
/* Return the processed range */
|
||||||
*leftp = left;
|
*leftp = left;
|
||||||
*rightp = right;
|
*rightp = right;
|
||||||
|
|
||||||
|
if (func)
|
||||||
|
func(user_data, y, left, right);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void flood_fill_seed(struct quirc *q,
|
static void flood_fill_seed(struct quirc *q,
|
||||||
|
@ -187,11 +191,9 @@ call:
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Fill the extent */
|
/* Fill the extent */
|
||||||
flood_fill_line(q, vars->left_up, vars->y, from, to, &vars->left_up,
|
flood_fill_line(q, vars->left_up, vars->y, from, to,
|
||||||
&vars->right);
|
func, user_data,
|
||||||
|
&vars->left_up, &vars->right);
|
||||||
if (func)
|
|
||||||
func(user_data, vars->y, vars->left_up, vars->right);
|
|
||||||
|
|
||||||
if (vars == last_vars) {
|
if (vars == last_vars) {
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in a new issue