Represents a bitmap image optimized for SNES ROM hacking. More...
#include <bitmap.h>

Classes | |
| struct | BitmapMetadata |
| Metadata for tracking bitmap source format and palette requirements. More... | |
| struct | DirtyRegion |
Public Types | |
| enum class | BitmapPurpose : uint8_t { kPreview , kEditable , kSelectionSource , kCompositeOutput } |
| How a bitmap is used in the editor pipeline. More... | |
Public Member Functions | |
| Bitmap ()=default | |
| Bitmap (int width, int height, int depth, const std::vector< uint8_t > &data) | |
| Create a bitmap with the given dimensions and raw pixel data. | |
| Bitmap (int width, int height, int depth, const std::vector< uint8_t > &data, const SnesPalette &palette) | |
| Create a bitmap with the given dimensions, data, and SNES palette. | |
| Bitmap (const Bitmap &other) | |
| Copy constructor - creates a deep copy. | |
| Bitmap & | operator= (const Bitmap &other) |
| Copy assignment operator. | |
| Bitmap (Bitmap &&other) noexcept | |
| Move constructor. | |
| Bitmap & | operator= (Bitmap &&other) noexcept |
| Move assignment operator. | |
| ~Bitmap ()=default | |
| Destructor. | |
| void | Create (int width, int height, int depth, std::span< uint8_t > data) |
| Create a bitmap with the given dimensions and data. | |
| void | Create (int width, int height, int depth, const std::vector< uint8_t > &data) |
| Create a bitmap with the given dimensions and data. | |
| void | Create (int width, int height, int depth, int format, const std::vector< uint8_t > &data) |
| Create a bitmap with the given dimensions, format, and data. | |
| void | Reformat (int format) |
| Reformat the bitmap to use a different pixel format. | |
| void | Fill (uint8_t value) |
| Fill the bitmap with a specific value. | |
| void | CreateTexture () |
| Creates the underlying SDL_Texture to be displayed. | |
| void | UpdateTexture () |
| Updates the underlying SDL_Texture when it already exists. | |
| void | QueueTextureUpdate (IRenderer *renderer) |
| Queue texture update for batch processing (improved performance) | |
| void | UpdateTextureData () |
| Updates the texture data from the surface. | |
| void | SetPalette (const SnesPalette &palette) |
| Set the palette for the bitmap using SNES palette format. | |
| void | SetPaletteWithTransparent (const SnesPalette &palette, size_t index, int length=7) |
| Set the palette with a transparent color. | |
| void | ApplyPaletteByMetadata (const SnesPalette &palette, int sub_palette_index=0) |
| Apply palette using metadata-driven strategy Chooses between SetPalette and SetPaletteWithTransparent based on metadata. | |
| void | ApplyStoredPalette () |
| Apply the stored palette to the surface (internal helper) | |
| void | UpdateSurfacePixels () |
| Update SDL surface with current pixel data from data_ vector Call this after modifying pixel data via mutable_data() | |
| void | SetPalette (const std::vector< SDL_Color > &palette) |
| Set the palette using SDL colors (direct surface palette access) | |
| void | WriteToPixel (int position, uint8_t value) |
| Write a value to a pixel at the given position. | |
| void | WriteToPixel (int x, int y, uint8_t value) |
| Write a palette index to a pixel at the given x,y coordinates. | |
| uint8_t | GetPixel (int x, int y) const |
| Get the palette index at the given x,y coordinates. | |
| void | WriteColor (int position, const ImVec4 &color) |
| Write a color to a pixel at the given position. | |
| void | SetPixel (int x, int y, const SnesColor &color) |
| Set a pixel at the given x,y coordinates with SNES color. | |
| void | Resize (int new_width, int new_height) |
| Resize the bitmap to new dimensions (preserves existing data) | |
| void | InvalidatePaletteCache () |
| Invalidate the palette lookup cache (call when palette changes) | |
| uint8_t | FindColorIndex (const SnesColor &color) |
| Find color index in palette using optimized hash map lookup. | |
| bool | ValidateDataSurfaceSync () |
| Validate that bitmap data and surface pixels are synchronized. | |
| void | Get8x8Tile (int tile_index, int x, int y, std::vector< uint8_t > &tile_data, int &tile_data_offset) |
| Extract an 8x8 tile from the bitmap (SNES standard tile size) | |
| void | Get16x16Tile (int tile_x, int tile_y, std::vector< uint8_t > &tile_data, int &tile_data_offset) |
| Extract a 16x16 tile from the bitmap (SNES metatile size) | |
| const SnesPalette & | palette () const |
| SnesPalette * | mutable_palette () |
| BitmapMetadata & | metadata () |
| const BitmapMetadata & | metadata () const |
| int | width () const |
| int | height () const |
| int | depth () const |
| bool | IsIndexed () const |
| SDL_Color | ReadColor (int x, int y) const |
| std::vector< uint8_t > | ToRgba () const |
| auto | size () const |
| const uint8_t * | data () const |
| std::vector< uint8_t > & | mutable_data () |
| SDL_Surface * | surface () const |
| TextureHandle | texture () const |
| const std::vector< uint8_t > & | vector () const |
| uint8_t | at (int i) const |
| bool | modified () const |
| bool | is_active () const |
| uint32_t | generation () const |
| void | set_active (bool active) |
| void | set_data (const std::vector< uint8_t > &data) |
| void | set_modified (bool modified) |
| void | set_texture (TextureHandle texture) |
Private Member Functions | |
| void | CopySurfaceState (const Bitmap &other) |
| SDL_Surface * | DetachSurfaceForArena () noexcept |
| TextureHandle | DetachTextureForArena () noexcept |
| void | MarkRetiredByArena () noexcept |
Static Private Member Functions | |
| static uint32_t | HashColor (const ImVec4 &color) |
| Hash a color for cache lookup. | |
Private Attributes | |
| int | width_ = 0 |
| int | height_ = 0 |
| int | depth_ = 0 |
| bool | active_ = false |
| bool | modified_ = false |
| uint32_t | generation_ = 0 |
| void * | texture_pixels = nullptr |
| uint8_t * | pixel_data_ = nullptr |
| gfx::SnesPalette | palette_ |
| Internal SNES palette storage (may be empty!) | |
| BitmapMetadata | metadata_ |
| std::vector< uint8_t > | data_ |
| SDL_Surface * | surface_ = nullptr |
| SDL surface for rendering (contains the authoritative palette) | |
| TextureHandle | texture_ = nullptr |
| std::unordered_map< uint32_t, uint8_t > | color_to_index_cache_ |
| struct yaze::gfx::Bitmap::DirtyRegion | dirty_region_ |
Static Private Attributes | |
| static uint32_t | next_generation_ = 1 |
Friends | |
| class | Arena |
Represents a bitmap image optimized for SNES ROM hacking.
The Bitmap class provides functionality to create, manipulate, and display bitmap images specifically designed for Link to the Past ROM editing. It supports:
Key Features:
Performance Optimizations:
ROM Hacking Specific:
|
strong |
How a bitmap is used in the editor pipeline.
Roles describe purpose, not behavior. Bitmap itself stays neutral and doesn't gate operations on this. Editors and Canvas widgets read the field to make informed defaults (e.g. a kPreview bitmap should not be the target of pixel writes; a kCompositeOutput bitmap is downstream of a layer-merge step and gets re-rendered, not edited in place).
Default is kEditable so existing callsites keep their semantics.
| Enumerator | |
|---|---|
| kPreview | |
| kEditable | |
| kSelectionSource | |
| kCompositeOutput | |
|
default |
Create a bitmap with the given dimensions and raw pixel data.
| width | Width in pixels (typically 128, 256, or 512 for SNES tilesheets) |
| height | Height in pixels (typically 32, 64, or 128 for SNES tilesheets) |
| depth | Color depth in bits per pixel (4, 8, or 16 for SNES) |
| data | Raw pixel data (indexed color values for SNES graphics) |
Definition at line 48 of file bitmap.cc.
References Create(), data(), depth(), height(), and width().
| yaze::gfx::Bitmap::Bitmap | ( | int | width, |
| int | height, | ||
| int | depth, | ||
| const std::vector< uint8_t > & | data, | ||
| const SnesPalette & | palette ) |
Create a bitmap with the given dimensions, data, and SNES palette.
| width | Width in pixels |
| height | Height in pixels |
| depth | Color depth in bits per pixel |
| data | Raw pixel data (indexed color values) |
| palette | SNES palette for color mapping (15-bit RGB format) |
Definition at line 54 of file bitmap.cc.
References Create(), data(), depth(), height(), palette(), SetPalette(), and width().
Copy constructor - creates a deep copy.
Definition at line 65 of file bitmap.cc.
References active_, yaze::gfx::Arena::AllocateSurface(), CopySurfaceState(), data_, depth_, yaze::gfx::Arena::Get(), yaze::gfx::GetSnesPixelFormat(), height_, yaze::gfx::kIndexed, yaze::gfx::kRgba, pixel_data_, surface_, UpdateSurfacePixels(), and width_.
|
noexcept |
|
default |
Destructor.
| Bitmap & yaze::gfx::Bitmap::operator= | ( | const Bitmap & | other | ) |
Copy assignment operator.
Definition at line 88 of file bitmap.cc.
References active_, yaze::gfx::Arena::AllocateSurface(), CopySurfaceState(), data_, depth_, yaze::gfx::Arena::DESTROY, yaze::gfx::Arena::FreeSurface(), generation_, yaze::gfx::Arena::Get(), yaze::gfx::GetSnesPixelFormat(), height_, yaze::gfx::kIndexed, yaze::gfx::kRgba, metadata_, modified_, next_generation_, palette_, pixel_data_, yaze::gfx::Arena::QueueTextureCommand(), surface_, texture_, UpdateSurfacePixels(), and width_.
|
noexcept |
Move assignment operator.
Definition at line 157 of file bitmap.cc.
References yaze::gfx::Arena::FreeSurface(), and yaze::gfx::Arena::Get().

