Skip to content

Commit 81d9f29

Browse files
committed
Add IGraphicsEffect interface
1 parent 043704a commit 81d9f29

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ target_sources(scratchcpp
5151
include/scratchcpp/iimageformat.h
5252
include/scratchcpp/iimageformatfactory.h
5353
include/scratchcpp/rect.h
54+
include/scratchcpp/igraphicseffect.h
5455
)
5556

5657
add_library(zip SHARED
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// SPDX-License-Identifier: Apache-2.0
2+
3+
#pragma once
4+
5+
#include <string>
6+
7+
#include "iimageformat.h"
8+
9+
namespace libscratchcpp
10+
{
11+
12+
/*! \brief The IGraphicsEffects class is an interface for implementing custom graphics effects. */
13+
class LIBSCRATCHCPP_EXPORT IGraphicsEffect
14+
{
15+
public:
16+
virtual ~IGraphicsEffect() { }
17+
18+
/*! Returns the name of the graphics effect. */
19+
virtual std::string name() const = 0;
20+
21+
/*! Applies the effect on the given bitmap. */
22+
virtual void apply(Rgb **bitmap, unsigned int width, unsigned int height, double value) const = 0;
23+
};
24+
25+
} // namespace libscratchcpp

0 commit comments

Comments
 (0)