/* * Copyright (c) 2023-2024, Aliaksandr Kalenik * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include #include #include #include #include #include class SkImage; namespace Gfx { struct ImmutableBitmapImpl; class ImmutableBitmap final : public RefCounted { public: static NonnullRefPtr create(NonnullRefPtr bitmap); 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); }; }