Create a bitmap with the given dimensions and data.
Definition at line 198 of file bitmap.cc.
References Create(), data(), data_, depth(), height(), and width().
Referenced by Bitmap(), Bitmap(), yaze::editor::Tile16EditSession::BuildStampPreview(), yaze::zelda3::ObjectTileEditor::BuildTile8Atlas(), yaze::zelda3::Inventory::BuildTileset(), yaze::zelda3::RoomLayerManager::CompositeToOutput(), yaze::editor::Tile16EditSession::CopyTile16ToClipboard(), Create(), Create(), yaze::zelda3::OverworldMapScreen::Create(), yaze::zelda3::Inventory::Create(), yaze::zelda3::TitleScreen::Create(), yaze::editor::GraphicsEditor::DecompressImportData(), yaze::editor::PixelEditorPanel::DisplaySheet(), yaze::gfx::BackgroundBuffer::DrawBackground(), yaze::editor::GraphicsEditor::DrawCgxImport(), yaze::gfx::BackgroundBuffer::DrawFloor(), yaze::editor::MenuTilemapEditorUI::DrawOverlayControls(), yaze::editor::OverworldEditor::DrawScratchSpace(), yaze::editor::GraphicsEditor::DrawScrImport(), yaze::editor::Tile16Editor::DrawTile16EditorWorkbenchColumn(), yaze::editor::Tile16EditSession::DrawToCurrentTile16Impl(), yaze::gfx::BackgroundBuffer::EnsureBitmapInitialized(), yaze::editor::internal::EnsureSpritePreviewBitmapReady(), yaze::editor::Tile16EditSession::InitializeBitmaps(), yaze::editor::ScreenEditor::Load(), yaze::zelda3::LoadDungeonMapTile16(), yaze::zelda3::LoadFontGraphics(), yaze::editor::OverworldEditor::LoadGraphics(), yaze::editor::Tile16EditSession::LoadTile16FromScratchSpaceImpl(), yaze::editor::Tile16EditSession::PasteTile16FromClipboardImpl(), yaze::editor::GfxGroupEditor::PrepareSheetPreview(), yaze::editor::Tile16EditSession::PreviewPaletteChange(), yaze::editor::MenuTilemapEditorUI::RebuildRenderTextures(), yaze::editor::OverworldEditor::RebuildScratchBitmapFromTileData(), yaze::editor::ScreenEditor::RefreshDungeonMapGraphicsFromSession(), yaze::editor::MessageEditor::RefreshFontAtlasBitmap(), yaze::zelda3::ObjectTileEditor::RenderLayoutToBitmap(), yaze::zelda3::RenderTile16BitmapFromMetadata(), yaze::zelda3::RenderTile16BitmapFromMetadata(), yaze::test::RomDependentTestSuite::RunTile16EditorTest(), yaze::editor::OverworldEditor::SaveCurrentSelectionToScratch(), yaze::editor::UsagePreviewView::ShowImage(), yaze::editor::anonymous_namespace{map_refresh_coordinator.cc}::SyncCurrentGraphicsBitmapForTile16Editor(), yaze::editor::SyncMapBrushPreview(), yaze::editor::internal::SyncSheetPreview(), yaze::gui::DungeonObjectEmulatorPreview::TriggerStaticRender(), and yaze::editor::Tile16EditSession::UpdateLivePreview().
| void yaze::gfx::Bitmap::Create | ( | int | width, |
| int | height, | ||
| int | depth, | ||
| const std::vector< uint8_t > & | data ) |
Create a bitmap with the given dimensions and data.
Definition at line 203 of file bitmap.cc.
References Create(), data(), depth(), height(), yaze::gfx::kIndexed, yaze::gfx::kRgba, and width().
| void yaze::gfx::Bitmap::Create | ( | int | width, |
| int | height, | ||
| int | depth, | ||
| int | format, | ||
| const std::vector< uint8_t > & | data ) |
Create a bitmap with the given dimensions, format, and data.
Create a bitmap with specified format and data.
| width | Width in pixels |
| height | Height in pixels |
| depth | Color depth in bits per pixel |
| format | Pixel format (0=indexed, 1=4BPP, 2=8BPP) |
| data | Raw pixel data |
Performance Notes:
Definition at line 223 of file bitmap.cc.
References active_, yaze::gfx::Arena::AllocateSurface(), ApplyStoredPalette(), data(), data_, depth(), depth_, yaze::gfx::SnesPalette::empty(), yaze::platform::EnsureSurfacePalette256(), yaze::gfx::Arena::FreeSurface(), generation_, yaze::gfx::Arena::Get(), yaze::gfx::GetSnesPixelFormat(), height(), height_, IsIndexed(), yaze::gfx::kIndexed, next_generation_, palette_, pixel_data_, surface_, UpdateSurfacePixels(), vector(), width(), and width_.
| void yaze::gfx::Bitmap::Reformat | ( | int | format | ) |
Reformat the bitmap to use a different pixel format.
Definition at line 280 of file bitmap.cc.
References active_, yaze::gfx::Arena::AllocateSurface(), data_, depth_, yaze::gfx::Arena::Get(), yaze::gfx::GetSnesPixelFormat(), height_, palette_, pixel_data_, SetPalette(), surface_, vector(), and width_.
Referenced by yaze::editor::internal::EnsureSpritePreviewBitmapReady(), and yaze::gui::CanvasContextMenu::RenderBitmapOperationsMenu().
Fill the bitmap with a specific value.
Definition at line 146 of file bitmap.h.
References data_, and modified_.
Referenced by yaze::zelda3::RoomLayerManager::CompositeToOutput().
| void yaze::gfx::Bitmap::CreateTexture | ( | ) |
Creates the underlying SDL_Texture to be displayed.
Definition at line 297 of file bitmap.cc.
References yaze::gfx::Arena::CREATE, yaze::gfx::Arena::Get(), and yaze::gfx::Arena::QueueTextureCommand().
Referenced by yaze::gfx::AtlasRenderer::AddBitmapWithBppOptimization(), yaze::editor::internal::EnsureSpritePreviewBitmapReady(), yaze::editor::ObjectTileEditorPanel::RenderObjectPreview(), yaze::editor::ObjectTileEditorPanel::RenderTile8Atlas(), yaze::gfx::RenderTilesBatch(), and yaze::editor::SyncMapBrushPreview().

| void yaze::gfx::Bitmap::UpdateTexture | ( | ) |
Updates the underlying SDL_Texture when it already exists.
Definition at line 301 of file bitmap.cc.
References yaze::gfx::Arena::Get(), yaze::gfx::Arena::QueueTextureCommand(), and yaze::gfx::Arena::UPDATE.
Referenced by yaze::gui::Canvas::ConvertBitmapFormat(), yaze::editor::GfxGroupEditor::PrepareSheetPreview(), yaze::editor::internal::PublishSpritePreviewPixels(), yaze::editor::ObjectTileEditorPanel::RenderObjectPreview(), yaze::editor::ObjectTileEditorPanel::RenderTile8Atlas(), yaze::editor::SyncMapBrushPreview(), yaze::editor::internal::SyncSheetPreview(), and yaze::gui::Canvas::UpdateColorPainter().

Queue texture update for batch processing (improved performance)
| renderer | SDL renderer for texture operations |
| void yaze::gfx::Bitmap::UpdateTextureData | ( | ) |
Updates the texture data from the surface.
| void yaze::gfx::Bitmap::SetPalette | ( | const SnesPalette & | palette | ) |
Set the palette for the bitmap using SNES palette format.
This method stores the palette in the internal palette_ member AND applies it to the SDL surface via ApplyStoredPalette().
palette_ member)**: Stores the SNES color format for serialization and palette editing. Accessible via palette().surface_->format->palette)**: Used by SDL for actual rendering. When converting indexed pixels to RGBA for textures, SDL uses THIS palette, not the internal one.Both are updated when calling SetPalette(SnesPalette). However, some code paths (like dungeon room rendering) use SetPalette(vector<SDL_Color>) which ONLY sets the SDL surface palette, leaving the internal palette_ empty.
When compositing bitmaps or copying palettes between bitmaps, you may need to extract the palette from the SDL surface directly rather than using palette() which may be empty. See RoomLayerManager::CompositeToOutput() for an example of proper palette extraction from SDL surfaces.
| palette | SNES palette to apply (15-bit RGB format) |
Definition at line 452 of file bitmap.cc.
References ApplyStoredPalette(), modified_, palette(), and palette_.
Referenced by yaze::editor::MessageEditor::ApplyFontPalette(), ApplyPaletteByMetadata(), yaze::gui::CanvasUtils::ApplyPaletteGroup(), yaze::editor::Tile16EditSession::ApplyPaletteToCurrentTile16Bitmap(), yaze::editor::internal::ApplyRoleDefaultPalette(), yaze::gui::PaletteEditorWidget::ApplyROMPalette(), yaze::editor::anonymous_namespace{tile_object_handler.cc}::ApplyRoomPaletteToGhost(), yaze::zelda3::anonymous_namespace{room_layer_manager.cc}::ApplySDLPaletteToBitmap(), Bitmap(), yaze::editor::Tile16EditSession::BuildStampPreview(), yaze::zelda3::ObjectTileEditor::BuildTile8Atlas(), yaze::zelda3::Inventory::BuildTileset(), yaze::zelda3::TitleScreen::BuildTileset(), CopySurfaceState(), yaze::editor::Tile16EditSession::CopyTile16ToClipboard(), yaze::zelda3::OverworldMapScreen::Create(), yaze::zelda3::Inventory::Create(), yaze::gfx::CreateTilemap(), yaze::editor::GraphicsEditor::DecompressImportData(), yaze::editor::GraphicsEditor::DrawCgxImport(), yaze::editor::ScreenEditor::DrawDungeonMapScreen(), yaze::editor::ScreenEditor::DrawDungeonMapsRoomGfx(), yaze::editor::MenuTilemapEditorUI::DrawOverlayControls(), yaze::editor::OverworldEditor::DrawScratchSpace(), yaze::editor::GraphicsEditor::DrawScrImport(), yaze::editor::Tile16Editor::DrawTile16EditorWorkbenchColumn(), yaze::editor::Tile16EditSession::DrawToCurrentTile16Impl(), yaze::gfx::BackgroundBuffer::EnsureBitmapInitialized(), yaze::editor::Tile16EditSession::InitializeBitmaps(), yaze::editor::ScreenEditor::Load(), yaze::zelda3::LoadDungeonMapTile16(), yaze::editor::OverworldEditor::LoadGraphics(), yaze::editor::Tile16EditSession::LoadTile16FromScratchSpaceImpl(), yaze::zelda3::TitleScreen::LoadTitleScreen(), yaze::editor::Tile16EditSession::PasteTile16FromClipboardImpl(), yaze::editor::GfxGroupEditor::PrepareSheetPreview(), yaze::editor::Tile16EditSession::PreviewPaletteChange(), yaze::editor::MenuTilemapEditorUI::RebuildRenderTextures(), yaze::editor::OverworldEditor::RebuildScratchBitmapFromTileData(), Reformat(), yaze::editor::Tile16EditSession::RefreshAllPalettes(), yaze::editor::ScreenEditor::RefreshDungeonMapGraphicsFromSession(), yaze::editor::MessageEditor::RefreshFontAtlasBitmap(), yaze::editor::MapRefreshCoordinator::RefreshTile16Blockset(), yaze::zelda3::ObjectTileEditor::RenderLayoutToBitmap(), yaze::editor::SpriteEditor::RenderVanillaSprite(), yaze::editor::SpriteEditor::RenderZSpriteFrame(), yaze::test::RomDependentTestSuite::RunTile16EditorTest(), yaze::editor::OverworldEditor::SaveCurrentSelectionToScratch(), yaze::editor::UsagePreviewView::ShowImage(), yaze::editor::SyncMapBrushPreview(), yaze::editor::internal::SyncSheetPreview(), yaze::editor::Tile16EditSession::UpdateLivePreview(), and yaze::editor::Tile16EditSession::UpdateTile8Palette().

| void yaze::gfx::Bitmap::SetPaletteWithTransparent | ( | const SnesPalette & | palette, |
| size_t | index, | ||
| int | length = 7 ) |
Set the palette with a transparent color.
Apply a sub-palette with automatic transparency for SNES rendering.
This method extracts a sub-palette from a larger palette and applies it to the SDL surface with proper SNES transparency handling.
SNES Transparency Model:
Usage:
Example: palette has colors [c0, c1, c2, c3, c4, c5, c6, c7, c8, ...] SetPaletteWithTransparent(palette, 0, 7) creates: [transparent_black, c0, c1, c2, c3, c4, c5, c6]
IMPORTANT: Source palette data is NOT modified
| palette | Source palette (can be 7, 8, 64, 128, or 256 colors) |
| index | Start index in source palette (0-based) |
| length | Number of colors to extract (default 7, max 7) |
Definition at line 524 of file bitmap.cc.
References yaze::platform::GetSurfacePalette(), InvalidatePaletteCache(), palette(), palette_, yaze::gfx::SnesPalette::size(), surface_, and vector().
Referenced by yaze::zelda3::anonymous_namespace{game_data.cc}::ApplyDefaultPalette(), ApplyPaletteByMetadata(), yaze::gui::CanvasUtils::ApplyPaletteGroup(), yaze::editor::Tile16EditSession::ApplyPaletteToCurrentTile16Bitmap(), yaze::gui::PaletteEditorWidget::ApplyROMPalette(), yaze::editor::PixelEditorPanel::DisplaySheet(), yaze::editor::Tile16EditSession::PreviewPaletteChange(), and yaze::editor::Tile16EditSession::UpdateLivePreview().
| void yaze::gfx::Bitmap::ApplyPaletteByMetadata | ( | const SnesPalette & | palette, |
| int | sub_palette_index = 0 ) |
Apply palette using metadata-driven strategy Chooses between SetPalette and SetPaletteWithTransparent based on metadata.
Apply palette using metadata-driven strategy.
Uses bitmap metadata to determine the appropriate palette application method:
This ensures correct rendering for different bitmap types:
| palette | Source palette to apply |
| sub_palette_index | Index within palette for sub-palette extraction (default 0) |
Definition at line 480 of file bitmap.cc.
References metadata_, palette(), yaze::gfx::Bitmap::BitmapMetadata::palette_format, SetPalette(), SetPaletteWithTransparent(), and vector().

| void yaze::gfx::Bitmap::ApplyStoredPalette | ( | ) |
Apply the stored palette to the surface (internal helper)
Apply the stored palette to the SDL surface.
This method applies the palette_ member to the SDL surface's palette.
IMPORTANT: Transparency handling
Color format notes:
Definition at line 321 of file bitmap.cc.
References yaze::gfx::SnesPalette::empty(), yaze::platform::GetSurfacePalette(), InvalidatePaletteCache(), IsIndexed(), palette_, yaze::gfx::SnesPalette::size(), surface_, and vector().
Referenced by Create(), and SetPalette().
| void yaze::gfx::Bitmap::UpdateSurfacePixels | ( | ) |
Update SDL surface with current pixel data from data_ vector Call this after modifying pixel data via mutable_data()
Definition at line 373 of file bitmap.cc.
References data_, height_, IsIndexed(), surface_, vector(), and width_.
Referenced by Bitmap(), yaze::zelda3::ObjectTileEditor::BuildTile8Atlas(), yaze::zelda3::RoomLayerManager::CompositeToOutput(), Create(), yaze::editor::Tile16Editor::DrawTile16EditorWorkbenchColumn(), operator=(), yaze::editor::internal::PublishSpritePreviewPixels(), yaze::zelda3::TitleScreen::RenderBG1Layer(), yaze::zelda3::TitleScreen::RenderBG2Layer(), yaze::zelda3::TitleScreen::RenderCompositeLayer(), yaze::zelda3::ObjectTileEditor::RenderLayoutToBitmap(), yaze::zelda3::OverworldMapScreen::RenderMapLayer(), and set_data().

Set the palette using SDL colors (direct surface palette access)
This method ONLY sets the SDL surface palette for rendering. It does NOT update the internal palette_ member (SnesPalette).
Use this method when:
| palette | Vector of SDL_Color values (256 colors for 8-bit indexed) |
Definition at line 603 of file bitmap.cc.
References yaze::platform::EnsureSurfacePalette256(), yaze::platform::GetSurfacePalette(), InvalidatePaletteCache(), IsIndexed(), modified_, palette(), yaze::gfx::SnesPalette::size(), surface_, and vector().
Write a value to a pixel at the given position.
Definition at line 649 of file bitmap.cc.
References active_, data_, IsIndexed(), modified_, pixel_data_, surface_, vector(), and width_.
Referenced by yaze::gfx::anonymous_namespace{tilemap.cc}::ComposeAndPlaceTilePart(), yaze::editor::OverworldEditor::UpdateScratchBitmapTile(), WriteColor(), and WriteToPixel().

