1 /* 2 * Copyright 2010 The Android Open Source Project 3 * 4 * Use of this source code is governed by a BSD-style license that can be 5 * found in the LICENSE file. 6 */ 7 8 9 #ifndef SkJpegUtility_DEFINED 10 #define SkJpegUtility_DEFINED 11 12 #include "include/core/SkTypes.h" 13 14 #include <cstdint> 15 16 extern "C" { 17 // We need to include stdio.h before jpeg because jpeg does not include it, but uses FILE 18 // See https://github.com/libjpeg-turbo/libjpeg-turbo/issues/17 19 #include <stdio.h> // IWYU pragma: keep 20 #include "jpeglib.h" // NO_G3_REWRITE 21 } 22 23 class SkWStream; 24 25 void skjpeg_error_exit(j_common_ptr cinfo); 26 27 ///////////////////////////////////////////////////////////////////////////// 28 /* Our destination struct for directing decompressed pixels to our stream 29 * object. 30 */ 31 struct SK_SPI skjpeg_destination_mgr : jpeg_destination_mgr { 32 skjpeg_destination_mgr(SkWStream* stream); 33 34 SkWStream* const fStream; 35 36 enum { 37 kBufferSize = 1024 38 }; 39 uint8_t fBuffer[kBufferSize]; 40 }; 41 42 #endif 43