Imported Upstream version 0.9.0
[platform/upstream/libjxl.git] / lib / jxl / jpeg / dec_jpeg_data_writer.h
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.
5
6 // Functions for writing a JPEGData object into a jpeg byte stream.
7
8 #ifndef LIB_JXL_JPEG_DEC_JPEG_DATA_WRITER_H_
9 #define LIB_JXL_JPEG_DEC_JPEG_DATA_WRITER_H_
10
11 #include <stddef.h>
12 #include <stdint.h>
13
14 #include <functional>
15
16 #include "lib/jxl/jpeg/dec_jpeg_serialization_state.h"
17 #include "lib/jxl/jpeg/jpeg_data.h"
18
19 namespace jxl {
20 namespace jpeg {
21
22 // Function type used to write len bytes into buf. Returns the number of bytes
23 // written.
24 using JPEGOutput = std::function<size_t(const uint8_t* buf, size_t len)>;
25
26 Status WriteJpeg(const JPEGData& jpg, const JPEGOutput& out);
27
28 }  // namespace jpeg
29 }  // namespace jxl
30
31 #endif  // LIB_JXL_JPEG_DEC_JPEG_DATA_WRITER_H_