bug fixes to enable cmake compilation on WIN32 platform (see CHANGES for details)
This commit is contained in:
parent
56afd80506
commit
73a6ed7c21
9
CHANGES
9
CHANGES
|
@ -5,6 +5,15 @@ What's New for OpenJPEG
|
|||
! : changed
|
||||
+ : added
|
||||
|
||||
January 2, 2011
|
||||
* [antonin] bug fixes to enable cmake compilation on WIN32 platform
|
||||
- fixed getopt bug in jpwl/CMakeLists.txt
|
||||
- added png, zlib and lcms win32 libraries to libs directory
|
||||
- updated libs/libtiff library
|
||||
- moved j2k_dump_{image,cp} to j2k_dump.c to remain consistent with API interface
|
||||
- changed mj2 cmake compilation method: as long as mj2 binaries do not strictly use the API interface, libopenjpeg source files are directly included in mj2 executables compilation.
|
||||
! [antonin] small update to xcode project
|
||||
|
||||
December 14, 2010
|
||||
! [szukw000] adapted Makefile.am/Makefile.nix to build
|
||||
choice: shared xor static
|
||||
|
|
|
@ -247,6 +247,7 @@ ELSEIF(WIN32)
|
|||
${OPENJPEG_SOURCE_DIR}/libs/png ${OPENJPEG_SOURCE_DIR}/libs/lcms2
|
||||
C:/WINDOWS/system32/user )
|
||||
SET(CMAKE_LIBRARY_PATH ${OPENJPEG_SOURCE_DIR}/libs/libtiff
|
||||
${OPENJPEG_SOURCE_DIR}/libs/png ${OPENJPEG_SOURCE_DIR}/libs/lcms2
|
||||
C:/WINDOWS/system32/user )
|
||||
ENDIF()
|
||||
#
|
||||
|
|
|
@ -4,14 +4,14 @@
|
|||
SET(common_SRCS
|
||||
convert.c
|
||||
index.c
|
||||
${PROJECT_SOURCE_DIR}/common/color.c
|
||||
${OPENJPEG_SOURCE_DIR}/common/color.c
|
||||
)
|
||||
|
||||
# If not getopt was found then add it to the lib:
|
||||
IF(DONT_HAVE_GETOPT)
|
||||
SET(common_SRCS
|
||||
${common_SRCS}
|
||||
${PROJECT_SOURCE_DIR}/common/getopt.c
|
||||
${OPENJPEG_SOURCE_DIR}/common/getopt.c
|
||||
)
|
||||
ENDIF(DONT_HAVE_GETOPT)
|
||||
|
||||
|
@ -28,6 +28,14 @@ IF(TIFF_FOUND)
|
|||
INCLUDE_DIRECTORIES(${TIFF_INCLUDE_DIR})
|
||||
ENDIF(TIFF_FOUND)
|
||||
|
||||
IF(WIN32)
|
||||
IF(BUILD_SHARED_LIBS)
|
||||
ADD_DEFINITIONS(-DOPJ_EXPORTS)
|
||||
ELSE(BUILD_SHARED_LIBS)
|
||||
ADD_DEFINITIONS(-DOPJ_STATIC)
|
||||
ENDIF(BUILD_SHARED_LIBS)
|
||||
ENDIF(WIN32)
|
||||
|
||||
# Loop over all executables:
|
||||
FOREACH(exe j2k_to_image image_to_j2k j2k_dump)
|
||||
ADD_EXECUTABLE(${exe} ${exe}.c ${common_SRCS})
|
||||
|
|
|
@ -96,6 +96,8 @@ void decode_help_display() {
|
|||
}
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
static void j2k_dump_image(FILE *fd, opj_image_t * img);
|
||||
static void j2k_dump_cp(FILE *fd, opj_image_t * img, opj_cp_t * cp);
|
||||
|
||||
int get_num_images(char *imgdirpath){
|
||||
DIR *dir;
|
||||
|
@ -554,3 +556,79 @@ int main(int argc, char *argv[])
|
|||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
static void j2k_dump_image(FILE *fd, opj_image_t * img) {
|
||||
int compno;
|
||||
fprintf(fd, "image {\n");
|
||||
fprintf(fd, " x0=%d, y0=%d, x1=%d, y1=%d\n", img->x0, img->y0, img->x1, img->y1);
|
||||
fprintf(fd, " numcomps=%d\n", img->numcomps);
|
||||
for (compno = 0; compno < img->numcomps; compno++) {
|
||||
opj_image_comp_t *comp = &img->comps[compno];
|
||||
fprintf(fd, " comp %d {\n", compno);
|
||||
fprintf(fd, " dx=%d, dy=%d\n", comp->dx, comp->dy);
|
||||
fprintf(fd, " prec=%d\n", comp->prec);
|
||||
//fprintf(fd, " bpp=%d\n", comp->bpp);
|
||||
fprintf(fd, " sgnd=%d\n", comp->sgnd);
|
||||
fprintf(fd, " }\n");
|
||||
}
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
|
||||
static void j2k_dump_cp(FILE *fd, opj_image_t * img, opj_cp_t * cp) {
|
||||
int tileno, compno, layno, bandno, resno, numbands;
|
||||
fprintf(fd, "coding parameters {\n");
|
||||
fprintf(fd, " tx0=%d, ty0=%d\n", cp->tx0, cp->ty0);
|
||||
fprintf(fd, " tdx=%d, tdy=%d\n", cp->tdx, cp->tdy);
|
||||
fprintf(fd, " tw=%d, th=%d\n", cp->tw, cp->th);
|
||||
for (tileno = 0; tileno < cp->tw * cp->th; tileno++) {
|
||||
opj_tcp_t *tcp = &cp->tcps[tileno];
|
||||
fprintf(fd, " tile %d {\n", tileno);
|
||||
fprintf(fd, " csty=%x\n", tcp->csty);
|
||||
fprintf(fd, " prg=%d\n", tcp->prg);
|
||||
fprintf(fd, " numlayers=%d\n", tcp->numlayers);
|
||||
fprintf(fd, " mct=%d\n", tcp->mct);
|
||||
fprintf(fd, " rates=");
|
||||
for (layno = 0; layno < tcp->numlayers; layno++) {
|
||||
fprintf(fd, "%.1f ", tcp->rates[layno]);
|
||||
}
|
||||
fprintf(fd, "\n");
|
||||
for (compno = 0; compno < img->numcomps; compno++) {
|
||||
opj_tccp_t *tccp = &tcp->tccps[compno];
|
||||
fprintf(fd, " comp %d {\n", compno);
|
||||
fprintf(fd, " csty=%x\n", tccp->csty);
|
||||
fprintf(fd, " numresolutions=%d\n", tccp->numresolutions);
|
||||
fprintf(fd, " cblkw=%d\n", tccp->cblkw);
|
||||
fprintf(fd, " cblkh=%d\n", tccp->cblkh);
|
||||
fprintf(fd, " cblksty=%x\n", tccp->cblksty);
|
||||
fprintf(fd, " qmfbid=%d\n", tccp->qmfbid);
|
||||
fprintf(fd, " qntsty=%d\n", tccp->qntsty);
|
||||
fprintf(fd, " numgbits=%d\n", tccp->numgbits);
|
||||
fprintf(fd, " roishift=%d\n", tccp->roishift);
|
||||
fprintf(fd, " stepsizes=");
|
||||
numbands = tccp->qntsty == J2K_CCP_QNTSTY_SIQNT ? 1 : tccp->numresolutions * 3 - 2;
|
||||
for (bandno = 0; bandno < numbands; bandno++) {
|
||||
fprintf(fd, "(%d,%d) ", tccp->stepsizes[bandno].mant,
|
||||
tccp->stepsizes[bandno].expn);
|
||||
}
|
||||
fprintf(fd, "\n");
|
||||
|
||||
if (tccp->csty & J2K_CCP_CSTY_PRT) {
|
||||
fprintf(fd, " prcw=");
|
||||
for (resno = 0; resno < tccp->numresolutions; resno++) {
|
||||
fprintf(fd, "%d ", tccp->prcw[resno]);
|
||||
}
|
||||
fprintf(fd, "\n");
|
||||
fprintf(fd, " prch=");
|
||||
for (resno = 0; resno < tccp->numresolutions; resno++) {
|
||||
fprintf(fd, "%d ", tccp->prch[resno]);
|
||||
}
|
||||
fprintf(fd, "\n");
|
||||
}
|
||||
fprintf(fd, " }\n");
|
||||
}
|
||||
fprintf(fd, " }\n");
|
||||
}
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
|
||||
|
|
|
@ -24,6 +24,14 @@ IF(DONT_HAVE_GETOPT)
|
|||
)
|
||||
ENDIF(DONT_HAVE_GETOPT)
|
||||
|
||||
IF(WIN32)
|
||||
IF(BUILD_SHARED_LIBS)
|
||||
ADD_DEFINITIONS(-DOPJ_EXPORTS)
|
||||
ELSE(BUILD_SHARED_LIBS)
|
||||
ADD_DEFINITIONS(-DOPJ_STATIC)
|
||||
ENDIF(BUILD_SHARED_LIBS)
|
||||
ENDIF(WIN32)
|
||||
|
||||
# Loop over all executables:
|
||||
FOREACH(exe jp3d_to_volume volume_to_jp3d)
|
||||
ADD_EXECUTABLE(${exe} ${exe}.c ${common_SRCS})
|
||||
|
|
|
@ -24,12 +24,10 @@ SET(OPJ_SRCS
|
|||
)
|
||||
SET(JPWL_SRCS crc.c jpwl.c jpwl_lib.c rs.c)
|
||||
|
||||
SET(common_SRCS "")
|
||||
# If not getopt was found then add it to the lib:
|
||||
IF(DONT_HAVE_GETOPT)
|
||||
SET(OPJ_SRCS
|
||||
${OPJ_SRCS}
|
||||
../common/getopt.c
|
||||
)
|
||||
SET(common_SRCS ${OPENJPEG_SOURCE_DIR}/common/getopt.c)
|
||||
ENDIF(DONT_HAVE_GETOPT)
|
||||
|
||||
# Build the library
|
||||
|
@ -70,8 +68,10 @@ ADD_EXECUTABLE(JPWL_j2k_to_image
|
|||
../codec/j2k_to_image.c
|
||||
../codec/convert.c
|
||||
../codec/index.c
|
||||
../common/color.c
|
||||
${OPENJPEG_SOURCE_DIR}/common/color.c
|
||||
${common_SRCS}
|
||||
)
|
||||
|
||||
TARGET_LINK_LIBRARIES(JPWL_j2k_to_image ${OPENJPEG_LIBRARY_NAME}_JPWL ${LCMS_LIB})
|
||||
IF(PNG_FOUND)
|
||||
TARGET_LINK_LIBRARIES(JPWL_j2k_to_image ${PNG_LIBRARIES})
|
||||
|
@ -88,7 +88,9 @@ ADD_EXECUTABLE(JPWL_image_to_j2k
|
|||
../codec/convert.c
|
||||
../codec/index.c
|
||||
../codec/image_to_j2k.c
|
||||
${common_SRCS}
|
||||
)
|
||||
|
||||
TARGET_LINK_LIBRARIES(JPWL_image_to_j2k ${OPENJPEG_LIBRARY_NAME}_JPWL ${LCMS_LIB})
|
||||
IF(PNG_FOUND)
|
||||
TARGET_LINK_LIBRARIES(JPWL_image_to_j2k ${PNG_LIBRARIES})
|
||||
|
|
|
@ -258,80 +258,6 @@ char *j2k_convert_progression_order(OPJ_PROG_ORDER prg_order){
|
|||
return po->str_prog;
|
||||
}
|
||||
|
||||
void j2k_dump_image(FILE *fd, opj_image_t * img) {
|
||||
int compno;
|
||||
fprintf(fd, "image {\n");
|
||||
fprintf(fd, " x0=%d, y0=%d, x1=%d, y1=%d\n", img->x0, img->y0, img->x1, img->y1);
|
||||
fprintf(fd, " numcomps=%d\n", img->numcomps);
|
||||
for (compno = 0; compno < img->numcomps; compno++) {
|
||||
opj_image_comp_t *comp = &img->comps[compno];
|
||||
fprintf(fd, " comp %d {\n", compno);
|
||||
fprintf(fd, " dx=%d, dy=%d\n", comp->dx, comp->dy);
|
||||
fprintf(fd, " prec=%d\n", comp->prec);
|
||||
//fprintf(fd, " bpp=%d\n", comp->bpp);
|
||||
fprintf(fd, " sgnd=%d\n", comp->sgnd);
|
||||
fprintf(fd, " }\n");
|
||||
}
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
|
||||
void j2k_dump_cp(FILE *fd, opj_image_t * img, opj_cp_t * cp) {
|
||||
int tileno, compno, layno, bandno, resno, numbands;
|
||||
fprintf(fd, "coding parameters {\n");
|
||||
fprintf(fd, " tx0=%d, ty0=%d\n", cp->tx0, cp->ty0);
|
||||
fprintf(fd, " tdx=%d, tdy=%d\n", cp->tdx, cp->tdy);
|
||||
fprintf(fd, " tw=%d, th=%d\n", cp->tw, cp->th);
|
||||
for (tileno = 0; tileno < cp->tw * cp->th; tileno++) {
|
||||
opj_tcp_t *tcp = &cp->tcps[tileno];
|
||||
fprintf(fd, " tile %d {\n", tileno);
|
||||
fprintf(fd, " csty=%x\n", tcp->csty);
|
||||
fprintf(fd, " prg=%d\n", tcp->prg);
|
||||
fprintf(fd, " numlayers=%d\n", tcp->numlayers);
|
||||
fprintf(fd, " mct=%d\n", tcp->mct);
|
||||
fprintf(fd, " rates=");
|
||||
for (layno = 0; layno < tcp->numlayers; layno++) {
|
||||
fprintf(fd, "%.1f ", tcp->rates[layno]);
|
||||
}
|
||||
fprintf(fd, "\n");
|
||||
for (compno = 0; compno < img->numcomps; compno++) {
|
||||
opj_tccp_t *tccp = &tcp->tccps[compno];
|
||||
fprintf(fd, " comp %d {\n", compno);
|
||||
fprintf(fd, " csty=%x\n", tccp->csty);
|
||||
fprintf(fd, " numresolutions=%d\n", tccp->numresolutions);
|
||||
fprintf(fd, " cblkw=%d\n", tccp->cblkw);
|
||||
fprintf(fd, " cblkh=%d\n", tccp->cblkh);
|
||||
fprintf(fd, " cblksty=%x\n", tccp->cblksty);
|
||||
fprintf(fd, " qmfbid=%d\n", tccp->qmfbid);
|
||||
fprintf(fd, " qntsty=%d\n", tccp->qntsty);
|
||||
fprintf(fd, " numgbits=%d\n", tccp->numgbits);
|
||||
fprintf(fd, " roishift=%d\n", tccp->roishift);
|
||||
fprintf(fd, " stepsizes=");
|
||||
numbands = tccp->qntsty == J2K_CCP_QNTSTY_SIQNT ? 1 : tccp->numresolutions * 3 - 2;
|
||||
for (bandno = 0; bandno < numbands; bandno++) {
|
||||
fprintf(fd, "(%d,%d) ", tccp->stepsizes[bandno].mant,
|
||||
tccp->stepsizes[bandno].expn);
|
||||
}
|
||||
fprintf(fd, "\n");
|
||||
|
||||
if (tccp->csty & J2K_CCP_CSTY_PRT) {
|
||||
fprintf(fd, " prcw=");
|
||||
for (resno = 0; resno < tccp->numresolutions; resno++) {
|
||||
fprintf(fd, "%d ", tccp->prcw[resno]);
|
||||
}
|
||||
fprintf(fd, "\n");
|
||||
fprintf(fd, " prch=");
|
||||
for (resno = 0; resno < tccp->numresolutions; resno++) {
|
||||
fprintf(fd, "%d ", tccp->prch[resno]);
|
||||
}
|
||||
fprintf(fd, "\n");
|
||||
}
|
||||
fprintf(fd, " }\n");
|
||||
}
|
||||
fprintf(fd, " }\n");
|
||||
}
|
||||
fprintf(fd, "}\n");
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------- */
|
||||
static int j2k_get_num_tp(opj_cp_t *cp,int pino,int tileno){
|
||||
char *prog;
|
||||
|
@ -2296,8 +2222,6 @@ bool j2k_encode(opj_j2k_t *j2k, opj_cio_t *cio, opj_image_t *image, opj_codestre
|
|||
|
||||
cp = j2k->cp;
|
||||
|
||||
/* j2k_dump_cp(stdout, image, cp); */
|
||||
|
||||
/* INDEX >> */
|
||||
j2k->cstr_info = cstr_info;
|
||||
if (cstr_info) {
|
||||
|
|
|
@ -438,8 +438,6 @@ Encode an image into a JPEG-2000 codestream
|
|||
*/
|
||||
bool j2k_encode(opj_j2k_t *j2k, opj_cio_t *cio, opj_image_t *image, opj_codestream_info_t *cstr_info);
|
||||
|
||||
void j2k_dump_image(FILE *fd, opj_image_t * img);
|
||||
void j2k_dump_cp(FILE *fd, opj_image_t * img, opj_cp_t * cp);
|
||||
/* ----------------------------------------------------------------------- */
|
||||
/*@}*/
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,533 @@
|
|||
//---------------------------------------------------------------------------------
|
||||
//
|
||||
// Little Color Management System
|
||||
// Copyright (c) 1998-2010 Marti Maria Saguer
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining
|
||||
// a copy of this software and associated documentation files (the "Software"),
|
||||
// to deal in the Software without restriction, including without limitation
|
||||
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
// and/or sell copies of the Software, and to permit persons to whom the Software
|
||||
// is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
||||
// THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
//---------------------------------------------------------------------------------
|
||||
//
|
||||
// This is the plug-in header file. Normal LittleCMS clients should not use it.
|
||||
// It is provided for plug-in writters that may want to access the support
|
||||
// functions to do low level operations. All plug-in related structures
|
||||
// are defined here. Including this file forces to include the standard API too.
|
||||
|
||||
#ifndef _lcms_plugin_H
|
||||
|
||||
// Deal with Microsoft's attempt at deprecating C standard runtime functions
|
||||
#ifdef _MSC_VER
|
||||
# if (_MSC_VER >= 1400)
|
||||
# ifndef _CRT_SECURE_NO_DEPRECATE
|
||||
# define _CRT_SECURE_NO_DEPRECATE
|
||||
# endif
|
||||
# ifndef _CRT_SECURE_NO_WARNINGS
|
||||
# define _CRT_SECURE_NO_WARNINGS
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef _lcms2_H
|
||||
#include "lcms2.h"
|
||||
#endif
|
||||
|
||||
// We need some standard C functions.
|
||||
#include <stdlib.h>
|
||||
#include <math.h>
|
||||
#include <stdarg.h>
|
||||
#include <memory.h>
|
||||
#include <string.h>
|
||||
|
||||
|
||||
#ifndef CMS_USE_CPP_API
|
||||
# ifdef __cplusplus
|
||||
extern "C" {
|
||||
# endif
|
||||
#endif
|
||||
|
||||
// Vector & Matrix operations -----------------------------------------------------------------------
|
||||
|
||||
// Axis of the matrix/array. No specific meaning at all.
|
||||
#define VX 0
|
||||
#define VY 1
|
||||
#define VZ 2
|
||||
|
||||
// Vectors
|
||||
typedef struct {
|
||||
cmsFloat64Number n[3];
|
||||
|
||||
} cmsVEC3;
|
||||
|
||||
// 3x3 Matrix
|
||||
typedef struct {
|
||||
cmsVEC3 v[3];
|
||||
|
||||
} cmsMAT3;
|
||||
|
||||
CMSAPI void CMSEXPORT _cmsVEC3init(cmsVEC3* r, cmsFloat64Number x, cmsFloat64Number y, cmsFloat64Number z);
|
||||
CMSAPI void CMSEXPORT _cmsVEC3minus(cmsVEC3* r, const cmsVEC3* a, const cmsVEC3* b);
|
||||
CMSAPI void CMSEXPORT _cmsVEC3cross(cmsVEC3* r, const cmsVEC3* u, const cmsVEC3* v);
|
||||
CMSAPI cmsFloat64Number CMSEXPORT _cmsVEC3dot(const cmsVEC3* u, const cmsVEC3* v);
|
||||
CMSAPI cmsFloat64Number CMSEXPORT _cmsVEC3length(const cmsVEC3* a);
|
||||
CMSAPI cmsFloat64Number CMSEXPORT _cmsVEC3distance(const cmsVEC3* a, const cmsVEC3* b);
|
||||
|
||||
CMSAPI void CMSEXPORT _cmsMAT3identity(cmsMAT3* a);
|
||||
CMSAPI cmsBool CMSEXPORT _cmsMAT3isIdentity(const cmsMAT3* a);
|
||||
CMSAPI void CMSEXPORT _cmsMAT3per(cmsMAT3* r, const cmsMAT3* a, const cmsMAT3* b);
|
||||
CMSAPI cmsBool CMSEXPORT _cmsMAT3inverse(const cmsMAT3* a, cmsMAT3* b);
|
||||
CMSAPI cmsBool CMSEXPORT _cmsMAT3solve(cmsVEC3* x, cmsMAT3* a, cmsVEC3* b);
|
||||
CMSAPI void CMSEXPORT _cmsMAT3eval(cmsVEC3* r, const cmsMAT3* a, const cmsVEC3* v);
|
||||
|
||||
|
||||
// Error logging -------------------------------------------------------------------------------------
|
||||
|
||||
CMSAPI void CMSEXPORT cmsSignalError(cmsContext ContextID, cmsUInt32Number ErrorCode, const char *ErrorText, ...);
|
||||
|
||||
// Memory management ----------------------------------------------------------------------------------
|
||||
|
||||
CMSAPI void* CMSEXPORT _cmsMalloc(cmsContext ContextID, cmsUInt32Number size);
|
||||
CMSAPI void* CMSEXPORT _cmsMallocZero(cmsContext ContextID, cmsUInt32Number size);
|
||||
CMSAPI void* CMSEXPORT _cmsCalloc(cmsContext ContextID, cmsUInt32Number num, cmsUInt32Number size);
|
||||
CMSAPI void* CMSEXPORT _cmsRealloc(cmsContext ContextID, void* Ptr, cmsUInt32Number NewSize);
|
||||
CMSAPI void CMSEXPORT _cmsFree(cmsContext ContextID, void* Ptr);
|
||||
CMSAPI void* CMSEXPORT _cmsDupMem(cmsContext ContextID, const void* Org, cmsUInt32Number size);
|
||||
|
||||
// I/O handler ----------------------------------------------------------------------------------
|
||||
|
||||
struct _cms_io_handler {
|
||||
|
||||
void* stream; // Associated stream, which is implemented differently depending on media.
|
||||
|
||||
cmsContext ContextID;
|
||||
cmsUInt32Number UsedSpace;
|
||||
char PhysicalFile[cmsMAX_PATH];
|
||||
|
||||
cmsUInt32Number (* Read)(struct _cms_io_handler* iohandler, void *Buffer,
|
||||
cmsUInt32Number size,
|
||||
cmsUInt32Number count);
|
||||
cmsBool (* Seek)(struct _cms_io_handler* iohandler, cmsUInt32Number offset);
|
||||
cmsBool (* Close)(struct _cms_io_handler* iohandler);
|
||||
cmsUInt32Number (* Tell)(struct _cms_io_handler* iohandler);
|
||||
cmsBool (* Write)(struct _cms_io_handler* iohandler, cmsUInt32Number size,
|
||||
const void* Buffer);
|
||||
};
|
||||
|
||||
// Endianess adjust functions
|
||||
CMSAPI cmsUInt16Number CMSEXPORT _cmsAdjustEndianess16(cmsUInt16Number Word);
|
||||
CMSAPI cmsUInt32Number CMSEXPORT _cmsAdjustEndianess32(cmsUInt32Number Value);
|
||||
CMSAPI void CMSEXPORT _cmsAdjustEndianess64(cmsUInt64Number* Result, cmsUInt64Number QWord);
|
||||
|
||||
// Helper IO functions
|
||||
CMSAPI cmsBool CMSEXPORT _cmsReadUInt8Number(cmsIOHANDLER* io, cmsUInt8Number* n);
|
||||
CMSAPI cmsBool CMSEXPORT _cmsReadUInt16Number(cmsIOHANDLER* io, cmsUInt16Number* n);
|
||||
CMSAPI cmsBool CMSEXPORT _cmsReadUInt32Number(cmsIOHANDLER* io, cmsUInt32Number* n);
|
||||
CMSAPI cmsBool CMSEXPORT _cmsReadFloat32Number(cmsIOHANDLER* io, cmsFloat32Number* n);
|
||||
CMSAPI cmsBool CMSEXPORT _cmsReadUInt64Number(cmsIOHANDLER* io, cmsUInt64Number* n);
|
||||
CMSAPI cmsBool CMSEXPORT _cmsRead15Fixed16Number(cmsIOHANDLER* io, cmsFloat64Number* n);
|
||||
CMSAPI cmsBool CMSEXPORT _cmsReadXYZNumber(cmsIOHANDLER* io, cmsCIEXYZ* XYZ);
|
||||
CMSAPI cmsBool CMSEXPORT _cmsReadUInt16Array(cmsIOHANDLER* io, cmsUInt32Number n, cmsUInt16Number* Array);
|
||||
|
||||
CMSAPI cmsBool CMSEXPORT _cmsWriteUInt8Number(cmsIOHANDLER* io, cmsUInt8Number n);
|
||||
CMSAPI cmsBool CMSEXPORT _cmsWriteUInt16Number(cmsIOHANDLER* io, cmsUInt16Number n);
|
||||
CMSAPI cmsBool CMSEXPORT _cmsWriteUInt32Number(cmsIOHANDLER* io, cmsUInt32Number n);
|
||||
CMSAPI cmsBool CMSEXPORT _cmsWriteFloat32Number(cmsIOHANDLER* io, cmsFloat32Number n);
|
||||
CMSAPI cmsBool CMSEXPORT _cmsWriteUInt64Number(cmsIOHANDLER* io, cmsUInt64Number n);
|
||||
CMSAPI cmsBool CMSEXPORT _cmsWrite15Fixed16Number(cmsIOHANDLER* io, cmsFloat64Number n);
|
||||
CMSAPI cmsBool CMSEXPORT _cmsWriteXYZNumber(cmsIOHANDLER* io, const cmsCIEXYZ* XYZ);
|
||||
CMSAPI cmsBool CMSEXPORT _cmsWriteUInt16Array(cmsIOHANDLER* io, cmsUInt32Number n, const cmsUInt16Number* Array);
|
||||
|
||||
// ICC base tag
|
||||
typedef struct {
|
||||
cmsTagTypeSignature sig;
|
||||
cmsInt8Number reserved[4];
|
||||
|
||||
} _cmsTagBase;
|
||||
|
||||
// Type base helper functions
|
||||
CMSAPI cmsTagTypeSignature CMSEXPORT _cmsReadTypeBase(cmsIOHANDLER* io);
|
||||
CMSAPI cmsBool CMSEXPORT _cmsWriteTypeBase(cmsIOHANDLER* io, cmsTagTypeSignature sig);
|
||||
|
||||
// Alignment functions
|
||||
CMSAPI cmsBool CMSEXPORT _cmsReadAlignment(cmsIOHANDLER* io);
|
||||
CMSAPI cmsBool CMSEXPORT _cmsWriteAlignment(cmsIOHANDLER* io);
|
||||
|
||||
// To deal with text streams. 2K at most
|
||||
CMSAPI cmsBool CMSEXPORT _cmsIOPrintf(cmsIOHANDLER* io, const char* frm, ...);
|
||||
|
||||
// Fixed point helper functions
|
||||
CMSAPI cmsFloat64Number CMSEXPORT _cms8Fixed8toDouble(cmsUInt16Number fixed8);
|
||||
CMSAPI cmsUInt16Number CMSEXPORT _cmsDoubleTo8Fixed8(cmsFloat64Number val);
|
||||
|
||||
CMSAPI cmsFloat64Number CMSEXPORT _cms15Fixed16toDouble(cmsS15Fixed16Number fix32);
|
||||
CMSAPI cmsS15Fixed16Number CMSEXPORT _cmsDoubleTo15Fixed16(cmsFloat64Number v);
|
||||
|
||||
// Date/time helper functions
|
||||
CMSAPI void CMSEXPORT _cmsEncodeDateTimeNumber(cmsDateTimeNumber *Dest, const struct tm *Source);
|
||||
CMSAPI void CMSEXPORT _cmsDecodeDateTimeNumber(const cmsDateTimeNumber *Source, struct tm *Dest);
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------------------------------------
|
||||
|
||||
// Plug-in foundation
|
||||
#define cmsPluginMagicNumber 0x61637070 // 'acpp'
|
||||
|
||||
#define cmsPluginMemHandlerSig 0x6D656D48 // 'memH'
|
||||
#define cmsPluginInterpolationSig 0x696E7048 // 'inpH'
|
||||
#define cmsPluginParametricCurveSig 0x70617248 // 'parH'
|
||||
#define cmsPluginFormattersSig 0x66726D48 // 'frmH
|
||||
#define cmsPluginTagTypeSig 0x74797048 // 'typH'
|
||||
#define cmsPluginTagSig 0x74616748 // 'tagH'
|
||||
#define cmsPluginRenderingIntentSig 0x696E7448 // 'intH'
|
||||
#define cmsPluginMultiProcessElementSig 0x6D706548 // 'mpeH'
|
||||
#define cmsPluginOptimizationSig 0x6F707448 // 'optH'
|
||||
|
||||
typedef struct _cmsPluginBaseStruct {
|
||||
|
||||
cmsUInt32Number Magic; // 'acpp' signature
|
||||
cmsUInt32Number ExpectedVersion; // Expected version of LittleCMS
|
||||
cmsUInt32Number Type; // Type of plug-in
|
||||
struct _cmsPluginBaseStruct* Next; // For multiple plugin definition. NULL for end of list.
|
||||
|
||||
} cmsPluginBase;
|
||||
|
||||
// Maximum number of types in a plugin array
|
||||
#define MAX_TYPES_IN_LCMS_PLUGIN 20
|
||||
|
||||
//----------------------------------------------------------------------------------------------------------
|
||||
|
||||
// Memory handler. Each new plug-in type replaces current behaviour
|
||||
typedef struct {
|
||||
|
||||
cmsPluginBase base;
|
||||
|
||||
// Required
|
||||
void * (* MallocPtr)(cmsContext ContextID, cmsUInt32Number size);
|
||||
void (* FreePtr)(cmsContext ContextID, void *Ptr);
|
||||
void * (* ReallocPtr)(cmsContext ContextID, void* Ptr, cmsUInt32Number NewSize);
|
||||
|
||||
// Optional
|
||||
void * (* MallocZeroPtr)(cmsContext ContextID, cmsUInt32Number size);
|
||||
void * (* CallocPtr)(cmsContext ContextID, cmsUInt32Number num, cmsUInt32Number size);
|
||||
void * (* DupPtr)(cmsContext ContextID, const void* Org, cmsUInt32Number size);
|
||||
|
||||
} cmsPluginMemHandler;
|
||||
|
||||
|
||||
// ------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
// Interpolation. 16 bits and floating point versions.
|
||||
struct _cms_interp_struc;
|
||||
|
||||
// Interpolation callbacks
|
||||
|
||||
// 16 bits forward interpolation. This function performs precision-limited linear interpolation
|
||||
// and is supposed to be quite fast. Implementation may be tetrahedral or trilinear, and plug-ins may
|
||||
// choose to implement any other interpolation algorithm.
|
||||
typedef void (* _cmsInterpFn16)(register const cmsUInt16Number Input[],
|
||||
register cmsUInt16Number Output[],
|
||||
register const struct _cms_interp_struc* p);
|
||||
|
||||
// Floating point forward interpolation. Full precision interpolation using floats. This is not a
|
||||
// time critical function. Implementation may be tetrahedral or trilinear, and plug-ins may
|
||||
// choose to implement any other interpolation algorithm.
|
||||
typedef void (* _cmsInterpFnFloat)(cmsFloat32Number const Input[],
|
||||
cmsFloat32Number Output[],
|
||||
const struct _cms_interp_struc* p);
|
||||
|
||||
|
||||
|
||||
// This type holds a pointer to an interpolator that can be either 16 bits or float
|
||||
typedef union {
|
||||
_cmsInterpFn16 Lerp16; // Forward interpolation in 16 bits
|
||||
_cmsInterpFnFloat LerpFloat; // Forward interpolation in floating point
|
||||
} cmsInterpFunction;
|
||||
|
||||
// Flags for interpolator selection
|
||||
#define CMS_LERP_FLAGS_16BITS 0x0000 // The default
|
||||
#define CMS_LERP_FLAGS_FLOAT 0x0001 // Requires different implementation
|
||||
#define CMS_LERP_FLAGS_TRILINEAR 0x0100 // Hint only
|
||||
|
||||
|
||||
#define MAX_INPUT_DIMENSIONS 8
|
||||
|
||||
typedef struct _cms_interp_struc { // Used on all interpolations. Supplied by lcms2 when calling the interpolation function
|
||||
|
||||
cmsContext ContextID; // The calling thread
|
||||
|
||||
cmsUInt32Number dwFlags; // Keep original flags
|
||||
cmsUInt32Number nInputs; // != 1 only in 3D interpolation
|
||||
cmsUInt32Number nOutputs; // != 1 only in 3D interpolation
|
||||
|
||||
cmsUInt32Number nSamples[MAX_INPUT_DIMENSIONS]; // Valid on all kinds of tables
|
||||
cmsUInt32Number Domain[MAX_INPUT_DIMENSIONS]; // Domain = nSamples - 1
|
||||
|
||||
cmsUInt32Number opta[MAX_INPUT_DIMENSIONS]; // Optimization for 3D CLUT. This is the number of nodes premultiplied for each
|
||||
// dimension. For example, in 7 nodes, 7, 7^2 , 7^3, 7^4, etc. On non-regular
|
||||
// Samplings may vary according of the number of nodes for each dimension.
|
||||
|
||||
const void *Table; // Points to the actual interpolation table
|
||||
cmsInterpFunction Interpolation; // Points to the function to do the interpolation
|
||||
|
||||
} cmsInterpParams;
|
||||
|
||||
// Interpolators factory
|
||||
typedef cmsInterpFunction (* cmsInterpFnFactory)(cmsUInt32Number nInputChannels, cmsUInt32Number nOutputChannels, cmsUInt32Number dwFlags);
|
||||
|
||||
// The plug-in
|
||||
typedef struct {
|
||||
cmsPluginBase base;
|
||||
|
||||
// Points to a user-supplied function which implements the factory
|
||||
cmsInterpFnFactory InterpolatorsFactory;
|
||||
|
||||
} cmsPluginInterpolation;
|
||||
|
||||
//----------------------------------------------------------------------------------------------------------
|
||||
|
||||
// Parametric curves. A negative type means same function but analytically inverted. Max. number of params is 10
|
||||
|
||||
// Evaluator callback for user-suplied parametric curves. May implement more than one type
|
||||
typedef cmsFloat64Number (* cmsParametricCurveEvaluator)(cmsInt32Number Type, const cmsFloat64Number Params[10], cmsFloat64Number R);
|
||||
|
||||
// Plug-in may implement an arbitrary number of parametric curves
|
||||
typedef struct {
|
||||
cmsPluginBase base;
|
||||
|
||||
cmsUInt32Number nFunctions; // Number of supported functions
|
||||
cmsUInt32Number FunctionTypes[MAX_TYPES_IN_LCMS_PLUGIN]; // The identification types
|
||||
cmsUInt32Number ParameterCount[MAX_TYPES_IN_LCMS_PLUGIN]; // Number of parameters for each function
|
||||
|
||||
cmsParametricCurveEvaluator Evaluator; // The evaluator
|
||||
|
||||
} cmsPluginParametricCurves;
|
||||
//----------------------------------------------------------------------------------------------------------
|
||||
|
||||
// Formatters. This plug-in adds new handlers, replacing them if they already exist. Formatters dealing with
|
||||
// cmsFloat32Number (bps = 4) or double (bps = 0) types are requested via FormatterFloat callback. Others come across
|
||||
// Formatter16 callback
|
||||
|
||||
struct _cmstransform_struct;
|
||||
|
||||
typedef cmsUInt8Number* (* cmsFormatter16)(register struct _cmstransform_struct* CMMcargo,
|
||||
register cmsUInt16Number Values[],
|
||||
register cmsUInt8Number* Buffer,
|
||||
register cmsUInt32Number Stride);
|
||||
|
||||
typedef cmsUInt8Number* (* cmsFormatterFloat)(struct _cmstransform_struct* CMMcargo,
|
||||
cmsFloat32Number Values[],
|
||||
cmsUInt8Number* Buffer,
|
||||
cmsUInt32Number Stride);
|
||||
|
||||
// This type holds a pointer to a formatter that can be either 16 bits or cmsFloat32Number
|
||||
typedef union {
|
||||
cmsFormatter16 Fmt16;
|
||||
cmsFormatterFloat FmtFloat;
|
||||
|
||||
} cmsFormatter;
|
||||
|
||||
#define CMS_PACK_FLAGS_16BITS 0x0000
|
||||
#define CMS_PACK_FLAGS_FLOAT 0x0001
|
||||
|
||||
typedef enum { cmsFormatterInput=0, cmsFormatterOutput=1 } cmsFormatterDirection;
|
||||
|
||||
typedef cmsFormatter (* cmsFormatterFactory)(cmsUInt32Number Type, // Specific type, i.e. TYPE_RGB_8
|
||||
cmsFormatterDirection Dir,
|
||||
cmsUInt32Number dwFlags); // precision
|
||||
|
||||
// Plug-in may implement an arbitrary number of formatters
|
||||
typedef struct {
|
||||
cmsPluginBase base;
|
||||
cmsFormatterFactory FormattersFactory;
|
||||
|
||||
} cmsPluginFormatters;
|
||||
|
||||
//----------------------------------------------------------------------------------------------------------
|
||||
|
||||
// Tag type handler. Each type is free to return anything it wants, and it is up to the caller to
|
||||
// know in advance what is the type contained in the tag.
|
||||
typedef struct _cms_typehandler_struct {
|
||||
|
||||
cmsTagTypeSignature Signature; // The signature of the type
|
||||
|
||||
// Allocates and reads items
|
||||
void * (* ReadPtr)(struct _cms_typehandler_struct* self,
|
||||
cmsIOHANDLER* io,
|
||||
cmsUInt32Number* nItems,
|
||||
cmsUInt32Number SizeOfTag);
|
||||
|
||||
// Writes n Items
|
||||
cmsBool (* WritePtr)(struct _cms_typehandler_struct* self,
|
||||
cmsIOHANDLER* io,
|
||||
void* Ptr,
|
||||
cmsUInt32Number nItems);
|
||||
|
||||
// Duplicate an item or array of items
|
||||
void* (* DupPtr)(struct _cms_typehandler_struct* self,
|
||||
const void *Ptr,
|
||||
cmsUInt32Number n);
|
||||
|
||||
// Free all resources
|
||||
void (* FreePtr)(struct _cms_typehandler_struct* self,
|
||||
void *Ptr);
|
||||
|
||||
// The calling thread
|
||||
cmsContext ContextID;
|
||||
|
||||
} cmsTagTypeHandler;
|
||||
|
||||
// Each plug-in implements a single type
|
||||
typedef struct {
|
||||
cmsPluginBase base;
|
||||
cmsTagTypeHandler Handler;
|
||||
|
||||
} cmsPluginTagType;
|
||||
|
||||
//----------------------------------------------------------------------------------------------------------
|
||||
|
||||
// This is the tag plugin, which identifies tags. For writing, a pointer to function is provided.
|
||||
// This function should return the desired type for this tag, given the version of profile
|
||||
// and the data being serialized.
|
||||
typedef struct {
|
||||
|
||||
cmsUInt32Number ElemCount; // If this tag needs an array, how many elements should keep
|
||||
|
||||
// For reading.
|
||||
cmsUInt32Number nSupportedTypes; // In how many types this tag can come (MAX_TYPES_IN_LCMS_PLUGIN maximum)
|
||||
cmsTagTypeSignature SupportedTypes[MAX_TYPES_IN_LCMS_PLUGIN];
|
||||
|
||||
// For writting
|
||||
cmsTagTypeSignature (* DecideType)(cmsFloat64Number ICCVersion, const void *Data);
|
||||
|
||||
} cmsTagDescriptor;
|
||||
|
||||
// Plug-in implements a single tag
|
||||
typedef struct {
|
||||
cmsPluginBase base;
|
||||
|
||||
cmsTagSignature Signature;
|
||||
cmsTagDescriptor Descriptor;
|
||||
|
||||
} cmsPluginTag;
|
||||
|
||||
//----------------------------------------------------------------------------------------------------------
|
||||
|
||||
// Custom intents. This function should join all profiles specified in the array in
|
||||
// a single LUT. Any custom intent in the chain redirects to custom function. If more than
|
||||
// one custom intent is found, the one located first is invoked. Usually users should use only one
|
||||
// custom intent, so mixing custom intents in same multiprofile transform is not supported.
|
||||
|
||||
typedef cmsPipeline* (* cmsIntentFn)( cmsContext ContextID,
|
||||
cmsUInt32Number nProfiles,
|
||||
cmsUInt32Number Intents[],
|
||||
cmsHPROFILE hProfiles[],
|
||||
cmsBool BPC[],
|
||||
cmsFloat64Number AdaptationStates[],
|
||||
cmsUInt32Number dwFlags);
|
||||
|
||||
|
||||
// Each plug-in defines a single intent number.
|
||||
typedef struct {
|
||||
cmsPluginBase base;
|
||||
cmsUInt32Number Intent;
|
||||
cmsIntentFn Link;
|
||||
char Description[256];
|
||||
|
||||
} cmsPluginRenderingIntent;
|
||||
|
||||
|
||||
// The default ICC intents (perceptual, saturation, rel.col and abs.col)
|
||||
CMSAPI cmsPipeline* CMSEXPORT _cmsDefaultICCintents(cmsContext ContextID,
|
||||
cmsUInt32Number nProfiles,
|
||||
cmsUInt32Number Intents[],
|
||||
cmsHPROFILE hProfiles[],
|
||||
cmsBool BPC[],
|
||||
cmsFloat64Number AdaptationStates[],
|
||||
cmsUInt32Number dwFlags);
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------------------------------------
|
||||
|
||||
// Pipelines, Multi Process Elements.
|
||||
|
||||
typedef void (* _cmsStageEvalFn) (const cmsFloat32Number In[], cmsFloat32Number Out[], const cmsStage* mpe);
|
||||
typedef void*(* _cmsStageDupElemFn) (cmsStage* mpe);
|
||||
typedef void (* _cmsStageFreeElemFn) (cmsStage* mpe);
|
||||
|
||||
|
||||
// This function allocates a generic MPE
|
||||
CMSAPI cmsStage* CMSEXPORT _cmsStageAllocPlaceholder(cmsContext ContextID,
|
||||
cmsStageSignature Type,
|
||||
cmsUInt32Number InputChannels,
|
||||
cmsUInt32Number OutputChannels,
|
||||
_cmsStageEvalFn EvalPtr, // Points to fn that evaluates the element (always in floating point)
|
||||
_cmsStageDupElemFn DupElemPtr, // Points to a fn that duplicates the stage
|
||||
_cmsStageFreeElemFn FreePtr, // Points to a fn that sets the element free
|
||||
void* Data); // A generic pointer to whatever memory needed by the element
|
||||
typedef struct {
|
||||
cmsPluginBase base;
|
||||
cmsTagTypeHandler Handler;
|
||||
|
||||
} cmsPluginMultiProcessElement;
|
||||
|
||||
//----------------------------------------------------------------------------------------------------------
|
||||
// Optimization. Using this plug-in, additional optimization strategies may be implemented.
|
||||
// The function should return TRUE if any optimization is done on the LUT, this terminates
|
||||
// the optimization search. Or FALSE if it is unable to optimize and want to give a chance
|
||||
// to the rest of optimizers.
|
||||
|
||||
typedef void (* _cmsOPTeval16Fn)(register const cmsUInt16Number In[],
|
||||
register cmsUInt16Number Out[],
|
||||
register const void* Data);
|
||||
|
||||
typedef void (* _cmsOPTfreeDataFn)(cmsContext ContextID, void* Data);
|
||||
typedef void* (* _cmsOPTdupDataFn)(cmsContext ContextID, const void* Data);
|
||||
|
||||
|
||||
typedef cmsBool (* _cmsOPToptimizeFn)(cmsPipeline** Lut,
|
||||
cmsUInt32Number Intent,
|
||||
cmsUInt32Number* InputFormat,
|
||||
cmsUInt32Number* OutputFormat,
|
||||
cmsUInt32Number* dwFlags);
|
||||
|
||||
// This function may be used to set the optional evaluator and a block of private data. If private data is being used, an optional
|
||||
// duplicator and free functions should also be specified in order to duplicate the LUT construct. Use NULL to inhibit such functionality.
|
||||
|
||||
CMSAPI void CMSEXPORT _cmsPipelineSetOptimizationParameters(cmsPipeline* Lut,
|
||||
_cmsOPTeval16Fn Eval16,
|
||||
void* PrivateData,
|
||||
_cmsOPTfreeDataFn FreePrivateDataFn,
|
||||
_cmsOPTdupDataFn DupPrivateDataFn);
|
||||
|
||||
typedef struct {
|
||||
cmsPluginBase base;
|
||||
|
||||
// Optimize entry point
|
||||
_cmsOPToptimizeFn OptimizePtr;
|
||||
|
||||
} cmsPluginOptimization;
|
||||
|
||||
//----------------------------------------------------------------------------------------------------------
|
||||
|
||||
#ifndef CMS_USE_CPP_API
|
||||
# ifdef __cplusplus
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#define _lcms_plugin_H
|
||||
#endif
|
Binary file not shown.
Binary file not shown.
|
@ -1,4 +1,4 @@
|
|||
/* $Id: tiff.h,v 1.42 2005/12/23 15:10:45 dron Exp $ */
|
||||
/* $Id: tiff.h,v 1.65 2010-03-10 18:56:49 bfriesen Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1988-1997 Sam Leffler
|
||||
|
@ -39,87 +39,75 @@
|
|||
* Suite 200
|
||||
* Seattle, WA 98104
|
||||
* 206-622-5500
|
||||
*
|
||||
*
|
||||
* (http://partners.adobe.com/asn/developer/PDFS/TN/TIFF6.pdf)
|
||||
*
|
||||
* For Big TIFF design notes see the following link
|
||||
* http://gdal.maptools.org/twiki/bin/view/libtiff/BigTIFFDesign
|
||||
* For BigTIFF design notes see the following links
|
||||
* http://www.remotesensing.org/libtiff/bigtiffdesign.html
|
||||
* http://www.awaresystems.be/imaging/tiff/bigtiff.html
|
||||
*/
|
||||
#define TIFF_VERSION 42
|
||||
#define TIFF_BIGTIFF_VERSION 43
|
||||
|
||||
#define TIFF_BIGENDIAN 0x4d4d
|
||||
#define TIFF_LITTLEENDIAN 0x4949
|
||||
#define MDI_LITTLEENDIAN 0x5045
|
||||
#define MDI_BIGENDIAN 0x4550
|
||||
#define TIFF_VERSION_CLASSIC 42
|
||||
#define TIFF_VERSION_BIG 43
|
||||
|
||||
#define TIFF_BIGENDIAN 0x4d4d
|
||||
#define TIFF_LITTLEENDIAN 0x4949
|
||||
#define MDI_LITTLEENDIAN 0x5045
|
||||
#define MDI_BIGENDIAN 0x4550
|
||||
|
||||
/*
|
||||
* Intrinsic data types required by the file format:
|
||||
*
|
||||
* 8-bit quantities int8/uint8
|
||||
* 16-bit quantities int16/uint16
|
||||
* 32-bit quantities int32/uint32
|
||||
* strings unsigned char*
|
||||
* 8-bit quantities int8/uint8
|
||||
* 16-bit quantities int16/uint16
|
||||
* 32-bit quantities int32/uint32
|
||||
* 64-bit quantities int64/uint64
|
||||
* strings unsigned char*
|
||||
*/
|
||||
|
||||
#ifndef HAVE_INT8
|
||||
typedef signed char int8; /* NB: non-ANSI compilers may not grok */
|
||||
#endif
|
||||
typedef unsigned char uint8;
|
||||
#ifndef HAVE_INT16
|
||||
typedef short int16;
|
||||
#endif
|
||||
typedef unsigned short uint16; /* sizeof (uint16) must == 2 */
|
||||
#if SIZEOF_INT == 4
|
||||
#ifndef HAVE_INT32
|
||||
typedef int int32;
|
||||
#endif
|
||||
typedef unsigned int uint32; /* sizeof (uint32) must == 4 */
|
||||
#elif SIZEOF_LONG == 4
|
||||
#ifndef HAVE_INT32
|
||||
typedef long int32;
|
||||
#endif
|
||||
typedef unsigned long uint32; /* sizeof (uint32) must == 4 */
|
||||
#endif
|
||||
typedef TIFF_INT8_T int8;
|
||||
typedef TIFF_UINT8_T uint8;
|
||||
|
||||
/* For TIFFReassignTagToIgnore */
|
||||
enum TIFFIgnoreSense /* IGNORE tag table */
|
||||
{
|
||||
TIS_STORE,
|
||||
TIS_EXTRACT,
|
||||
TIS_EMPTY
|
||||
};
|
||||
typedef TIFF_INT16_T int16;
|
||||
typedef TIFF_UINT16_T uint16;
|
||||
|
||||
typedef TIFF_INT32_T int32;
|
||||
typedef TIFF_UINT32_T uint32;
|
||||
|
||||
typedef TIFF_INT64_T int64;
|
||||
typedef TIFF_UINT64_T uint64;
|
||||
|
||||
/*
|
||||
* Some types as promoted in a variable argument list
|
||||
* We use uint16_vap rather then directly using int, because this way
|
||||
* we document the type we actually want to pass through, conceptually,
|
||||
* rather then confusing the issue by merely stating the type it gets
|
||||
* promoted to
|
||||
*/
|
||||
|
||||
typedef int uint16_vap;
|
||||
|
||||
/*
|
||||
* TIFF header.
|
||||
*/
|
||||
typedef struct {
|
||||
uint16 tiff_magic; /* magic number (defines byte order) */
|
||||
#define TIFF_MAGIC_SIZE 2
|
||||
uint16 tiff_version; /* TIFF version number */
|
||||
#define TIFF_VERSION_SIZE 2
|
||||
uint32 tiff_diroff; /* byte offset to first directory */
|
||||
#define TIFF_DIROFFSET_SIZE 4
|
||||
} TIFFHeader;
|
||||
typedef struct {
|
||||
uint16 tiff_magic; /* magic number (defines byte order) */
|
||||
uint16 tiff_version; /* TIFF version number */
|
||||
} TIFFHeaderCommon;
|
||||
typedef struct {
|
||||
uint16 tiff_magic; /* magic number (defines byte order) */
|
||||
uint16 tiff_version; /* TIFF version number */
|
||||
uint32 tiff_diroff; /* byte offset to first directory */
|
||||
} TIFFHeaderClassic;
|
||||
typedef struct {
|
||||
uint16 tiff_magic; /* magic number (defines byte order) */
|
||||
uint16 tiff_version; /* TIFF version number */
|
||||
uint16 tiff_offsetsize; /* size of offsets, should be 8 */
|
||||
uint16 tiff_unused; /* unused word, should be 0 */
|
||||
uint64 tiff_diroff; /* byte offset to first directory */
|
||||
} TIFFHeaderBig;
|
||||
|
||||
|
||||
/*
|
||||
* TIFF Image File Directories are comprised of a table of field
|
||||
* descriptors of the form shown below. The table is sorted in
|
||||
* ascending order by tag. The values associated with each entry are
|
||||
* disjoint and may appear anywhere in the file (so long as they are
|
||||
* placed on a word boundary).
|
||||
*
|
||||
* If the value is 4 bytes or less, then it is placed in the offset
|
||||
* field to save space. If the value is less than 4 bytes, it is
|
||||
* left-justified in the offset field.
|
||||
*/
|
||||
typedef struct {
|
||||
uint16 tdir_tag; /* see below */
|
||||
uint16 tdir_type; /* data type; see below */
|
||||
uint32 tdir_count; /* number of items; length in spec */
|
||||
uint32 tdir_offset; /* byte offset to field data */
|
||||
} TIFFDirEntry;
|
||||
|
||||
/*
|
||||
* NB: In the comments below,
|
||||
* - items marked with a + are obsoleted by revision 5.0,
|
||||
|
@ -134,21 +122,24 @@ typedef struct {
|
|||
*
|
||||
* Note: RATIONALs are the ratio of two 32-bit integer values.
|
||||
*/
|
||||
typedef enum {
|
||||
TIFF_NOTYPE = 0, /* placeholder */
|
||||
TIFF_BYTE = 1, /* 8-bit unsigned integer */
|
||||
TIFF_ASCII = 2, /* 8-bit bytes w/ last byte null */
|
||||
TIFF_SHORT = 3, /* 16-bit unsigned integer */
|
||||
TIFF_LONG = 4, /* 32-bit unsigned integer */
|
||||
TIFF_RATIONAL = 5, /* 64-bit unsigned fraction */
|
||||
TIFF_SBYTE = 6, /* !8-bit signed integer */
|
||||
TIFF_UNDEFINED = 7, /* !8-bit untyped data */
|
||||
TIFF_SSHORT = 8, /* !16-bit signed integer */
|
||||
TIFF_SLONG = 9, /* !32-bit signed integer */
|
||||
TIFF_SRATIONAL = 10, /* !64-bit signed fraction */
|
||||
TIFF_FLOAT = 11, /* !32-bit IEEE floating point */
|
||||
TIFF_DOUBLE = 12, /* !64-bit IEEE floating point */
|
||||
TIFF_IFD = 13 /* %32-bit unsigned integer (offset) */
|
||||
typedef enum {
|
||||
TIFF_NOTYPE = 0, /* placeholder */
|
||||
TIFF_BYTE = 1, /* 8-bit unsigned integer */
|
||||
TIFF_ASCII = 2, /* 8-bit bytes w/ last byte null */
|
||||
TIFF_SHORT = 3, /* 16-bit unsigned integer */
|
||||
TIFF_LONG = 4, /* 32-bit unsigned integer */
|
||||
TIFF_RATIONAL = 5, /* 64-bit unsigned fraction */
|
||||
TIFF_SBYTE = 6, /* !8-bit signed integer */
|
||||
TIFF_UNDEFINED = 7, /* !8-bit untyped data */
|
||||
TIFF_SSHORT = 8, /* !16-bit signed integer */
|
||||
TIFF_SLONG = 9, /* !32-bit signed integer */
|
||||
TIFF_SRATIONAL = 10, /* !64-bit signed fraction */
|
||||
TIFF_FLOAT = 11, /* !32-bit IEEE floating point */
|
||||
TIFF_DOUBLE = 12, /* !64-bit IEEE floating point */
|
||||
TIFF_IFD = 13, /* %32-bit unsigned integer (offset) */
|
||||
TIFF_LONG8 = 16, /* BigTIFF 64-bit unsigned integer */
|
||||
TIFF_SLONG8 = 17, /* BigTIFF 64-bit signed integer */
|
||||
TIFF_IFD8 = 18 /* BigTIFF 64-bit unsigned integer (offset) */
|
||||
} TIFFDataType;
|
||||
|
||||
/*
|
||||
|
@ -645,3 +636,10 @@ typedef enum {
|
|||
#endif /* _TIFF_ */
|
||||
|
||||
/* vim: set ts=8 sts=8 sw=8 noet: */
|
||||
/*
|
||||
* Local Variables:
|
||||
* mode: c
|
||||
* c-basic-offset: 8
|
||||
* fill-column: 78
|
||||
* End:
|
||||
*/
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* libtiff/tiffconf.h. Generated by configure. */
|
||||
/* libtiff/tiffconf.h. Generated from tiffconf.h.in by configure. */
|
||||
/*
|
||||
Configuration defines for installed libtiff.
|
||||
This file maintained for backward compatibility. Do not use definitions
|
||||
|
@ -8,6 +8,36 @@
|
|||
#ifndef _TIFFCONF_
|
||||
#define _TIFFCONF_
|
||||
|
||||
/* Signed 16-bit type */
|
||||
#define TIFF_INT16_T signed short
|
||||
|
||||
/* Signed 32-bit type */
|
||||
#define TIFF_INT32_T signed int
|
||||
|
||||
/* Signed 64-bit type */
|
||||
#define TIFF_INT64_T signed long long
|
||||
|
||||
/* Signed 8-bit type */
|
||||
#define TIFF_INT8_T signed char
|
||||
|
||||
/* Unsigned 16-bit type */
|
||||
#define TIFF_UINT16_T unsigned short
|
||||
|
||||
/* Unsigned 32-bit type */
|
||||
#define TIFF_UINT32_T unsigned int
|
||||
|
||||
/* Unsigned 64-bit type */
|
||||
#define TIFF_UINT64_T unsigned long long
|
||||
|
||||
/* Unsigned 8-bit type */
|
||||
#define TIFF_UINT8_T unsigned char
|
||||
|
||||
/* Signed size type */
|
||||
#define TIFF_SSIZE_T signed long
|
||||
|
||||
/* Pointer difference type */
|
||||
#define TIFF_PTRDIFF_T ptrdiff_t
|
||||
|
||||
/* Define to 1 if the system has the type `int16'. */
|
||||
/* #undef HAVE_INT16 */
|
||||
|
||||
|
@ -17,12 +47,6 @@
|
|||
/* Define to 1 if the system has the type `int8'. */
|
||||
/* #undef HAVE_INT8 */
|
||||
|
||||
/* The size of a `int', as computed by sizeof. */
|
||||
#define SIZEOF_INT 4
|
||||
|
||||
/* The size of a `long', as computed by sizeof. */
|
||||
#define SIZEOF_LONG 4
|
||||
|
||||
/* Compatibility stuff. */
|
||||
|
||||
/* Define as 0 or 1 according to the floating point format suported by the
|
||||
|
@ -40,7 +64,10 @@
|
|||
#define CCITT_SUPPORT 1
|
||||
|
||||
/* Support JPEG compression (requires IJG JPEG library) */
|
||||
#undef JPEG_SUPPORT
|
||||
#define JPEG_SUPPORT 1
|
||||
|
||||
/* Support JBIG compression (requires JBIG-KIT library) */
|
||||
#define JBIG_SUPPORT 1
|
||||
|
||||
/* Support LogLuv high dynamic range encoding */
|
||||
#define LOGLUV_SUPPORT 1
|
||||
|
@ -53,7 +80,7 @@
|
|||
|
||||
/* Support Old JPEG compresson (read contrib/ojpeg/README first! Compilation
|
||||
fails with unpatched IJG JPEG library) */
|
||||
/* #undef OJPEG_SUPPORT */
|
||||
#define OJPEG_SUPPORT 1
|
||||
|
||||
/* Support Macintosh PackBits algorithm */
|
||||
#define PACKBITS_SUPPORT 1
|
||||
|
|
|
@ -1,21 +1,21 @@
|
|||
/* $Id: tiffio.h,v 1.50 2006/03/21 16:37:51 dron Exp $ */
|
||||
/* $Id: tiffio.h,v 1.86 2010-03-10 18:56:49 bfriesen Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1988-1997 Sam Leffler
|
||||
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
|
||||
*
|
||||
* Permission to use, copy, modify, distribute, and sell this software and
|
||||
* Permission to use, copy, modify, distribute, and sell this software and
|
||||
* its documentation for any purpose is hereby granted without fee, provided
|
||||
* that (i) the above copyright notices and this permission notice appear in
|
||||
* all copies of the software and related documentation, and (ii) the names of
|
||||
* Sam Leffler and Silicon Graphics may not be used in any advertising or
|
||||
* publicity relating to the software without the specific, prior written
|
||||
* permission of Sam Leffler and Silicon Graphics.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
|
||||
* WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
|
||||
* WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
|
||||
* ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
|
||||
* OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
||||
|
@ -37,7 +37,7 @@
|
|||
* TIFF is defined as an incomplete type to hide the
|
||||
* library's internal data structures from clients.
|
||||
*/
|
||||
typedef struct tiff TIFF;
|
||||
typedef struct tiff TIFF;
|
||||
|
||||
/*
|
||||
* The following typedefs define the intrinsic size of
|
||||
|
@ -55,17 +55,27 @@ typedef struct tiff TIFF;
|
|||
* NB: tsize_t is int32 and not uint32 because some functions
|
||||
* return -1.
|
||||
* NB: toff_t is not off_t for many reasons; TIFFs max out at
|
||||
* 32-bit file offsets being the most important, and to ensure
|
||||
* that it is unsigned, rather than signed.
|
||||
* 32-bit file offsets, and BigTIFF maxes out at 64-bit
|
||||
* offsets being the most important, and to ensure use of
|
||||
* a consistently unsigned type across architectures.
|
||||
* Prior to libtiff 4.0, this was an unsigned 32 bit type.
|
||||
*/
|
||||
typedef uint32 ttag_t; /* directory tag */
|
||||
typedef uint16 tdir_t; /* directory index */
|
||||
typedef uint16 tsample_t; /* sample number */
|
||||
typedef uint32 tstrip_t; /* strip number */
|
||||
typedef uint32 ttile_t; /* tile number */
|
||||
typedef int32 tsize_t; /* i/o size in bytes */
|
||||
typedef void* tdata_t; /* image data ref */
|
||||
typedef uint32 toff_t; /* file offset */
|
||||
/*
|
||||
* this is the machine addressing size type, only it's signed, so make it
|
||||
* int32 on 32bit machines, int64 on 64bit machines
|
||||
*/
|
||||
typedef TIFF_SSIZE_T tmsize_t;
|
||||
typedef uint64 toff_t; /* file offset */
|
||||
/* the following are deprecated and should be replaced by their defining
|
||||
counterparts */
|
||||
typedef uint32 ttag_t; /* directory tag */
|
||||
typedef uint16 tdir_t; /* directory index */
|
||||
typedef uint16 tsample_t; /* sample number */
|
||||
typedef uint32 tstrile_t; /* strip or tile number */
|
||||
typedef tstrile_t tstrip_t; /* strip number */
|
||||
typedef tstrile_t ttile_t; /* tile number */
|
||||
typedef tmsize_t tsize_t; /* i/o size in bytes */
|
||||
typedef void* tdata_t; /* image data ref */
|
||||
|
||||
#if !defined(__WIN32__) && (defined(_WIN32) || defined(WIN32))
|
||||
#define __WIN32__
|
||||
|
@ -88,31 +98,27 @@ typedef uint32 toff_t; /* file offset */
|
|||
# define VC_EXTRALEAN
|
||||
# include <windows.h>
|
||||
# ifdef __WIN32__
|
||||
DECLARE_HANDLE(thandle_t); /* Win32 file handle */
|
||||
DECLARE_HANDLE(thandle_t); /* Win32 file handle */
|
||||
# else
|
||||
typedef HFILE thandle_t; /* client data handle */
|
||||
typedef HFILE thandle_t; /* client data handle */
|
||||
# endif /* __WIN32__ */
|
||||
#else
|
||||
typedef void* thandle_t; /* client data handle */
|
||||
typedef void* thandle_t; /* client data handle */
|
||||
#endif /* USE_WIN32_FILEIO */
|
||||
|
||||
#ifndef NULL
|
||||
# define NULL (void *)0
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Flags to pass to TIFFPrintDirectory to control
|
||||
* printing of data structures that are potentially
|
||||
* very large. Bit-or these flags to enable printing
|
||||
* multiple items.
|
||||
*/
|
||||
#define TIFFPRINT_NONE 0x0 /* no extra info */
|
||||
#define TIFFPRINT_STRIPS 0x1 /* strips/tiles info */
|
||||
#define TIFFPRINT_CURVES 0x2 /* color/gray response curves */
|
||||
#define TIFFPRINT_COLORMAP 0x4 /* colormap */
|
||||
#define TIFFPRINT_JPEGQTABLES 0x100 /* JPEG Q matrices */
|
||||
#define TIFFPRINT_JPEGACTABLES 0x200 /* JPEG AC tables */
|
||||
#define TIFFPRINT_JPEGDCTABLES 0x200 /* JPEG DC tables */
|
||||
#define TIFFPRINT_NONE 0x0 /* no extra info */
|
||||
#define TIFFPRINT_STRIPS 0x1 /* strips/tiles info */
|
||||
#define TIFFPRINT_CURVES 0x2 /* color/gray response curves */
|
||||
#define TIFFPRINT_COLORMAP 0x4 /* colormap */
|
||||
#define TIFFPRINT_JPEGQTABLES 0x100 /* JPEG Q matrices */
|
||||
#define TIFFPRINT_JPEGACTABLES 0x200 /* JPEG AC tables */
|
||||
#define TIFFPRINT_JPEGDCTABLES 0x200 /* JPEG DC tables */
|
||||
|
||||
/*
|
||||
* Colour conversion stuff
|
||||
|
@ -129,42 +135,42 @@ typedef void* thandle_t; /* client data handle */
|
|||
|
||||
/* Structure for holding information about a display device. */
|
||||
|
||||
typedef unsigned char TIFFRGBValue; /* 8-bit samples */
|
||||
typedef unsigned char TIFFRGBValue; /* 8-bit samples */
|
||||
|
||||
typedef struct {
|
||||
float d_mat[3][3]; /* XYZ -> luminance matrix */
|
||||
float d_YCR; /* Light o/p for reference white */
|
||||
float d_mat[3][3]; /* XYZ -> luminance matrix */
|
||||
float d_YCR; /* Light o/p for reference white */
|
||||
float d_YCG;
|
||||
float d_YCB;
|
||||
uint32 d_Vrwr; /* Pixel values for ref. white */
|
||||
uint32 d_Vrwr; /* Pixel values for ref. white */
|
||||
uint32 d_Vrwg;
|
||||
uint32 d_Vrwb;
|
||||
float d_Y0R; /* Residual light for black pixel */
|
||||
float d_Y0R; /* Residual light for black pixel */
|
||||
float d_Y0G;
|
||||
float d_Y0B;
|
||||
float d_gammaR; /* Gamma values for the three guns */
|
||||
float d_gammaR; /* Gamma values for the three guns */
|
||||
float d_gammaG;
|
||||
float d_gammaB;
|
||||
} TIFFDisplay;
|
||||
|
||||
typedef struct { /* YCbCr->RGB support */
|
||||
TIFFRGBValue* clamptab; /* range clamping table */
|
||||
int* Cr_r_tab;
|
||||
int* Cb_b_tab;
|
||||
int32* Cr_g_tab;
|
||||
int32* Cb_g_tab;
|
||||
int32* Y_tab;
|
||||
typedef struct { /* YCbCr->RGB support */
|
||||
TIFFRGBValue* clamptab; /* range clamping table */
|
||||
int* Cr_r_tab;
|
||||
int* Cb_b_tab;
|
||||
int32* Cr_g_tab;
|
||||
int32* Cb_g_tab;
|
||||
int32* Y_tab;
|
||||
} TIFFYCbCrToRGB;
|
||||
|
||||
typedef struct { /* CIE Lab 1976->RGB support */
|
||||
int range; /* Size of conversion table */
|
||||
typedef struct { /* CIE Lab 1976->RGB support */
|
||||
int range; /* Size of conversion table */
|
||||
#define CIELABTORGB_TABLE_RANGE 1500
|
||||
float rstep, gstep, bstep;
|
||||
float X0, Y0, Z0; /* Reference white point */
|
||||
float rstep, gstep, bstep;
|
||||
float X0, Y0, Z0; /* Reference white point */
|
||||
TIFFDisplay display;
|
||||
float Yr2r[CIELABTORGB_TABLE_RANGE + 1]; /* Conversion of Yr to r */
|
||||
float Yg2g[CIELABTORGB_TABLE_RANGE + 1]; /* Conversion of Yg to g */
|
||||
float Yb2b[CIELABTORGB_TABLE_RANGE + 1]; /* Conversion of Yb to b */
|
||||
float Yr2r[CIELABTORGB_TABLE_RANGE + 1]; /* Conversion of Yr to r */
|
||||
float Yg2g[CIELABTORGB_TABLE_RANGE + 1]; /* Conversion of Yg to g */
|
||||
float Yb2b[CIELABTORGB_TABLE_RANGE + 1]; /* Conversion of Yb to b */
|
||||
} TIFFCIELabToRGB;
|
||||
|
||||
/*
|
||||
|
@ -191,45 +197,49 @@ typedef void (*tileSeparateRoutine)
|
|||
* RGBA-reader state.
|
||||
*/
|
||||
struct _TIFFRGBAImage {
|
||||
TIFF* tif; /* image handle */
|
||||
int stoponerr; /* stop on read error */
|
||||
int isContig; /* data is packed/separate */
|
||||
int alpha; /* type of alpha data present */
|
||||
uint32 width; /* image width */
|
||||
uint32 height; /* image height */
|
||||
uint16 bitspersample; /* image bits/sample */
|
||||
uint16 samplesperpixel; /* image samples/pixel */
|
||||
uint16 orientation; /* image orientation */
|
||||
uint16 req_orientation; /* requested orientation */
|
||||
uint16 photometric; /* image photometric interp */
|
||||
uint16* redcmap; /* colormap pallete */
|
||||
uint16* greencmap;
|
||||
uint16* bluecmap;
|
||||
/* get image data routine */
|
||||
int (*get)(TIFFRGBAImage*, uint32*, uint32, uint32);
|
||||
TIFF* tif; /* image handle */
|
||||
int stoponerr; /* stop on read error */
|
||||
int isContig; /* data is packed/separate */
|
||||
int alpha; /* type of alpha data present */
|
||||
uint32 width; /* image width */
|
||||
uint32 height; /* image height */
|
||||
uint16 bitspersample; /* image bits/sample */
|
||||
uint16 samplesperpixel; /* image samples/pixel */
|
||||
uint16 orientation; /* image orientation */
|
||||
uint16 req_orientation; /* requested orientation */
|
||||
uint16 photometric; /* image photometric interp */
|
||||
uint16* redcmap; /* colormap pallete */
|
||||
uint16* greencmap;
|
||||
uint16* bluecmap;
|
||||
/* get image data routine */
|
||||
int (*get)(TIFFRGBAImage*, uint32*, uint32, uint32);
|
||||
/* put decoded strip/tile */
|
||||
union {
|
||||
void (*any)(TIFFRGBAImage*);
|
||||
tileContigRoutine contig;
|
||||
tileSeparateRoutine separate;
|
||||
} put; /* put decoded strip/tile */
|
||||
TIFFRGBValue* Map; /* sample mapping array */
|
||||
uint32** BWmap; /* black&white map */
|
||||
uint32** PALmap; /* palette image map */
|
||||
TIFFYCbCrToRGB* ycbcr; /* YCbCr conversion state */
|
||||
TIFFCIELabToRGB* cielab; /* CIE L*a*b conversion state */
|
||||
tileContigRoutine contig;
|
||||
tileSeparateRoutine separate;
|
||||
} put;
|
||||
TIFFRGBValue* Map; /* sample mapping array */
|
||||
uint32** BWmap; /* black&white map */
|
||||
uint32** PALmap; /* palette image map */
|
||||
TIFFYCbCrToRGB* ycbcr; /* YCbCr conversion state */
|
||||
TIFFCIELabToRGB* cielab; /* CIE L*a*b conversion state */
|
||||
|
||||
int row_offset;
|
||||
int col_offset;
|
||||
uint8* UaToAa; /* Unassociated alpha to associated alpha convertion LUT */
|
||||
uint8* Bitdepth16To8; /* LUT for conversion from 16bit to 8bit values */
|
||||
|
||||
int row_offset;
|
||||
int col_offset;
|
||||
};
|
||||
|
||||
/*
|
||||
* Macros for extracting components from the
|
||||
* packed ABGR form returned by TIFFReadRGBAImage.
|
||||
*/
|
||||
#define TIFFGetR(abgr) ((abgr) & 0xff)
|
||||
#define TIFFGetG(abgr) (((abgr) >> 8) & 0xff)
|
||||
#define TIFFGetB(abgr) (((abgr) >> 16) & 0xff)
|
||||
#define TIFFGetA(abgr) (((abgr) >> 24) & 0xff)
|
||||
#define TIFFGetR(abgr) ((abgr) & 0xff)
|
||||
#define TIFFGetG(abgr) (((abgr) >> 8) & 0xff)
|
||||
#define TIFFGetB(abgr) (((abgr) >> 16) & 0xff)
|
||||
#define TIFFGetA(abgr) (((abgr) >> 24) & 0xff)
|
||||
|
||||
/*
|
||||
* A CODEC is a software package that implements decoding,
|
||||
|
@ -238,11 +248,11 @@ struct _TIFFRGBAImage {
|
|||
* More codecs may be registered through calls to the library
|
||||
* and/or the builtin implementations may be overridden.
|
||||
*/
|
||||
typedef int (*TIFFInitMethod)(TIFF*, int);
|
||||
typedef int (*TIFFInitMethod)(TIFF*, int);
|
||||
typedef struct {
|
||||
char* name;
|
||||
uint16 scheme;
|
||||
TIFFInitMethod init;
|
||||
char* name;
|
||||
uint16 scheme;
|
||||
TIFFInitMethod init;
|
||||
} TIFFCodec;
|
||||
|
||||
#include <stdio.h>
|
||||
|
@ -250,54 +260,264 @@ typedef struct {
|
|||
|
||||
/* share internal LogLuv conversion routines? */
|
||||
#ifndef LOGLUV_PUBLIC
|
||||
#define LOGLUV_PUBLIC 1
|
||||
#define LOGLUV_PUBLIC 1
|
||||
#endif
|
||||
|
||||
#if !defined(__GNUC__) && !defined(__attribute__)
|
||||
# define __attribute__(x) /*nothing*/
|
||||
#endif
|
||||
|
||||
#if defined(c_plusplus) || defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
typedef void (*TIFFErrorHandler)(const char*, const char*, va_list);
|
||||
typedef void (*TIFFErrorHandlerExt)(thandle_t, const char*, const char*, va_list);
|
||||
typedef tsize_t (*TIFFReadWriteProc)(thandle_t, tdata_t, tsize_t);
|
||||
typedef toff_t (*TIFFSeekProc)(thandle_t, toff_t, int);
|
||||
typedef int (*TIFFCloseProc)(thandle_t);
|
||||
typedef toff_t (*TIFFSizeProc)(thandle_t);
|
||||
typedef int (*TIFFMapFileProc)(thandle_t, tdata_t*, toff_t*);
|
||||
typedef void (*TIFFUnmapFileProc)(thandle_t, tdata_t, toff_t);
|
||||
typedef void (*TIFFExtendProc)(TIFF*);
|
||||
typedef void (*TIFFErrorHandler)(const char*, const char*, va_list);
|
||||
typedef void (*TIFFErrorHandlerExt)(thandle_t, const char*, const char*, va_list);
|
||||
typedef tmsize_t (*TIFFReadWriteProc)(thandle_t, void*, tmsize_t);
|
||||
typedef toff_t (*TIFFSeekProc)(thandle_t, toff_t, int);
|
||||
typedef int (*TIFFCloseProc)(thandle_t);
|
||||
typedef toff_t (*TIFFSizeProc)(thandle_t);
|
||||
typedef int (*TIFFMapFileProc)(thandle_t, void** base, toff_t* size);
|
||||
typedef void (*TIFFUnmapFileProc)(thandle_t, void* base, toff_t size);
|
||||
typedef void (*TIFFExtendProc)(TIFF*);
|
||||
|
||||
extern const char* TIFFGetVersion(void);
|
||||
extern const char* TIFFGetVersion(void);
|
||||
|
||||
extern const TIFFCodec* TIFFFindCODEC(uint16);
|
||||
extern TIFFCodec* TIFFRegisterCODEC(uint16, const char*, TIFFInitMethod);
|
||||
extern void TIFFUnRegisterCODEC(TIFFCodec*);
|
||||
extern int TIFFIsCODECConfigured(uint16);
|
||||
extern TIFFCodec* TIFFGetConfiguredCODECs(void);
|
||||
extern const TIFFCodec* TIFFFindCODEC(uint16);
|
||||
extern TIFFCodec* TIFFRegisterCODEC(uint16, const char*, TIFFInitMethod);
|
||||
extern void TIFFUnRegisterCODEC(TIFFCodec*);
|
||||
extern int TIFFIsCODECConfigured(uint16);
|
||||
extern TIFFCodec* TIFFGetConfiguredCODECs(void);
|
||||
|
||||
/*
|
||||
* Auxiliary functions.
|
||||
*/
|
||||
|
||||
extern tdata_t _TIFFmalloc(tsize_t);
|
||||
extern tdata_t _TIFFrealloc(tdata_t, tsize_t);
|
||||
extern void _TIFFmemset(tdata_t, int, tsize_t);
|
||||
extern void _TIFFmemcpy(tdata_t, const tdata_t, tsize_t);
|
||||
extern int _TIFFmemcmp(const tdata_t, const tdata_t, tsize_t);
|
||||
extern void _TIFFfree(tdata_t);
|
||||
extern void* _TIFFmalloc(tmsize_t s);
|
||||
extern void* _TIFFrealloc(void* p, tmsize_t s);
|
||||
extern void _TIFFmemset(void* p, int v, tmsize_t c);
|
||||
extern void _TIFFmemcpy(void* d, const void* s, tmsize_t c);
|
||||
extern int _TIFFmemcmp(const void* p1, const void* p2, tmsize_t c);
|
||||
extern void _TIFFfree(void* p);
|
||||
|
||||
/*
|
||||
** Stuff, related to tag handling and creating custom tags.
|
||||
*/
|
||||
extern int TIFFGetTagListCount( TIFF * );
|
||||
extern ttag_t TIFFGetTagListEntry( TIFF *, int tag_index );
|
||||
extern int TIFFGetTagListCount( TIFF * );
|
||||
extern uint32 TIFFGetTagListEntry( TIFF *, int tag_index );
|
||||
|
||||
#define TIFF_ANY TIFF_NOTYPE /* for field descriptor searching */
|
||||
#define TIFF_VARIABLE -1 /* marker for variable length tags */
|
||||
#define TIFF_SPP -2 /* marker for SamplesPerPixel tags */
|
||||
#define TIFF_VARIABLE2 -3 /* marker for uint32 var-length tags */
|
||||
#define TIFF_ANY TIFF_NOTYPE /* for field descriptor searching */
|
||||
#define TIFF_VARIABLE -1 /* marker for variable length tags */
|
||||
#define TIFF_SPP -2 /* marker for SamplesPerPixel tags */
|
||||
#define TIFF_VARIABLE2 -3 /* marker for uint32 var-length tags */
|
||||
|
||||
#define FIELD_CUSTOM 65
|
||||
#define FIELD_CUSTOM 65
|
||||
|
||||
typedef struct _TIFFField TIFFField;
|
||||
typedef struct _TIFFFieldArray TIFFFieldArray;
|
||||
|
||||
extern const TIFFField* TIFFFindField(TIFF *, uint32, TIFFDataType);
|
||||
extern const TIFFField* TIFFFieldWithTag(TIFF*, uint32);
|
||||
extern const TIFFField* TIFFFieldWithName(TIFF*, const char *);
|
||||
|
||||
typedef int (*TIFFVSetMethod)(TIFF*, uint32, va_list);
|
||||
typedef int (*TIFFVGetMethod)(TIFF*, uint32, va_list);
|
||||
typedef void (*TIFFPrintMethod)(TIFF*, FILE*, long);
|
||||
|
||||
typedef struct {
|
||||
TIFFVSetMethod vsetfield; /* tag set routine */
|
||||
TIFFVGetMethod vgetfield; /* tag get routine */
|
||||
TIFFPrintMethod printdir; /* directory print routine */
|
||||
} TIFFTagMethods;
|
||||
|
||||
extern TIFFTagMethods *TIFFAccessTagMethods(TIFF *);
|
||||
extern void *TIFFGetClientInfo(TIFF *, const char *);
|
||||
extern void TIFFSetClientInfo(TIFF *, void *, const char *);
|
||||
|
||||
extern void TIFFCleanup(TIFF* tif);
|
||||
extern void TIFFClose(TIFF* tif);
|
||||
extern int TIFFFlush(TIFF* tif);
|
||||
extern int TIFFFlushData(TIFF* tif);
|
||||
extern int TIFFGetField(TIFF* tif, uint32 tag, ...);
|
||||
extern int TIFFVGetField(TIFF* tif, uint32 tag, va_list ap);
|
||||
extern int TIFFGetFieldDefaulted(TIFF* tif, uint32 tag, ...);
|
||||
extern int TIFFVGetFieldDefaulted(TIFF* tif, uint32 tag, va_list ap);
|
||||
extern int TIFFReadDirectory(TIFF* tif);
|
||||
extern int TIFFReadCustomDirectory(TIFF* tif, toff_t diroff, const TIFFFieldArray* infoarray);
|
||||
extern int TIFFReadEXIFDirectory(TIFF* tif, toff_t diroff);
|
||||
extern uint64 TIFFScanlineSize64(TIFF* tif);
|
||||
extern tmsize_t TIFFScanlineSize(TIFF* tif);
|
||||
extern uint64 TIFFRasterScanlineSize64(TIFF* tif);
|
||||
extern tmsize_t TIFFRasterScanlineSize(TIFF* tif);
|
||||
extern uint64 TIFFStripSize64(TIFF* tif);
|
||||
extern tmsize_t TIFFStripSize(TIFF* tif);
|
||||
extern uint64 TIFFRawStripSize64(TIFF* tif, uint32 strip);
|
||||
extern tmsize_t TIFFRawStripSize(TIFF* tif, uint32 strip);
|
||||
extern uint64 TIFFVStripSize64(TIFF* tif, uint32 nrows);
|
||||
extern tmsize_t TIFFVStripSize(TIFF* tif, uint32 nrows);
|
||||
extern uint64 TIFFTileRowSize64(TIFF* tif);
|
||||
extern tmsize_t TIFFTileRowSize(TIFF* tif);
|
||||
extern uint64 TIFFTileSize64(TIFF* tif);
|
||||
extern tmsize_t TIFFTileSize(TIFF* tif);
|
||||
extern uint64 TIFFVTileSize64(TIFF* tif, uint32 nrows);
|
||||
extern tmsize_t TIFFVTileSize(TIFF* tif, uint32 nrows);
|
||||
extern uint32 TIFFDefaultStripSize(TIFF* tif, uint32 request);
|
||||
extern void TIFFDefaultTileSize(TIFF*, uint32*, uint32*);
|
||||
extern int TIFFFileno(TIFF*);
|
||||
extern int TIFFSetFileno(TIFF*, int);
|
||||
extern thandle_t TIFFClientdata(TIFF*);
|
||||
extern thandle_t TIFFSetClientdata(TIFF*, thandle_t);
|
||||
extern int TIFFGetMode(TIFF*);
|
||||
extern int TIFFSetMode(TIFF*, int);
|
||||
extern int TIFFIsTiled(TIFF*);
|
||||
extern int TIFFIsByteSwapped(TIFF*);
|
||||
extern int TIFFIsUpSampled(TIFF*);
|
||||
extern int TIFFIsMSB2LSB(TIFF*);
|
||||
extern int TIFFIsBigEndian(TIFF*);
|
||||
extern TIFFReadWriteProc TIFFGetReadProc(TIFF*);
|
||||
extern TIFFReadWriteProc TIFFGetWriteProc(TIFF*);
|
||||
extern TIFFSeekProc TIFFGetSeekProc(TIFF*);
|
||||
extern TIFFCloseProc TIFFGetCloseProc(TIFF*);
|
||||
extern TIFFSizeProc TIFFGetSizeProc(TIFF*);
|
||||
extern TIFFMapFileProc TIFFGetMapFileProc(TIFF*);
|
||||
extern TIFFUnmapFileProc TIFFGetUnmapFileProc(TIFF*);
|
||||
extern uint32 TIFFCurrentRow(TIFF*);
|
||||
extern uint16 TIFFCurrentDirectory(TIFF*);
|
||||
extern uint16 TIFFNumberOfDirectories(TIFF*);
|
||||
extern uint64 TIFFCurrentDirOffset(TIFF*);
|
||||
extern uint32 TIFFCurrentStrip(TIFF*);
|
||||
extern uint32 TIFFCurrentTile(TIFF* tif);
|
||||
extern int TIFFReadBufferSetup(TIFF* tif, void* bp, tmsize_t size);
|
||||
extern int TIFFWriteBufferSetup(TIFF* tif, void* bp, tmsize_t size);
|
||||
extern int TIFFSetupStrips(TIFF *);
|
||||
extern int TIFFWriteCheck(TIFF*, int, const char *);
|
||||
extern void TIFFFreeDirectory(TIFF*);
|
||||
extern int TIFFCreateDirectory(TIFF*);
|
||||
extern int TIFFLastDirectory(TIFF*);
|
||||
extern int TIFFSetDirectory(TIFF*, uint16);
|
||||
extern int TIFFSetSubDirectory(TIFF*, uint64);
|
||||
extern int TIFFUnlinkDirectory(TIFF*, uint16);
|
||||
extern int TIFFSetField(TIFF*, uint32, ...);
|
||||
extern int TIFFVSetField(TIFF*, uint32, va_list);
|
||||
extern int TIFFUnsetField(TIFF*, uint32);
|
||||
extern int TIFFWriteDirectory(TIFF *);
|
||||
extern int TIFFCheckpointDirectory(TIFF *);
|
||||
extern int TIFFRewriteDirectory(TIFF *);
|
||||
|
||||
#if defined(c_plusplus) || defined(__cplusplus)
|
||||
extern void TIFFPrintDirectory(TIFF*, FILE*, long = 0);
|
||||
extern int TIFFReadScanline(TIFF* tif, void* buf, uint32 row, uint16 sample = 0);
|
||||
extern int TIFFWriteScanline(TIFF* tif, void* buf, uint32 row, uint16 sample = 0);
|
||||
extern int TIFFReadRGBAImage(TIFF*, uint32, uint32, uint32*, int = 0);
|
||||
extern int TIFFReadRGBAImageOriented(TIFF*, uint32, uint32, uint32*,
|
||||
int = ORIENTATION_BOTLEFT, int = 0);
|
||||
#else
|
||||
extern void TIFFPrintDirectory(TIFF*, FILE*, long);
|
||||
extern int TIFFReadScanline(TIFF* tif, void* buf, uint32 row, uint16 sample);
|
||||
extern int TIFFWriteScanline(TIFF* tif, void* buf, uint32 row, uint16 sample);
|
||||
extern int TIFFReadRGBAImage(TIFF*, uint32, uint32, uint32*, int);
|
||||
extern int TIFFReadRGBAImageOriented(TIFF*, uint32, uint32, uint32*, int, int);
|
||||
#endif
|
||||
|
||||
extern int TIFFReadRGBAStrip(TIFF*, uint32, uint32 * );
|
||||
extern int TIFFReadRGBATile(TIFF*, uint32, uint32, uint32 * );
|
||||
extern int TIFFRGBAImageOK(TIFF*, char [1024]);
|
||||
extern int TIFFRGBAImageBegin(TIFFRGBAImage*, TIFF*, int, char [1024]);
|
||||
extern int TIFFRGBAImageGet(TIFFRGBAImage*, uint32*, uint32, uint32);
|
||||
extern void TIFFRGBAImageEnd(TIFFRGBAImage*);
|
||||
extern TIFF* TIFFOpen(const char*, const char*);
|
||||
# ifdef __WIN32__
|
||||
extern TIFF* TIFFOpenW(const wchar_t*, const char*);
|
||||
# endif /* __WIN32__ */
|
||||
extern TIFF* TIFFFdOpen(int, const char*, const char*);
|
||||
extern TIFF* TIFFClientOpen(const char*, const char*,
|
||||
thandle_t,
|
||||
TIFFReadWriteProc, TIFFReadWriteProc,
|
||||
TIFFSeekProc, TIFFCloseProc,
|
||||
TIFFSizeProc,
|
||||
TIFFMapFileProc, TIFFUnmapFileProc);
|
||||
extern const char* TIFFFileName(TIFF*);
|
||||
extern const char* TIFFSetFileName(TIFF*, const char *);
|
||||
extern void TIFFError(const char*, const char*, ...) __attribute__((format (printf,2,3)));
|
||||
extern void TIFFErrorExt(thandle_t, const char*, const char*, ...) __attribute__((format (printf,3,4)));
|
||||
extern void TIFFWarning(const char*, const char*, ...) __attribute__((format (printf,2,3)));
|
||||
extern void TIFFWarningExt(thandle_t, const char*, const char*, ...) __attribute__((format (printf,3,4)));
|
||||
extern TIFFErrorHandler TIFFSetErrorHandler(TIFFErrorHandler);
|
||||
extern TIFFErrorHandlerExt TIFFSetErrorHandlerExt(TIFFErrorHandlerExt);
|
||||
extern TIFFErrorHandler TIFFSetWarningHandler(TIFFErrorHandler);
|
||||
extern TIFFErrorHandlerExt TIFFSetWarningHandlerExt(TIFFErrorHandlerExt);
|
||||
extern TIFFExtendProc TIFFSetTagExtender(TIFFExtendProc);
|
||||
extern uint32 TIFFComputeTile(TIFF* tif, uint32 x, uint32 y, uint32 z, uint16 s);
|
||||
extern int TIFFCheckTile(TIFF* tif, uint32 x, uint32 y, uint32 z, uint16 s);
|
||||
extern uint32 TIFFNumberOfTiles(TIFF*);
|
||||
extern tmsize_t TIFFReadTile(TIFF* tif, void* buf, uint32 x, uint32 y, uint32 z, uint16 s);
|
||||
extern tmsize_t TIFFWriteTile(TIFF* tif, void* buf, uint32 x, uint32 y, uint32 z, uint16 s);
|
||||
extern uint32 TIFFComputeStrip(TIFF*, uint32, uint16);
|
||||
extern uint32 TIFFNumberOfStrips(TIFF*);
|
||||
extern tmsize_t TIFFReadEncodedStrip(TIFF* tif, uint32 strip, void* buf, tmsize_t size);
|
||||
extern tmsize_t TIFFReadRawStrip(TIFF* tif, uint32 strip, void* buf, tmsize_t size);
|
||||
extern tmsize_t TIFFReadEncodedTile(TIFF* tif, uint32 tile, void* buf, tmsize_t size);
|
||||
extern tmsize_t TIFFReadRawTile(TIFF* tif, uint32 tile, void* buf, tmsize_t size);
|
||||
extern tmsize_t TIFFWriteEncodedStrip(TIFF* tif, uint32 strip, void* data, tmsize_t cc);
|
||||
extern tmsize_t TIFFWriteRawStrip(TIFF* tif, uint32 strip, void* data, tmsize_t cc);
|
||||
extern tmsize_t TIFFWriteEncodedTile(TIFF* tif, uint32 tile, void* data, tmsize_t cc);
|
||||
extern tmsize_t TIFFWriteRawTile(TIFF* tif, uint32 tile, void* data, tmsize_t cc);
|
||||
extern int TIFFDataWidth(TIFFDataType); /* table of tag datatype widths */
|
||||
extern void TIFFSetWriteOffset(TIFF* tif, toff_t off);
|
||||
extern void TIFFSwabShort(uint16*);
|
||||
extern void TIFFSwabLong(uint32*);
|
||||
extern void TIFFSwabLong8(uint64*);
|
||||
extern void TIFFSwabFloat(float*);
|
||||
extern void TIFFSwabDouble(double*);
|
||||
extern void TIFFSwabArrayOfShort(uint16* wp, tmsize_t n);
|
||||
extern void TIFFSwabArrayOfTriples(uint8* tp, tmsize_t n);
|
||||
extern void TIFFSwabArrayOfLong(uint32* lp, tmsize_t n);
|
||||
extern void TIFFSwabArrayOfLong8(uint64* lp, tmsize_t n);
|
||||
extern void TIFFSwabArrayOfFloat(float* fp, tmsize_t n);
|
||||
extern void TIFFSwabArrayOfDouble(double* dp, tmsize_t n);
|
||||
extern void TIFFReverseBits(uint8* cp, tmsize_t n);
|
||||
extern const unsigned char* TIFFGetBitRevTable(int);
|
||||
|
||||
#ifdef LOGLUV_PUBLIC
|
||||
#define U_NEU 0.210526316
|
||||
#define V_NEU 0.473684211
|
||||
#define UVSCALE 410.
|
||||
extern double LogL16toY(int);
|
||||
extern double LogL10toY(int);
|
||||
extern void XYZtoRGB24(float*, uint8*);
|
||||
extern int uv_decode(double*, double*, int);
|
||||
extern void LogLuv24toXYZ(uint32, float*);
|
||||
extern void LogLuv32toXYZ(uint32, float*);
|
||||
#if defined(c_plusplus) || defined(__cplusplus)
|
||||
extern int LogL16fromY(double, int = SGILOGENCODE_NODITHER);
|
||||
extern int LogL10fromY(double, int = SGILOGENCODE_NODITHER);
|
||||
extern int uv_encode(double, double, int = SGILOGENCODE_NODITHER);
|
||||
extern uint32 LogLuv24fromXYZ(float*, int = SGILOGENCODE_NODITHER);
|
||||
extern uint32 LogLuv32fromXYZ(float*, int = SGILOGENCODE_NODITHER);
|
||||
#else
|
||||
extern int LogL16fromY(double, int);
|
||||
extern int LogL10fromY(double, int);
|
||||
extern int uv_encode(double, double, int);
|
||||
extern uint32 LogLuv24fromXYZ(float*, int);
|
||||
extern uint32 LogLuv32fromXYZ(float*, int);
|
||||
#endif
|
||||
#endif /* LOGLUV_PUBLIC */
|
||||
|
||||
extern int TIFFCIELabToRGBInit(TIFFCIELabToRGB*, const TIFFDisplay *, float*);
|
||||
extern void TIFFCIELabToXYZ(TIFFCIELabToRGB *, uint32, int32, int32,
|
||||
float *, float *, float *);
|
||||
extern void TIFFXYZToRGB(TIFFCIELabToRGB *, float, float, float,
|
||||
uint32 *, uint32 *, uint32 *);
|
||||
|
||||
extern int TIFFYCbCrToRGBInit(TIFFYCbCrToRGB*, float*, float*);
|
||||
extern void TIFFYCbCrtoRGB(TIFFYCbCrToRGB *, uint32, int32, int32,
|
||||
uint32 *, uint32 *, uint32 *);
|
||||
|
||||
/****************************************************************************
|
||||
* O B S O L E T E D I N T E R F A C E S
|
||||
*
|
||||
* Don't use this stuff in your applications, it may be removed in the future
|
||||
* libtiff versions.
|
||||
****************************************************************************/
|
||||
typedef struct {
|
||||
ttag_t field_tag; /* field's tag */
|
||||
short field_readcount; /* read count/TIFF_VARIABLE/TIFF_SPP */
|
||||
|
@ -309,202 +529,10 @@ typedef struct {
|
|||
char *field_name; /* ASCII name */
|
||||
} TIFFFieldInfo;
|
||||
|
||||
typedef struct _TIFFTagValue {
|
||||
const TIFFFieldInfo *info;
|
||||
int count;
|
||||
void *value;
|
||||
} TIFFTagValue;
|
||||
|
||||
extern void TIFFMergeFieldInfo(TIFF*, const TIFFFieldInfo[], int);
|
||||
extern const TIFFFieldInfo* TIFFFindFieldInfo(TIFF*, ttag_t, TIFFDataType);
|
||||
extern const TIFFFieldInfo* TIFFFindFieldInfoByName(TIFF* , const char *,
|
||||
TIFFDataType);
|
||||
extern const TIFFFieldInfo* TIFFFieldWithTag(TIFF*, ttag_t);
|
||||
extern const TIFFFieldInfo* TIFFFieldWithName(TIFF*, const char *);
|
||||
|
||||
typedef int (*TIFFVSetMethod)(TIFF*, ttag_t, va_list);
|
||||
typedef int (*TIFFVGetMethod)(TIFF*, ttag_t, va_list);
|
||||
typedef void (*TIFFPrintMethod)(TIFF*, FILE*, long);
|
||||
|
||||
typedef struct {
|
||||
TIFFVSetMethod vsetfield; /* tag set routine */
|
||||
TIFFVGetMethod vgetfield; /* tag get routine */
|
||||
TIFFPrintMethod printdir; /* directory print routine */
|
||||
} TIFFTagMethods;
|
||||
|
||||
extern TIFFTagMethods *TIFFAccessTagMethods( TIFF * );
|
||||
extern void *TIFFGetClientInfo( TIFF *, const char * );
|
||||
extern void TIFFSetClientInfo( TIFF *, void *, const char * );
|
||||
|
||||
extern void TIFFCleanup(TIFF*);
|
||||
extern void TIFFClose(TIFF*);
|
||||
extern int TIFFFlush(TIFF*);
|
||||
extern int TIFFFlushData(TIFF*);
|
||||
extern int TIFFGetField(TIFF*, ttag_t, ...);
|
||||
extern int TIFFVGetField(TIFF*, ttag_t, va_list);
|
||||
extern int TIFFGetFieldDefaulted(TIFF*, ttag_t, ...);
|
||||
extern int TIFFVGetFieldDefaulted(TIFF*, ttag_t, va_list);
|
||||
extern int TIFFReadDirectory(TIFF*);
|
||||
extern int TIFFReadCustomDirectory(TIFF*, toff_t, const TIFFFieldInfo[],
|
||||
size_t);
|
||||
extern int TIFFReadEXIFDirectory(TIFF*, toff_t);
|
||||
extern tsize_t TIFFScanlineSize(TIFF*);
|
||||
extern tsize_t TIFFRasterScanlineSize(TIFF*);
|
||||
extern tsize_t TIFFStripSize(TIFF*);
|
||||
extern tsize_t TIFFRawStripSize(TIFF*, tstrip_t);
|
||||
extern tsize_t TIFFVStripSize(TIFF*, uint32);
|
||||
extern tsize_t TIFFTileRowSize(TIFF*);
|
||||
extern tsize_t TIFFTileSize(TIFF*);
|
||||
extern tsize_t TIFFVTileSize(TIFF*, uint32);
|
||||
extern uint32 TIFFDefaultStripSize(TIFF*, uint32);
|
||||
extern void TIFFDefaultTileSize(TIFF*, uint32*, uint32*);
|
||||
extern int TIFFFileno(TIFF*);
|
||||
extern int TIFFSetFileno(TIFF*, int);
|
||||
extern thandle_t TIFFClientdata(TIFF*);
|
||||
extern thandle_t TIFFSetClientdata(TIFF*, thandle_t);
|
||||
extern int TIFFGetMode(TIFF*);
|
||||
extern int TIFFSetMode(TIFF*, int);
|
||||
extern int TIFFIsTiled(TIFF*);
|
||||
extern int TIFFIsByteSwapped(TIFF*);
|
||||
extern int TIFFIsUpSampled(TIFF*);
|
||||
extern int TIFFIsMSB2LSB(TIFF*);
|
||||
extern int TIFFIsBigEndian(TIFF*);
|
||||
extern TIFFReadWriteProc TIFFGetReadProc(TIFF*);
|
||||
extern TIFFReadWriteProc TIFFGetWriteProc(TIFF*);
|
||||
extern TIFFSeekProc TIFFGetSeekProc(TIFF*);
|
||||
extern TIFFCloseProc TIFFGetCloseProc(TIFF*);
|
||||
extern TIFFSizeProc TIFFGetSizeProc(TIFF*);
|
||||
extern TIFFMapFileProc TIFFGetMapFileProc(TIFF*);
|
||||
extern TIFFUnmapFileProc TIFFGetUnmapFileProc(TIFF*);
|
||||
extern uint32 TIFFCurrentRow(TIFF*);
|
||||
extern tdir_t TIFFCurrentDirectory(TIFF*);
|
||||
extern tdir_t TIFFNumberOfDirectories(TIFF*);
|
||||
extern uint32 TIFFCurrentDirOffset(TIFF*);
|
||||
extern tstrip_t TIFFCurrentStrip(TIFF*);
|
||||
extern ttile_t TIFFCurrentTile(TIFF*);
|
||||
extern int TIFFReadBufferSetup(TIFF*, tdata_t, tsize_t);
|
||||
extern int TIFFWriteBufferSetup(TIFF*, tdata_t, tsize_t);
|
||||
extern int TIFFSetupStrips(TIFF *);
|
||||
extern int TIFFWriteCheck(TIFF*, int, const char *);
|
||||
extern void TIFFFreeDirectory(TIFF*);
|
||||
extern int TIFFCreateDirectory(TIFF*);
|
||||
extern int TIFFLastDirectory(TIFF*);
|
||||
extern int TIFFSetDirectory(TIFF*, tdir_t);
|
||||
extern int TIFFSetSubDirectory(TIFF*, uint32);
|
||||
extern int TIFFUnlinkDirectory(TIFF*, tdir_t);
|
||||
extern int TIFFSetField(TIFF*, ttag_t, ...);
|
||||
extern int TIFFVSetField(TIFF*, ttag_t, va_list);
|
||||
extern int TIFFWriteDirectory(TIFF *);
|
||||
extern int TIFFCheckpointDirectory(TIFF *);
|
||||
extern int TIFFRewriteDirectory(TIFF *);
|
||||
extern int TIFFReassignTagToIgnore(enum TIFFIgnoreSense, int);
|
||||
|
||||
#if defined(c_plusplus) || defined(__cplusplus)
|
||||
extern void TIFFPrintDirectory(TIFF*, FILE*, long = 0);
|
||||
extern int TIFFReadScanline(TIFF*, tdata_t, uint32, tsample_t = 0);
|
||||
extern int TIFFWriteScanline(TIFF*, tdata_t, uint32, tsample_t = 0);
|
||||
extern int TIFFReadRGBAImage(TIFF*, uint32, uint32, uint32*, int = 0);
|
||||
extern int TIFFReadRGBAImageOriented(TIFF*, uint32, uint32, uint32*,
|
||||
int = ORIENTATION_BOTLEFT, int = 0);
|
||||
#else
|
||||
extern void TIFFPrintDirectory(TIFF*, FILE*, long);
|
||||
extern int TIFFReadScanline(TIFF*, tdata_t, uint32, tsample_t);
|
||||
extern int TIFFWriteScanline(TIFF*, tdata_t, uint32, tsample_t);
|
||||
extern int TIFFReadRGBAImage(TIFF*, uint32, uint32, uint32*, int);
|
||||
extern int TIFFReadRGBAImageOriented(TIFF*, uint32, uint32, uint32*, int, int);
|
||||
#endif
|
||||
|
||||
extern int TIFFReadRGBAStrip(TIFF*, tstrip_t, uint32 * );
|
||||
extern int TIFFReadRGBATile(TIFF*, uint32, uint32, uint32 * );
|
||||
extern int TIFFRGBAImageOK(TIFF*, char [1024]);
|
||||
extern int TIFFRGBAImageBegin(TIFFRGBAImage*, TIFF*, int, char [1024]);
|
||||
extern int TIFFRGBAImageGet(TIFFRGBAImage*, uint32*, uint32, uint32);
|
||||
extern void TIFFRGBAImageEnd(TIFFRGBAImage*);
|
||||
extern TIFF* TIFFOpen(const char*, const char*);
|
||||
# ifdef __WIN32__
|
||||
extern TIFF* TIFFOpenW(const wchar_t*, const char*);
|
||||
# endif /* __WIN32__ */
|
||||
extern TIFF* TIFFFdOpen(int, const char*, const char*);
|
||||
extern TIFF* TIFFClientOpen(const char*, const char*,
|
||||
thandle_t,
|
||||
TIFFReadWriteProc, TIFFReadWriteProc,
|
||||
TIFFSeekProc, TIFFCloseProc,
|
||||
TIFFSizeProc,
|
||||
TIFFMapFileProc, TIFFUnmapFileProc);
|
||||
extern const char* TIFFFileName(TIFF*);
|
||||
extern const char* TIFFSetFileName(TIFF*, const char *);
|
||||
extern void TIFFError(const char*, const char*, ...);
|
||||
extern void TIFFErrorExt(thandle_t, const char*, const char*, ...);
|
||||
extern void TIFFWarning(const char*, const char*, ...);
|
||||
extern void TIFFWarningExt(thandle_t, const char*, const char*, ...);
|
||||
extern TIFFErrorHandler TIFFSetErrorHandler(TIFFErrorHandler);
|
||||
extern TIFFErrorHandlerExt TIFFSetErrorHandlerExt(TIFFErrorHandlerExt);
|
||||
extern TIFFErrorHandler TIFFSetWarningHandler(TIFFErrorHandler);
|
||||
extern TIFFErrorHandlerExt TIFFSetWarningHandlerExt(TIFFErrorHandlerExt);
|
||||
extern TIFFExtendProc TIFFSetTagExtender(TIFFExtendProc);
|
||||
extern ttile_t TIFFComputeTile(TIFF*, uint32, uint32, uint32, tsample_t);
|
||||
extern int TIFFCheckTile(TIFF*, uint32, uint32, uint32, tsample_t);
|
||||
extern ttile_t TIFFNumberOfTiles(TIFF*);
|
||||
extern tsize_t TIFFReadTile(TIFF*,
|
||||
tdata_t, uint32, uint32, uint32, tsample_t);
|
||||
extern tsize_t TIFFWriteTile(TIFF*,
|
||||
tdata_t, uint32, uint32, uint32, tsample_t);
|
||||
extern tstrip_t TIFFComputeStrip(TIFF*, uint32, tsample_t);
|
||||
extern tstrip_t TIFFNumberOfStrips(TIFF*);
|
||||
extern tsize_t TIFFReadEncodedStrip(TIFF*, tstrip_t, tdata_t, tsize_t);
|
||||
extern tsize_t TIFFReadRawStrip(TIFF*, tstrip_t, tdata_t, tsize_t);
|
||||
extern tsize_t TIFFReadEncodedTile(TIFF*, ttile_t, tdata_t, tsize_t);
|
||||
extern tsize_t TIFFReadRawTile(TIFF*, ttile_t, tdata_t, tsize_t);
|
||||
extern tsize_t TIFFWriteEncodedStrip(TIFF*, tstrip_t, tdata_t, tsize_t);
|
||||
extern tsize_t TIFFWriteRawStrip(TIFF*, tstrip_t, tdata_t, tsize_t);
|
||||
extern tsize_t TIFFWriteEncodedTile(TIFF*, ttile_t, tdata_t, tsize_t);
|
||||
extern tsize_t TIFFWriteRawTile(TIFF*, ttile_t, tdata_t, tsize_t);
|
||||
extern int TIFFDataWidth(TIFFDataType); /* table of tag datatype widths */
|
||||
extern void TIFFSetWriteOffset(TIFF*, toff_t);
|
||||
extern void TIFFSwabShort(uint16*);
|
||||
extern void TIFFSwabLong(uint32*);
|
||||
extern void TIFFSwabDouble(double*);
|
||||
extern void TIFFSwabArrayOfShort(uint16*, unsigned long);
|
||||
extern void TIFFSwabArrayOfTriples(uint8*, unsigned long);
|
||||
extern void TIFFSwabArrayOfLong(uint32*, unsigned long);
|
||||
extern void TIFFSwabArrayOfDouble(double*, unsigned long);
|
||||
extern void TIFFReverseBits(unsigned char *, unsigned long);
|
||||
extern const unsigned char* TIFFGetBitRevTable(int);
|
||||
|
||||
#ifdef LOGLUV_PUBLIC
|
||||
#define U_NEU 0.210526316
|
||||
#define V_NEU 0.473684211
|
||||
#define UVSCALE 410.
|
||||
extern double LogL16toY(int);
|
||||
extern double LogL10toY(int);
|
||||
extern void XYZtoRGB24(float*, uint8*);
|
||||
extern int uv_decode(double*, double*, int);
|
||||
extern void LogLuv24toXYZ(uint32, float*);
|
||||
extern void LogLuv32toXYZ(uint32, float*);
|
||||
#if defined(c_plusplus) || defined(__cplusplus)
|
||||
extern int LogL16fromY(double, int = SGILOGENCODE_NODITHER);
|
||||
extern int LogL10fromY(double, int = SGILOGENCODE_NODITHER);
|
||||
extern int uv_encode(double, double, int = SGILOGENCODE_NODITHER);
|
||||
extern uint32 LogLuv24fromXYZ(float*, int = SGILOGENCODE_NODITHER);
|
||||
extern uint32 LogLuv32fromXYZ(float*, int = SGILOGENCODE_NODITHER);
|
||||
#else
|
||||
extern int LogL16fromY(double, int);
|
||||
extern int LogL10fromY(double, int);
|
||||
extern int uv_encode(double, double, int);
|
||||
extern uint32 LogLuv24fromXYZ(float*, int);
|
||||
extern uint32 LogLuv32fromXYZ(float*, int);
|
||||
#endif
|
||||
#endif /* LOGLUV_PUBLIC */
|
||||
|
||||
extern int TIFFCIELabToRGBInit(TIFFCIELabToRGB*, TIFFDisplay *, float*);
|
||||
extern void TIFFCIELabToXYZ(TIFFCIELabToRGB *, uint32, int32, int32,
|
||||
float *, float *, float *);
|
||||
extern void TIFFXYZToRGB(TIFFCIELabToRGB *, float, float, float,
|
||||
uint32 *, uint32 *, uint32 *);
|
||||
|
||||
extern int TIFFYCbCrToRGBInit(TIFFYCbCrToRGB*, float*, float*);
|
||||
extern void TIFFYCbCrtoRGB(TIFFYCbCrToRGB *, uint32, int32, int32,
|
||||
uint32 *, uint32 *, uint32 *);
|
||||
extern int TIFFMergeFieldInfo(TIFF*, const TIFFFieldInfo[], uint32);
|
||||
extern const TIFFFieldInfo* TIFFFindFieldInfo(TIFF*, uint32, TIFFDataType);
|
||||
extern const TIFFFieldInfo* TIFFFindFieldInfoByName(TIFF* , const char *,
|
||||
TIFFDataType);
|
||||
|
||||
#if defined(c_plusplus) || defined(__cplusplus)
|
||||
}
|
||||
|
@ -513,3 +541,10 @@ extern void TIFFYCbCrtoRGB(TIFFYCbCrToRGB *, uint32, int32, int32,
|
|||
#endif /* _TIFFIO_ */
|
||||
|
||||
/* vim: set ts=8 sts=8 sw=8 noet: */
|
||||
/*
|
||||
* Local Variables:
|
||||
* mode: c
|
||||
* c-basic-offset: 8
|
||||
* fill-column: 78
|
||||
* End:
|
||||
*/
|
||||
|
|
|
@ -0,0 +1,49 @@
|
|||
/* $Id: tiffio.hxx,v 1.3 2010-06-08 18:55:15 bfriesen Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1988-1997 Sam Leffler
|
||||
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
|
||||
*
|
||||
* Permission to use, copy, modify, distribute, and sell this software and
|
||||
* its documentation for any purpose is hereby granted without fee, provided
|
||||
* that (i) the above copyright notices and this permission notice appear in
|
||||
* all copies of the software and related documentation, and (ii) the names of
|
||||
* Sam Leffler and Silicon Graphics may not be used in any advertising or
|
||||
* publicity relating to the software without the specific, prior written
|
||||
* permission of Sam Leffler and Silicon Graphics.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
|
||||
* WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
|
||||
* ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
|
||||
* OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
||||
* WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
|
||||
* LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
|
||||
* OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef _TIFFIO_HXX_
|
||||
#define _TIFFIO_HXX_
|
||||
|
||||
/*
|
||||
* TIFF I/O library definitions which provide C++ streams API.
|
||||
*/
|
||||
|
||||
#include <iostream>
|
||||
#include "tiff.h"
|
||||
|
||||
extern TIFF* TIFFStreamOpen(const char*, std::ostream *);
|
||||
extern TIFF* TIFFStreamOpen(const char*, std::istream *);
|
||||
|
||||
#endif /* _TIFFIO_HXX_ */
|
||||
|
||||
/* vim: set ts=8 sts=8 sw=8 noet: */
|
||||
/*
|
||||
* Local Variables:
|
||||
* mode: c++
|
||||
* c-basic-offset: 8
|
||||
* fill-column: 78
|
||||
* End:
|
||||
*/
|
|
@ -1,4 +1,4 @@
|
|||
#define TIFFLIB_VERSION_STR "LIBTIFF, Version 3.8.2\nCopyright (c) 1988-1996 Sam Leffler\nCopyright (c) 1991-1996 Silicon Graphics, Inc."
|
||||
#define TIFFLIB_VERSION_STR "LIBTIFF, Version 4.0.0beta6\nCopyright (c) 1988-1996 Sam Leffler\nCopyright (c) 1991-1996 Silicon Graphics, Inc."
|
||||
/*
|
||||
* This define can be used in code that requires
|
||||
* compilation-related definitions specific to a
|
||||
|
@ -6,4 +6,4 @@
|
|||
* version checking should be done based on the
|
||||
* string returned by TIFFGetVersion.
|
||||
*/
|
||||
#define TIFFLIB_VERSION 20060323
|
||||
#define TIFFLIB_VERSION 20100611
|
||||
|
|
Binary file not shown.
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,332 @@
|
|||
/* zconf.h -- configuration of the zlib compression library
|
||||
* Copyright (C) 1995-2005 Jean-loup Gailly.
|
||||
* For conditions of distribution and use, see copyright notice in zlib.h
|
||||
*/
|
||||
|
||||
/* @(#) $Id$ */
|
||||
|
||||
#ifndef ZCONF_H
|
||||
#define ZCONF_H
|
||||
|
||||
/*
|
||||
* If you *really* need a unique prefix for all types and library functions,
|
||||
* compile with -DZ_PREFIX. The "standard" zlib should be compiled without it.
|
||||
*/
|
||||
#ifdef Z_PREFIX
|
||||
# define deflateInit_ z_deflateInit_
|
||||
# define deflate z_deflate
|
||||
# define deflateEnd z_deflateEnd
|
||||
# define inflateInit_ z_inflateInit_
|
||||
# define inflate z_inflate
|
||||
# define inflateEnd z_inflateEnd
|
||||
# define deflateInit2_ z_deflateInit2_
|
||||
# define deflateSetDictionary z_deflateSetDictionary
|
||||
# define deflateCopy z_deflateCopy
|
||||
# define deflateReset z_deflateReset
|
||||
# define deflateParams z_deflateParams
|
||||
# define deflateBound z_deflateBound
|
||||
# define deflatePrime z_deflatePrime
|
||||
# define inflateInit2_ z_inflateInit2_
|
||||
# define inflateSetDictionary z_inflateSetDictionary
|
||||
# define inflateSync z_inflateSync
|
||||
# define inflateSyncPoint z_inflateSyncPoint
|
||||
# define inflateCopy z_inflateCopy
|
||||
# define inflateReset z_inflateReset
|
||||
# define inflateBack z_inflateBack
|
||||
# define inflateBackEnd z_inflateBackEnd
|
||||
# define compress z_compress
|
||||
# define compress2 z_compress2
|
||||
# define compressBound z_compressBound
|
||||
# define uncompress z_uncompress
|
||||
# define adler32 z_adler32
|
||||
# define crc32 z_crc32
|
||||
# define get_crc_table z_get_crc_table
|
||||
# define zError z_zError
|
||||
|
||||
# define alloc_func z_alloc_func
|
||||
# define free_func z_free_func
|
||||
# define in_func z_in_func
|
||||
# define out_func z_out_func
|
||||
# define Byte z_Byte
|
||||
# define uInt z_uInt
|
||||
# define uLong z_uLong
|
||||
# define Bytef z_Bytef
|
||||
# define charf z_charf
|
||||
# define intf z_intf
|
||||
# define uIntf z_uIntf
|
||||
# define uLongf z_uLongf
|
||||
# define voidpf z_voidpf
|
||||
# define voidp z_voidp
|
||||
#endif
|
||||
|
||||
#if defined(__MSDOS__) && !defined(MSDOS)
|
||||
# define MSDOS
|
||||
#endif
|
||||
#if (defined(OS_2) || defined(__OS2__)) && !defined(OS2)
|
||||
# define OS2
|
||||
#endif
|
||||
#if defined(_WINDOWS) && !defined(WINDOWS)
|
||||
# define WINDOWS
|
||||
#endif
|
||||
#if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__)
|
||||
# ifndef WIN32
|
||||
# define WIN32
|
||||
# endif
|
||||
#endif
|
||||
#if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32)
|
||||
# if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__)
|
||||
# ifndef SYS16BIT
|
||||
# define SYS16BIT
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Compile with -DMAXSEG_64K if the alloc function cannot allocate more
|
||||
* than 64k bytes at a time (needed on systems with 16-bit int).
|
||||
*/
|
||||
#ifdef SYS16BIT
|
||||
# define MAXSEG_64K
|
||||
#endif
|
||||
#ifdef MSDOS
|
||||
# define UNALIGNED_OK
|
||||
#endif
|
||||
|
||||
#ifdef __STDC_VERSION__
|
||||
# ifndef STDC
|
||||
# define STDC
|
||||
# endif
|
||||
# if __STDC_VERSION__ >= 199901L
|
||||
# ifndef STDC99
|
||||
# define STDC99
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
#if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus))
|
||||
# define STDC
|
||||
#endif
|
||||
#if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__))
|
||||
# define STDC
|
||||
#endif
|
||||
#if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32))
|
||||
# define STDC
|
||||
#endif
|
||||
#if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__))
|
||||
# define STDC
|
||||
#endif
|
||||
|
||||
#if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */
|
||||
# define STDC
|
||||
#endif
|
||||
|
||||
#ifndef STDC
|
||||
# ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
|
||||
# define const /* note: need a more gentle solution here */
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Some Mac compilers merge all .h files incorrectly: */
|
||||
#if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__)
|
||||
# define NO_DUMMY_DECL
|
||||
#endif
|
||||
|
||||
/* Maximum value for memLevel in deflateInit2 */
|
||||
#ifndef MAX_MEM_LEVEL
|
||||
# ifdef MAXSEG_64K
|
||||
# define MAX_MEM_LEVEL 8
|
||||
# else
|
||||
# define MAX_MEM_LEVEL 9
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Maximum value for windowBits in deflateInit2 and inflateInit2.
|
||||
* WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
|
||||
* created by gzip. (Files created by minigzip can still be extracted by
|
||||
* gzip.)
|
||||
*/
|
||||
#ifndef MAX_WBITS
|
||||
# define MAX_WBITS 15 /* 32K LZ77 window */
|
||||
#endif
|
||||
|
||||
/* The memory requirements for deflate are (in bytes):
|
||||
(1 << (windowBits+2)) + (1 << (memLevel+9))
|
||||
that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values)
|
||||
plus a few kilobytes for small objects. For example, if you want to reduce
|
||||
the default memory requirements from 256K to 128K, compile with
|
||||
make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
|
||||
Of course this will generally degrade compression (there's no free lunch).
|
||||
|
||||
The memory requirements for inflate are (in bytes) 1 << windowBits
|
||||
that is, 32K for windowBits=15 (default value) plus a few kilobytes
|
||||
for small objects.
|
||||
*/
|
||||
|
||||
/* Type declarations */
|
||||
|
||||
#ifndef OF /* function prototypes */
|
||||
# ifdef STDC
|
||||
# define OF(args) args
|
||||
# else
|
||||
# define OF(args) ()
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* The following definitions for FAR are needed only for MSDOS mixed
|
||||
* model programming (small or medium model with some far allocations).
|
||||
* This was tested only with MSC; for other MSDOS compilers you may have
|
||||
* to define NO_MEMCPY in zutil.h. If you don't need the mixed model,
|
||||
* just define FAR to be empty.
|
||||
*/
|
||||
#ifdef SYS16BIT
|
||||
# if defined(M_I86SM) || defined(M_I86MM)
|
||||
/* MSC small or medium model */
|
||||
# define SMALL_MEDIUM
|
||||
# ifdef _MSC_VER
|
||||
# define FAR _far
|
||||
# else
|
||||
# define FAR far
|
||||
# endif
|
||||
# endif
|
||||
# if (defined(__SMALL__) || defined(__MEDIUM__))
|
||||
/* Turbo C small or medium model */
|
||||
# define SMALL_MEDIUM
|
||||
# ifdef __BORLANDC__
|
||||
# define FAR _far
|
||||
# else
|
||||
# define FAR far
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined(WINDOWS) || defined(WIN32)
|
||||
/* If building or using zlib as a DLL, define ZLIB_DLL.
|
||||
* This is not mandatory, but it offers a little performance increase.
|
||||
*/
|
||||
# ifdef ZLIB_DLL
|
||||
# if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))
|
||||
# ifdef ZLIB_INTERNAL
|
||||
# define ZEXTERN extern __declspec(dllexport)
|
||||
# else
|
||||
# define ZEXTERN extern __declspec(dllimport)
|
||||
# endif
|
||||
# endif
|
||||
# endif /* ZLIB_DLL */
|
||||
/* If building or using zlib with the WINAPI/WINAPIV calling convention,
|
||||
* define ZLIB_WINAPI.
|
||||
* Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI.
|
||||
*/
|
||||
# ifdef ZLIB_WINAPI
|
||||
# ifdef FAR
|
||||
# undef FAR
|
||||
# endif
|
||||
# include <windows.h>
|
||||
/* No need for _export, use ZLIB.DEF instead. */
|
||||
/* For complete Windows compatibility, use WINAPI, not __stdcall. */
|
||||
# define ZEXPORT WINAPI
|
||||
# ifdef WIN32
|
||||
# define ZEXPORTVA WINAPIV
|
||||
# else
|
||||
# define ZEXPORTVA FAR CDECL
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined (__BEOS__)
|
||||
# ifdef ZLIB_DLL
|
||||
# ifdef ZLIB_INTERNAL
|
||||
# define ZEXPORT __declspec(dllexport)
|
||||
# define ZEXPORTVA __declspec(dllexport)
|
||||
# else
|
||||
# define ZEXPORT __declspec(dllimport)
|
||||
# define ZEXPORTVA __declspec(dllimport)
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef ZEXTERN
|
||||
# define ZEXTERN extern
|
||||
#endif
|
||||
#ifndef ZEXPORT
|
||||
# define ZEXPORT
|
||||
#endif
|
||||
#ifndef ZEXPORTVA
|
||||
# define ZEXPORTVA
|
||||
#endif
|
||||
|
||||
#ifndef FAR
|
||||
# define FAR
|
||||
#endif
|
||||
|
||||
#if !defined(__MACTYPES__)
|
||||
typedef unsigned char Byte; /* 8 bits */
|
||||
#endif
|
||||
typedef unsigned int uInt; /* 16 bits or more */
|
||||
typedef unsigned long uLong; /* 32 bits or more */
|
||||
|
||||
#ifdef SMALL_MEDIUM
|
||||
/* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
|
||||
# define Bytef Byte FAR
|
||||
#else
|
||||
typedef Byte FAR Bytef;
|
||||
#endif
|
||||
typedef char FAR charf;
|
||||
typedef int FAR intf;
|
||||
typedef uInt FAR uIntf;
|
||||
typedef uLong FAR uLongf;
|
||||
|
||||
#ifdef STDC
|
||||
typedef void const *voidpc;
|
||||
typedef void FAR *voidpf;
|
||||
typedef void *voidp;
|
||||
#else
|
||||
typedef Byte const *voidpc;
|
||||
typedef Byte FAR *voidpf;
|
||||
typedef Byte *voidp;
|
||||
#endif
|
||||
|
||||
#if 0 /* HAVE_UNISTD_H -- this line is updated by ./configure */
|
||||
# include <sys/types.h> /* for off_t */
|
||||
# include <unistd.h> /* for SEEK_* and off_t */
|
||||
# ifdef VMS
|
||||
# include <unixio.h> /* for off_t */
|
||||
# endif
|
||||
# define z_off_t off_t
|
||||
#endif
|
||||
#ifndef SEEK_SET
|
||||
# define SEEK_SET 0 /* Seek from beginning of file. */
|
||||
# define SEEK_CUR 1 /* Seek from current position. */
|
||||
# define SEEK_END 2 /* Set file pointer to EOF plus "offset" */
|
||||
#endif
|
||||
#ifndef z_off_t
|
||||
# define z_off_t long
|
||||
#endif
|
||||
|
||||
#if defined(__OS400__)
|
||||
# define NO_vsnprintf
|
||||
#endif
|
||||
|
||||
#if defined(__MVS__)
|
||||
# define NO_vsnprintf
|
||||
# ifdef FAR
|
||||
# undef FAR
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* MVS linker does not support external names larger than 8 bytes */
|
||||
#if defined(__MVS__)
|
||||
# pragma map(deflateInit_,"DEIN")
|
||||
# pragma map(deflateInit2_,"DEIN2")
|
||||
# pragma map(deflateEnd,"DEEND")
|
||||
# pragma map(deflateBound,"DEBND")
|
||||
# pragma map(inflateInit_,"ININ")
|
||||
# pragma map(inflateInit2_,"ININ2")
|
||||
# pragma map(inflateEnd,"INEND")
|
||||
# pragma map(inflateSync,"INSY")
|
||||
# pragma map(inflateSetDictionary,"INSEDI")
|
||||
# pragma map(compressBound,"CMBND")
|
||||
# pragma map(inflate_table,"INTABL")
|
||||
# pragma map(inflate_fast,"INFA")
|
||||
# pragma map(inflate_copyright,"INCOPY")
|
||||
#endif
|
||||
|
||||
#endif /* ZCONF_H */
|
File diff suppressed because it is too large
Load Diff
Binary file not shown.
|
@ -1,5 +1,38 @@
|
|||
# Makefile for the MJ2 codecs of the OpenJPEG library: frames_to_mj2, mj2_to_frames, extract_j2k_from_mj2 and wrap_j2k_in_mj2
|
||||
|
||||
SET(common_SRCS "")
|
||||
IF(DONT_HAVE_GETOPT)
|
||||
SET(common_SRCS ${OPENJPEG_SOURCE_DIR}/common/getopt.c)
|
||||
ENDIF(DONT_HAVE_GETOPT)
|
||||
|
||||
# While mj2 executables do not use the API correctly, we do not link with the library but rather compile the sources files.
|
||||
SET(OPJ_SRCS
|
||||
${OPENJPEG_SOURCE_DIR}/libopenjpeg/bio.c
|
||||
${OPENJPEG_SOURCE_DIR}/libopenjpeg/cio.c
|
||||
${OPENJPEG_SOURCE_DIR}/libopenjpeg/dwt.c
|
||||
${OPENJPEG_SOURCE_DIR}/libopenjpeg/event.c
|
||||
${OPENJPEG_SOURCE_DIR}/libopenjpeg/image.c
|
||||
${OPENJPEG_SOURCE_DIR}/libopenjpeg/j2k.c
|
||||
${OPENJPEG_SOURCE_DIR}/libopenjpeg/j2k_lib.c
|
||||
${OPENJPEG_SOURCE_DIR}/libopenjpeg/jp2.c
|
||||
${OPENJPEG_SOURCE_DIR}/libopenjpeg/jpt.c
|
||||
${OPENJPEG_SOURCE_DIR}/libopenjpeg/mct.c
|
||||
${OPENJPEG_SOURCE_DIR}/libopenjpeg/mqc.c
|
||||
${OPENJPEG_SOURCE_DIR}/libopenjpeg/openjpeg.c
|
||||
${OPENJPEG_SOURCE_DIR}/libopenjpeg/pi.c
|
||||
${OPENJPEG_SOURCE_DIR}/libopenjpeg/raw.c
|
||||
${OPENJPEG_SOURCE_DIR}/libopenjpeg/t1.c
|
||||
${OPENJPEG_SOURCE_DIR}/libopenjpeg/t2.c
|
||||
${OPENJPEG_SOURCE_DIR}/libopenjpeg/tcd.c
|
||||
${OPENJPEG_SOURCE_DIR}/libopenjpeg/tgt.c
|
||||
)
|
||||
|
||||
SET(MJ2_SRCS mj2.c mj2_convert.c)
|
||||
|
||||
IF(WIN32)
|
||||
ADD_DEFINITIONS(-DOPJ_STATIC)
|
||||
ENDIF(WIN32)
|
||||
|
||||
# Headers file are located here:
|
||||
INCLUDE_DIRECTORIES(
|
||||
${OPENJPEG_SOURCE_DIR}/libopenjpeg
|
||||
|
@ -9,39 +42,43 @@ INCLUDE_DIRECTORIES(
|
|||
|
||||
ADD_EXECUTABLE(frames_to_mj2
|
||||
frames_to_mj2.c
|
||||
${PROJECT_SOURCE_DIR}/common/getopt.c
|
||||
mj2_convert.c
|
||||
mj2.c
|
||||
${common_SRCS}
|
||||
${OPJ_SRCS}
|
||||
${MJ2_SRCS}
|
||||
)
|
||||
TARGET_LINK_LIBRARIES(frames_to_mj2 ${OPENJPEG_LIBRARY_NAME} ${LCMS_LIB})
|
||||
TARGET_LINK_LIBRARIES(frames_to_mj2 ${LCMS_LIB})
|
||||
IF(UNIX)
|
||||
TARGET_LINK_LIBRARIES(frames_to_mj2 m)
|
||||
ENDIF(UNIX)
|
||||
|
||||
ADD_EXECUTABLE(mj2_to_frames
|
||||
mj2_to_frames.c
|
||||
${PROJECT_SOURCE_DIR}/common/getopt.c
|
||||
mj2_convert.c
|
||||
mj2.c
|
||||
${PROJECT_SOURCE_DIR}/common/color.c
|
||||
${common_SRCS}
|
||||
${OPJ_SRCS}
|
||||
${MJ2_SRCS}
|
||||
${OPENJPEG_SOURCE_DIR}/common/color.c
|
||||
)
|
||||
TARGET_LINK_LIBRARIES(mj2_to_frames ${OPENJPEG_LIBRARY_NAME} ${LCMS_LIB})
|
||||
TARGET_LINK_LIBRARIES(mj2_to_frames ${LCMS_LIB})
|
||||
IF(UNIX)
|
||||
TARGET_LINK_LIBRARIES(mj2_to_frames m)
|
||||
ENDIF(UNIX)
|
||||
|
||||
ADD_EXECUTABLE(extract_j2k_from_mj2
|
||||
extract_j2k_from_mj2.c
|
||||
mj2.c )
|
||||
TARGET_LINK_LIBRARIES(extract_j2k_from_mj2 ${OPENJPEG_LIBRARY_NAME} ${LCMS_LIB})
|
||||
${OPJ_SRCS}
|
||||
${MJ2_SRCS}
|
||||
)
|
||||
TARGET_LINK_LIBRARIES(extract_j2k_from_mj2 ${LCMS_LIB})
|
||||
IF(UNIX)
|
||||
TARGET_LINK_LIBRARIES(extract_j2k_from_mj2 m)
|
||||
ENDIF(UNIX)
|
||||
|
||||
ADD_EXECUTABLE(wrap_j2k_in_mj2
|
||||
wrap_j2k_in_mj2.c
|
||||
mj2.c )
|
||||
TARGET_LINK_LIBRARIES(wrap_j2k_in_mj2 ${OPENJPEG_LIBRARY_NAME} ${LCMS_LIB})
|
||||
${OPJ_SRCS}
|
||||
${MJ2_SRCS}
|
||||
)
|
||||
TARGET_LINK_LIBRARIES(wrap_j2k_in_mj2 ${LCMS_LIB})
|
||||
IF(UNIX)
|
||||
TARGET_LINK_LIBRARIES(wrap_j2k_in_mj2 m)
|
||||
ENDIF(UNIX)
|
||||
|
|
Loading…
Reference in New Issue