Backed out 3 changesets (bug 1790375) for causing wd failures on fetch_error.py....
[gecko.git] / third_party / jpeg-xl / lib / jpegli / decode_marker.h
blobfb24b3ee872bf90ca299525c43189ed0e36442b2
1 // Copyright (c) the JPEG XL Project Authors. All rights reserved.
2 //
3 // Use of this source code is governed by a BSD-style
4 // license that can be found in the LICENSE file.
6 #ifndef LIB_JPEGLI_DECODE_MARKER_H_
7 #define LIB_JPEGLI_DECODE_MARKER_H_
9 #include <stdint.h>
11 #include "lib/jpegli/common.h"
13 namespace jpegli {
15 // Reads the available input in the source manager's input buffer until either
16 // the end of the next SOS marker or the end of the input.
17 // The corresponding fields of cinfo are updated with the processed input data.
18 // Upon return, the input buffer will be at the start or at the end of a marker
19 // data segment (inter-marker data is allowed).
20 // Return value is one of:
21 // * JPEG_SUSPENDED, if the current input buffer ends before the next SOS or
22 // EOI marker. Input buffer refill is handled by the caller;
23 // * JPEG_REACHED_SOS, if the next SOS marker is found;
24 // * JPEG_REACHED_EOR, if the end of the input is found.
25 int ProcessMarkers(j_decompress_ptr cinfo, const uint8_t* const data,
26 const size_t len, size_t* pos);
28 jpeg_marker_parser_method GetMarkerProcessor(j_decompress_ptr cinfo);
30 } // namespace jpegli
32 #endif // LIB_JPEGLI_DECODE_MARKER_H_