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:
parent
4a8e7f44dc
commit
38526414b0
Notes:
sideshowbarker
2024-07-17 18:23:22 +09:00
Author: https://github.com/nico
Commit: 38526414b0
Pull-request: https://github.com/SerenityOS/serenity/pull/23034
Reviewed-by: https://github.com/LucasChollet ✅
1 changed files with 6 additions and 4 deletions
|
@ -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));
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue