yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
sheet_png_transfer.h
Go to the documentation of this file.
1#ifndef YAZE_APP_EDITOR_GRAPHICS_SHEET_PNG_TRANSFER_H
2#define YAZE_APP_EDITOR_GRAPHICS_SHEET_PNG_TRANSFER_H
3
4#include <cstdint>
5#include <string>
6#include <vector>
7
8#include "absl/status/status.h"
9#include "absl/status/statusor.h"
11
12namespace yaze {
13class Rom;
14
15namespace editor {
16
17class UndoManager;
18class GraphicsEditorState;
19
33absl::StatusOr<std::vector<uint8_t>> ExportSheetPixelsPng(
34 uint16_t sheet_id, const std::vector<uint8_t>& indexed_pixels,
35 const zelda3::SheetPalette& palette);
36
39 uint16_t sheet_id = 0;
40 std::vector<uint8_t> indexed_pixels; // 128x32, the sheet after import
41 std::vector<int> changed_blocks; // 16x16 blocks 0-15
42 std::vector<int> changed_tiles; // 8x8 tiles 0-63
43};
44
50absl::StatusOr<SheetPngImportPreview> PreviewSheetPngImport(
51 uint16_t sheet_id, const std::vector<uint8_t>& indexed_pixels,
52 const std::vector<uint8_t>& png_bytes, const zelda3::SheetPalette& palette,
53 int first_block = 0);
54
57absl::StatusOr<std::vector<SheetPngImportPreview>> PreviewRoomPngImport(
58 const Rom& rom, const zelda3::RoomBackgroundSet& set,
59 const std::vector<uint8_t>& png_bytes, const zelda3::SheetPalette& palette);
60
64absl::Status ApplySheetPngImport(const SheetPngImportPreview& preview,
66 UndoManager* undo_manager);
67
69std::string DescribeSheetPngImport(const SheetPngImportPreview& preview);
70
71} // namespace editor
72} // namespace yaze
73
74#endif // YAZE_APP_EDITOR_GRAPHICS_SHEET_PNG_TRANSFER_H
The Rom class is used to load, save, and modify Rom data. This is a generic SNES ROM container and do...
Definition rom.h:49
Shared state between GraphicsEditor panel components.
Manages undo/redo stacks for a single editor.
3bpp graphics sheets to and from indexed PNGs.
absl::StatusOr< std::vector< uint8_t > > ExportSheetPixelsPng(uint16_t sheet_id, const std::vector< uint8_t > &indexed_pixels, const zelda3::SheetPalette &palette)
std::string DescribeSheetPngImport(const SheetPngImportPreview &preview)
"Sheet 0x20: blocks 0, 3 (5 tiles)" for the preview list.
absl::StatusOr< std::vector< SheetPngImportPreview > > PreviewRoomPngImport(const Rom &rom, const zelda3::RoomBackgroundSet &set, const std::vector< uint8_t > &png_bytes, const zelda3::SheetPalette &palette)
absl::StatusOr< SheetPngImportPreview > PreviewSheetPngImport(uint16_t sheet_id, const std::vector< uint8_t > &indexed_pixels, const std::vector< uint8_t > &png_bytes, const zelda3::SheetPalette &palette, int first_block)
absl::Status ApplySheetPngImport(const SheetPngImportPreview &preview, GraphicsEditorState &state, UndoManager *undo_manager)
std::array< SheetColor, 8 > SheetPalette
Colors for 3bpp indices 0-7. Index 0 is exported as transparent.
One sheet's pixels after an import, and what changed.