/* * Copyright (c) 2022, Tom Needham <06needhamt@gmail.com> * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include namespace Gfx { struct TGALoadingContext; class TGAImageDecoderPlugin final : public ImageDecoderPlugin { public: static ErrorOr validate_before_create(ReadonlyBytes); static ErrorOr> create(ReadonlyBytes); virtual ~TGAImageDecoderPlugin() override; TGAImageDecoderPlugin(u8 const*, size_t); virtual IntSize size() override; virtual ErrorOr initialize() 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 frame(size_t index, Optional ideal_size = {}) override; virtual ErrorOr> icc_data() override; private: bool decode_tga_header(); OwnPtr m_context; }; }