Loading...
Searching...
No Matches
RecomposeOp.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 Recompose_OP_H_
32#define Recompose_OP_H_
33
34#include "ImageOp.h"
35
36namespace drain
37{
38
39namespace image
40{
41
42
44
63class RecomposeOp : public ImageOp
64{
65
66public:
67
68 inline
69 RecomposeOp(const std::string & views = "fia") : ImageOp (__FUNCTION__, "Recompose image.") {
70 parameters.link("views", this->views = views, "i=image,f=imageWithAlpha,r=red,g=green,b=blue,a=alpha");
71 };
72
73 inline
74 RecomposeOp(const RecomposeOp & op) : ImageOp(op) {
75 parameters.copyStruct(op.getParameters(), op, *this);
76 }
77
78 virtual
79 void getDstConf(const ImageConf & src, ImageConf & dst) const;
80
81 virtual
82 void process(const ImageFrame & src, Image & dst) const;
83
84 //virtual
85 //void traverseChannels(const ImageTray<const Channel> & src, ImageTray<Channel> & dst) const;
86
87
88protected:
89
90 std::string views;
91
92};
93
94} // image::
95
96} // drain::
97
98#endif // Recompose_OP_H_
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
Struct for image (excluding data)
Definition ImageConf.h:333
Image with static geometry.
Definition ImageFrame.h:67
Base class for image processing functions.
Definition ImageOp.h:49
Class for multi-channel digital images. Supports dynamic typing with base types (char,...
Definition Image.h:184
Create vertical image composed of separate views.
Definition RecomposeOp.h:64
virtual void process(const ImageFrame &src, Image &dst) const
Main interface. Typically splits processing to each channel.
Definition RecomposeOp.cpp:86
virtual void getDstConf(const ImageConf &src, ImageConf &dst) const
Given source image, determine respective dest image configuration.
Definition RecomposeOp.cpp:38
Definition DataSelector.cpp:1277