Write a palette index to a pixel at the given x,y coordinates.
| x | X coordinate (0 to width-1) |
| y | Y coordinate (0 to height-1) |
| value | Palette index (0-255) |
Definition at line 265 of file bitmap.h.
References height_, vector(), width_, and WriteToPixel().

|
inline |
Get the palette index at the given x,y coordinates.
| x | X coordinate (0 to width-1) |
| y | Y coordinate (0 to height-1) |
Definition at line 277 of file bitmap.h.
References data_, height_, vector(), and width_.
Referenced by yaze::editor::PixelEditorPanel::DrawPixelInfoTooltip().

Write a color to a pixel at the given position.
Definition at line 705 of file bitmap.cc.
References IsIndexed(), yaze::platform::MapRGB(), surface_, vector(), and WriteToPixel().
Referenced by yaze::gui::Canvas::DrawTileOnBitmap().

Set a pixel at the given x,y coordinates with SNES color.
Set a pixel at the given coordinates with SNES color.
| x | X coordinate (0 to width-1) |
| y | Y coordinate (0 to height-1) |
| color | SNES color (15-bit RGB format) |
| x | X coordinate (0 to width-1) |
| y | Y coordinate (0 to height-1) |
| color | SNES color (15-bit RGB format) |
Performance Notes:
Optimizations Applied:
Definition at line 766 of file bitmap.cc.
References yaze::gfx::Bitmap::DirtyRegion::AddPoint(), data_, dirty_region_, FindColorIndex(), height_, IsIndexed(), modified_, pixel_data_, surface_, vector(), and width_.
Referenced by yaze::cli::Tile16ProposalGenerator::GenerateDiff(), yaze::zelda3::DungeonObjectEditor::RenderLayerVisualization(), and yaze::zelda3::DungeonObjectEditor::RenderSelectionHighlight().

| void yaze::gfx::Bitmap::Resize | ( | int | new_width, |
| int | new_height ) |
Resize the bitmap to new dimensions (preserves existing data)
| new_width | New width in pixels |
| new_height | New height in pixels |
Definition at line 798 of file bitmap.cc.
References active_, yaze::gfx::Arena::AllocateSurface(), data_, depth_, yaze::gfx::Arena::Get(), yaze::gfx::GetSnesPixelFormat(), height_, IsIndexed(), yaze::gfx::kIndexed, yaze::gfx::kRgba, modified_, pixel_data_, surface_, vector(), and width_.
| void yaze::gfx::Bitmap::InvalidatePaletteCache | ( | ) |
Invalidate the palette lookup cache (call when palette changes)
Performance Notes:
Definition at line 873 of file bitmap.cc.
References color_to_index_cache_, HashColor(), palette_, yaze::gfx::SnesPalette::size(), and vector().
Referenced by ApplyStoredPalette(), SetPalette(), and SetPaletteWithTransparent().

Find color index in palette using optimized hash map lookup.
| color | SNES color to find index for |
| color | SNES color to find index for |
Performance Notes:
Definition at line 894 of file bitmap.cc.
References color_to_index_cache_, HashColor(), yaze::gfx::SnesColor::rgb(), and vector().
Referenced by SetPixel().

| bool yaze::gfx::Bitmap::ValidateDataSurfaceSync | ( | ) |
Validate that bitmap data and surface pixels are synchronized.
Definition at line 916 of file bitmap.cc.
References data_, height_, IsIndexed(), surface_, vector(), and width_.

| void yaze::gfx::Bitmap::Get8x8Tile | ( | int | tile_index, |
| int | x, | ||
| int | y, | ||
| std::vector< uint8_t > & | tile_data, | ||
| int & | tile_data_offset ) |
Extract an 8x8 tile from the bitmap (SNES standard tile size)
| tile_index | Index of the tile in the tilesheet |
| x | X offset within the tile (0-7) |
| y | Y offset within the tile (0-7) |
| tile_data | Output buffer for tile pixel data (64 bytes for 8x8) |
| tile_data_offset | Current offset in tile_data buffer |
Definition at line 716 of file bitmap.cc.
References data_, height_, vector(), and width_.

| void yaze::gfx::Bitmap::Get16x16Tile | ( | int | tile_x, |
| int | tile_y, | ||
| std::vector< uint8_t > & | tile_data, | ||
| int & | tile_data_offset ) |
Extract a 16x16 tile from the bitmap (SNES metatile size)
| tile_x | X coordinate of tile in tilesheet |
| tile_y | Y coordinate of tile in tilesheet |
| tile_data | Output buffer for tile pixel data (256 bytes for 16x16) |
| tile_data_offset | Current offset in tile_data buffer |
Definition at line 732 of file bitmap.cc.
References data_, vector(), and width_.
Referenced by yaze::editor::ScreenEditor::DrawDungeonMapScreen(), and yaze::gfx::UpdateTile16().

