WebPLoaderLossy.h 762 B

1234567891011121314151617181920212223242526272829303132
  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 VP8Header {
  12. u8 version;
  13. bool show_frame;
  14. u32 size_of_first_partition;
  15. u32 width;
  16. u8 horizontal_scale;
  17. u32 height;
  18. u8 vertical_scale;
  19. ReadonlyBytes first_partition;
  20. ReadonlyBytes second_partition;
  21. };
  22. // Parses the header data in a VP8 chunk. Pass the payload of a `VP8 ` chunk, after the tag and after the tag's data size.
  23. ErrorOr<VP8Header> decode_webp_chunk_VP8_header(ReadonlyBytes vp8_data);
  24. ErrorOr<NonnullRefPtr<Bitmap>> decode_webp_chunk_VP8_contents(VP8Header const&, bool include_alpha_channel);
  25. }