LibGfx/JBIG2: Add some debug logging for text segments

This commit is contained in:
Nico Weber 2024-04-02 13:41:20 -07:00 committed by Tim Flynn
parent b130e36330
commit b31e3fe573
Notes: sideshowbarker 2024-07-16 22:26:05 +09:00

View File

@ -1451,6 +1451,7 @@ static ErrorOr<NonnullOwnPtr<BitBuffer>> text_region_decoding_procedure(TextRegi
// "x) Draw IBI into SBREG. Combine each pixel of IBI with the current value of the corresponding
// pixel in SBREG, using the combination operator specified by SBCOMBOP. Write the results
// of each combination into that pixel in SBREG."
dbgln_if(JBIG2_DEBUG, "combining symbol {} ({}x{}) at ({}, {}) with operator {}", id, symbol.width(), symbol.height(), s_instance, t_instance, (int)inputs.operator_);
composite_bitbuffer(*result, symbol, { s_instance, t_instance }, inputs.operator_);
// "xi) Update CURS as follows:
@ -1964,6 +1965,10 @@ static ErrorOr<void> decode_immediate_text_region(JBIG2LoadingContext& context,
// "It is only present if SBHUFF is 1."
// FIXME: Support this eventually.
dbgln_if(JBIG2_DEBUG, "Text region: uses_huffman_encoding={}, uses_refinement_coding={}, strip_size={}, reference_corner={}, is_transposed={}", uses_huffman_encoding, uses_refinement_coding, strip_size, reference_corner, is_transposed);
dbgln_if(JBIG2_DEBUG, "Text region: combination_operator={}, default_pixel_value={}, delta_s_offset={}, refinement_template={}, number_of_symbol_instances={}", combination_operator, default_pixel_value, delta_s_offset, refinement_template, number_of_symbol_instances);
dbgln_if(JBIG2_DEBUG, "Text region: number_of_symbol_instances={}", number_of_symbol_instances);
// 7.4.3.2 Decoding a text region segment
// "1) Interpret its header, as described in 7.4.3.1."
// Done!