|
inline |
Definition at line 393 of file bitmap.h.
References palette_.
Referenced by yaze::gfx::AtlasRenderer::AddBitmapWithBppOptimization(), yaze::editor::Tile16EditSession::AnalyzeTile8SourceData(), yaze::editor::Tile16EditSession::ApplyDefinitions(), ApplyPaletteByMetadata(), yaze::gui::PaletteEditorWidget::ApplyROMPalette(), Bitmap(), yaze::editor::Tile16EditSession::BuildStampPreview(), CopySurfaceState(), yaze::editor::Tile16EditSession::CopyTile16ToClipboard(), yaze::editor::PixelEditorPanel::DisplaySheet(), yaze::editor::ScreenEditor::DrawDungeonMapScreen(), yaze::editor::ScreenEditor::DrawDungeonMapsRoomGfx(), yaze::editor::Tile16Editor::DrawPaletteSettings(), yaze::editor::Tile16Editor::DrawTile16EditorWorkbenchColumn(), yaze::editor::Tile16EditSession::DrawToCurrentTile16Impl(), yaze::editor::Tile16EditSession::InitializeBitmaps(), yaze::editor::Tile16EditSession::PasteTile16FromClipboardImpl(), yaze::editor::GfxGroupEditor::PrepareSheetPreview(), ReadColor(), yaze::editor::ScreenEditor::RefreshTileCacheForReload(), yaze::gui::CanvasContextMenu::RenderPaletteOperationsMenu(), yaze::gfx::RenderTile(), yaze::gfx::RenderTile16(), yaze::gfx::RenderTilesBatch(), yaze::editor::Tile16EditSession::SaveTile16ToScratchSpace(), SetPalette(), SetPalette(), SetPaletteWithTransparent(), yaze::gui::Canvas::ShowBppAnalysis(), yaze::gui::Canvas::ShowBppConversionDialog(), yaze::gui::Canvas::ShowBppFormatSelector(), yaze::editor::SyncMapBrushPreview(), and yaze::editor::internal::SyncSheetPreview().
|
inline |
Definition at line 394 of file bitmap.h.
References palette_.
Referenced by yaze::gui::Canvas::DrawContextMenu(), yaze::editor::MessageEditor::Initialize(), yaze::gui::CanvasContextMenu::RenderPaletteOperationsMenu(), and yaze::gui::Canvas::ShowPaletteEditor().
|
inline |
Definition at line 395 of file bitmap.h.
References metadata_.
Referenced by yaze::zelda3::RoomLayerManager::CompositeToOutput(), yaze::zelda3::OverworldMapScreen::Create(), yaze::zelda3::TitleScreen::Create(), yaze::gfx::EnsureCompositeBitmapTextureQueued(), yaze::editor::internal::EnsureSheetTextureQueued(), yaze::editor::internal::EnsureSpritePreviewBitmapReady(), yaze::gui::anonymous_namespace{canvas_rendering.cc}::LogBitmapDropIfDebug(), yaze::gui::CanvasContextMenu::RenderPaletteOperationsMenu(), and yaze::editor::UsagePreviewView::ShowImage().
|
inline |
|
inline |
Definition at line 398 of file bitmap.h.
References width_.
Referenced by yaze::gfx::AtlasRenderer::AddBitmap(), yaze::gfx::AtlasRenderer::AddBitmapWithBppOptimization(), yaze::editor::Tile16EditSession::AnalyzeTile8SourceData(), Bitmap(), Bitmap(), yaze::app::service::RenderService::BitmapToRgba(), yaze::editor::Tile16EditSession::BuildStampMutations(), yaze::gui::BppComparisonTool::CalculateMetrics(), yaze::gfx::anonymous_namespace{tilemap.cc}::ComposeAndPlaceTilePart(), yaze::gfx::ComposeTile16(), yaze::zelda3::RoomLayerManager::CompositeToOutput(), yaze::zelda3::ComputeTile16Count(), yaze::gui::Canvas::ConvertBitmapFormat(), Create(), Create(), Create(), yaze::gfx::BackgroundBuffer::DrawBackground(), yaze::gui::Canvas::DrawBitmap(), yaze::gui::Canvas::DrawBitmap(), yaze::gui::Canvas::DrawBitmap(), yaze::gui::DrawBitmap(), yaze::editor::UsagePreviewView::DrawBitmapFit(), yaze::gui::Canvas::DrawBitmapGroup(), yaze::gui::DrawBitmapPreview(), yaze::gui::DrawBitmapViewer(), yaze::editor::TilePaintingManager::DrawBrushPreview(), yaze::editor::ScreenEditor::DrawDungeonMapScreen(), yaze::editor::ScreenEditor::DrawDungeonMapsRoomGfx(), yaze::gfx::BackgroundBuffer::DrawFloor(), yaze::editor::PixelEditorPanel::DrawPixelInfoTooltip(), yaze::editor::SheetBrowserPanel::DrawSheetThumbnail(), yaze::editor::Tile16Editor::DrawTile8SourcePanel(), yaze::editor::Tile16Editor::DrawTile8UsageOverlay(), yaze::editor::SpriteDrawer::DrawTile8x8(), yaze::editor::PixelEditorPanel::DrawTileHighlight(), yaze::gui::DrawTilemapPainter(), yaze::gui::CanvasInteractionHandler::DrawTilemapPainter(), yaze::gui::Canvas::DrawTileOnBitmap(), yaze::zelda3::ObjectDrawer::DrawTileToBitmap(), yaze::gfx::BackgroundBuffer::EnsureBitmapInitialized(), yaze::gui::BppComparisonTool::GenerateComparisons(), yaze::gui::Canvas::GetCurrentBppFormat(), yaze::gfx::GetTilemapData(), yaze::editor::Tile16Editor::HandleTile8SourceSelection(), yaze::editor::Tile16EditSession::LoadTile8(), yaze::gui::anonymous_namespace{canvas_rendering.cc}::LogBitmapDropIfDebug(), yaze::gfx::ModifyTile16(), yaze::gfx::AtlasRenderer::PackBitmap(), yaze::gfx::TextureAtlas::PackBitmap(), yaze::gui::TileSelectorWidget::Render(), yaze::editor::usage_preview::RoomUsagePreview::Render(), yaze::gui::CanvasModals::RenderAdvancedPropertiesModal(), yaze::gui::BppFormatUI::RenderAnalysisPanel(), yaze::gui::RenderBitmapGroup(), yaze::gui::RenderBitmapOnCanvas(), yaze::gui::RenderBitmapOnCanvas(), yaze::gui::RenderBitmapOnCanvas(), yaze::gui::CanvasContextMenu::RenderBitmapOperationsMenu(), yaze::gui::BppFormatUI::RenderConversionPreview(), yaze::gui::BppFormatUI::RenderFormatSelector(), yaze::zelda3::DungeonObjectEditor::RenderLayerVisualization(), yaze::gui::RenderPreviewPanel(), yaze::gui::CanvasModals::RenderScalingControlsModal(), yaze::zelda3::DungeonObjectEditor::RenderSelectionHighlight(), yaze::gfx::RenderTile16(), yaze::zelda3::PaletteDebugger::SamplePixelAt(), yaze::gui::Canvas::SetZoomToFit(), yaze::gui::Canvas::ShowAdvancedCanvasProperties(), yaze::gui::PaletteEditorWidget::ShowColorAnalysis(), yaze::editor::UsagePreviewView::ShowImage(), yaze::gui::Canvas::ShowScalingControls(), yaze::editor::usage_preview::SnapshotBitmap(), yaze::editor::anonymous_namespace{map_refresh_coordinator.cc}::SyncCurrentGraphicsBitmapForTile16Editor(), yaze::zelda3::anonymous_namespace{object_drawer.cc}::SyncModifiedBitmapToSurface(), yaze::editor::internal::SyncSheetPreview(), yaze::gui::TableCanvasPipeline(), yaze::gui::DungeonObjectEmulatorPreview::TriggerStaticRender(), yaze::gfx::AtlasRenderer::UpdateBitmap(), yaze::editor::MapRefreshCoordinator::UpdateBlocksetWithPendingTileChanges(), yaze::gui::BppConversionDialog::UpdatePreview(), yaze::editor::OverworldEditor::UpdateScratchBitmapTile(), and yaze::gfx::UpdateTile16().
|
inline |
Definition at line 399 of file bitmap.h.
References height_.
Referenced by yaze::gfx::AtlasRenderer::AddBitmap(), yaze::gfx::AtlasRenderer::AddBitmapWithBppOptimization(), yaze::editor::Tile16EditSession::AnalyzeTile8SourceData(), Bitmap(), Bitmap(), yaze::app::service::RenderService::BitmapToRgba(), yaze::gui::BppComparisonTool::CalculateMetrics(), yaze::zelda3::RoomLayerManager::CompositeToOutput(), yaze::zelda3::ComputeTile16Count(), yaze::gui::Canvas::ConvertBitmapFormat(), Create(), Create(), Create(), yaze::gui::Canvas::DrawBitmap(), yaze::gui::Canvas::DrawBitmap(), yaze::gui::Canvas::DrawBitmap(), yaze::gui::DrawBitmap(), yaze::editor::UsagePreviewView::DrawBitmapFit(), yaze::gui::Canvas::DrawBitmapGroup(), yaze::gui::DrawBitmapPreview(), yaze::gui::DrawBitmapViewer(), yaze::editor::ScreenEditor::DrawDungeonMapScreen(), yaze::editor::ScreenEditor::DrawDungeonMapsRoomGfx(), yaze::gfx::BackgroundBuffer::DrawFloor(), yaze::editor::PixelEditorPanel::DrawPixelInfoTooltip(), yaze::editor::SheetBrowserPanel::DrawSheetThumbnail(), yaze::editor::Tile16Editor::DrawTile8SourcePanel(), yaze::editor::SpriteDrawer::DrawTile8x8(), yaze::gui::DrawTilemapPainter(), yaze::gui::CanvasInteractionHandler::DrawTilemapPainter(), yaze::zelda3::ObjectDrawer::DrawTileToBitmap(), yaze::gui::BppComparisonTool::GenerateComparisons(), yaze::gui::Canvas::GetCurrentBppFormat(), yaze::gfx::GetTilemapData(), yaze::editor::Tile16EditSession::LoadTile8(), yaze::gui::anonymous_namespace{canvas_rendering.cc}::LogBitmapDropIfDebug(), yaze::gfx::AtlasRenderer::PackBitmap(), yaze::gfx::TextureAtlas::PackBitmap(), yaze::gui::TileSelectorWidget::Render(), yaze::gui::CanvasModals::RenderAdvancedPropertiesModal(), yaze::gui::BppFormatUI::RenderAnalysisPanel(), yaze::gui::RenderBitmapGroup(), yaze::gui::RenderBitmapOnCanvas(), yaze::gui::RenderBitmapOnCanvas(), yaze::gui::RenderBitmapOnCanvas(), yaze::gui::CanvasContextMenu::RenderBitmapOperationsMenu(), yaze::gui::BppFormatUI::RenderConversionPreview(), yaze::gui::BppFormatUI::RenderFormatSelector(), yaze::zelda3::DungeonObjectEditor::RenderLayerVisualization(), yaze::gui::RenderPreviewPanel(), yaze::gui::CanvasModals::RenderScalingControlsModal(), yaze::zelda3::DungeonObjectEditor::RenderSelectionHighlight(), yaze::gfx::RenderTile16(), yaze::zelda3::PaletteDebugger::SamplePixelAt(), yaze::gui::Canvas::SetZoomToFit(), yaze::gui::Canvas::ShowAdvancedCanvasProperties(), yaze::gui::PaletteEditorWidget::ShowColorAnalysis(), yaze::editor::UsagePreviewView::ShowImage(), yaze::gui::Canvas::ShowScalingControls(), yaze::editor::usage_preview::SnapshotBitmap(), yaze::editor::anonymous_namespace{map_refresh_coordinator.cc}::SyncCurrentGraphicsBitmapForTile16Editor(), yaze::zelda3::anonymous_namespace{object_drawer.cc}::SyncModifiedBitmapToSurface(), yaze::editor::internal::SyncSheetPreview(), yaze::gui::TableCanvasPipeline(), yaze::gfx::AtlasRenderer::UpdateBitmap(), yaze::editor::MapRefreshCoordinator::UpdateBlocksetWithPendingTileChanges(), yaze::gui::BppConversionDialog::UpdatePreview(), and yaze::editor::OverworldEditor::UpdateScratchBitmapTile().
|
inline |
Definition at line 400 of file bitmap.h.
References depth_.
Referenced by yaze::gfx::AtlasRenderer::AddBitmapWithBppOptimization(), yaze::editor::Tile16EditSession::AnalyzeTile8SourceData(), Bitmap(), Bitmap(), yaze::zelda3::RoomLayerManager::CompositeToOutput(), Create(), Create(), Create(), yaze::editor::SheetBrowserPanel::DrawSheetThumbnail(), yaze::gui::BppComparisonTool::GenerateComparisons(), yaze::gui::BppFormatUI::RenderConversionPreview(), yaze::editor::UsagePreviewView::ShowImage(), yaze::editor::anonymous_namespace{map_refresh_coordinator.cc}::SyncCurrentGraphicsBitmapForTile16Editor(), yaze::zelda3::anonymous_namespace{object_drawer.cc}::SyncModifiedBitmapToSurface(), yaze::editor::internal::SyncSheetPreview(), and yaze::gui::BppConversionDialog::UpdatePreview().
|
inline |
Definition at line 401 of file bitmap.h.
References depth_.
Referenced by yaze::gui::Canvas::ApplyROMPalette(), ApplyStoredPalette(), yaze::gui::Canvas::ConvertBitmapFormat(), Create(), ReadColor(), Resize(), yaze::zelda3::PaletteDebugger::SamplePixelAt(), SetPalette(), SetPixel(), yaze::gui::Canvas::ShowBppAnalysis(), yaze::gui::Canvas::ShowBppConversionDialog(), yaze::gui::Canvas::ShowBppFormatSelector(), yaze::gui::Canvas::ShowColorAnalysis(), yaze::gui::Canvas::ShowPaletteEditor(), yaze::editor::usage_preview::SnapshotBitmap(), UpdateSurfacePixels(), ValidateDataSurfaceSync(), WriteColor(), and WriteToPixel().
| SDL_Color yaze::gfx::Bitmap::ReadColor | ( | int | x, |
| int | y ) const |
Definition at line 414 of file bitmap.cc.
References data_, yaze::platform::GetSurfacePalette(), height_, IsIndexed(), palette(), surface_, vector(), and width_.
Referenced by yaze::app::service::RenderService::BitmapToRgba(), yaze::zelda3::PaletteDebugger::SamplePixelAt(), and ToRgba().

