/* * Copyright (c) 2023-2025, Aliaksandr Kalenik * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include #include #include #include #include #include #include class SkImage; namespace Gfx { struct ImmutableBitmapImpl; class ImmutableBitmap final : public AtomicRefCounted { public: static NonnullRefPtr create(NonnullRefPtr bitmap, ColorSpace color_space = {}); static NonnullRefPtr create(NonnullRefPtr bitmap, AlphaType, ColorSpace color_space = {}); static NonnullRefPtr create_snapshot_from_painting_surface(NonnullRefPtr); ~ImmutableBitmap(); int width() const; int height() const; IntRect rect() const; IntSize size() const; Gfx::AlphaType alpha_type() const; SkImage const* sk_image() const; Color get_pixel(int x, int y) const; RefPtr bitmap() const; private: NonnullOwnPtr m_impl; explicit ImmutableBitmap(NonnullOwnPtr bitmap); }; }