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

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>

Collaboration diagram for yaze::editor::ImageImportView:

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
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ ImageImportView()

yaze::editor::ImageImportView::ImageImportView ( GraphicsEditorState * state,
UndoManager * undo_manager )
inline

Definition at line 28 of file image_import_view.h.

Member Function Documentation

◆ Update()

◆ Load()

void yaze::editor::ImageImportView::Load ( absl::StatusOr< std::vector< uint8_t > > png_bytes,
const std::string & source )
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().

Here is the call graph for this function:

◆ DrawImage()

void yaze::editor::ImageImportView::DrawImage ( )
private

Definition at line 131 of file image_import_view.cc.

References yaze::editor::DescribeImportedSheetImage(), and image_.

Referenced by Update().

Here is the call graph for this function:

◆ DrawSaveButtons()

◆ DrawWriteIntoSheet()

◆ DrawPaletteImport()

◆ SetStatus()

void yaze::editor::ImageImportView::SetStatus ( std::string message,
bool is_error )
private

Definition at line 50 of file image_import_view.cc.

References status_, and status_is_error_.

Referenced by DrawPaletteImport(), DrawSaveButtons(), DrawWriteIntoSheet(), and Load().

Member Data Documentation

◆ state_

GraphicsEditorState* yaze::editor::ImageImportView::state_ = nullptr
private

Definition at line 42 of file image_import_view.h.

Referenced by DrawPaletteImport(), and DrawWriteIntoSheet().

◆ undo_manager_

UndoManager* yaze::editor::ImageImportView::undo_manager_ = nullptr
private

Definition at line 43 of file image_import_view.h.

Referenced by DrawWriteIntoSheet().

◆ path_

std::string yaze::editor::ImageImportView::path_
private

Definition at line 45 of file image_import_view.h.

Referenced by DrawSaveButtons(), and Update().

◆ image_

std::optional<ImportedSheetImage> yaze::editor::ImageImportView::image_
private

◆ source_

std::string yaze::editor::ImageImportView::source_
private

Definition at line 47 of file image_import_view.h.

Referenced by Load().

◆ status_

std::string yaze::editor::ImageImportView::status_
private

Definition at line 48 of file image_import_view.h.

Referenced by SetStatus(), and Update().

◆ status_is_error_

bool yaze::editor::ImageImportView::status_is_error_ = false
private

Definition at line 49 of file image_import_view.h.

Referenced by SetStatus(), and Update().


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