yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
yaze::editor::usage_preview::PreviewImage Struct Reference

#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
 

Detailed Description

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.

Member Enumeration Documentation

◆ Format

Enumerator
kIndexed 
kRgba 

Definition at line 15 of file graphics_preview_image.h.

Member Function Documentation

◆ empty()

bool yaze::editor::usage_preview::PreviewImage::empty ( ) const
inline

Definition at line 23 of file graphics_preview_image.h.

References height, and width.

Referenced by yaze::editor::UsagePreviewView::ShowImage(), and ToRgba().

◆ 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().

Here is the call graph for this function:

◆ 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.

Here is the call graph for this function:

Member Data Documentation

◆ format

Format yaze::editor::usage_preview::PreviewImage::format = Format::kIndexed

◆ width

◆ height

◆ pixels

◆ colors

◆ index0_transparent


The documentation for this struct was generated from the following files: