SourceXtractorPlusPlus
0.10
Please provide a description of the project.
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
SEFramework
SEFramework
Image
ConstantImage.h
Go to the documentation of this file.
1
17
/*
18
* ConstantImage.h
19
*
20
* Created on: Jan 12, 2017
21
* Author: mschefer
22
*/
23
24
#ifndef _SEFRAMEWORK_IMAGE_CONSTANTIMAGE_H_
25
#define _SEFRAMEWORK_IMAGE_CONSTANTIMAGE_H_
26
27
#include "
SEFramework/Image/Image.h
"
28
#include "
SEFramework/Image/ImageBase.h
"
29
30
namespace
SourceXtractor {
31
32
template
<
typename
T>
33
class
ConstantImage
:
public
ImageBase
<T> {
34
protected
:
35
36
ConstantImage
(
int
width
,
int
height
, T constant_value)
37
:
m_width
(width),
m_height
(height),
m_constant_value
(constant_value) {}
38
39
40
public
:
41
42
static
std::shared_ptr<ConstantImage<T>
>
create
(
int
width
,
int
height
, T constant_value) {
43
return
std::shared_ptr<ConstantImage<T>
>(
new
ConstantImage
(width, height, constant_value));
44
}
45
46
virtual
~ConstantImage
() =
default
;
47
48
std::string
getRepr
()
const override
{
49
return
"ConstantImage<"
+
std::to_string
(
m_width
) +
","
+
std::to_string
(
m_height
) +
">("
+
50
std::to_string
(
m_constant_value
) +
")"
;
51
}
52
53
int
getHeight
()
const override
{
54
return
m_height
;
55
}
56
57
int
getWidth
()
const override
{
58
return
m_width
;
59
}
60
61
using
Image<T>::getValue
;
62
T
getValue
(
int
,
int
)
const override
{
63
return
m_constant_value
;
64
}
65
66
private
:
67
68
int
m_width
;
69
int
m_height
;
70
T
m_constant_value
;
71
72
};
73
74
}
75
76
77
#endif
/* _SEFRAMEWORK_IMAGE_CONSTANTIMAGE_H_ */
std::shared_ptr
SourceXtractor::ImageBase
Definition:
ImageBase.h:35
std::to_string
T to_string(T...args)
SourceXtractor::ConstantImage::getWidth
int getWidth() const override
Returns the width of the image in pixels.
Definition:
ConstantImage.h:57
std::string
STL class.
SourceXtractor::ConstantImage
Definition:
ConstantImage.h:33
Image.h
SourceXtractor::ConstantImage::getHeight
int getHeight() const override
Returns the height of the image in pixels.
Definition:
ConstantImage.h:53
SourceXtractor::ConstantImage::m_height
int m_height
Definition:
ConstantImage.h:69
SourceXtractor::ConstantImage::m_constant_value
T m_constant_value
Definition:
ConstantImage.h:70
SourceXtractor::ConstantImage::getValue
T getValue(int, int) const override
Returns the value of the pixel with the coordinates (x,y)
Definition:
ConstantImage.h:62
ModelFitting::height
height
Definition:
CompactModelBase.icpp:16
SourceXtractor::ConstantImage::create
static std::shared_ptr< ConstantImage< T > > create(int width, int height, T constant_value)
Definition:
ConstantImage.h:42
SourceXtractor::Image
Interface representing an image.
Definition:
Image.h:43
SourceXtractor::ConstantImage::m_width
int m_width
Definition:
ConstantImage.h:68
SourceXtractor::ConstantImage::~ConstantImage
virtual ~ConstantImage()=default
ModelFitting::width
width
Definition:
CompactModelBase.icpp:16
SourceXtractor::ConstantImage::ConstantImage
ConstantImage(int width, int height, T constant_value)
Definition:
ConstantImage.h:36
SourceXtractor::ConstantImage::getRepr
std::string getRepr() const override
Get a string identifying this image in a human readable manner.
Definition:
ConstantImage.h:48
ImageBase.h
Generated by
1.8.5