From 9225420eba3d8982ee73066eb9c2ef6c171ec60f Mon Sep 17 00:00:00 2001 From: David Capello Date: Mon, 2 Nov 2015 16:45:09 -0300 Subject: [PATCH] Minor change in floodfill.h/cpp --- src/doc/algorithm/floodfill.cpp | 23 ++++++++++++----------- src/doc/algorithm/floodfill.h | 11 ++++++----- 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/src/doc/algorithm/floodfill.cpp b/src/doc/algorithm/floodfill.cpp index fc7deb646..e278ebafd 100644 --- a/src/doc/algorithm/floodfill.cpp +++ b/src/doc/algorithm/floodfill.cpp @@ -125,9 +125,9 @@ inline bool color_equal(color_t c1, color_t c2, int tolerance) * to the list of drawn segments. Returns the first x coordinate after * the part of the line which it has dealt with. */ -static int flooder(Image *image, int x, int y, - const gfx::Rect& bounds, - color_t src_color, int tolerance, void *data, AlgoHLine proc) +static int flooder(const Image* image, int x, int y, + const gfx::Rect& bounds, + color_t src_color, int tolerance, void *data, AlgoHLine proc) { FLOODED_LINE *p; int left = 0, right = 0; @@ -263,9 +263,9 @@ static int flooder(Image *image, int x, int y, * segments which have already been drawn in order to minimise the required * number of tests. */ -static int check_flood_line(Image* image, int y, int left, int right, - const gfx::Rect& bounds, - int src_color, int tolerance, void *data, AlgoHLine proc) +static int check_flood_line(const Image* image, int y, int left, int right, + const gfx::Rect& bounds, + int src_color, int tolerance, void *data, AlgoHLine proc) { int c; FLOODED_LINE *p; @@ -296,7 +296,7 @@ static int check_flood_line(Image* image, int y, int left, int right, } template -static void replace_color(Image* image, const gfx::Rect& bounds, int src_color, int tolerance, void *data, AlgoHLine proc) +static void replace_color(const Image* image, const gfx::Rect& bounds, int src_color, int tolerance, void* data, AlgoHLine proc) { typename ImageTraits::address_t address; @@ -322,10 +322,11 @@ static void replace_color(Image* image, const gfx::Rect& bounds, int src_color, /* floodfill: * Fills an enclosed area (starting at point x, y) with the specified color. */ -void floodfill(Image* image, int x, int y, - const gfx::Rect& bounds, - int tolerance, bool contiguous, - void* data, AlgoHLine proc) +void floodfill(const Image* image, int x, int y, + const gfx::Rect& bounds, + int tolerance, bool contiguous, + void* data, + AlgoHLine proc) { // Make sure we have a valid starting point if ((x < 0) || (x >= image->width()) || diff --git a/src/doc/algorithm/floodfill.h b/src/doc/algorithm/floodfill.h index 6a8e58a20..01d939a40 100644 --- a/src/doc/algorithm/floodfill.h +++ b/src/doc/algorithm/floodfill.h @@ -1,5 +1,5 @@ // Aseprite Document Library -// Copyright (c) 2001-2014 David Capello +// Copyright (c) 2001-2015 David Capello // // This file is released under the terms of the MIT license. // Read LICENSE.txt for more information. @@ -17,10 +17,11 @@ namespace doc { namespace algorithm { - void floodfill(Image* image, int x, int y, - const gfx::Rect& bounds, - int tolerance, bool contiguous, - void* data, AlgoHLine proc); + void floodfill(const Image* image, int x, int y, + const gfx::Rect& bounds, + int tolerance, bool contiguous, + void* data, + AlgoHLine proc); } }