@@ -1956,7 +1956,7 @@ static ErrorOr<NonnullRefPtr<BilevelImage>> text_region_decoding_procedure(TextR
19561956        refinement_inputs.is_typical_prediction_used  = false ;
19571957        refinement_inputs.adaptive_template_pixels  = inputs.refinement_adaptive_template_pixels ;
19581958        auto  result = TRY (generic_refinement_region_decoding_procedure (refinement_inputs, *decoder, refinement_contexts.value ()));
1959-         refinement_result = result->subbitmap ( IntRect ( 0 ,  0 , result-> width (), result-> height ()) );
1959+         refinement_result = result->as_subbitmap ( );
19601960        return  &refinement_result.value ();
19611961    };
19621962
@@ -2380,7 +2380,7 @@ static ErrorOr<Vector<BilevelSubImage>> symbol_dictionary_decoding_procedure(Sym
23802380            //  FIXME: Doing this eagerly is pretty wasteful. Decode on demand instead?
23812381            if  (!inputs.uses_huffman_encoding  || inputs.uses_refinement_or_aggregate_coding ) {
23822382                auto  bitmap = TRY (read_symbol_bitmap (symbol_width, height_class_height));
2383-                 new_symbols.append (bitmap->subbitmap ( IntRect ( 0 ,  0 , bitmap-> width (), bitmap-> height ()) ));
2383+                 new_symbols.append (bitmap->as_subbitmap ( ));
23842384            }
23852385
23862386            //  "iii) If SDHUFF is 1 and SDREFAGG is 0, then set:
@@ -3764,7 +3764,7 @@ static ErrorOr<void> decode_immediate_generic_refinement_region(JBIG2LoadingCont
37643764    inputs.region_width  = information_field.width ;
37653765    inputs.region_height  = information_field.height ;
37663766    inputs.gr_template  = arithmetic_coding_template;
3767-     auto  subbitmap = reference_bitmap->subbitmap ( IntRect ( 0 ,  0 , reference_bitmap-> width (), reference_bitmap-> height ()) );
3767+     auto  subbitmap = reference_bitmap->as_subbitmap ( );
37683768    inputs.reference_bitmap  = &subbitmap;
37693769    inputs.reference_x_offset  = 0 ;
37703770    inputs.reference_y_offset  = 0 ;
0 commit comments