| std::vector< uint8_t > yaze::gfx::Bitmap::ToRgba | ( | ) | const |
Definition at line 435 of file bitmap.cc.
References height_, ReadColor(), and width_.

|
inline |
Definition at line 406 of file bitmap.h.
References data_.
Referenced by yaze::editor::Tile16EditSession::AnalyzeTile8SourceData(), yaze::editor::Tile16EditSession::BitmapHasEncodedPaletteRows(), yaze::zelda3::BlitTile16BitmapToAtlas(), yaze::editor::ScreenEditor::DrawDungeonMapsRoomGfx(), yaze::editor::Tile16EditSession::LoadTile8(), yaze::zelda3::RenderTile16PixelsFromMetadata(), yaze::zelda3::PaletteDebugger::SamplePixelAt(), and yaze::zelda3::anonymous_namespace{object_drawer.cc}::SyncModifiedBitmapToSurface().
Definition at line 407 of file bitmap.h.
References data_.
Referenced by yaze::editor::Tile16EditSession::AnalyzeTile8SourceData(), Bitmap(), Bitmap(), yaze::editor::Tile16EditSession::BitmapHasEncodedPaletteRows(), yaze::zelda3::BlitTile16BitmapToAtlas(), Create(), Create(), Create(), yaze::editor::ScreenEditor::DrawDungeonMapsRoomGfx(), yaze::editor::Tile16EditSession::LoadTile8(), yaze::editor::ObjectTileEditorPanel::RenderObjectPreview(), yaze::zelda3::RenderTile16PixelsFromMetadata(), yaze::editor::ObjectTileEditorPanel::RenderTile8Atlas(), yaze::zelda3::PaletteDebugger::SamplePixelAt(), set_data(), and yaze::zelda3::anonymous_namespace{object_drawer.cc}::SyncModifiedBitmapToSurface().
|
inline |
Definition at line 408 of file bitmap.h.
References data_.
Referenced by yaze::zelda3::TitleScreen::BuildTileset(), yaze::editor::SpriteDrawer::ClearBitmap(), yaze::editor::OverworldEditor::ClearScratchSpace(), yaze::zelda3::RoomLayerManager::CompositeToOutput(), yaze::gfx::BackgroundBuffer::DrawBackground(), yaze::editor::Tile16Editor::DrawTile16EditorWorkbenchColumn(), yaze::editor::SpriteDrawer::DrawTile8x8(), yaze::zelda3::ObjectDrawer::DrawTileToBitmap(), yaze::zelda3::TitleScreen::RenderBG1Layer(), yaze::zelda3::TitleScreen::RenderBG2Layer(), yaze::zelda3::TitleScreen::RenderCompositeLayer(), yaze::zelda3::OverworldMapScreen::RenderMapLayer(), yaze::gui::DungeonObjectEmulatorPreview::TriggerStaticRender(), and yaze::editor::MapRefreshCoordinator::UpdateBlocksetWithPendingTileChanges().
|
inline |
Definition at line 409 of file bitmap.h.
References surface_.
Referenced by yaze::editor::anonymous_namespace{tile_object_handler.cc}::ApplyRoomPaletteToGhost(), yaze::app::service::RenderService::BitmapToRgba(), yaze::zelda3::ObjectTileEditor::BuildTile8Atlas(), yaze::zelda3::RoomLayerManager::CompositeToOutput(), yaze::gfx::CreateTilemap(), DetachSurfaceForArena(), yaze::gfx::BackgroundBuffer::DrawBackground(), yaze::gui::DrawBitmap(), yaze::gui::DrawBitmapPreview(), yaze::gfx::BackgroundBuffer::EnsureBitmapInitialized(), yaze::gfx::EnsureCompositeBitmapTextureQueued(), yaze::editor::internal::EnsureSheetTextureQueued(), yaze::editor::internal::EnsureSpritePreviewBitmapReady(), yaze::editor::OverworldEditor::LoadGraphics(), yaze::editor::GfxGroupEditor::PrepareSheetPreview(), yaze::gui::CanvasContextMenu::RenderBitmapOperationsMenu(), yaze::zelda3::ObjectTileEditor::RenderLayoutToBitmap(), yaze::gui::RenderPreviewPanel(), yaze::gfx::RenderTilesBatch(), yaze::zelda3::PaletteDebugger::SamplePixelAt(), yaze::editor::usage_preview::SnapshotBitmap(), yaze::zelda3::anonymous_namespace{object_drawer.cc}::SyncModifiedBitmapToSurface(), yaze::editor::internal::SyncSheetPreview(), yaze::gfx::MetalRenderer::UpdateTexture(), yaze::gfx::SDL2Renderer::UpdateTexture(), and yaze::gfx::UpdateTilemap().
|
inline |
Definition at line 410 of file bitmap.h.
References texture_.
Referenced by yaze::gfx::AtlasRenderer::AddBitmap(), yaze::gfx::AtlasRenderer::AddBitmapWithBppOptimization(), yaze::editor::OverworldEditor::AreaScreenBitmap(), DetachTextureForArena(), yaze::editor::PixelEditorPanel::DisplaySheet(), yaze::gui::DrawBitmap(), yaze::editor::UsagePreviewView::DrawBitmapFit(), yaze::gui::Canvas::DrawBitmapGroup(), yaze::gui::DrawBitmapPreview(), yaze::gui::DrawBitmapViewer(), yaze::editor::DungeonCanvasViewer::DrawConnectedRoomMatrix(), yaze::editor::DungeonCanvasViewer::DrawRoomBackgroundLayers(), yaze::editor::ObjectTileEditorPanel::DrawSourceSheet(), yaze::editor::Tile16Editor::DrawTile16EditorWorkbenchColumn(), yaze::editor::ObjectTileEditorPanel::DrawTileGrid(), yaze::gui::DrawTilemapPainter(), yaze::gui::CanvasInteractionHandler::DrawTilemapPainter(), yaze::gui::Canvas::DrawTilePainter(), yaze::gui::CanvasInteractionHandler::DrawTilePainter(), yaze::gfx::EnsureCompositeBitmapTextureQueued(), yaze::editor::MessageEditor::EnsureFontTexturesReady(), yaze::editor::internal::EnsureSheetTextureQueued(), yaze::gfx::Arena::GetSheetWithCache(), yaze::gui::HandleTilePaintWithPreview(), yaze::editor::GfxGroupEditor::PrepareSheetPreview(), yaze::editor::anonymous_namespace{usage_preview_view.cc}::QueueTexture(), yaze::editor::MapRefreshCoordinator::RefreshTile16Blockset(), yaze::gui::TileSelectorWidget::Render(), yaze::gui::RenderBitmapGroup(), yaze::gui::RenderBitmapOnCanvas(), yaze::gui::RenderBitmapOnCanvas(), yaze::gui::RenderBitmapOnCanvas(), yaze::gui::BppComparisonTool::RenderComparisonGrid(), yaze::gui::BppFormatUI::RenderConversionPreview(), yaze::editor::ObjectTileEditorPanel::RenderObjectPreview(), yaze::gui::BppConversionDialog::RenderPreview(), yaze::gui::RenderPreviewPanel(), yaze::editor::ObjectTileEditorPanel::RenderTile8Atlas(), yaze::gfx::RenderTilesBatch(), yaze::gfx::Arena::RetireBitmap(), set_texture(), yaze::editor::anonymous_namespace{map_refresh_coordinator.cc}::SyncCurrentGraphicsBitmapForTile16Editor(), yaze::editor::SyncMapBrushPreview(), yaze::editor::internal::SyncSheetPreview(), yaze::gfx::AtlasRenderer::UpdateBitmap(), yaze::editor::MapRefreshCoordinator::UpdateBlocksetWithPendingTileChanges(), yaze::gfx::UpdateTile16(), and yaze::gfx::UpdateTilemap().
|
inline |
Definition at line 411 of file bitmap.h.
References data_.
Referenced by yaze::gfx::AtlasRenderer::AddBitmap(), yaze::gfx::AtlasRenderer::AddBitmapWithBppOptimization(), ApplyPaletteByMetadata(), ApplyStoredPalette(), yaze::gui::Canvas::ConvertBitmapFormat(), CopySurfaceState(), yaze::editor::Tile16EditSession::CopyTile16ToClipboard(), Create(), DetachSurfaceForArena(), yaze::editor::PixelEditorPanel::DisplaySheet(), yaze::editor::SpriteEditor::DrawSpriteCanvas(), yaze::editor::Tile16EditSession::DrawToCurrentTile16Impl(), FindColorIndex(), yaze::gui::BppComparisonTool::GenerateComparisons(), Get16x16Tile(), Get8x8Tile(), yaze::gui::Canvas::GetCurrentBppFormat(), GetPixel(), yaze::gfx::GetTilemapData(), HashColor(), InvalidatePaletteCache(), yaze::editor::Tile16EditSession::PasteTile16FromClipboardImpl(), yaze::editor::GfxGroupEditor::PrepareSheetPreview(), yaze::editor::Tile16EditSession::PreviewPaletteChange(), ReadColor(), Reformat(), yaze::gui::BppFormatUI::RenderAnalysisPanel(), yaze::zelda3::TitleScreen::RenderBG1Layer(), yaze::zelda3::TitleScreen::RenderBG2Layer(), yaze::editor::sprite_graphics_context::RenderCapturedFrame(), yaze::zelda3::TitleScreen::RenderCompositeLayer(), yaze::gui::BppFormatUI::RenderConversionPreview(), yaze::gui::BppFormatUI::RenderFormatSelector(), yaze::editor::usage_preview::SpriteUsagePreview::RenderFrame(), yaze::zelda3::OverworldMapScreen::RenderMapLayer(), yaze::gfx::RenderTile(), yaze::gfx::RenderTile16(), Resize(), yaze::editor::Tile16EditSession::SaveTile16ToScratchSpace(), set_data(), SetPalette(), SetPaletteWithTransparent(), SetPixel(), yaze::gui::PaletteEditorWidget::ShowColorAnalysis(), yaze::editor::usage_preview::SnapshotBitmap(), yaze::editor::SyncMapBrushPreview(), yaze::editor::internal::SyncSheetPreview(), yaze::editor::MapRefreshCoordinator::UpdateBlocksetWithPendingTileChanges(), yaze::editor::Tile16EditSession::UpdateLivePreview(), yaze::gui::BppConversionDialog::UpdatePreview(), UpdateSurfacePixels(), ValidateDataSurfaceSync(), WriteColor(), WriteToPixel(), and WriteToPixel().
|
inline |
Definition at line 412 of file bitmap.h.
References data_.
Referenced by yaze::editor::OverworldEditor::map_bitmap(), and yaze::editor::TilePaintingManager::map_brush_preview().
|
inline |
Definition at line 413 of file bitmap.h.
References modified_.
Referenced by yaze::editor::Tile16EditSession::CommitChangesToBlockset(), yaze::gfx::EnsureCompositeBitmapTextureQueued(), set_modified(), and yaze::zelda3::anonymous_namespace{object_drawer.cc}::SyncModifiedBitmapToSurface().
|
inline |
Definition at line 414 of file bitmap.h.
References active_.
Referenced by yaze::gfx::AtlasRenderer::AddBitmap(), yaze::gfx::AtlasRenderer::AddBitmapWithBppOptimization(), yaze::editor::Tile16EditSession::ApplyDefinitions(), yaze::editor::MessageEditor::ApplyFontPalette(), yaze::editor::Tile16EditSession::ApplyPaletteToCurrentTile16Bitmap(), yaze::editor::OverworldEditor::AreaScreenBitmap(), yaze::editor::Tile16EditSession::BitmapHasEncodedPaletteRows(), yaze::zelda3::BlitTile16BitmapToAtlas(), yaze::editor::Tile16EditSession::BuildStampMutations(), yaze::editor::CanvasNavigationManager::CheckForCurrentMap(), yaze::editor::SpriteDrawer::ClearBitmap(), yaze::editor::OverworldEditor::ClearScratchSpace(), yaze::editor::Tile16EditSession::ClearTile16Impl(), yaze::zelda3::ComputeTile16Count(), yaze::editor::Tile16EditSession::CopyTile16ToAtlas(), yaze::editor::Tile16EditSession::CopyTile16ToClipboard(), yaze::editor::Tile16EditSession::CopyTileBitmapToBlockset(), yaze::gfx::CreateTilemap(), yaze::editor::PixelEditorPanel::DisplaySheet(), yaze::gfx::BackgroundBuffer::DrawBackground(), yaze::gui::Canvas::DrawBitmap(), yaze::gui::Canvas::DrawBitmap(), yaze::gui::Canvas::DrawBitmap(), yaze::editor::UsagePreviewView::DrawBitmapFit(), yaze::gui::Canvas::DrawBitmapGroup(), yaze::gfx::BackgroundBuffer::DrawFloor(), yaze::editor::MenuTilemapEditorUI::DrawMainCanvas(), yaze::editor::SpriteDrawer::DrawOamTile(), yaze::editor::OverworldEditor::DrawScratchSpace(), yaze::editor::SheetBrowserPanel::DrawSheetThumbnail(), yaze::editor::ObjectTileEditorPanel::DrawSourceSheet(), yaze::editor::SpriteEditor::DrawSpriteCanvas(), yaze::editor::Tile16Editor::DrawTile16EditorWorkbenchColumn(), yaze::editor::OverworldCanvasRenderer::DrawTile16Selector(), yaze::editor::Tile16Editor::DrawTile8SourcePanel(), yaze::editor::ObjectTileEditorPanel::DrawTileGrid(), yaze::gui::DrawTilemapPainter(), yaze::gui::CanvasInteractionHandler::DrawTilemapPainter(), yaze::gui::Canvas::DrawTilePainter(), yaze::gui::CanvasInteractionHandler::DrawTilePainter(), yaze::editor::MenuTilemapEditorUI::DrawTilePicker(), yaze::zelda3::ObjectDrawer::DrawTileToBitmap(), yaze::editor::Tile16EditSession::DrawToCurrentTile16Impl(), yaze::gfx::BackgroundBuffer::EnsureBitmapInitialized(), yaze::gfx::EnsureCompositeBitmapTextureQueued(), yaze::editor::MessageEditor::EnsureFontTexturesReady(), yaze::editor::internal::EnsureSheetTextureQueued(), yaze::editor::internal::EnsureSpritePreviewBitmapReady(), yaze::editor::Tile16EditSession::FlipTile16HorizontalImpl(), yaze::editor::Tile16EditSession::FlipTile16VerticalImpl(), yaze::gfx::GetTilemapData(), yaze::gui::HandleTilePaintWithPreview(), yaze::editor::Tile16EditSession::HasCurrentGfxBitmap(), yaze::editor::Tile16EditSession::HasTile16BlocksetBitmap(), yaze::editor::OverworldEditor::LoadGraphics(), yaze::gui::anonymous_namespace{canvas_rendering.cc}::LogBitmapDropIfDebug(), yaze::gfx::TextureAtlas::PackBitmap(), yaze::editor::Tile16EditSession::PasteTile16FromClipboardImpl(), yaze::editor::Tile16EditSession::PreviewPaletteChange(), yaze::editor::MenuTilemapEditorUI::RebuildRenderTextures(), yaze::editor::Tile16EditSession::RefreshAllPalettes(), yaze::editor::MapRefreshCoordinator::RefreshTile16Blockset(), yaze::gui::TileSelectorWidget::Render(), yaze::editor::usage_preview::RoomUsagePreview::Render(), yaze::gui::RenderBitmapGroup(), yaze::gui::RenderBitmapOnCanvas(), yaze::gui::RenderBitmapOnCanvas(), yaze::gui::RenderBitmapOnCanvas(), yaze::gfx::RenderTile(), yaze::gfx::RenderTile16(), yaze::zelda3::RenderTile16PixelsFromMetadata(), yaze::gfx::RenderTilesBatch(), yaze::editor::SpriteEditor::RenderZSpriteFrame(), yaze::editor::Tile16EditSession::RotateTile16Impl(), yaze::editor::Tile16EditSession::SaveTile16ToROM(), yaze::editor::Tile16EditSession::SaveTile16ToScratchSpace(), yaze::editor::Tile16EditSession::set_palette(), yaze::gui::Canvas::SetZoomToFit(), yaze::gui::PaletteEditorWidget::ShowColorAnalysis(), yaze::editor::UsagePreviewView::ShowImage(), yaze::editor::usage_preview::SnapshotBitmap(), yaze::editor::anonymous_namespace{map_refresh_coordinator.cc}::SyncCurrentGraphicsBitmapForTile16Editor(), yaze::editor::SyncMapBrushPreview(), yaze::gui::TableCanvasPipeline(), yaze::editor::TilePaintingManager::Tile16PixelsForMap(), yaze::editor::Tile16EditSession::UpdateBlocksetBitmap(), yaze::editor::MapRefreshCoordinator::UpdateBlocksetWithPendingTileChanges(), yaze::editor::Tile16EditSession::UpdateLivePreview(), yaze::gfx::UpdateTile16(), and yaze::gfx::UpdateTilemap().
|
inline |
Definition at line 415 of file bitmap.h.
References generation_.
Referenced by yaze::gfx::Arena::HasPendingTextureCommand(), and yaze::gfx::Arena::QueueTextureCommand().
Definition at line 416 of file bitmap.h.
References active_.
Referenced by yaze::zelda3::OverworldMapScreen::Create(), yaze::gfx::EnsureCompositeBitmapTextureQueued(), yaze::editor::internal::EnsureSheetTextureQueued(), and yaze::zelda3::TitleScreen::LoadTitleScreen().
Definition at line 901 of file bitmap.cc.
References data(), data_, modified_, pixel_data_, UpdateSurfacePixels(), and vector().
Referenced by yaze::gui::Canvas::ConvertBitmapFormat(), yaze::editor::PixelEditorPanel::DisplaySheet(), yaze::editor::ScreenEditor::DrawDungeonMapScreen(), yaze::editor::UsagePreviewView::ShowImage(), yaze::editor::anonymous_namespace{map_refresh_coordinator.cc}::SyncCurrentGraphicsBitmapForTile16Editor(), yaze::gfx::UpdateTile16(), and yaze::gfx::UpdateTilemap().

