SourceXtractorPlusPlus 0.21
SourceXtractor++, the next generation SExtractor
Loading...
Searching...
No Matches
ProcessingImageSource.h
Go to the documentation of this file.
1
17/*
18 * ProcessingImageSource.h
19 *
20 * Created on: May 2, 2018
21 * Author: mschefer
22 */
23
24#ifndef _SEFRAMEWORK_IMAGE_PROCESSINGIMAGESOURCE_H_
25#define _SEFRAMEWORK_IMAGE_PROCESSINGIMAGESOURCE_H_
26
29
30namespace SourceXtractor {
31
32template <typename T>
34public:
35
37
38 virtual ~ProcessingImageSource() = default;
39
40 std::shared_ptr<ImageTile> getImageTile(int x, int y, int width, int height) const override {
42 x, y, width, height, (const_cast<ProcessingImageSource*>(this))->shared_from_this());
43
44 generateTile(m_image, *tile, x, y, width, height);
45
46 return tile;
47 }
48
49 void saveTile(ImageTile& /*tile*/) override {
50 assert(false);
51 }
52
54 int getWidth() const override {
55 return m_image->getWidth();
56 }
57
59 int getHeight() const override {
60 return m_image->getHeight();
61 }
62
63 ImageTile::ImageType getType() const override {
64 return ImageTile::getTypeValue(T());
65 }
66
67protected:
68 virtual void generateTile(const std::shared_ptr<Image<T>>& image, ImageTileWithType<T>& tile, int x, int y, int width, int height) const = 0;
69
71 return m_image->getRepr();
72 }
73
74private:
76};
77
78}
79
80
81
82#endif /* _SEFRAMEWORK_IMAGE_PROCESSINGIMAGESOURCE_H_ */
std::shared_ptr< DependentParameter< std::shared_ptr< EngineParameter > > > x
std::shared_ptr< DependentParameter< std::shared_ptr< EngineParameter > > > y
static ImageType getTypeValue(float)
Definition ImageTile.h:97
int getWidth() const override
Returns the width of the image in pixels.
ImageTile::ImageType getType() const override
ProcessingImageSource(std::shared_ptr< Image< T > > image)
std::shared_ptr< Image< T > > m_image
virtual void generateTile(const std::shared_ptr< Image< T > > &image, ImageTileWithType< T > &tile, int x, int y, int width, int height) const =0
std::shared_ptr< ImageTile > getImageTile(int x, int y, int width, int height) const override
int getHeight() const override
Returns the height of the image in pixels.