SourceXtractorPlusPlus  0.8
Please provide a description of the project.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
WriteableBufferedImage.h
Go to the documentation of this file.
1 
17 /*
18  * WriteableBufferedImage.h
19  *
20  * Created on: Mar 8, 2018
21  * Author: mschefer
22  */
23 
24 #ifndef _SEFRAMEWORK_IMAGE_WRITEABLEBUFFEREDIMAGE_H_
25 #define _SEFRAMEWORK_IMAGE_WRITEABLEBUFFEREDIMAGE_H_
26 
29 
30 namespace SourceXtractor {
31 
32 template <typename T>
33 class WriteableBufferedImage : public BufferedImage<T>, public WriteableImage<T> {
34 
35 protected:
36 
38  : BufferedImage<T>(source, tile_manager) {}
39 
41 
42 public:
43 
44  virtual ~WriteableBufferedImage() = default;
45 
49  }
50 
51  virtual void setValue(int x, int y, T value) override {
52  assert(x >= 0 && y >=0 && x < BufferedImage<T>::m_source->getWidth() && y < BufferedImage<T>::m_source->getHeight());
53 
54  if (m_current_tile == nullptr || !m_current_tile->isPixelInTile(x, y)) {
56  }
57 
58  m_current_tile->setModified(true);
59  m_current_tile->setValue(x, y, value);
60  }
61 
62 };
63 
64 }
65 
66 #endif /* _SEFRAMEWORK_IMAGE_WRITEABLEBUFFEREDIMAGE_H_ */
static std::shared_ptr< TileManager > getInstance()
Definition: TileManager.h:137
std::shared_ptr< ImageTile< T > > m_current_tile
Definition: BufferedImage.h:66
std::shared_ptr< DependentParameter< std::shared_ptr< EngineParameter > > > x
std::shared_ptr< DependentParameter< std::shared_ptr< EngineParameter > > > y
static std::shared_ptr< WriteableBufferedImage< T > > create(std::shared_ptr< const ImageSource< T >> source, std::shared_ptr< TileManager > tile_manager=TileManager::getInstance())
int getHeight() const override
Returns the height of the image in pixels.
int getWidth() const override
Returns the width of the image in pixels.
virtual void setValue(int x, int y, T value) override
WriteableBufferedImage(std::shared_ptr< const ImageSource< T >> source, std::shared_ptr< TileManager > tile_manager)