CCITTDecoder.h 772 B

1234567891011121314151617181920212223242526
  1. /*
  2. * Copyright (c) 2023, Lucas Chollet <lucas.chollet@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <AK/ByteBuffer.h>
  8. namespace Gfx::CCITT {
  9. // You can find a great overview of CCITT compression schemes here:
  10. // https://www.fileformat.info/mirror/egff/ch09_05.htm
  11. // The CCITT3 specification is accessible at this page:
  12. // https://www.itu.int/rec/T-REC-T.4/en
  13. // The unidimensional scheme is originally described in:
  14. // 4.1 One-dimensional coding scheme
  15. // However, this function implements the TIFF variant (see TIFFLoader.h for a spec link),
  16. // differences are detailed in section:
  17. // Section 10: Modified Huffman Compression
  18. ErrorOr<ByteBuffer> decode_ccitt_rle(ReadonlyBytes bytes, u32 image_width, u32 image_height);
  19. }