yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
yaze::gui::BppConversionDialog Class Reference

BPP format conversion dialog. More...

#include <bpp_format_ui.h>

Collaboration diagram for yaze::gui::BppConversionDialog:

Public Member Functions

 BppConversionDialog (const std::string &id)
 Constructor.
 
void Show (const gfx::Bitmap &bitmap, const gfx::SnesPalette &palette, std::function< void(gfx::BppFormat, bool)> on_convert)
 Show the conversion dialog.
 
bool Render ()
 Render the dialog.
 
bool IsOpen () const
 Check if dialog is open.
 
void Close ()
 Close the dialog.
 

Private Member Functions

void UpdatePreview ()
 
void RenderFormatSelector ()
 
void RenderPreview ()
 
void RenderOptions ()
 
void RenderButtons ()
 

Private Attributes

std::string id_
 
bool is_open_
 
gfx::Bitmap source_bitmap_
 
gfx::SnesPalette source_palette_
 
gfx::BppFormat target_format_
 
bool preserve_palette_
 
std::function< void(gfx::BppFormat, bool)> convert_callback_
 
std::vector< uint8_t > preview_data_
 
gfx::Bitmap preview_bitmap_
 
bool preview_valid_
 
bool show_preview_
 
float preview_scale_
 

Detailed Description

BPP format conversion dialog.

Definition at line 119 of file bpp_format_ui.h.

Constructor & Destructor Documentation

◆ BppConversionDialog()

yaze::gui::BppConversionDialog::BppConversionDialog ( const std::string &  id)
explicit

Constructor.

Parameters
idUnique identifier

Definition at line 384 of file bpp_format_ui.cc.

Member Function Documentation

◆ Show()

void yaze::gui::BppConversionDialog::Show ( const gfx::Bitmap bitmap,
const gfx::SnesPalette palette,
std::function< void(gfx::BppFormat, bool)>  on_convert 
)

Show the conversion dialog.

Parameters
bitmapBitmap to convert
palettePalette to use
on_convertCallback when conversion is confirmed

Definition at line 389 of file bpp_format_ui.cc.

References convert_callback_, is_open_, preview_valid_, source_bitmap_, and source_palette_.

◆ Render()

bool yaze::gui::BppConversionDialog::Render ( )

Render the dialog.

Returns
True if dialog should remain open

Definition at line 398 of file bpp_format_ui.cc.

References is_open_, RenderButtons(), RenderFormatSelector(), RenderOptions(), RenderPreview(), and show_preview_.

Here is the call graph for this function:

◆ IsOpen()

bool yaze::gui::BppConversionDialog::IsOpen ( ) const
inline

Check if dialog is open.

Returns
True if dialog is open

Definition at line 146 of file bpp_format_ui.h.

References is_open_.

◆ Close()

void yaze::gui::BppConversionDialog::Close ( )
inline

Close the dialog.

Definition at line 151 of file bpp_format_ui.h.

References is_open_.

◆ UpdatePreview()

◆ RenderFormatSelector()

void yaze::gui::BppConversionDialog::RenderFormatSelector ( )
private

Definition at line 445 of file bpp_format_ui.cc.

References yaze::gfx::BppFormatManager::Get(), yaze::gfx::BppFormatManager::GetFormatInfo(), preview_valid_, and target_format_.

Referenced by Render().

Here is the call graph for this function:

◆ RenderPreview()

void yaze::gui::BppConversionDialog::RenderPreview ( )
private

Definition at line 461 of file bpp_format_ui.cc.

References preview_bitmap_, preview_scale_, preview_valid_, yaze::gfx::Bitmap::texture(), and UpdatePreview().

Referenced by Render().

Here is the call graph for this function:

◆ RenderOptions()

void yaze::gui::BppConversionDialog::RenderOptions ( )
private

Definition at line 477 of file bpp_format_ui.cc.

References preserve_palette_, and show_preview_.

Referenced by Render().

◆ RenderButtons()

void yaze::gui::BppConversionDialog::RenderButtons ( )
private

Definition at line 483 of file bpp_format_ui.cc.

References convert_callback_, is_open_, preserve_palette_, and target_format_.

Referenced by Render().

Member Data Documentation

◆ id_

std::string yaze::gui::BppConversionDialog::id_
private

Definition at line 154 of file bpp_format_ui.h.

◆ is_open_

bool yaze::gui::BppConversionDialog::is_open_
private

Definition at line 155 of file bpp_format_ui.h.

Referenced by Close(), IsOpen(), Render(), RenderButtons(), and Show().

◆ source_bitmap_

gfx::Bitmap yaze::gui::BppConversionDialog::source_bitmap_
private

Definition at line 156 of file bpp_format_ui.h.

Referenced by Show(), and UpdatePreview().

◆ source_palette_

gfx::SnesPalette yaze::gui::BppConversionDialog::source_palette_
private

Definition at line 157 of file bpp_format_ui.h.

Referenced by Show(), and UpdatePreview().

◆ target_format_

gfx::BppFormat yaze::gui::BppConversionDialog::target_format_
private

Definition at line 158 of file bpp_format_ui.h.

Referenced by RenderButtons(), RenderFormatSelector(), and UpdatePreview().

◆ preserve_palette_

bool yaze::gui::BppConversionDialog::preserve_palette_
private

Definition at line 159 of file bpp_format_ui.h.

Referenced by RenderButtons(), and RenderOptions().

◆ convert_callback_

std::function<void(gfx::BppFormat, bool)> yaze::gui::BppConversionDialog::convert_callback_
private

Definition at line 160 of file bpp_format_ui.h.

Referenced by RenderButtons(), and Show().

◆ preview_data_

std::vector<uint8_t> yaze::gui::BppConversionDialog::preview_data_
private

Definition at line 163 of file bpp_format_ui.h.

◆ preview_bitmap_

gfx::Bitmap yaze::gui::BppConversionDialog::preview_bitmap_
private

Definition at line 164 of file bpp_format_ui.h.

Referenced by RenderPreview(), and UpdatePreview().

◆ preview_valid_

bool yaze::gui::BppConversionDialog::preview_valid_
private

Definition at line 165 of file bpp_format_ui.h.

Referenced by RenderFormatSelector(), RenderPreview(), Show(), and UpdatePreview().

◆ show_preview_

bool yaze::gui::BppConversionDialog::show_preview_
private

Definition at line 168 of file bpp_format_ui.h.

Referenced by Render(), and RenderOptions().

◆ preview_scale_

float yaze::gui::BppConversionDialog::preview_scale_
private

Definition at line 169 of file bpp_format_ui.h.

Referenced by RenderPreview().


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