mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 05:08:13 +00:00

Type 2 <=> One-dimensional Group3, customized for TIFF Type 3 <=> Two-dimensional Group3, uses the original 1D internally Type 4 <=> Two-dimensional Group4 So let's clarify that this is not Group3 1D but the TIFF variant, which is called `CCITTRLE` in libtiff. So let's stick with this name to avoid confusion.
26 lines
772 B
C++
26 lines
772 B
C++
/*
|
|
* Copyright (c) 2023, Lucas Chollet <lucas.chollet@serenityos.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <AK/ByteBuffer.h>
|
|
|
|
namespace Gfx::CCITT {
|
|
|
|
// You can find a great overview of CCITT compression schemes here:
|
|
// https://www.fileformat.info/mirror/egff/ch09_05.htm
|
|
|
|
// The CCITT3 specification is accessible at this page:
|
|
// https://www.itu.int/rec/T-REC-T.4/en
|
|
|
|
// The unidimensional scheme is originally described in:
|
|
// 4.1 One-dimensional coding scheme
|
|
// However, this function implements the TIFF variant (see TIFFLoader.h for a spec link),
|
|
// differences are detailed in section:
|
|
// Section 10: Modified Huffman Compression
|
|
ErrorOr<ByteBuffer> decode_ccitt_rle(ReadonlyBytes bytes, u32 image_width, u32 image_height);
|
|
|
|
}
|