#include <graphics_preview_image.h>
Public Types | |
| enum class | Format { kIndexed , kRgba } |
Public Member Functions | |
| bool | empty () const |
| std::vector< uint8_t > | ToRgba () const |
| RGBA8 rows; transparent pixels get alpha 0. | |
| int | CountDifferentPixels (const PreviewImage &other) const |
Public Attributes | |
| Format | format = Format::kIndexed |
| int | width = 0 |
| int | height = 0 |
| std::vector< uint8_t > | pixels |
| std::array< SDL_Color, 256 > | colors {} |
| bool | index0_transparent = false |
Display snapshot with an explicit pixel format. Source indices are retained for uncomposited assets; color-math results use packed RGBA.
Definition at line 14 of file graphics_preview_image.h.
|
strong |
| Enumerator | |
|---|---|
| kIndexed | |
| kRgba | |
Definition at line 15 of file graphics_preview_image.h.
|
inline |
Definition at line 23 of file graphics_preview_image.h.
Referenced by yaze::editor::UsagePreviewView::ShowImage(), and ToRgba().
| std::vector< uint8_t > yaze::editor::usage_preview::PreviewImage::ToRgba | ( | ) | const |
RGBA8 rows; transparent pixels get alpha 0.
Definition at line 74 of file usage_preview.cc.
References colors, empty(), format, height, index0_transparent, kRgba, pixels, and width.
Referenced by CountDifferentPixels().

| int yaze::editor::usage_preview::PreviewImage::CountDifferentPixels | ( | const PreviewImage & | other | ) | const |
Number of pixels whose displayed color differs (sizes must match; returns -1 when they do not).
Definition at line 97 of file usage_preview.cc.
References height, ToRgba(), and width.

| Format yaze::editor::usage_preview::PreviewImage::format = Format::kIndexed |
Definition at line 16 of file graphics_preview_image.h.
Referenced by yaze::editor::UsagePreviewView::ShowImage(), yaze::editor::usage_preview::SnapshotBitmap(), and ToRgba().
| int yaze::editor::usage_preview::PreviewImage::width = 0 |
Definition at line 17 of file graphics_preview_image.h.
Referenced by CountDifferentPixels(), empty(), yaze::editor::OverworldEditor::OpenGraphicsForTile16Quadrant(), yaze::editor::usage_preview::Tile16UsagePreview::Render(), yaze::editor::sprite_graphics_context::RenderCapturedFrame(), yaze::editor::RenderDungeonMapTilesGfxPreview(), yaze::editor::usage_preview::SpriteUsagePreview::RenderFrame(), yaze::editor::UsagePreviewView::ShowImage(), yaze::editor::usage_preview::SnapshotBitmap(), and ToRgba().
| int yaze::editor::usage_preview::PreviewImage::height = 0 |
Definition at line 18 of file graphics_preview_image.h.
Referenced by CountDifferentPixels(), empty(), yaze::editor::OverworldEditor::OpenGraphicsForTile16Quadrant(), yaze::editor::usage_preview::Tile16UsagePreview::Render(), yaze::editor::sprite_graphics_context::RenderCapturedFrame(), yaze::editor::RenderDungeonMapTilesGfxPreview(), yaze::editor::usage_preview::SpriteUsagePreview::RenderFrame(), yaze::editor::UsagePreviewView::ShowImage(), yaze::editor::usage_preview::SnapshotBitmap(), and ToRgba().
| std::vector<uint8_t> yaze::editor::usage_preview::PreviewImage::pixels |
Definition at line 19 of file graphics_preview_image.h.
Referenced by yaze::editor::OverworldEditor::OpenGraphicsForTile16Quadrant(), yaze::editor::usage_preview::Tile16UsagePreview::Render(), yaze::editor::sprite_graphics_context::RenderCapturedFrame(), yaze::editor::RenderDungeonMapTilesGfxPreview(), yaze::editor::usage_preview::SpriteUsagePreview::RenderFrame(), yaze::editor::UsagePreviewView::ShowImage(), yaze::editor::usage_preview::SnapshotBitmap(), and ToRgba().
| std::array<SDL_Color, 256> yaze::editor::usage_preview::PreviewImage::colors {} |
Definition at line 20 of file graphics_preview_image.h.
Referenced by yaze::editor::OverworldEditor::OpenGraphicsForTile16Quadrant(), yaze::editor::usage_preview::Tile16UsagePreview::Render(), yaze::editor::sprite_graphics_context::RenderCapturedFrame(), yaze::editor::RenderDungeonMapTilesGfxPreview(), yaze::editor::usage_preview::SpriteUsagePreview::RenderFrame(), yaze::editor::UsagePreviewView::ShowImage(), yaze::editor::usage_preview::SnapshotBitmap(), and ToRgba().
| bool yaze::editor::usage_preview::PreviewImage::index0_transparent = false |
Definition at line 21 of file graphics_preview_image.h.
Referenced by yaze::editor::OverworldEditor::OpenGraphicsForTile16Quadrant(), yaze::editor::usage_preview::Tile16UsagePreview::Render(), yaze::editor::sprite_graphics_context::RenderCapturedFrame(), yaze::editor::usage_preview::SpriteUsagePreview::RenderFrame(), yaze::editor::UsagePreviewView::ShowImage(), and ToRgba().