/* * Copyright (c) 2022, Sam Atkins * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include #include #include #include namespace Cards { class CardPainter { public: static CardPainter& the(); NonnullRefPtr card_front(Suit, Rank); NonnullRefPtr card_back(); NonnullRefPtr card_front_inverted(Suit, Rank); NonnullRefPtr card_back_inverted(); NonnullRefPtr card_front_highlighted(Suit, Rank); void set_background_image_path(DeprecatedString path); void set_background_color(Color); private: CardPainter(); NonnullRefPtr create_card_bitmap(); void paint_card_front(Gfx::Bitmap&, Suit, Rank); void paint_card_back(Gfx::Bitmap&); void paint_inverted_card(Gfx::Bitmap& bitmap, Gfx::Bitmap const& source_to_invert); void paint_highlighted_card(Gfx::Bitmap& bitmap, Gfx::Bitmap const& source_to_highlight); Array, to_underlying(Rank::__Count)>, to_underlying(Suit::__Count)> m_cards; Array, to_underlying(Rank::__Count)>, to_underlying(Suit::__Count)> m_cards_inverted; Array, to_underlying(Rank::__Count)>, to_underlying(Suit::__Count)> m_cards_highlighted; RefPtr m_card_back; RefPtr m_card_back_inverted; DeprecatedString m_background_image_path; Color m_background_color; }; }