BPP format comparison tool. More...
#include <bpp_format_ui.h>
Public Member Functions | |
BppComparisonTool (const std::string &id) | |
Constructor. | |
void | SetSource (const gfx::Bitmap &bitmap, const gfx::SnesPalette &palette) |
Set source bitmap for comparison. | |
void | Render () |
Render the comparison tool. | |
bool | IsOpen () const |
Check if tool is open. | |
void | Open () |
Open the tool. | |
void | Close () |
Close the tool. | |
Private Member Functions | |
void | GenerateComparisons () |
void | RenderComparisonGrid () |
void | RenderMetrics () |
void | RenderFormatSelector () |
std::string | CalculateMetrics (gfx::BppFormat format) const |
Private Attributes | |
std::string | id_ |
bool | is_open_ |
gfx::Bitmap | source_bitmap_ |
gfx::SnesPalette | source_palette_ |
bool | has_source_ |
std::unordered_map< gfx::BppFormat, gfx::Bitmap > | comparison_bitmaps_ |
std::unordered_map< gfx::BppFormat, gfx::SnesPalette > | comparison_palettes_ |
std::unordered_map< gfx::BppFormat, bool > | comparison_valid_ |
float | comparison_scale_ |
bool | show_metrics_ |
gfx::BppFormat | selected_comparison_ |
BPP format comparison tool.
Definition at line 182 of file bpp_format_ui.h.
|
explicit |
void yaze::gui::BppComparisonTool::SetSource | ( | const gfx::Bitmap & | bitmap, |
const gfx::SnesPalette & | palette | ||
) |
Set source bitmap for comparison.
bitmap | Source bitmap |
palette | Source palette |
Definition at line 504 of file bpp_format_ui.cc.
References GenerateComparisons(), has_source_, source_bitmap_, and source_palette_.
void yaze::gui::BppComparisonTool::Render | ( | ) |
Render the comparison tool.
Definition at line 511 of file bpp_format_ui.cc.
References has_source_, is_open_, RenderComparisonGrid(), RenderFormatSelector(), RenderMetrics(), and show_metrics_.
|
inline |
Check if tool is open.
Definition at line 206 of file bpp_format_ui.h.
References is_open_.
|
inline |
|
inline |
|
private |
Definition at line 528 of file bpp_format_ui.cc.
References comparison_bitmaps_, comparison_palettes_, comparison_valid_, yaze::gfx::BppFormatManager::ConvertFormat(), yaze::gfx::Bitmap::depth(), yaze::gfx::BppFormatManager::DetectFormat(), yaze::gfx::BppFormatManager::Get(), yaze::gfx::BppFormatManager::GetAvailableFormats(), yaze::gfx::Bitmap::height(), source_bitmap_, source_palette_, yaze::gfx::Bitmap::vector(), and yaze::gfx::Bitmap::width().
Referenced by SetSource().
|
private |
Definition at line 555 of file bpp_format_ui.cc.
References comparison_bitmaps_, comparison_scale_, comparison_valid_, yaze::gfx::BppFormatManager::Get(), yaze::gfx::BppFormatManager::GetAvailableFormats(), yaze::gfx::BppFormatManager::GetFormatInfo(), and yaze::gfx::Bitmap::texture().
Referenced by Render().
|
private |
Definition at line 581 of file bpp_format_ui.cc.
References CalculateMetrics(), comparison_valid_, yaze::gfx::BppFormatManager::Get(), yaze::gfx::BppFormatManager::GetAvailableFormats(), and yaze::gfx::BppFormatManager::GetFormatInfo().
Referenced by Render().
|
private |
Definition at line 594 of file bpp_format_ui.cc.
References selected_comparison_, and show_metrics_.
Referenced by Render().
|
private |
Definition at line 609 of file bpp_format_ui.cc.
References yaze::gfx::BppFormatManager::Get(), yaze::gfx::BppFormatManager::GetFormatInfo(), yaze::gfx::Bitmap::height(), yaze::gfx::BppFormatInfo::max_colors, source_bitmap_, and yaze::gfx::Bitmap::width().
Referenced by RenderMetrics().
|
private |
Definition at line 219 of file bpp_format_ui.h.
|
private |
|
private |
Definition at line 223 of file bpp_format_ui.h.
Referenced by CalculateMetrics(), GenerateComparisons(), and SetSource().
|
private |
Definition at line 224 of file bpp_format_ui.h.
Referenced by GenerateComparisons(), and SetSource().
|
private |
Definition at line 225 of file bpp_format_ui.h.
Referenced by Render(), and SetSource().
|
private |
Definition at line 228 of file bpp_format_ui.h.
Referenced by GenerateComparisons(), and RenderComparisonGrid().
|
private |
Definition at line 229 of file bpp_format_ui.h.
Referenced by GenerateComparisons().
|
private |
Definition at line 230 of file bpp_format_ui.h.
Referenced by GenerateComparisons(), RenderComparisonGrid(), and RenderMetrics().
|
private |
Definition at line 233 of file bpp_format_ui.h.
Referenced by RenderComparisonGrid().
|
private |
Definition at line 234 of file bpp_format_ui.h.
Referenced by Render(), and RenderFormatSelector().
|
private |
Definition at line 235 of file bpp_format_ui.h.
Referenced by RenderFormatSelector().