include libpng bindling source

This commit is contained in:
Vadim Lopatin 2014-03-05 06:38:30 +04:00
parent e44c7fd3fd
commit 99dae613f2
5 changed files with 2920 additions and 0 deletions

12
3rdparty/libpng/README.md vendored Normal file
View File

@ -0,0 +1,12 @@
libpng
======
D bindings to libpng.
Seems suitable for inclusion into the larger set of bindings offered by the Deimos project.
These bindings were miticulously created by hand, based on the C headers from libpng
version 1.5.14 - January 24, 2013.
The repo is following the usual 'dub' structure, but you don't need 'dub' to use it.
You can simply copy the libpng folder to your import path.

13
3rdparty/libpng/package.json vendored Normal file
View File

@ -0,0 +1,13 @@
{
"name": "libpng",
"description": "D bindings to libpng.",
"homepage": "http://libpng.org/",
"license": "Boost",
"authors": [
"Lionello Lunesu"
],
"targetType": "sourceLibrary",
"dependencies": {
},
"libs": ["png"]
}

2615
3rdparty/libpng/source/libpng/png.d vendored Normal file

File diff suppressed because it is too large Load Diff

100
3rdparty/libpng/source/libpng/pngconf.d vendored Normal file
View File

@ -0,0 +1,100 @@
module libpng.pngconf;
/* pngconf.h - machine configurable file for libpng
*
* libpng version 1.5.14 - January 24, 2013
*
* Copyright (c) 1998-2013 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
*
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer
* and license in png.h
*
*/
/* Any machine specific code is near the front of this file, so if you
* are configuring libpng for a machine, you may want to read the section
* starting here down to where it starts to typedef png_color, png_text,
* and png_info.
*/
/* For png_FILE_p - this provides the standard definition of a
* FILE
*/
import core.stdc.stdio : FILE;
public:
/* Some typedefs to get us started. These should be safe on most of the
* common platforms. The typedefs should be at least as large as the
* numbers suggest (a png_uint_32 must be at least 32 bits long), but they
* don't have to be exactly that size. Some compilers dislike passing
* unsigned shorts as function parameters, so you may be better off using
* unsigned int for png_uint_16.
*/
alias uint png_uint_32;
alias int png_int_32;
alias ushort png_uint_16;
alias short png_int_16;
alias ubyte png_byte;
alias size_t png_size_t;
//#define png_sizeof(x) (sizeof (x))
/* Typedef for floating-point numbers that are converted
* to fixed-point with a multiple of 100,000, e.g., gamma
*/
alias png_int_32 png_fixed_point;
/* Add typedefs for pointers */
alias void * png_voidp;
alias const(void) * png_const_voidp;
alias png_byte * png_bytep;
alias const(png_byte) * png_const_bytep;
alias png_uint_32 * png_uint_32p;
alias const(png_uint_32) * png_const_uint_32p;
alias png_int_32 * png_int_32p;
alias const(png_int_32) * png_const_int_32p;
alias png_uint_16 * png_uint_16p;
alias const(png_uint_16) * png_const_uint_16p;
alias png_int_16 * png_int_16p;
alias const(png_int_16) * png_const_int_16p;
alias char * png_charp;
alias const(char) * png_const_charp;
alias png_fixed_point * png_fixed_point_p;
alias const(png_fixed_point) * png_const_fixed_point_p;
alias png_size_t * png_size_tp;
alias const(png_size_t) * png_const_size_tp;
alias FILE * png_FILE_p;
alias double * png_doublep;
alias const(double) * png_const_doublep;
/* Pointers to pointers; i.e. arrays */
alias png_byte * * png_bytepp;
alias png_uint_32 * * png_uint_32pp;
alias png_int_32 * * png_int_32pp;
alias png_uint_16 * * png_uint_16pp;
alias png_int_16 * * png_int_16pp;
alias const(char) * * png_const_charpp;
alias char * * png_charpp;
alias png_fixed_point * * png_fixed_point_pp;
alias double * * png_doublepp;
/* Pointers to pointers to pointers; i.e., pointer to array */
alias char * * * png_charppp;
/* png_alloc_size_t is guaranteed to be no smaller than png_size_t,
* and no smaller than png_uint_32. Casts from png_size_t or png_uint_32
* to png_alloc_size_t are not necessary; in fact, it is recommended
* not to use them at all so that the compiler can complain when something
* turns out to be problematic.
* Casts in the other direction (from png_alloc_size_t to png_size_t or
* png_uint_32) should be explicitly applied; however, we do not expect
* to encounter practical situations that require such conversions.
*/
alias png_size_t png_alloc_size_t;

