31 #ifndef IMAGE_MODIFIER_PACK_H
32 #define IMAGE_MODIFIER_PACK_H
34 #include "drain/util/Rectangle.h"
35 #include "drain/util/Histogram.h"
36 #include "drain/image/Sampler.h"
53 parameters.link(
"imageChannels", imageChannelCount = 1UL);
54 parameters.link(
"alphaChannels", alphaChannelCount = 0UL);
58 parameters.
copyStruct(op.getParameters(), op, *
this);
72 size_t imageChannelCount;
75 size_t alphaChannelCount;
85 ImageCoordPolicy() :
ImageMod(__FUNCTION__,
"Coordinate under/overflow policy: 0=UNDEFINED, 1=LIMIT, 2=WRAP, 3=MIRROR, 4=POLAR"){
86 parameters.link(
"policy", value,
"<xUF>[,<yUF>[,<xOF>,<yOF>]]");
91 parameters.
copyStruct(op.getParameters(), op, *
this);
127 refMap.link(
"type", encoding.
type);
129 refMap.link(
"scale", encoding.
getScaling().tuple()).fillArray =
false;
130 refMap.link(
"range", encoding.
getPhysicalRange().tuple()).fillArray =
false;
134 parameters.link(
"request", request, refMap.getKeys());
140 parameters.
copyStruct(op.getParameters(), op, *
this);
188 ImageFill() :
ImageMod(__FUNCTION__,
"Fill the image with intensity <value>[,<green>,<blue>[,alpha]]. See also 'plotfile'.") {
191 parameters.link(
"value", value);
195 parameters.
copyStruct(op.getParameters(), op, *
this);
220 parameters.link(
"bins", bins = 256);
222 parameters.link(
"store", store =
"histogram",
"attribute name (empty = don't save)");
223 parameters.link(
"filename", filename =
"",
"<filename>.txt");
228 parameters.
copyStruct(op.getParameters(), op, *
this);
243 std::string filename;
264 parameters.link(
"width", width = 0UL,
"pix");
265 parameters.link(
"heigh", height = 0UL,
"pix");
266 parameters.link(
"imageChannels", imageChannelCount = 1UL);
267 parameters.link(
"alphaChannels", alphaChannelCount = 0UL);
272 parameters.
copyStruct(op.getParameters(), op, *
this);
284 mutable size_t height;
285 mutable size_t imageChannelCount;
286 mutable size_t alphaChannelCount;
308 ImagePlot() :
ImageMod(__FUNCTION__,
"Set intensity at (i,j) to (f1,f2,f3,...)."){
311 parameters.link(
"value", value=
"0,0,0",
"<i>,<j>,<f1>[,f2,f3,alpha]");
316 parameters.
copyStruct(op.getParameters(), op, *
this);
336 parameters.link(
"filename", filename =
"",
"string");
340 parameters.
copyStruct(op.getParameters(), op, *
this);
349 std::string filename;
367 ImageBox() :
ImageMod(__FUNCTION__,
"Set intensity at (i:i2,j:j2) to (f1,f2,f3,...)."){
370 parameters.link(
"i", iRange.tuple(),
"i:i2").fillArray =
true;
371 parameters.link(
"j", jRange.tuple(),
"j:j2").fillArray =
true;
372 parameters.link(
"value", value=
"0",
"<f1>[:f2:f3:alpha]").fillArray =
true;
378 parameters.
copyStruct(op.getParameters(), op, *
this);
407 parameters.
append(sampler.getParameters());
413 parameters.
copyStruct(op.sampler.getParameters(), op.sampler, this->sampler);
429 const std::string & getFormat()
const {
445 ImageSampler(
const std::string & name,
const std::string & description) :
ImageMod(name, description){
446 parameters.
append(sampler.getParameters());
Definition: ReferenceMap.h:207
void append(ReferenceMap &rMap, bool replace=true)
Adopts the references of r. If replace==false, only new entries are appended.
Definition: ReferenceMap.h:320
void copyStruct(const ReferenceMap &m, const T &src, T &dst, extLinkPolicy policy=RESERVE)
Experimental. Copies references and values of a structure to another.
Definition: ReferenceMap.h:399
char separator
Default character used for splitting input and output. See setValues.
Definition: SmartMap.h:85
virtual const ValueScaling & getScaling() const
Get linear scaling.
Definition: ValueScaling.h:147
const Range< double > & getPhysicalRange() const
Returns a typical or supported range for physical values.
Definition: ValueScaling.h:221
Image with static geometry.
Definition: ImageChannel.h:60
Policies for coordinate underflows and overflows.
Definition: CoordinatePolicy.h:106
Definition: ImageConf.h:51
std::string type
Information of the current type.
Definition: ImageConf.h:103
Plots a single value in an image. The value will be scaled; notice that alpha channel is scaled by de...
Definition: ImageModifierPack.h:363
virtual void traverseChannels(ImageTray< Channel > &dst) const
Run this modifier for a set of channels.
Definition: ImageModifierPack.cpp:368
Definition: ImageModifierPack.h:48
virtual void initialize(Image &dst) const
Modifies the geometry and the type of dst such that traverseChannel(Channel &) can be called.
Definition: ImageModifierPack.cpp:52
virtual void traverseChannel(Channel &dst) const
Run this modifier for an image frame.
Definition: ImageModifierPack.h:66
Definition: ImageModifierPack.h:81
virtual void traverseChannel(Channel &dst) const
Run this modifier for an image frame.
Definition: ImageModifierPack.cpp:290
void initialize(Image &dst) const
Sets the policy.
Definition: ImageModifierPack.cpp:245
Changes the type of a target image.
Definition: ImageModifierPack.h:120
virtual void initialize(Image &dst) const
Modifies the geometry and the type of dst such that traverseChannel(Channel &) can be called.
Definition: ImageModifierPack.cpp:63
virtual void traverseChannel(Channel &dst) const
Run this modifier for an image frame.
Definition: ImageModifierPack.h:148
Definition: ImageModifierPack.h:184
virtual void traverseChannel(Channel &dst) const
Run this modifier for an image frame.
Definition: ImageModifierPack.cpp:218
virtual void traverseChannels(ImageTray< Channel > &dst) const
Run this modifier for a set of channels.
Definition: ImageModifierPack.cpp:200
Image with static geometry.
Definition: ImageFrame.h:67
Definition: ImageModifierPack.h:257
virtual void initialize(Image &dst) const
Modifies the geometry and the type of dst such that traverseChannel(Channel &) can be called.
Definition: ImageModifierPack.cpp:226
virtual void traverseChannel(Channel &dst) const
Run this modifier for an image frame.
Definition: ImageModifierPack.h:279
Definition: ImageModifierPack.h:214
virtual void traverseChannel(Channel &dst) const
Run this modifier for an image frame.
Definition: ImageModifierPack.cpp:105
Class for operations that modify an existing image instead of producing a new image.
Definition: ImageMod.h:52
ImageMod(const std::string &name=__FUNCTION__, const std::string &description="")
Definition: ImageMod.h:137
Definition: ImageModifierPack.h:331
Plots a single value in an image. The value will be scaled; notice that alpha channel is scaled by de...
Definition: ImageModifierPack.h:304
virtual void traverseChannels(ImageTray< Channel > &dst) const
Run this modifier for a set of channels.
Definition: ImageModifierPack.cpp:299
Traverses image, returning samples.
Definition: ImageModifierPack.h:401
ImageSampler()
Default constructor.
Definition: ImageModifierPack.h:406
std::string format
Output format, e.g. '{LON} {LAT} {AMVU} {AMVV} {QIND}'.
Definition: ImageModifierPack.h:454
virtual void process(Image &dst) const
Runs Sampler on the given image.
Definition: ImageModifierPack.cpp:485
std::string filename
If defined, sampler will directly write to this file. The default constructor does not reference this...
Definition: ImageModifierPack.h:431
Container applicable for Channels and Images, with alpha support.
Definition: ImageTray.h:267
Class for multi-channel digital images. Supports dynamic typing with base types (char,...
Definition: Image.h:184
Utility for sampling images (2D data), outputting formatted text data.
Definition: Sampler.h:152
Definition: DataSelector.cpp:1277