-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #247 from NoxHarmonium/more-tiledit-cleanup
test(tiledit): add some integration tests with real images
- Loading branch information
Showing
39 changed files
with
26,454 additions
and
215 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
libs/shared/tests/catch2/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
libs/shared/tests/catch2/* |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
exclude = .*\/tests\/.* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// | ||
// Created by Sean Dawson on 27/6/2024. | ||
// | ||
|
||
#ifndef CONSTANTS_HPP | ||
#define CONSTANTS_HPP | ||
|
||
constexpr int WIDTH_PIXELS = 256; | ||
constexpr int HEIGHT_PIXELS = 256; | ||
|
||
#endif // CONSTANTS_HPP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
|
||
#ifndef IMAGELOADER_HPP | ||
#define IMAGELOADER_HPP | ||
|
||
#include "constants.hpp" | ||
|
||
#include <array> | ||
#include <cstdint> | ||
#include <limits> | ||
|
||
using RgbaComponent = uint8_t; | ||
using RgbaPixel = uint32_t; | ||
using RgbaPixelData = | ||
std::array<std::array<RgbaPixel, HEIGHT_PIXELS>, WIDTH_PIXELS>; | ||
|
||
constexpr RgbaComponent RGBA_COMPONENT_MIN = | ||
std::numeric_limits<RgbaComponent>::min(); | ||
constexpr RgbaComponent RGBA_COMPONENT_MAX = | ||
std::numeric_limits<RgbaComponent>::max(); | ||
|
||
class ImageLoader { | ||
public: | ||
static RgbaPixelData loadImageFromPng(const char *filename); | ||
static void saveImageToPng(const char *filename, const RgbaPixelData &data); | ||
}; | ||
|
||
#endif // IMAGELOADER_HPP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
|
||
#ifndef MISCADAPTER_HPP | ||
#define MISCADAPTER_HPP | ||
|
||
#include "sircimage.hpp" | ||
|
||
class MiscAdapter { | ||
public: | ||
static SircImage | ||
packedSircPixelDataToSircImage(const PackedSircPixelData &pixelData); | ||
}; | ||
|
||
#endif // MISCADAPTER_HPP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#ifndef RGBAADAPTER_H | ||
#define RGBAADAPTER_H | ||
|
||
#include <imageloader.hpp> | ||
#include <sircimage.hpp> | ||
|
||
// PNGs are loaded with standard 32 bit colour RGBA (8bpp) | ||
constexpr unsigned int RGBA_COLOR_RANGE = 0xFF; | ||
constexpr unsigned int RGBA_TO_SIRC_COLOR_RATIO = | ||
RGBA_COLOR_RANGE / SIRC_COLOR_RANGE; | ||
constexpr unsigned int RGBA_BLACK = 0x000000FF; | ||
|
||
class RgbaAdapter { | ||
public: | ||
static SircImage rgbaToSircImage(const RgbaPixelData &pixelData); | ||
static RgbaPixelData sircImageToRgba(const SircImage &sircImage); | ||
}; | ||
|
||
#endif // RGBAADAPTER_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.