View File

@ -0,0 +1,180 @@
module libpng.pnglibconf;
/* pnglibconf.h - library build configuration */
/* libpng version 1.5.14 - January 24, 2013 */
/* Copyright (c) 1998-2011 Glenn Randers-Pehrson */
/* This code is released under the libpng license. */
/* For conditions of distribution and use, see the disclaimer */
/* and license in png.h */
/* pnglibconf.h */
/* Machine generated file: DO NOT EDIT */
/* Derived from: scripts/pnglibconf.dfa */
/* settings */
enum PNG_COST_SHIFT = 3;
enum PNG_GAMMA_THRESHOLD_FIXED = 5000;
enum PNG_QUANTIZE_BLUE_BITS = 5;
enum PNG_WEIGHT_SHIFT = 8;
enum PNG_API_RULE = 0;
//#define PNG_CALLOC_SUPPORTED
enum PNG_ZBUF_SIZE = 8192;
enum PNG_QUANTIZE_GREEN_BITS = 5;
enum PNG_sCAL_PRECISION = 5;
enum PNG_QUANTIZE_RED_BITS = 5;
enum PNG_DEFAULT_READ_MACROS = 1;
enum PNG_MAX_GAMMA_8 = 11;
/* end of settings */
/* options */
enum PNG_IO_STATE_SUPPORTED = 1;
enum PNG_BENIGN_ERRORS_SUPPORTED = 1;
enum PNG_WRITE_SUPPORTED = 1;
enum PNG_EASY_ACCESS_SUPPORTED = 1;
enum PNG_INFO_IMAGE_SUPPORTED = 1;
enum PNG_TIME_RFC1123_SUPPORTED = 1;
enum PNG_WRITE_FILTER_SUPPORTED = 1;
enum PNG_FIXED_POINT_SUPPORTED = 1;
enum PNG_READ_SUPPORTED = 1;
enum PNG_WRITE_OPTIMIZE_CMF_SUPPORTED = 1;
enum PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED = 1;
enum PNG_WRITE_FLUSH_SUPPORTED = 1;
enum PNG_WRITE_INTERLACING_SUPPORTED = 1;
enum PNG_WRITE_TRANSFORMS_SUPPORTED = 1;
enum PNG_READ_UNKNOWN_CHUNKS_SUPPORTED = 1;
enum PNG_INCH_CONVERSIONS_SUPPORTED = 1;
enum PNG_USER_MEM_SUPPORTED = 1;
enum PNG_SETJMP_SUPPORTED = 1;
enum PNG_WARNINGS_SUPPORTED = 1;
enum PNG_FLOATING_POINT_SUPPORTED = 1;
enum PNG_WRITE_CUSTOMIZE_ZTXT_COMPRESSION_SUPPORTED = 1;
enum PNG_READ_QUANTIZE_SUPPORTED = 1;
enum PNG_READ_16BIT_SUPPORTED = 1;
enum PNG_ALIGN_MEMORY_SUPPORTED = 1;
enum PNG_ERROR_NUMBERS_SUPPORTED = 0;
enum PNG_CHECK_FOR_INVALID_INDEX_SUPPORTED = 1;
enum PNG_SEQUENTIAL_READ_SUPPORTED = 1;
enum PNG_BUILD_GRAYSCALE_PALETTE_SUPPORTED = 1;
enum PNG_WRITE_SHIFT_SUPPORTED = 1;
enum PNG_ERROR_TEXT_SUPPORTED = 1;
enum PNG_WRITE_FILLER_SUPPORTED = 1;
enum PNG_WRITE_WEIGHTED_FILTER_SUPPORTED = 1;
enum PNG_SAFE_LIMITS_SUPPORTED = 0;
enum PNG_WRITE_16BIT_SUPPORTED = 1;
enum PNG_WRITE_SWAP_ALPHA_SUPPORTED = 1;
enum PNG_POINTER_INDEXING_SUPPORTED = 1;
enum PNG_FLOATING_ARITHMETIC_SUPPORTED = 1;
enum PNG_WRITE_CHECK_FOR_INVALID_INDEX_SUPPORTED = 1;
enum PNG_MNG_FEATURES_SUPPORTED = 1;
enum PNG_STDIO_SUPPORTED = 1;
enum PNG_WRITE_INT_FUNCTIONS_SUPPORTED = 1;
enum PNG_WRITE_PACKSWAP_SUPPORTED = 1;
enum PNG_READ_INTERLACING_SUPPORTED = 1;
enum PNG_READ_COMPOSITE_NODIV_SUPPORTED = 0;///
enum PNG_PROGRESSIVE_READ_SUPPORTED = 1;
enum PNG_READ_INT_FUNCTIONS_SUPPORTED = 1;
enum PNG_HANDLE_AS_UNKNOWN_SUPPORTED = 1;
enum PNG_WRITE_INVERT_SUPPORTED = 1;
enum PNG_WRITE_PACK_SUPPORTED = 1;
enum PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED = 1;
enum PNG_16BIT_SUPPORTED = 1;
enum PNG_READ_CHECK_FOR_INVALID_INDEX_SUPPORTED = 1;
enum PNG_WRITE_cHRM_SUPPORTED = 1;
enum PNG_READ_ANCILLARY_CHUNKS_SUPPORTED = 1;
enum PNG_WRITE_BGR_SUPPORTED = 1;
enum PNG_WRITE_sBIT_SUPPORTED = 1;
enum PNG_READ_sBIT_SUPPORTED = 1;
enum PNG_READ_TRANSFORMS_SUPPORTED = 1;
enum PNG_READ_EXPAND_16_SUPPORTED = 1;
enum PNG_WRITE_SWAP_SUPPORTED = 1;
enum PNG_READ_SWAP_SUPPORTED = 1;
enum PNG_WRITE_oFFs_SUPPORTED = 1;
enum PNG_READ_oFFs_SUPPORTED = 1;
enum PNG_WRITE_USER_TRANSFORM_SUPPORTED = 1;
enum PNG_WRITE_tIME_SUPPORTED = 1;
enum PNG_WRITE_INVERT_ALPHA_SUPPORTED = 1;
enum PNG_READ_tIME_SUPPORTED = 1;
enum PNG_READ_PACKSWAP_SUPPORTED = 1;
enum PNG_USER_LIMITS_SUPPORTED = 1;
enum PNG_READ_GRAY_TO_RGB_SUPPORTED = 1;
enum PNG_READ_STRIP_16_TO_8_SUPPORTED = 1;
enum PNG_READ_SCALE_16_TO_8_SUPPORTED = 1;
enum PNG_READ_USER_CHUNKS_SUPPORTED = 1;
enum PNG_READ_OPT_PLTE_SUPPORTED = 1;
enum PNG_UNKNOWN_CHUNKS_SUPPORTED = 1;
enum PNG_WRITE_gAMA_SUPPORTED = 1;
enum PNG_SET_USER_LIMITS_SUPPORTED = 1;
enum PNG_WRITE_iCCP_SUPPORTED = 1;
enum PNG_READ_iCCP_SUPPORTED = 1;
enum PNG_READ_SHIFT_SUPPORTED = 1;
enum PNG_SET_CHUNK_MALLOC_LIMIT_SUPPORTED = 1;
enum PNG_READ_EXPAND_SUPPORTED = 1;
enum PNG_WRITE_iTXt_SUPPORTED = 1;
enum PNG_READ_iTXt_SUPPORTED = 1;
enum PNG_READ_SWAP_ALPHA_SUPPORTED = 1;
enum PNG_CONSOLE_IO_SUPPORTED = 1;
enum PNG_sBIT_SUPPORTED = 1;
enum PNG_WRITE_sRGB_SUPPORTED = 1;
enum PNG_READ_sRGB_SUPPORTED = 1;
enum PNG_READ_ALPHA_MODE_SUPPORTED = 1;
enum PNG_WRITE_sCAL_SUPPORTED = 1;
enum PNG_READ_sCAL_SUPPORTED = 1;
enum PNG_USER_CHUNKS_SUPPORTED = 1;
enum PNG_oFFs_SUPPORTED = 1;
enum PNG_READ_GAMMA_SUPPORTED = 1;
enum PNG_WRITE_pHYs_SUPPORTED = 1;
enum PNG_WRITE_tRNS_SUPPORTED = 1;
enum PNG_READ_pHYs_SUPPORTED = 1;
enum PNG_READ_tRNS_SUPPORTED = 1;
enum PNG_READ_RGB_TO_GRAY_SUPPORTED = 1;
enum PNG_tIME_SUPPORTED = 0;//
enum PNG_WRITE_bKGD_SUPPORTED = 1;
enum PNG_READ_bKGD_SUPPORTED = 1;
enum PNG_WRITE_zTXt_SUPPORTED = 1;
enum PNG_WRITE_pCAL_SUPPORTED = 1;
enum PNG_READ_zTXt_SUPPORTED = 1;
enum PNG_READ_pCAL_SUPPORTED = 1;
enum PNG_WRITE_hIST_SUPPORTED = 1;
enum PNG_READ_hIST_SUPPORTED = 1;
enum PNG_WRITE_sPLT_SUPPORTED = 1;
enum PNG_READ_sPLT_SUPPORTED = 1;
enum PNG_READ_INVERT_ALPHA_SUPPORTED = 1;
enum PNG_iCCP_SUPPORTED = 1;
enum PNG_CONVERT_tIME_SUPPORTED = 1;
enum PNG_READ_FILLER_SUPPORTED = 1;
enum PNG_READ_USER_TRANSFORM_SUPPORTED = 1;
enum PNG_READ_PACK_SUPPORTED = 1;
enum PNG_READ_BACKGROUND_SUPPORTED = 1;
enum PNG_iTXt_SUPPORTED = 1;
enum PNG_READ_cHRM_SUPPORTED = 1;
enum PNG_USER_TRANSFORM_INFO_SUPPORTED = 1;
enum PNG_sRGB_SUPPORTED = 1;
enum PNG_SET_CHUNK_CACHE_LIMIT_SUPPORTED = 1;
enum PNG_USER_TRANSFORM_PTR_SUPPORTED = 1;
enum PNG_sCAL_SUPPORTED = 1;
enum PNG_READ_BGR_SUPPORTED = 1;
enum PNG_READ_INVERT_SUPPORTED = 1;
enum PNG_READ_COMPRESSED_TEXT_SUPPORTED = 1;
enum PNG_pHYs_SUPPORTED = 1;
enum PNG_tRNS_SUPPORTED = 1;
enum PNG_bKGD_SUPPORTED = 1;
enum PNG_pCAL_SUPPORTED = 1;
enum PNG_zTXt_SUPPORTED = 1;
enum PNG_READ_TEXT_SUPPORTED = 1;
enum PNG_hIST_SUPPORTED = 1;
enum PNG_READ_STRIP_ALPHA_SUPPORTED = 1;
enum PNG_WRITE_COMPRESSED_TEXT_SUPPORTED = 1;
enum PNG_sPLT_SUPPORTED = 1;
enum PNG_READ_gAMA_SUPPORTED = 1;
enum PNG_SAVE_INT_32_SUPPORTED = 1;
enum PNG_cHRM_SUPPORTED = 1;
enum PNG_CHECK_cHRM_SUPPORTED = 1;
enum PNG_gAMA_SUPPORTED = 1;
enum PNG_READ_tEXt_SUPPORTED = 1;
enum PNG_WRITE_TEXT_SUPPORTED = 1;
enum PNG_TEXT_SUPPORTED = 1;
enum PNG_WRITE_tEXt_SUPPORTED = 1;
enum PNG_tEXt_SUPPORTED = 1;
/* end of options */