1
0
Fork 0
mirror of https://github.com/LadybirdBrowser/ladybird.git synced 2025-06-11 02:13:56 +09:00

LibGfx/JPEGWriter: Add a named constant in add_scan_header()

No behavior change.
This commit is contained in:
Nico Weber 2024-01-31 20:32:11 -05:00 committed by Andreas Kling
parent 4a8e7f44dc
commit 38526414b0
Notes: sideshowbarker 2024-07-17 18:23:22 +09:00

View file

@ -486,14 +486,16 @@ ErrorOr<void> add_scan_header(Stream& stream)
// B.2.3 - Scan header syntax
TRY(stream.write_value<BigEndian<Marker>>(JPEG_SOS));
u16 const Ns = 3;
// Ls - 6 + 2 × Ns
TRY(stream.write_value<BigEndian<u16>>(6 + 2 * 3));
TRY(stream.write_value<BigEndian<u16>>(6 + 2 * Ns));
// Ns
TRY(stream.write_value<u8>(3));
TRY(stream.write_value<u8>(Ns));
// Encode 3 components
for (u8 i {}; i < 3; ++i) {
// Encode Ns components
for (u8 i {}; i < Ns; ++i) {
// Csj
TRY(stream.write_value<u8>(i + 1));