Definition at line 418 of file bitmap.h.
References modified(), and modified_.
Referenced by yaze::gui::CanvasUtils::ApplyPaletteGroup(), yaze::editor::Tile16EditSession::ApplyPaletteToCurrentTile16Bitmap(), yaze::editor::OverworldEditor::ClearScratchSpace(), yaze::zelda3::RoomLayerManager::CompositeToOutput(), yaze::editor::Tile16EditSession::CopyTile16ToAtlas(), yaze::editor::Tile16EditSession::CopyTileBitmapToBlockset(), yaze::zelda3::ObjectDrawer::DrawTileToBitmap(), yaze::editor::Tile16EditSession::DrawToCurrentTile16Impl(), yaze::gfx::EnsureCompositeBitmapTextureQueued(), yaze::editor::Tile16EditSession::RefreshAllPalettes(), yaze::editor::Tile16EditSession::RefreshTile16Blockset(), yaze::editor::MapRefreshCoordinator::UpdateBlocksetWithPendingTileChanges(), yaze::editor::OverworldEditor::UpdateScratchBitmapTile(), and yaze::editor::Tile16EditSession::UpdateTile8Palette().

|
inline |
Definition at line 391 of file bitmap.cc.
References yaze::platform::GetSurfacePalette(), palette(), SetPalette(), surface_, and vector().
Referenced by Bitmap(), and operator=().

