📄 libmng_types.h
字号:
/* ************************************************************************** *//* * For conditions of distribution and use, * *//* * see copyright notice in libmng.h * *//* ************************************************************************** *//* * * *//* * project : libmng * *//* * file : libmng_types.h copyright (c) 2000 G.Juyn * *//* * version : 1.0.3 * *//* * * *//* * purpose : type specifications * *//* * * *//* * author : G.Juyn * *//* * web : http://www.3-t.com * *//* * email : mailto:info@3-t.com * *//* * * *//* * comment : Specification of the types used by the library * *//* * Creates platform-independant structure * *//* * * *//* * changes : 0.5.1 - 05/06/2000 - G.Juyn * *//* * - added iteratechunk callback definition * *//* * 0.5.1 - 05/08/2000 - G.Juyn * *//* * - improved definitions for DLL support * *//* * - added 8-bit palette definition * *//* * - added general array definitions * *//* * - added MNG_NULL definition * *//* * - changed strict-ANSI stuff * *//* * 0.5.1 - 05/11/2000 - G.Juyn * *//* * - changed most callback prototypes to allow the app * *//* * to report errors during callback processing * *//* * 0.5.1 - 05/16/2000 - G.Juyn * *//* * - moved standard header includes into this file * *//* * (stdlib/mem for mem-mngmt & math for fp gamma-calc) * *//* * * *//* * 0.5.2 - 05/18/2000 - G.Juyn * *//* * - B003 - fixed problem with <mem.h> being proprietary * *//* * to Borland platform * *//* * - added helper definitions for JNG (IJG-based) * *//* * - fixed support for IJGSRC6B * *//* * 0.5.2 - 05/24/2000 - G.Juyn * *//* * - added default IJG compression parameters and such * *//* * 0.5.2 - 05/31/2000 - G.Juyn * *//* * - fixed inclusion for memcpy (contributed by Tim Rowley) * *//* * - added mng_int32p (contributed by Tim Rowley) * *//* * 0.5.2 - 06/02/2000 - G.Juyn * *//* * - removed SWAP_ENDIAN reference (contributed by Tim Rowley)* *//* * - added getalphaline callback for RGB8_A8 canvasstyle * *//* * * *//* * 0.5.3 - 06/21/2000 - G.Juyn * *//* * - added speedtype to facilitate testing * *//* * 0.5.3 - 06/27/2000 - G.Juyn * *//* * - added typedef for mng_size_t * *//* * - changed size parameter for memory callbacks to * *//* * mng_size_t * *//* * 0.5.3 - 06/28/2000 - G.Juyn * *//* * - changed definition of 32-bit ints (64-bit platforms) * *//* * - changed definition of mng_handle (64-bit platforms) * *//* * 0.5.3 - 06/29/2000 - G.Juyn * *//* * - changed definition of mng_handle (again) * *//* * - swapped refresh parameters * *//* * - added inclusion of stdlib.h for abs() * *//* * * *//* * 0.9.0 - 06/30/2000 - G.Juyn * *//* * - changed refresh parameters to 'x,y,width,height' * *//* * 0.9.1 - 07/10/2000 - G.Juyn * *//* * - added suspendbuffer constants * *//* * 0.9.1 - 07/15/2000 - G.Juyn * *//* * - added callbacks for SAVE/SEEK processing * *//* * * *//* * 0.9.2 - 08/05/2000 - G.Juyn * *//* * - changed file-prefixes * *//* * * *//* * 0.9.3 - 08/07/2000 - G.Juyn * *//* * - B111300 - fixup for improved portability * *//* * 0.9.3 - 08/12/2000 - G.Juyn * *//* * - added workaround for faulty PhotoShop iCCP chunk * *//* * 0.9.3 - 09/11/2000 - G.Juyn * *//* * - added export of zlib functions from windows dll * *//* * - fixed inclusion parameters once again to make those * *//* * external libs work together * *//* * - re-fixed fixed inclusion parameters * *//* * (these freeking libraries make me mad) * *//* * 0.9.3 - 10/11/2000 - G.Juyn * *//* * - added support for nEED * *//* * 0.9.3 - 10/17/2000 - G.Juyn * *//* * - added callback to process non-critical unknown chunks * *//* * * *//* * 0.9.4 - 11/20/2000 - R.Giles * *//* * - fixed inclusion of lcms header for non-windows platforms * *//* * 0.9.4 - 12/12/2000 - G.Juyn * *//* * - changed callback convention for MSVC (Thanks Chad) * *//* * 0.9.4 - 12/16/2000 - G.Juyn * *//* * - fixed mixup of data- & function-pointers (thanks Dimitri)* *//* * * *//* * 1.0.1 - 02/08/2001 - G.Juyn * *//* * - added MEND processing callback * *//* * * *//* * 1.0.2 - 06/23/2001 - G.Juyn * *//* * - added processterm callback * *//* * * *//* * 1.0.3 - 08/06/2001 - G.Juyn * *//* * - changed inclusion of lcms.h for Linux platforms * *//* * * *//* ************************************************************************** */#ifndef _libmng_types_h_#define _libmng_types_h_/* ************************************************************************** */#ifdef __BORLANDC__#pragma option -AT /* turn off strict ANSI-C for the moment */#endif#ifndef WIN32#if defined(_WIN32) || defined(__WIN32__) || defined(_Windows) || defined(_WINDOWS)#define WIN32 /* gather them into a single define */#endif#endif/* ************************************************************************** *//* * * *//* * Here's where the external & standard libs are embedded * *//* * * *//* * (it can be a bit of a pain in the lower-back to get them to work * *//* * together) * *//* * * *//* ************************************************************************** */#ifdef WIN32 /* only include needed stuff */#ifndef WIN32_LEAN_AND_MEAN#define WIN32_LEAN_AND_MEAN#endif#endif#ifdef MNG_USE_DLL#ifdef MNG_SKIP_ZLIB#undef MNG_INCLUDE_ZLIB#endif#ifdef MNG_SKIP_LCMS#undef MNG_INCLUDE_LCMS#endif#ifdef MNG_SKIP_IJG6B#undef MNG_INCLUDE_IJG6B#endif#endif#ifdef MNG_INCLUDE_ZLIB /* zlib by Mark Adler & Jean-loup Gailly */#include "zlib.h"#endif#ifdef MNG_INCLUDE_LCMS /* little cms by Marti Maria Saguer */#ifndef ZLIB_DLL#undef FAR#endif#if defined(WIN32) || defined(linux) /* different header locations */#include "lcms.h"#else#include "lcms/lcms.h"#endif#endif /* MNG_INCLUDE_LCMS */#ifdef MNG_INCLUDE_IJG6B /* IJG's jpgsrc6b */#include <stdio.h>#ifdef MNG_USE_SETJMP#include <setjmp.h> /* needed for error-recovery (blergh) */#else#ifdef WIN32#define USE_WINDOWS_MESSAGEBOX /* display a messagebox under Windoze */#endif#endif /* MNG_USE_SETJMP */#ifdef FAR#undef FAR /* possibly defined by zlib or lcms */#endif#include "jpeglib.h" /* all that for JPEG support :-) */#endif /* MNG_INCLUDE_IJG6B */#if defined(MNG_INTERNAL_MEMMNGMT) || defined(MNG_INCLUDE_FILTERS)#include <stdlib.h> /* "calloc" & "free" & "abs" */#endif#include <limits.h> /* get proper integer widths */#ifdef WIN32/* B003 */#if defined __BORLANDC__#include <mem.h> /* defines "memcpy" for BCB */#else#include <memory.h> /* defines "memcpy" for other win32 platforms */#endif/* B003 */#ifdef MNG_CHECK_BAD_ICCP#include <string.h> /* strncmp() */#endif#else#ifdef BSD#include <strings.h> /* defines "memcpy" for BSD (?) */#else#include <string.h> /* defines "memcpy" for all others (???) */#endif#endif#if defined(MNG_FULL_CMS) || defined(MNG_GAMMA_ONLY)#include <math.h> /* fp gamma-calculation */#endif/* ************************************************************************** *//* * * *//* * Platform-dependant stuff * *//* * * *//* ************************************************************************** *//* TODO: this may require some elaboration for other platforms; only works with BCB for now */#ifndef MNG_DLL#if defined(MNG_BUILD_DLL) || defined(MNG_USE_DLL)#define MNG_DLL#endif#endif#if defined(MNG_DLL) && defined(WIN32) /* setup DLL calling conventions */ #define MNG_DECL __stdcall#if defined(MNG_BUILD_DLL)#define MNG_EXT __declspec(dllexport)#elif defined(MNG_USE_DLL)#define MNG_EXT __declspec(dllimport)#else#define MNG_EXT#endif#ifdef MNG_STRICT_ANSI#undef MNG_STRICT_ANSI /* can't do strict-ANSI with this DLL-stuff */#endif#else#define MNG_DECL /* dummies for non-DLL */#define MNG_EXT#endif /* MNG_DLL && WIN32 */#if defined(__BORLANDC__) && defined(MNG_STRICT_ANSI)#pragma option -A /* now force ANSI-C from here on */#endif/* ************************************************************************** */#if USHRT_MAX == 0xffffffffU /* get the proper 32-bit width !!! */typedef unsigned short mng_uint32;typedef signed short mng_int32;#elif UINT_MAX == 0xffffffffUtypedef unsigned int mng_uint32;typedef signed int mng_int32;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -