1 // Copyright 2020 Google LLC 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // https://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 15 #ifndef LIBPNG_WRAPPER_FUNC_H_ 16 #define LIBPNG_WRAPPER_FUNC_H_ 17 18 #include "png.h" // NOLINT(build/include) 19 20 extern "C" { 21 22 void* png_fdopen(int fd, const char* mode); 23 void png_rewind(void* f); 24 void png_fread(void* buffer, size_t size, size_t count, void* stream); 25 void png_fclose(void* f); 26 void png_setjmp(png_structrp ptr); 27 png_structp png_create_read_struct_wrapper(png_const_charp user_png_ver, 28 png_voidp error_ptr); 29 png_structp png_create_write_struct_wrapper(png_const_charp user_png_ver, 30 png_voidp error_ptr); 31 void png_init_io_wrapper(png_structrp png_ptr, void* f); 32 void png_read_image_wrapper(png_structrp png_ptr, png_bytep image, 33 size_t height, size_t rowbytes); 34 void png_write_image_wrapper(png_structrp png_ptr, png_bytep image, 35 size_t height, size_t rowbytes); 36 37 } // extern "C" 38 39 #endif // LIBPNG_WRAPPER_FUNC_H_ 40