|
inlineprivatenoexcept |
|
inlineprivatenoexcept |
Definition at line 433 of file bitmap.h.
References texture(), and texture_.
Referenced by yaze::gfx::Arena::RetireBitmap().

|
inlineprivatenoexcept |
Definition at line 438 of file bitmap.h.
References active_, generation_, modified_, next_generation_, and texture_pixels.
Referenced by yaze::gfx::Arena::RetireBitmap().
Hash a color for cache lookup.
| color | ImVec4 color to hash |
| color | ImVec4 color to hash |
Performance Notes:
Definition at line 852 of file bitmap.cc.
References vector().
Referenced by FindColorIndex(), and InvalidatePaletteCache().

|
private |
Definition at line 444 of file bitmap.h.
Referenced by Bitmap(), Create(), Get16x16Tile(), Get8x8Tile(), GetPixel(), operator=(), ReadColor(), Reformat(), Resize(), SetPixel(), ToRgba(), UpdateSurfacePixels(), ValidateDataSurfaceSync(), width(), WriteToPixel(), and WriteToPixel().
|
private |
Definition at line 445 of file bitmap.h.
Referenced by Bitmap(), Create(), Get8x8Tile(), GetPixel(), height(), operator=(), ReadColor(), Reformat(), Resize(), SetPixel(), ToRgba(), UpdateSurfacePixels(), ValidateDataSurfaceSync(), and WriteToPixel().
|
private |
Definition at line 446 of file bitmap.h.
Referenced by Bitmap(), Create(), depth(), IsIndexed(), operator=(), Reformat(), and Resize().
Definition at line 448 of file bitmap.h.
Referenced by Bitmap(), Create(), is_active(), MarkRetiredByArena(), operator=(), Reformat(), Resize(), set_active(), and WriteToPixel().
Definition at line 449 of file bitmap.h.
Referenced by Fill(), MarkRetiredByArena(), modified(), operator=(), Resize(), set_data(), set_modified(), SetPalette(), SetPalette(), SetPixel(), and WriteToPixel().
|
private |
Definition at line 453 of file bitmap.h.
Referenced by Create(), generation(), MarkRetiredByArena(), and operator=().
|
inlinestaticprivate |
Definition at line 454 of file bitmap.h.
Referenced by Create(), MarkRetiredByArena(), and operator=().
Definition at line 457 of file bitmap.h.
Referenced by MarkRetiredByArena().
Definition at line 460 of file bitmap.h.
Referenced by Bitmap(), Create(), operator=(), Reformat(), Resize(), set_data(), SetPixel(), and WriteToPixel().
|
private |
Internal SNES palette storage (may be empty!)
This stores the palette in SNES 15-bit RGB format for serialization and palette editing. It is populated by SetPalette(SnesPalette) but NOT by SetPalette(vector<SDL_Color>).
Definition at line 476 of file bitmap.h.
Referenced by ApplyStoredPalette(), Create(), InvalidatePaletteCache(), mutable_palette(), operator=(), palette(), Reformat(), SetPalette(), and SetPaletteWithTransparent().
|
private |
Definition at line 479 of file bitmap.h.
Referenced by ApplyPaletteByMetadata(), metadata(), metadata(), and operator=().
|
private |
Definition at line 482 of file bitmap.h.
Referenced by at(), Bitmap(), Create(), Create(), data(), Fill(), Get16x16Tile(), Get8x8Tile(), GetPixel(), mutable_data(), operator=(), ReadColor(), Reformat(), Resize(), set_data(), SetPixel(), size(), UpdateSurfacePixels(), ValidateDataSurfaceSync(), vector(), and WriteToPixel().
|
private |
SDL surface for rendering (contains the authoritative palette)
For 8-bit indexed bitmaps, the surface contains:
The SDL palette (surface_->format->palette) is the authoritative source for color data when rendering. When SDL converts indexed pixels to RGBA for texture creation, it uses this palette.
Definition at line 507 of file bitmap.h.
Referenced by ApplyStoredPalette(), Bitmap(), CopySurfaceState(), Create(), DetachSurfaceForArena(), operator=(), ReadColor(), Reformat(), Resize(), SetPalette(), SetPaletteWithTransparent(), SetPixel(), surface(), UpdateSurfacePixels(), ValidateDataSurfaceSync(), WriteColor(), and WriteToPixel().
|
private |
Definition at line 510 of file bitmap.h.
Referenced by DetachTextureForArena(), operator=(), set_texture(), and texture().
Definition at line 513 of file bitmap.h.
Referenced by FindColorIndex(), and InvalidatePaletteCache().
|
private |
Referenced by SetPixel().