yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
catalog_palette_preview.h
Go to the documentation of this file.
1#ifndef YAZE_APP_EDITOR_GRAPHICS_CATALOG_PALETTE_PREVIEW_H_
2#define YAZE_APP_EDITOR_GRAPHICS_CATALOG_PALETTE_PREVIEW_H_
3
4#include <array>
5#include <cstdint>
6#include <string>
7#include <vector>
8
9#include "absl/status/statusor.h"
10
11namespace yaze::editor {
12
14 std::string label;
15 std::string source_path;
16 std::array<std::array<uint8_t, 3>, 8> colors;
17};
18
19// Reads sibling palettes/rom-palettes.json (schema_version 1), if present.
20// Source paths resolve relative to that file. Every source SHA256 is verified
21// before returning any rows. Colors come only from eight BGR555 words (c * 8).
22// Index zero is retained as RGB; the preview renderer owns transparency.
23// Missing file returns an empty vector. Malformed/unreadable files are errors.
24// Accepts bgr5558 or current exporter bgr555; conflicting fields are errors.
25// Limits: 8 MiB JSON, depth 32, 64 sources, 4096 total rows, 16 MiB per
26// source and 128 MiB of distinct source bytes. No ROM decoding or writes.
27absl::StatusOr<std::vector<CatalogPreviewPalette>> LoadCatalogPreviewPalettes(
28 const std::string& catalog_filename);
29
30} // namespace yaze::editor
31
32#endif // YAZE_APP_EDITOR_GRAPHICS_CATALOG_PALETTE_PREVIEW_H_
Editors are the view controllers for the application.
absl::StatusOr< std::vector< CatalogPreviewPalette > > LoadCatalogPreviewPalettes(const std::string &catalog_filename)
std::array< std::array< uint8_t, 3 >, 8 > colors