File tree Expand file tree Collapse file tree 2 files changed +33
-0
lines changed
Expand file tree Collapse file tree 2 files changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -48,6 +48,7 @@ target_sources(scratchcpp
4848 include /scratchcpp/sprite.h
4949 include /scratchcpp/itimer.h
5050 include /scratchcpp/keyevent.h
51+ include /scratchcpp/iimageformat.h
5152)
5253
5354add_library (zip SHARED
Original file line number Diff line number Diff line change 1+ // SPDX-License-Identifier: Apache-2.0
2+
3+ #pragma once
4+
5+ #include " global.h"
6+
7+ namespace libscratchcpp
8+ {
9+
10+ /* ! A typedef for unsigned int. Holds the RGBA values. */
11+ using Rgb = unsigned int ;
12+
13+ /* ! \brief The IImageFormat class is an interface for image format implementation. */
14+ class LIBSCRATCHCPP_EXPORT IImageFormat
15+ {
16+ public:
17+ virtual ~IImageFormat () { }
18+
19+ /* ! Sets the image data (buffer). */
20+ virtual void setData (const char *data) = 0;
21+
22+ /* ! Returns the width of the image. */
23+ virtual unsigned int width () const = 0;
24+
25+ /* ! Returns the height of the image. */
26+ virtual unsigned int height () const = 0;
27+
28+ /* ! Returns the color at the given pixel. */
29+ virtual Rgb colorAt (unsigned int x, unsigned int y, double scale = 1 ) const = 0;
30+ };
31+
32+ } // namespace libscratchcpp
You can’t perform that action at this time.
0 commit comments