yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
graphics_preview_image.h
Go to the documentation of this file.
1#ifndef YAZE_APP_EDITOR_GRAPHICS_GRAPHICS_PREVIEW_IMAGE_H_
2#define YAZE_APP_EDITOR_GRAPHICS_GRAPHICS_PREVIEW_IMAGE_H_
3
4#include <array>
5#include <cstdint>
6#include <vector>
7
9
11
15 enum class Format { kIndexed, kRgba };
17 int width = 0;
18 int height = 0;
19 std::vector<uint8_t> pixels;
20 std::array<SDL_Color, 256> colors{};
21 bool index0_transparent = false;
22
23 bool empty() const { return width <= 0 || height <= 0; }
25 std::vector<uint8_t> ToRgba() const;
28 int CountDifferentPixels(const PreviewImage& other) const;
29};
30
31} // namespace yaze::editor::usage_preview
32
33#endif // YAZE_APP_EDITOR_GRAPHICS_GRAPHICS_PREVIEW_IMAGE_H_
SDL2/SDL3 compatibility layer.
std::vector< uint8_t > ToRgba() const
RGBA8 rows; transparent pixels get alpha 0.
int CountDifferentPixels(const PreviewImage &other) const