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

BPP format selection and conversion UI component. More...

#include <bpp_format_ui.h>

Public Member Functions

 BppFormatUI (const std::string &id)
 Constructor.
 
bool RenderFormatSelector (gfx::Bitmap *bitmap, const gfx::SnesPalette &palette, std::function< void(gfx::BppFormat)> on_format_changed)
 Render the BPP format selection UI.
 
void RenderAnalysisPanel (const gfx::Bitmap &bitmap, const gfx::SnesPalette &palette)
 Render format analysis panel.
 
void RenderConversionPreview (const gfx::Bitmap &bitmap, gfx::BppFormat target_format, const gfx::SnesPalette &palette)
 Render conversion preview.
 
void RenderSheetAnalysis (const std::vector< uint8_t > &sheet_data, int sheet_id, const gfx::SnesPalette &palette)
 Render graphics sheet analysis.
 
gfx::BppFormat GetSelectedFormat () const
 Get currently selected BPP format.
 
void SetSelectedFormat (gfx::BppFormat format)
 Set the selected BPP format.
 
bool IsConversionAvailable (gfx::BppFormat from_format, gfx::BppFormat to_format) const
 Check if format conversion is available.
 
int GetConversionEfficiency (gfx::BppFormat from_format, gfx::BppFormat to_format) const
 Get conversion efficiency score.
 

Private Member Functions

void RenderFormatInfo (const gfx::BppFormatInfo &info)
 
void RenderColorUsageChart (const std::vector< int > &color_usage)
 
void RenderConversionHistory (const std::string &history)
 
std::string GetFormatDescription (gfx::BppFormat format) const
 
ImVec4 GetFormatColor (gfx::BppFormat format) const
 
void UpdateAnalysisCache (int sheet_id, const gfx::GraphicsSheetAnalysis &analysis)
 

Private Attributes

std::string id_
 
gfx::BppFormat selected_format_
 
gfx::BppFormat preview_format_
 
bool show_analysis_
 
bool show_preview_
 
bool show_sheet_analysis_
 
std::unordered_map< int, gfx::GraphicsSheetAnalysiscached_analysis_
 
bool format_changed_
 
std::string last_analysis_sheet_
 

Detailed Description

BPP format selection and conversion UI component.

Provides a comprehensive UI for BPP format management in the YAZE ROM hacking editor. Includes format selection, conversion preview, and analysis tools.

Definition at line 21 of file bpp_format_ui.h.

Constructor & Destructor Documentation

◆ BppFormatUI()

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

Constructor.

Parameters
idUnique identifier for this UI component

Definition at line 14 of file bpp_format_ui.cc.

Member Function Documentation

◆ RenderFormatSelector()

bool yaze::gui::BppFormatUI::RenderFormatSelector ( gfx::Bitmap bitmap,
const gfx::SnesPalette palette,
std::function< void(gfx::BppFormat)>  on_format_changed 
)

◆ RenderAnalysisPanel()

◆ RenderConversionPreview()

void yaze::gui::BppFormatUI::RenderConversionPreview ( const gfx::Bitmap bitmap,
gfx::BppFormat  target_format,
const gfx::SnesPalette palette 
)

◆ RenderSheetAnalysis()

void yaze::gui::BppFormatUI::RenderSheetAnalysis ( const std::vector< uint8_t > &  sheet_data,
int  sheet_id,
const gfx::SnesPalette palette 
)

Render graphics sheet analysis.

Parameters
sheet_dataGraphics sheet data
sheet_idSheet identifier
paletteSheet palette

Definition at line 236 of file bpp_format_ui.cc.

References yaze::gfx::BppFormatManager::AnalyzeGraphicsSheet(), cached_analysis_, yaze::gfx::BppFormatManager::Get(), yaze::gui::GetSuccessColor(), yaze::gui::GetWarningColor(), last_analysis_sheet_, show_sheet_analysis_, yaze::gfx::SnesPalette::size(), and UpdateAnalysisCache().

◆ GetSelectedFormat()

gfx::BppFormat yaze::gui::BppFormatUI::GetSelectedFormat ( ) const
inline

Get currently selected BPP format.

Returns
Selected BPP format

Definition at line 68 of file bpp_format_ui.h.

References selected_format_.

◆ SetSelectedFormat()

