WebPLoaderLossless.h 609 B

123456789101112131415161718192021222324252627
  1. /*
  2. * Copyright (c) 2023, Nico Weber <thakis@chromium.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <AK/Span.h>
  8. #include <AK/Types.h>
  9. #include <LibGfx/Bitmap.h>
  10. namespace Gfx {
  11. struct VP8LHeader {
  12. u16 width;
  13. u16 height;
  14. bool is_alpha_used;
  15. ReadonlyBytes lossless_data;
  16. };
  17. // Parses the header data in a VP8L chunk. Pass the payload of a `VP8L` chunk, after the tag and after the tag's data size.
  18. ErrorOr<VP8LHeader> decode_webp_chunk_VP8L_header(ReadonlyBytes vp8l_data);
  19. ErrorOr<NonnullRefPtr<Bitmap>> decode_webp_chunk_VP8L_contents(VP8LHeader const&);
  20. }