ILBMLoader.h 745 B

12345678910111213141516171819202122232425262728293031
  1. /*
  2. * Copyright (c) 2023, Nicolas Ramz <nicolas.ramz@gmail.com>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <LibGfx/ImageFormats/ImageDecoder.h>
  8. namespace Gfx {
  9. struct ILBMLoadingContext;
  10. class ILBMImageDecoderPlugin final : public ImageDecoderPlugin {
  11. public:
  12. static bool sniff(ReadonlyBytes);
  13. static ErrorOr<NonnullOwnPtr<ImageDecoderPlugin>> create(ReadonlyBytes);
  14. virtual ~ILBMImageDecoderPlugin() override;
  15. virtual IntSize size() override;
  16. virtual ErrorOr<ImageFrameDescriptor> frame(size_t index, Optional<IntSize> ideal_size = {}) override;
  17. private:
  18. ILBMImageDecoderPlugin(ReadonlyBytes, NonnullOwnPtr<ILBMLoadingContext>);
  19. NonnullOwnPtr<ILBMLoadingContext> m_context;
  20. };
  21. }