31#ifndef IMAGE_MODIFIER_PACK_H
32#define IMAGE_MODIFIER_PACK_H
34#include "drain/util/Histogram.h"
35#include "drain/image/Sampler.h"
52 parameters.link(
"imageChannels", imageChannelCount = 1UL);
53 parameters.link(
"alphaChannels", alphaChannelCount = 0UL);
57 parameters.
copyStruct(op.getParameters(), op, *
this);
71 size_t imageChannelCount;
74 size_t alphaChannelCount;
84 ImageCoordPolicy() :
ImageMod(__FUNCTION__,
"Coordinate under/overflow policy: 0=UNDEFINED, 1=LIMIT, 2=WRAP, 3=MIRROR, 4=POLAR"){
85 parameters.link(
"policy", value,
"<xUF>[,<yUF>[,<xOF>,<yOF>]]");
90 parameters.
copyStruct(op.getParameters(), op, *
this);
126 refMap.link(
"type", encoding.
type);
128 refMap.link(
"scale", encoding.
getScaling().tuple()).fillArray =
false;
129 refMap.link(
"range", encoding.
getPhysicalRange().tuple()).fillArray =
false;
133 parameters.link(
"request", request, refMap.getKeys());
139 parameters.
copyStruct(op.getParameters(), op, *
this);
187 ImageFill() :
ImageMod(__FUNCTION__,
"Fill the image with intensity <value>[,<green>,<blue>[,alpha]]. See also 'plotfile'.") {
190 parameters.link(
"value", value);
194 parameters.
copyStruct(op.getParameters(), op, *
this);
219 parameters.link(
"bins", bins = 256);
221 parameters.link(
"store", store =
"histogram",
"attribute name (empty = don't save)");
222 parameters.link(
"filename", filename =
"",
"<filename>.txt");
227 parameters.
copyStruct(op.getParameters(), op, *
this);
242 std::string filename;
263 parameters.link(
"width", width = 0UL,
"pix");
264 parameters.link(
"heigh", height = 0UL,
"pix");
265 parameters.link(
"imageChannels", imageChannelCount = 1UL);
266 parameters.link(
"alphaChannels", alphaChannelCount = 0UL);
271 parameters.
copyStruct(op.getParameters(), op, *
this);
283 mutable size_t height = 0;
284 mutable size_t imageChannelCount = 1;
285 mutable size_t alphaChannelCount = 0;
307 ImagePlot() :
ImageMod(__FUNCTION__,
"Set intensity at (i,j) to (f1,f2,f3,...)."){
310 parameters.link(
"value", value=
"0,0,0",
"<i>,<j>,<f1>[,f2,f3,alpha]");
315 parameters.
copyStruct(op.getParameters(), op, *
this);
335 parameters.link(
"filename", filename =
"",
"string");
339 parameters.
copyStruct(op.getParameters(), op, *
this);
348 std::string filename;
366 ImageBox() :
ImageMod(__FUNCTION__,
"Set intensity at (i:i2,j:j2) to (f1,f2,f3,...)."){
369 parameters.link(
"i", iRange.tuple(),
"i:i2").fillArray =
true;
370 parameters.link(
"j", jRange.tuple(),
"j:j2").fillArray =
true;
371 parameters.link(
"value", value=
"0",
"<f1>[:f2:f3:alpha]").fillArray =
true;
377 parameters.
copyStruct(op.getParameters(), op, *
this);
406 parameters.
append(sampler.getParameters());
412 parameters.
copyStruct(op.sampler.getParameters(), op.sampler, this->sampler);
428 const std::string & getFormat()
const {
444 ImageSampler(
const std::string & name,
const std::string & description) :
ImageMod(name, description){
445 parameters.
append(sampler.getParameters());
Definition ReferenceMap.h:215
void append(ReferenceMap &rMap, bool replace=true)
Adopts the references of r. If replace==false, only new entries are appended.
Definition ReferenceMap.h:336
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:415
char separator
Default character used for splitting input and output. See setValues.
Definition SmartMap.h:81
const Range< double > & getPhysicalRange() const
Returns a typical or supported range for physical values.
Definition ValueScaling.h:220
virtual const ValueScaling & getScaling() const
Get linear scaling.
Definition ValueScaling.h:146
Image with static geometry.
Definition ImageChannel.h:58
Policies for coordinate underflows and overflows.
Definition CoordinatePolicy.h:100
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:362
virtual void traverseChannels(ImageTray< Channel > &dst) const
Run this modifier for a set of channels.
Definition ImageModifierPack.cpp:367
Definition ImageModifierPack.h:47
virtual void initialize(Image &dst) const
Modifies the geometry and the type of dst such that traverseChannel(Channel &) can be called.
Definition ImageModifierPack.cpp:51
virtual void traverseChannel(Channel &dst) const
Run this modifier for an image frame.
Definition ImageModifierPack.h:65
Definition ImageModifierPack.h:80
virtual void traverseChannel(Channel &dst) const
Run this modifier for an image frame.
Definition ImageModifierPack.cpp:289
void initialize(Image &dst) const
Sets the policy.
Definition ImageModifierPack.cpp:244
Changes the type of a target image.
Definition ImageModifierPack.h:119
virtual void initialize(Image &dst) const
Modifies the geometry and the type of dst such that traverseChannel(Channel &) can be called.
Definition ImageModifierPack.cpp:62
virtual void traverseChannel(Channel &dst) const
Run this modifier for an image frame.
Definition ImageModifierPack.h:147
Definition ImageModifierPack.h:183
virtual void traverseChannel(Channel &dst) const
Run this modifier for an image frame.
Definition ImageModifierPack.cpp:217
virtual void traverseChannels(ImageTray< Channel > &dst) const
Run this modifier for a set of channels.
Definition ImageModifierPack.cpp:199
Image with static geometry.
Definition ImageFrame.h:62
Definition ImageModifierPack.h:256
virtual void initialize(Image &dst) const
Modifies the geometry and the type of dst such that traverseChannel(Channel &) can be called.
Definition ImageModifierPack.cpp:225
virtual void traverseChannel(Channel &dst) const
Run this modifier for an image frame.
Definition ImageModifierPack.h:278
Definition ImageModifierPack.h:213
virtual void traverseChannel(Channel &dst) const
Run this modifier for an image frame.
Definition ImageModifierPack.cpp:104
Class for operations that modify an existing image instead of producing a new image.
Definition ImageMod.h:52
Definition ImageModifierPack.h:330
Plots a single value in an image. The value will be scaled; notice that alpha channel is scaled by de...
Definition ImageModifierPack.h:303
virtual void traverseChannels(ImageTray< Channel > &dst) const
Run this modifier for a set of channels.
Definition ImageModifierPack.cpp:298
Traverses image, returning samples.
Definition ImageModifierPack.h:400
ImageSampler()
Default constructor.
Definition ImageModifierPack.h:405
std::string format
Output format, e.g. '{LON} {LAT} {AMVU} {AMVV} {QIND}'.
Definition ImageModifierPack.h:453
virtual void process(Image &dst) const
Runs Sampler on the given image.
Definition ImageModifierPack.cpp:484
std::string filename
If defined, sampler will directly write to this file. The default constructor does not reference this...
Definition ImageModifierPack.h:440
Container applicable for Channels and Images, with alpha support.
Definition ImageTray.h:266
Class for multi-channel digital images. Supports dynamic typing with base types (char,...
Definition Image.h:183
Utility for sampling images (2D data), outputting formatted text data.
Definition Sampler.h:162
Definition DataSelector.cpp:1277