bfs namespace: specifies a set of filler functions for doing fills on images employing a breadth-first-search approach.
More...
|
animation | fillSolid (PNG &img, int x, int y, RGBAPixel fillColor, int tolerance, int frameFreq) |
| Performs a flood fill on the given image using a solid color, employing a breadth-first-search approach. More...
|
|
animation | fillGrid (PNG &img, int x, int y, RGBAPixel gridColor, int gridSpacing, int tolerance, int frameFreq) |
| Performs a flood fill on the given image using a grid, employing a breadth-first-search approach. More...
|
|
animation | fillGradient (PNG &img, int x, int y, RGBAPixel fadeColor1, RGBAPixel fadeColor2, int radius, int tolerance, int frameFreq) |
| Performs a flood fill on the given image using a gradient, employing a breadth-first-search approach. More...
|
|
animation | fill (PNG &img, int x, int y, colorPicker &fillColor, int tolerance, int frameFreq) |
| Performs a flood fill on the given image using the given color picker, employing a breadth-first-search approach. More...
|
|
bfs namespace: specifies a set of filler functions for doing fills on images employing a breadth-first-search approach.
- Note
- All of the functions in this namespace should call the generic filler::bfs::fill function with the correct color picker parameter (except for, of course, filler::bfs::fill itself).
- Author
- Chase Geigle
- Date
- Fall 2012
animation filler::bfs::fillSolid |
( |
PNG & |
img, |
|
|
int |
x, |
|
|
int |
y, |
|
|
RGBAPixel |
fillColor, |
|
|
int |
tolerance, |
|
|
int |
frameFreq |
|
) |
| |
Performs a flood fill on the given image using a solid color, employing a breadth-first-search approach.
- Parameters
-
img | The image to be filled. |
x | The starting x coordinate for the fill. |
y | The starting y coordinate for the fill. |
fillColor | The color of the fill. |
tolerance | How far away colors are allowed to be to still be included in the fill: this is given as squared euclidean distance in RGB space (i.e. \((c1.red - c2.red)^2 + (c1.green - c2.green)^2 + (c1.blue - c2.blue)^2)\). |
frameFreq | How frequently to add a frame to the animation, in pixels. For instance, if frameFreq == 1, a frame is added when every pixel is filled. If frameFreq == 10, a frame is added after every 10 pixels is filled. |
- Returns
- An animation that shows the fill progressing over the image.
- Todo:
- Your code here! You should replace the following line with a correct call to fill with the correct colorPicker parameter.
animation filler::bfs::fillGrid |
( |
PNG & |
img, |
|
|
int |
x, |
|
|
int |
y, |
|
|
RGBAPixel |
gridColor, |
|
|
int |
gridSpacing, |
|
|
int |
tolerance, |
|
|
int |
frameFreq |
|
) |
| |
Performs a flood fill on the given image using a grid, employing a breadth-first-search approach.
- Parameters
-
img | The image to be filled. |
x | The starting x coordinate for the fill. |
y | The starting y coordinate for the fill. |
gridColor | The color the lines of the grid should appear. |
gridSpacing | The width and height of the cells of the grid. |
tolerance | How far away colors are allowed to be to still be included in the fill: this is given as squared euclidean distance in RGB space (i.e. \((c1.red - c2.red)^2 + (c1.green - c2.green)^2 + (c1.blue - c2.blue)^2)\). |
frameFreq | How frequently to add a frame to the animation, in pixels. For instance, if frameFreq == 1, a frame is added when every pixel is filled. If frameFreq == 10, a frame is added after every 10 pixels is filled. |
- Returns
- An animation that shows the fill progressing over the image.
- Todo:
- Your code here! You should replace the following line with a correct call to fill with the correct colorPicker parameter.
Performs a flood fill on the given image using a gradient, employing a breadth-first-search approach.
- Parameters
-
img | The image to be filled. |
x | The starting x coordinate for the fill. |
y | The starting y coordinate for the fill. |
fadeColor1 | The starting color of the gradient. |
fadeColor2 | The ending color of the gradient. |
radius | The radius for the gradient. |
tolerance | How far away colors are allowed to be to still be included in the fill: this is given as squared euclidean distance in RGB space (i.e. \((c1.red - c2.red)^2 + (c1.green - c2.green)^2 + (c1.blue - c2.blue)^2)\). |
frameFreq | How frequently to add a frame to the animation, in pixels. For instance, if frameFreq == 1, a frame is added when every pixel is filled. If frameFreq == 10, a frame is added after every 10 pixels is filled. |
- Returns
- An animation that shows the fill progressing over the image.
- Todo:
- Your code here! You should replace the following line with a correct call to fill with the correct colorPicker parameter.
Performs a flood fill on the given image using the given color picker, employing a breadth-first-search approach.
- Parameters
-
img | Image to do the filling on. |
x | X coordinate to start the fill from. |
y | Y coordinate to start the fill from. |
fillColor | The colorPicker to be used for the fill. |
tolerance | How far away colors are allowed to be to still be included in the fill: this is given as squared euclidean distance in RGB space (i.e. \((c1.red - c2.red)^2 + (c1.green - c2.green)^2 + (c1.blue - c2.blue)^2)\). |
frameFreq | How frequently to add a frame to the animation, in pixels. For instance, if frameFreq == 1, a frame is added when every pixel is filled. If frameFreq == 10, a frame is added after every 10 pixels is filled. |
- Returns
- An animation that shows the fill progressing over the image.
- Todo:
- Your code here! You should replace the following line with a correct call to filler::fill with the correct template parameter indicating the ordering structure to be used in the fill.