Loading...
Searching...
No Matches
FloodFillOp.h
1/*
2
3MIT License
4
5Copyright (c) 2017 FMI Open Development / Markus Peura, first.last@fmi.fi
6
7Permission is hereby granted, free of charge, to any person obtaining a copy
8of this software and associated documentation files (the "Software"), to deal
9in the Software without restriction, including without limitation the rights
10to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11copies of the Software, and to permit persons to whom the Software is
12furnished to do so, subject to the following conditions:
13
14The above copyright notice and this permission notice shall be included in all
15copies or substantial portions of the Software.
16
17THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23SOFTWARE.
24
25*/
26/*
27Part of Rack development has been done in the BALTRAD projects part-financed
28by the European Union (European Regional Development Fund and European
29Neighbourhood Partnership Instrument, Baltic Sea Region Programme 2007-2013)
30*/
31#ifndef FLOODFILL2_H
32#define FLOODFILL2_H
33
34#include <drain/image/CoordinatePolicy.h>
35#include <sstream>
36#include <ostream>
37
38#include "drain/image/FilePng.h"
39#include "drain/image/SegmentProber.h"
40
41#include "ImageOp.h"
42
43namespace drain
44{
45namespace image
46{
47
49
64// Consider multi-channel fill. Needs one marker image.
65class FloodFillOp : public ImageOp {
66
67public:
68
69 FloodFillOp(int i=0, int j=0, double min=1.0, double max=65536.0, double value=1.0);
70
71 FloodFillOp(const FloodFillOp & op);
72
73 //virtual void makeCompatible(const ImageFrame & src,Image & dst) const;
74 virtual
75 void traverseChannels(const ImageTray<const Channel> & src, ImageTray<Channel> & dst) const {
76 //drain::Logger mout(getImgLog(), __FUNCTION__,__FILE__); //REP (this->name+"(ImageOp::)[const ImageTray &, ImageTray &]", __FUNCTION__);
78 }
79
80 virtual
81 void traverseChannel(const Channel & src, Channel & dst) const;
82
83 void traverseChannel(const Channel & src, const Channel & srcAlpha, Channel & dst, Channel & dstAlpha) const {
84 Logger mout(getImgLog(), __FILE__, __FUNCTION__);
85 mout.warn("Alpha channels not supported, calling traverseChannel(src, dst).");
86 traverseChannel(src, dst);
87 }
88
92 //template <class C> void fill(const Channel & src, int i, int j, Channel & dst) const;
93
94
97 // mutable int i0;
99 // mutable int j0;
100
102
103};
104
105
106} // image::
107} // drain::
108
109#endif /* FLOODFILL_H_ */
110
111
LogSourc e is the means for a function or any program segment to "connect" to a Log.
Definition Log.h:312
Logger & warn(const TT &... args)
Possible error, but execution can continue.
Definition Log.h:430
Image with static geometry.
Definition ImageChannel.h:60
A fill operation for one color.
Definition FloodFillOp.h:65
virtual void traverseChannel(const Channel &src, Channel &dst) const
Apply to single channel.
Definition FloodFillOp.cpp:112
Point2D< int > startPoint
Mutable, for coord handler ?
Definition FloodFillOp.h:96
void traverseChannel(const Channel &src, const Channel &srcAlpha, Channel &dst, Channel &dstAlpha) const
Apply to single channel with alpha.
Definition FloodFillOp.h:83
SegmentProberConf< double, double > conf
Mutable, for coord handler.
Definition FloodFillOp.h:101
virtual int srcAlpha() const
Tell if alpha channel(s) is required in input.
Definition ImageMod.h:66
Base class for image processing functions.
Definition ImageOp.h:49
void traverseChannelsSeparately(const ImageTray< const Channel > &src, ImageTray< Channel > &dst) const
Process each (src,dst) channel pair independently. Raise error if their counts differ.
Definition ImageOp.cpp:340
Container applicable for Channels and Images, with alpha support.
Definition ImageTray.h:267
Container for parameters of SegmentProber.
Definition SegmentProber.h:58
Definition DataSelector.cpp:1277
Definition Point.h:48