Original implementation of Edge Image filters

This commit is contained in:
Bruno Herbelin
2022-06-01 23:49:12 +02:00
parent fd942b28c6
commit d7be7a69ab
18 changed files with 258 additions and 15 deletions

View File

@@ -148,6 +148,8 @@ public:
SHARPEN_MASK = 0,
SHARPEN_CONVOLUTION,
SHARPEN_EDGE,
SHARPEN_WHITEHAT,
SHARPEN_BLACKHAT,
SHARPEN_INVALID
} SharpenMethod;
static const char* method_label[SHARPEN_INVALID];
@@ -166,5 +168,36 @@ private:
};
class EdgeFilter : public ImageFilter
{
public:
EdgeFilter();
// Algorithms used for edge detection
typedef enum {
EDGE_THRESHOLD = 0,
EDGE_SOBEL,
EDGE_FREICHEN,
EDGE_CONTOUR,
EDGE_INVALID
} EdgeMethod;
static const char* method_label[EDGE_INVALID];
EdgeMethod method () const { return method_; }
void setMethod(int method);
// implementation of FrameBufferFilter
Type type() const override { return FrameBufferFilter::FILTER_EDGE; }
void draw (FrameBuffer *input) override;
void accept (Visitor& v) override;
private:
EdgeMethod method_;
static std::vector< FilteringProgram > programs_;
};
#endif // IMAGEFILTER_H