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
8
#include "
app/platform/sdl_compat.h
"
9
10
namespace
yaze::editor::usage_preview
{
11
14
struct
PreviewImage
{
15
enum class
Format
{
kIndexed
,
kRgba
};
16
Format
format
=
Format::kIndexed
;
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_
yaze::editor::usage_preview
Definition
graphics_preview_image.h:10
sdl_compat.h
SDL2/SDL3 compatibility layer.
yaze::editor::usage_preview::PreviewImage
Definition
graphics_preview_image.h:14
yaze::editor::usage_preview::PreviewImage::colors
std::array< SDL_Color, 256 > colors
Definition
graphics_preview_image.h:20
yaze::editor::usage_preview::PreviewImage::width
int width
Definition
graphics_preview_image.h:17
yaze::editor::usage_preview::PreviewImage::ToRgba
std::vector< uint8_t > ToRgba() const
RGBA8 rows; transparent pixels get alpha 0.
Definition
usage_preview.cc:74
yaze::editor::usage_preview::PreviewImage::height
int height
Definition
graphics_preview_image.h:18
yaze::editor::usage_preview::PreviewImage::index0_transparent
bool index0_transparent
Definition
graphics_preview_image.h:21
yaze::editor::usage_preview::PreviewImage::CountDifferentPixels
int CountDifferentPixels(const PreviewImage &other) const
Definition
usage_preview.cc:97
yaze::editor::usage_preview::PreviewImage::pixels
std::vector< uint8_t > pixels
Definition
graphics_preview_image.h:19
yaze::editor::usage_preview::PreviewImage::format
Format format
Definition
graphics_preview_image.h:16
yaze::editor::usage_preview::PreviewImage::empty
bool empty() const
Definition
graphics_preview_image.h:23
yaze::editor::usage_preview::PreviewImage::Format
Format
Definition
graphics_preview_image.h:15
yaze::editor::usage_preview::PreviewImage::Format::kIndexed
@ kIndexed
yaze::editor::usage_preview::PreviewImage::Format::kRgba
@ kRgba
src
app
editor
graphics
graphics_preview_image.h
Generated by
1.10.0