yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
palette_widget.h
Go to the documentation of this file.
1#ifndef YAZE_APP_GUI_PALETTE_WIDGET_H
2#define YAZE_APP_GUI_PALETTE_WIDGET_H
3
4#include <vector>
5#include <map>
7#include "app/gfx/bitmap.h"
8#include "app/rom.h"
9#include "imgui/imgui.h"
10
11namespace yaze {
12namespace gui {
13
25public:
26 PaletteWidget() = default;
27
31 void Initialize(Rom* rom);
32
36 void ShowPaletteEditor(gfx::SnesPalette& palette, const std::string& title = "Palette Editor");
37
42
46 void ShowColorAnalysis(const gfx::Bitmap& bitmap, const std::string& title = "Color Analysis");
47
51 bool ApplyROMPalette(gfx::Bitmap* bitmap, int group_index, int palette_index);
52
57
61 void SavePaletteBackup(const gfx::SnesPalette& palette);
62
67
68 // Accessors
69 bool IsROMLoaded() const { return rom_ != nullptr; }
73
74private:
75 void DrawPaletteGrid(gfx::SnesPalette& palette, int cols = 8);
76 void DrawColorEditControls(gfx::SnesColor& color, int color_index);
77 void DrawPaletteAnalysis(const gfx::SnesPalette& palette);
78 void LoadROMPalettes();
79
80 Rom* rom_ = nullptr;
81 std::vector<gfx::SnesPalette> rom_palette_groups_;
82 std::vector<std::string> palette_group_names_;
84
89 bool show_rom_manager_ = false;
90
91 // Color editing state
93 ImVec4 temp_color_ = ImVec4(0, 0, 0, 1);
94};
95
96} // namespace gui
97} // namespace yaze
98
99#endif // YAZE_APP_GUI_WIDGETS_PALETTE_WIDGET_H
The Rom class is used to load, save, and modify Rom data.
Definition rom.h:71
Represents a bitmap image optimized for SNES ROM hacking.
Definition bitmap.h:66
SNES Color container.
Definition snes_color.h:38
Represents a palette of colors for the Super Nintendo Entertainment System (SNES).
Palette widget with ROM integration, analysis tools, and AI tool call support.
void DrawPaletteAnalysis(const gfx::SnesPalette &palette)
const gfx::SnesPalette * GetSelectedROMPalette() const
Get the currently selected ROM palette.
int GetCurrentPaletteIndex() const
std::vector< gfx::SnesPalette > rom_palette_groups_
void SavePaletteBackup(const gfx::SnesPalette &palette)
Save current palette as backup.
void ShowROMPaletteManager()
Show the ROM palette manager window.
void ShowColorAnalysis(const gfx::Bitmap &bitmap, const std::string &title="Color Analysis")
Show color analysis window for a bitmap.
void DrawPaletteGrid(gfx::SnesPalette &palette, int cols=8)
void Initialize(Rom *rom)
Initialize the palette editor with ROM data.
void ShowPaletteEditor(gfx::SnesPalette &palette, const std::string &title="Palette Editor")
Show the main palette editor window.
bool RestorePaletteBackup(gfx::SnesPalette &palette)
Restore palette from backup.
std::vector< std::string > palette_group_names_
bool ApplyROMPalette(gfx::Bitmap *bitmap, int group_index, int palette_index)
Apply a ROM palette group to a bitmap.
void DrawColorEditControls(gfx::SnesColor &color, int color_index)
gfx::SnesPalette backup_palette_
Main namespace for the application.