Skip to content

Commit aa643aa

Browse files
committed
Add image format stub
1 parent 97baeb4 commit aa643aa

File tree

5 files changed

+61
-0
lines changed

5 files changed

+61
-0
lines changed

src/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ add_subdirectory(blocks)
1212
add_subdirectory(engine)
1313
add_subdirectory(internal)
1414
add_subdirectory(scratch)
15+
add_subdirectory(imageformats)

src/imageformats/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
add_subdirectory(stub)
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
target_sources(scratchcpp
2+
PRIVATE
3+
imageformatstub.cpp
4+
imageformatstub.h
5+
)
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// SPDX-License-Identifier: Apache-2.0
2+
3+
#include "imageformatstub.h"
4+
5+
namespace libscratchcpp
6+
{
7+
8+
ImageFormatStub::ImageFormatStub()
9+
{
10+
}
11+
12+
void ImageFormatStub::setData(const char *)
13+
{
14+
}
15+
16+
unsigned int ImageFormatStub::width() const
17+
{
18+
return 0;
19+
}
20+
21+
unsigned int ImageFormatStub::height() const
22+
{
23+
return 0;
24+
}
25+
26+
Rgb ImageFormatStub::colorAt(unsigned int, unsigned int, double) const
27+
{
28+
return 0;
29+
}
30+
31+
} // namespace libscratchcpp
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// SPDX-License-Identifier: Apache-2.0
2+
3+
#pragma once
4+
5+
#include <scratchcpp/iimageformat.h>
6+
7+
namespace libscratchcpp
8+
{
9+
10+
class ImageFormatStub : public IImageFormat
11+
{
12+
public:
13+
ImageFormatStub();
14+
15+
void setData(const char *) override;
16+
17+
unsigned int width() const override;
18+
unsigned int height() const override;
19+
20+
Rgb colorAt(unsigned int, unsigned int, double) const override;
21+
};
22+
23+
} // namespace libscratchcpp

0 commit comments

Comments
 (0)