SourceXtractorPlusPlus
0.13
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
SEImplementation
SEImplementation
Image
LockedImage.h
Go to the documentation of this file.
1
18
#ifndef _SEIMPLEMENTATION_IMAGE_LOCKEDIMAGE_H_
19
#define _SEIMPLEMENTATION_IMAGE_LOCKEDIMAGE_H_
20
21
#include "
SEFramework/Image/ImageBase.h
"
22
23
#include "
SEImplementation/Measurement/MultithreadedMeasurement.h
"
24
25
namespace
SourceXtractor {
26
27
template
<
typename
T>
28
class
LockedImage
:
public
ImageBase
<T> {
29
protected
:
30
LockedImage
(
std::shared_ptr
<
const
Image<T>
> img) :
m_img
{img},
m_lock
(
MultithreadedMeasurement::g_global_mutex
) {
31
}
32
33
public
:
34
template
<
typename
... Args>
35
static
std::shared_ptr<LockedImage<T>
>
create
(Args &&... args) {
36
return
std::shared_ptr<LockedImage<T>
>(
new
LockedImage
{std::forward<Args>(args)...});
37
}
38
39
std::string
getRepr
()
const override
{
40
return
"LockedImage("
+
m_img
->getRepr() +
")"
;
41
}
42
43
int
getWidth
()
const override
{
44
return
m_img
->getWidth();
45
}
46
47
int
getHeight
()
const override
{
48
return
m_img
->getHeight();
49
}
50
51
T
getValue
(
int
x
,
int
y
)
const override
{
52
return
m_img
->getValue(x, y);
53
}
54
55
private
:
56
std::shared_ptr<const Image<T>
>
m_img
;
57
std::lock_guard<std::recursive_mutex>
m_lock
;
58
};
59
60
61
}
62
63
#endif
/* _SEIMPLEMENTATION_IMAGE_LOCKEDIMAGE_H_ */
std::shared_ptr
SourceXtractor::ImageBase
Definition:
ImageBase.h:35
x
std::shared_ptr< DependentParameter< std::shared_ptr< EngineParameter > > > x
Definition:
MoffatModelFittingTask.cpp:94
SourceXtractor::LockedImage::m_img
std::shared_ptr< const Image< T > > m_img
Definition:
LockedImage.h:56
SourceXtractor::LockedImage::create
static std::shared_ptr< LockedImage< T > > create(Args &&...args)
Definition:
LockedImage.h:35
SourceXtractor::LockedImage::getWidth
int getWidth() const override
Returns the width of the image in pixels.
Definition:
LockedImage.h:43
SourceXtractor::LockedImage::getValue
T getValue(int x, int y) const override
Returns the value of the pixel with the coordinates (x,y)
Definition:
LockedImage.h:51
y
std::shared_ptr< DependentParameter< std::shared_ptr< EngineParameter > > > y
Definition:
MoffatModelFittingTask.cpp:94
SourceXtractor::LockedImage::getRepr
std::string getRepr() const override
Get a string identifying this image in a human readable manner.
Definition:
LockedImage.h:39
std::string
STL class.
SourceXtractor::LockedImage::m_lock
std::lock_guard< std::recursive_mutex > m_lock
Definition:
LockedImage.h:57
SourceXtractor::LockedImage
Definition:
LockedImage.h:28
std::lock_guard
SourceXtractor::Image
Interface representing an image.
Definition:
Image.h:43
SourceXtractor::LockedImage::LockedImage
LockedImage(std::shared_ptr< const Image< T >> img)
Definition:
LockedImage.h:30
SourceXtractor::LockedImage::getHeight
int getHeight() const override
Returns the height of the image in pixels.
Definition:
LockedImage.h:47
SourceXtractor::MultithreadedMeasurement::g_global_mutex
static std::recursive_mutex g_global_mutex
Definition:
MultithreadedMeasurement.h:53
MultithreadedMeasurement.h
ImageBase.h
Generated by
1.8.5