BPP format conversion dialog. More...
#include <bpp_format_ui.h>
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_ |
BPP format conversion dialog.
Definition at line 119 of file bpp_format_ui.h.
|
explicit |
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.
bitmap | Bitmap to convert |
palette | Palette to use |
on_convert | Callback 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_.
bool yaze::gui::BppConversionDialog::Render | ( | ) |
Render the dialog.
Definition at line 398 of file bpp_format_ui.cc.
References is_open_, RenderButtons(), RenderFormatSelector(), RenderOptions(), RenderPreview(), and show_preview_.
|
inline |
Check if dialog is open.
Definition at line 146 of file bpp_format_ui.h.
References is_open_.
|
inline |
|
private |
Definition at line 424 of file bpp_format_ui.cc.
References yaze::gfx::BppFormatManager::ConvertFormat(), yaze::gfx::Bitmap::depth(), yaze::gfx::BppFormatManager::DetectFormat(), yaze::gfx::BppFormatManager::Get(), yaze::gfx::Bitmap::height(), preview_bitmap_, preview_valid_, source_bitmap_, source_palette_, target_format_, yaze::gfx::Bitmap::vector(), and yaze::gfx::Bitmap::width().
Referenced by RenderPreview().
|
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().
|
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().
|
private |
Definition at line 477 of file bpp_format_ui.cc.
References preserve_palette_, and show_preview_.
Referenced by Render().
|
private |
Definition at line 483 of file bpp_format_ui.cc.
References convert_callback_, is_open_, preserve_palette_, and target_format_.
Referenced by Render().
|
private |
Definition at line 154 of file bpp_format_ui.h.
|
private |
Definition at line 155 of file bpp_format_ui.h.
Referenced by Close(), IsOpen(), Render(), RenderButtons(), and Show().
|
private |
Definition at line 156 of file bpp_format_ui.h.
Referenced by Show(), and UpdatePreview().
|
private |
Definition at line 157 of file bpp_format_ui.h.
Referenced by Show(), and UpdatePreview().
|
private |
Definition at line 158 of file bpp_format_ui.h.
Referenced by RenderButtons(), RenderFormatSelector(), and UpdatePreview().
|
private |
Definition at line 159 of file bpp_format_ui.h.
Referenced by RenderButtons(), and RenderOptions().
|
private |
Definition at line 160 of file bpp_format_ui.h.
Referenced by RenderButtons(), and Show().
|
private |
Definition at line 163 of file bpp_format_ui.h.
|
private |
Definition at line 164 of file bpp_format_ui.h.
Referenced by RenderPreview(), and UpdatePreview().
|
private |
Definition at line 165 of file bpp_format_ui.h.
Referenced by RenderFormatSelector(), RenderPreview(), Show(), and UpdatePreview().
|
private |
Definition at line 168 of file bpp_format_ui.h.
Referenced by Render(), and RenderOptions().
|
private |
Definition at line 169 of file bpp_format_ui.h.
Referenced by RenderPreview().