SourceXtractorPlusPlus 1.0.3
SourceXtractor++, the next generation SExtractor
Loading...
Searching...
No Matches
LockedWriteableImage.h
Go to the documentation of this file.
1/*
2 * LockedWriteableImage.h
3 *
4 * Created on: Jul 7, 2020
5 * Author: mschefer
6 */
7
8#ifndef _SEIMPLEMENTATION_IMAGE_LOCKEDWRITEABLEIMAGE_H_
9#define _SEIMPLEMENTATION_IMAGE_LOCKEDWRITEABLEIMAGE_H_
10
12
14
15namespace SourceXtractor {
16
17template <typename T>
19protected:
22
23public:
24 template<typename... Args>
28
29 std::string getRepr() const override {
30 return "LockedWriteableImage(" + m_img->getRepr() + ")";
31 }
32
33 int getWidth() const override {
34 return m_img->getWidth();
35 }
36
37 int getHeight() const override {
38 return m_img->getHeight();
39 }
40
41 void setValue(int x, int y, T value) override {
42 m_img->setValue(x, y, value);
43 }
44
45 std::shared_ptr<ImageChunk<T>> getChunk(int x, int y, int width, int height) const override {
46 return m_img->getChunk(x, y, width, height);
47 }
48
49private:
52};
53
54}
55
56#endif /* _SEIMPLEMENTATION_IMAGE_LOCKEDWRITEABLEIMAGE_H_ */
static std::shared_ptr< LockedWriteableImage< T > > create(Args &&... args)
int getHeight() const override
Returns the height of the image in pixels.
std::shared_ptr< WriteableImage< T > > m_img
void setValue(int x, int y, T value) override
std::string getRepr() const override
Get a string identifying this image in a human readable manner.
int getWidth() const override
Returns the width of the image in pixels.
std::shared_ptr< ImageChunk< T > > getChunk(int x, int y, int width, int height) const override
std::lock_guard< std::mutex > m_lock
LockedWriteableImage(std::shared_ptr< WriteableImage< T > > img)
T forward(T... args)