Import view hosted by the existing graphics Image Import WindowContent. Imports a PNG file or the clipboard image with its own palette and indices (sheet_image_import.h). More...
#include <image_import_view.h>

Public Member Functions | |
| ImageImportView (GraphicsEditorState *state, UndoManager *undo_manager) | |
| absl::Status | Update () |
Private Member Functions | |
| void | Load (absl::StatusOr< std::vector< uint8_t > > png_bytes, const std::string &source) |
| void | DrawImage () |
| void | DrawSaveButtons () |
| void | DrawWriteIntoSheet () |
| void | DrawPaletteImport () |
| void | SetStatus (std::string message, bool is_error) |
Private Attributes | |
| GraphicsEditorState * | state_ = nullptr |
| UndoManager * | undo_manager_ = nullptr |
| std::string | path_ |
| std::optional< ImportedSheetImage > | image_ |
| std::string | source_ |
| std::string | status_ |
| bool | status_is_error_ = false |
Import view hosted by the existing graphics Image Import WindowContent. Imports a PNG file or the clipboard image with its own palette and indices (sheet_image_import.h).
The imported art can be saved as 3bpp/4bpp tiles or an indexed PNG, or written into the current 3bpp sheet as one undoable step. Its colors are written into the sheet's preview palette only when asked, after a confirmation that lists each changed slot.
Definition at line 26 of file image_import_view.h.
|
inline |
Definition at line 28 of file image_import_view.h.
| absl::Status yaze::editor::ImageImportView::Update | ( | ) |
Definition at line 72 of file image_import_view.cc.
References DrawImage(), DrawPaletteImport(), DrawSaveButtons(), DrawWriteIntoSheet(), yaze::util::FileDialogOptions::filters, yaze::util::GetClipboardPng(), yaze::gui::GetErrorColor(), HOVER_HINT, ICON_MD_CONTENT_PASTE, ICON_MD_FILE_OPEN, image_, yaze::util::ImageClipboardSupported(), Load(), path_, yaze::util::ReadBinaryFile(), yaze::util::FileDialogWrapper::ShowOpenFileDialog(), status_, and status_is_error_.
|
private |
Definition at line 55 of file image_import_view.cc.
References yaze::editor::DescribeImportedSheetImage(), image_, yaze::editor::ImportSheetImagePng(), SetStatus(), and source_.
Referenced by Update().

|
private |
Definition at line 131 of file image_import_view.cc.
References yaze::editor::DescribeImportedSheetImage(), and image_.
Referenced by Update().

|
private |
Definition at line 173 of file image_import_view.cc.
References yaze::editor::EncodeImportedSheetPng(), yaze::editor::EncodeImportedSheetTiles(), HOVER_HINT, ICON_MD_SAVE, image_, path_, SetStatus(), yaze::util::FileDialogWrapper::ShowSaveFileDialog(), and yaze::util::WriteBinaryFile().
Referenced by Update().
|
private |
Definition at line 219 of file image_import_view.cc.
References yaze::editor::ApplySheetPngImport(), yaze::editor::GraphicsEditorState::current_sheet_id, yaze::editor::DescribeSheetPngImport(), yaze::editor::EncodeImportedSheetPng(), yaze::editor::GraphicsEditorState::game_data, yaze::gfx::Arena::Get(), yaze::gfx::Arena::gfx_sheets(), yaze::gfx::Arena::gfx_sheets_owner(), HOVER_HINT, ICON_MD_FILE_UPLOAD, image_, yaze::editor::PreviewSheetPngImport(), SetStatus(), state_, and undo_manager_.
Referenced by Update().
|
private |
Definition at line 262 of file image_import_view.cc.
References yaze::editor::GraphicsEditorState::current_sheet_id, yaze::editor::GraphicsEditorState::game_data, yaze::gfx::PaletteManager::Get(), yaze::gfx::PaletteGroupMap::get_group(), yaze::gui::GetWarningColor(), yaze::editor::GraphicsPaletteSelection::group, HOVER_HINT, ICON_MD_ARROW_FORWARD, ICON_MD_PALETTE, image_, yaze::editor::GraphicsPaletteSelection::palette, yaze::zelda3::GameData::palette_groups, yaze::gfx::PaletteGroup::palette_ref(), yaze::editor::GraphicsEditorState::PreviewPalette(), yaze::editor::PreviewPaletteSlots(), yaze::editor::RefreshGraphicsPreviewPalettes(), yaze::editor::GraphicsPaletteSelection::row, SetStatus(), yaze::gfx::PaletteGroup::size(), and state_.
Referenced by Update().
|
private |
Definition at line 50 of file image_import_view.cc.
References status_, and status_is_error_.
Referenced by DrawPaletteImport(), DrawSaveButtons(), DrawWriteIntoSheet(), and Load().
|
private |
Definition at line 42 of file image_import_view.h.
Referenced by DrawPaletteImport(), and DrawWriteIntoSheet().
|
private |
Definition at line 43 of file image_import_view.h.
Referenced by DrawWriteIntoSheet().
|
private |
Definition at line 45 of file image_import_view.h.
Referenced by DrawSaveButtons(), and Update().
|
private |
Definition at line 46 of file image_import_view.h.
Referenced by DrawImage(), DrawPaletteImport(), DrawSaveButtons(), DrawWriteIntoSheet(), Load(), and Update().
|
private |
Definition at line 47 of file image_import_view.h.
Referenced by Load().
|
private |
Definition at line 48 of file image_import_view.h.
Referenced by SetStatus(), and Update().
|
private |
Definition at line 49 of file image_import_view.h.
Referenced by SetStatus(), and Update().