yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
sheet_image_import.cc File Reference
#include "app/editor/graphics/sheet_image_import.h"
#include <algorithm>
#include <optional>
#include "absl/strings/str_format.h"
#include "absl/strings/str_join.h"
#include "app/editor/graphics/palette_controls_panel_internal.h"
#include "app/gfx/types/snes_tile.h"

Go to the source code of this file.

Namespaces

namespace  yaze
 
namespace  yaze::editor
 Editors are the view controllers for the application.
 
namespace  yaze::editor::anonymous_namespace{sheet_image_import.cc}
 

Typedefs

using yaze::editor::anonymous_namespace{sheet_image_import.cc}::Rgba = std::array<uint8_t, 4>
 

Functions

Rgba yaze::editor::anonymous_namespace{sheet_image_import.cc}::PixelAt (const util::PngImage &png, int x, int y)
 
template<typename T , typename Get >
std::optional< T > yaze::editor::anonymous_namespace{sheet_image_import.cc}::UniformSwatch (int swatch, int strip_top, Get get)
 
template<typename Same >
int yaze::editor::anonymous_namespace{sheet_image_import.cc}::StripPeriod (int swatches, Same same)
 
bool yaze::editor::anonymous_namespace{sheet_image_import.cc}::CanHoldStrip (int width, int height)
 
int yaze::editor::anonymous_namespace{sheet_image_import.cc}::MaxIndex (const std::vector< uint8_t > &indices)
 
absl::StatusOr< ImportedSheetImage > yaze::editor::anonymous_namespace{sheet_image_import.cc}::ImportIndexed (const util::PngImage &png)
 
absl::StatusOr< ImportedSheetImage > yaze::editor::anonymous_namespace{sheet_image_import.cc}::ImportPaletteStrip (const util::PngImage &png)
 
absl::StatusOr< ImportedSheetImage > yaze::editor::ImportSheetImage (const util::PngImage &png)
 Converts a decoded PNG without re-quantizing it.
 
absl::StatusOr< ImportedSheetImage > yaze::editor::ImportSheetImagePng (const std::vector< uint8_t > &png_bytes)
 Decodes PNG bytes (file or clipboard) and calls ImportSheetImage.
 
absl::StatusOr< std::vector< uint8_t > > yaze::editor::EncodeImportedSheetTiles (const ImportedSheetImage &image, int bpp)
 
absl::StatusOr< std::vector< uint8_t > > yaze::editor::EncodeImportedSheetPng (const ImportedSheetImage &image)
 Re-encodes the art (without the strip) as an indexed PNG in index order.
 
std::string yaze::editor::DescribeImportedSheetImage (const ImportedSheetImage &image)
 "128x32 indexed PNG, 8 colors (strip removed), highest index 7".
 
absl::StatusOr< std::vector< int > > yaze::editor::PreviewPaletteSlots (std::string_view group_name, size_t palette_size, int row, int count)
 

Variables

constexpr int yaze::editor::anonymous_namespace{sheet_image_import.cc}::kSwatchSize = 8
 
constexpr std::array< int, 3 > yaze::editor::anonymous_namespace{sheet_image_import.cc}::kStripPaletteSizes = {4, 8, 16}
 
constexpr int yaze::editor::anonymous_namespace{sheet_image_import.cc}::kListedOffenders = 5