1234567891011121314151617181920212223242526272829303132333435363738 |
- /*
- * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
- *
- * SPDX-License-Identifier: BSD-2-Clause
- */
- #pragma once
- #include <AK/MemoryStream.h>
- #include <LibGfx/Bitmap.h>
- #include <LibGfx/ImageFormats/ImageDecoder.h>
- namespace Gfx {
- struct GIFLoadingContext;
- class GIFImageDecoderPlugin final : public ImageDecoderPlugin {
- public:
- static bool sniff(ReadonlyBytes);
- static ErrorOr<NonnullOwnPtr<ImageDecoderPlugin>> create(ReadonlyBytes);
- virtual ~GIFImageDecoderPlugin() override;
- virtual IntSize size() override;
- virtual bool is_animated() override;
- virtual size_t loop_count() override;
- virtual size_t frame_count() override;
- virtual size_t first_animated_frame_index() override;
- virtual ErrorOr<ImageFrameDescriptor> frame(size_t index, Optional<IntSize> ideal_size = {}) override;
- private:
- GIFImageDecoderPlugin(FixedMemoryStream);
- OwnPtr<GIFLoadingContext> m_context;
- };
- }
|