void yaze::gui::BppFormatUI::SetSelectedFormat ( gfx::BppFormat  format)
inline

Set the selected BPP format.

Parameters
formatBPP format to select

Definition at line 74 of file bpp_format_ui.h.

References selected_format_.

◆ IsConversionAvailable()

bool yaze::gui::BppFormatUI::IsConversionAvailable ( gfx::BppFormat  from_format,
gfx::BppFormat  to_format 
) const

Check if format conversion is available.

Parameters
from_formatSource format
to_formatTarget format
Returns
True if conversion is available

Definition at line 312 of file bpp_format_ui.cc.

◆ GetConversionEfficiency()

int yaze::gui::BppFormatUI::GetConversionEfficiency ( gfx::BppFormat  from_format,
gfx::BppFormat  to_format 
) const

Get conversion efficiency score.

Parameters
from_formatSource format
to_formatTarget format
Returns
Efficiency score (0-100)

Definition at line 317 of file bpp_format_ui.cc.

Referenced by RenderFormatSelector().

◆ RenderFormatInfo()

◆ RenderColorUsageChart()

void yaze::gui::BppFormatUI::RenderColorUsageChart ( const std::vector< int > &  color_usage)
private

Definition at line 340 of file bpp_format_ui.cc.

Referenced by RenderAnalysisPanel().

◆ RenderConversionHistory()

void yaze::gui::BppFormatUI::RenderConversionHistory ( const std::string &  history)
private

Definition at line 359 of file bpp_format_ui.cc.

◆ GetFormatDescription()

std::string yaze::gui::BppFormatUI::GetFormatDescription ( gfx::BppFormat  format) const
private

Definition at line 364 of file bpp_format_ui.cc.

References yaze::gfx::BppFormatInfo::description, yaze::gfx::BppFormatManager::Get(), and yaze::gfx::BppFormatManager::GetFormatInfo().

Here is the call graph for this function:

◆ GetFormatColor()

ImVec4 yaze::gui::BppFormatUI::GetFormatColor ( gfx::BppFormat  format) const
private

◆ UpdateAnalysisCache()

void yaze::gui::BppFormatUI::UpdateAnalysisCache ( int  sheet_id,
const gfx::GraphicsSheetAnalysis analysis 
)
private

Definition at line 378 of file bpp_format_ui.cc.

References cached_analysis_.

Referenced by RenderSheetAnalysis().

Member Data Documentation

◆ id_

std::string yaze::gui::BppFormatUI::id_
private

Definition at line 93 of file bpp_format_ui.h.

◆ selected_format_

gfx::BppFormat yaze::gui::BppFormatUI::selected_format_
private

Definition at line 94 of file bpp_format_ui.h.

Referenced by GetSelectedFormat(), RenderFormatSelector(), and SetSelectedFormat().

◆ preview_format_

gfx::BppFormat yaze::gui::BppFormatUI::preview_format_
private

Definition at line 95 of file bpp_format_ui.h.

Referenced by RenderFormatSelector().

◆ show_analysis_

bool yaze::gui::BppFormatUI::show_analysis_
private

Definition at line 96 of file bpp_format_ui.h.

Referenced by RenderAnalysisPanel(), and RenderFormatSelector().

◆ show_preview_

bool yaze::gui::BppFormatUI::show_preview_
private

Definition at line 97 of file bpp_format_ui.h.

Referenced by RenderConversionPreview(), and RenderFormatSelector().

◆ show_sheet_analysis_

bool yaze::gui::BppFormatUI::show_sheet_analysis_
private

Definition at line 98 of file bpp_format_ui.h.

Referenced by RenderSheetAnalysis().

◆ cached_analysis_

std::unordered_map<int, gfx::GraphicsSheetAnalysis> yaze::gui::BppFormatUI::cached_analysis_
private

Definition at line 101 of file bpp_format_ui.h.

Referenced by RenderSheetAnalysis(), and UpdateAnalysisCache().

◆ format_changed_

bool yaze::gui::BppFormatUI::format_changed_
private

Definition at line 104 of file bpp_format_ui.h.

Referenced by RenderFormatSelector().

◆ last_analysis_sheet_

std::string yaze::gui::BppFormatUI::last_analysis_sheet_
private

Definition at line 105 of file bpp_format_ui.h.

Referenced by RenderSheetAnalysis().


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