diff options
author | Even Rouault <even.rouault@spatialys.com> | 2021-01-04 09:54:32 +0000 |
---|---|---|
committer | Even Rouault <even.rouault@spatialys.com> | 2021-01-04 09:54:32 +0000 |
commit | 68810ae523d1193b547d70d6300433e02249e20d (patch) | |
tree | a8bea149794f7e4c972df36a58899841d79b40aa | |
parent | d84ef79d2abc8a2b0dfc1799ce603911cc0cb2d2 (diff) | |
parent | 09735b1659b599b6843c81221c95830138a284a7 (diff) | |
download | libtiff-git-68810ae523d1193b547d70d6300433e02249e20d.tar.gz |
Merge branch 'drop-wince' into 'master'
Remove non-functional WinCE support
See merge request libtiff/libtiff!188
-rw-r--r-- | libtiff/CMakeLists.txt | 2 | ||||
-rw-r--r-- | libtiff/Makefile.am | 4 | ||||
-rw-r--r-- | libtiff/tif_config.wince.h | 69 | ||||
-rw-r--r-- | libtiff/tiffconf.wince.h | 110 | ||||
-rw-r--r-- | tools/tiffinfoce.c | 484 |
5 files changed, 1 insertions, 668 deletions
diff --git a/libtiff/CMakeLists.txt b/libtiff/CMakeLists.txt index e5370581..a186f5dd 100644 --- a/libtiff/CMakeLists.txt +++ b/libtiff/CMakeLists.txt @@ -33,9 +33,7 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/tiffconf.h.cmake.in extra_dist( SConstruct tif_config.vc.h - tif_config.wince.h tiffconf.vc.h - tiffconf.wince.h libtiff.def libtiff.map libtiffxx.map) diff --git a/libtiff/Makefile.am b/libtiff/Makefile.am index 811ca24d..9f4a821c 100644 --- a/libtiff/Makefile.am +++ b/libtiff/Makefile.am @@ -36,10 +36,8 @@ EXTRA_DIST = \ libtiffxx.map \ tif_config.h.cmake.in \ tif_config.vc.h \ - tif_config.wince.h \ tiffconf.h.cmake.in \ - tiffconf.vc.h \ - tiffconf.wince.h + tiffconf.vc.h libtiffinclude_HEADERS = \ tiff.h \ diff --git a/libtiff/tif_config.wince.h b/libtiff/tif_config.wince.h deleted file mode 100644 index da09ba18..00000000 --- a/libtiff/tif_config.wince.h +++ /dev/null @@ -1,69 +0,0 @@ -/* - * TIFF library configuration header for Windows CE platform. - */ -#ifndef _WIN32_WCE -# error This version of tif_config.h header is dedicated for Windows CE platform! -#endif - -/* Define to 1 if you have the <assert.h> header file. */ -#define HAVE_ASSERT_H 1 - -/* Define to 1 if you have the <fcntl.h> header file. */ -#define HAVE_FCNTL_H 1 - -/* Define as 0 or 1 according to the floating point format supported by the - machine */ -#define HAVE_IEEEFP 1 - -/* Define to 1 if you have the `jbg_newlen' function. */ -#define HAVE_JBG_NEWLEN 1 - -/* Define to 1 if you have the <string.h> header file. */ -#define HAVE_STRING_H 1 - -/* Define to 1 if you have the <sys/types.h> header file. */ -#undef HAVE_SYS_TYPES_H - -/* Define to 1 if you have the <io.h> header file. */ -#define HAVE_IO_H 1 - -/* Define to 1 if you have the <search.h> header file. */ -#define HAVE_SEARCH_H 1 - -/* Define to 1 if you have the `setmode' function. */ -#define HAVE_SETMODE 1 - -/* Define to 1 if you have the `bsearch' function. */ -#define HAVE_BSEARCH 1 -#define bsearch wceex_bsearch - -/* Define to 1 if you have the `lfind' function. */ -#define HAVE_LFIND 1 -#define lfind wceex_lfind - -/* The size of a `int', as computed by sizeof. */ -#define SIZEOF_INT 4 - -/* Set the native cpu bit order */ -#define HOST_FILLORDER FILLORDER_LSB2MSB - -/* Define to 1 if your processor stores words with the most significant byte - first (like Motorola and SPARC, unlike Intel and VAX). */ -/* #undef WORDS_BIGENDIAN */ - -/* Define to `__inline__' or `__inline' if that's what the C compiler - calls it, or to nothing if 'inline' is not supported under any name. */ -#ifndef __cplusplus -# ifndef inline -# define inline __inline -# endif -#endif - - -/* - * Local Variables: - * mode: c - * c-basic-offset: 8 - * fill-column: 78 - * End: - */ diff --git a/libtiff/tiffconf.wince.h b/libtiff/tiffconf.wince.h deleted file mode 100644 index 05fd0564..00000000 --- a/libtiff/tiffconf.wince.h +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Windows CE platform tiffconf.wince.h - * Created by Mateusz Loskot (mateusz@loskot.net) - * - * NOTE: Requires WCELIBCEX library with wceex_* functions, - * It's an extension to C library on Windows CE platform. - * For example, HAVE_STDIO_H definition indicates there are - * following files available: - * stdio.h - from Windows CE / Windows Mobile SDK - * wce_stdio.h - from WCELIBCEX library - */ - - -/* - Configuration defines for installed libtiff. - This file maintained for backward compatibility. Do not use definitions - from this file in your programs. -*/ - -#ifndef _WIN32_WCE -# error This version of tif_config.h header is dedicated for Windows CE platform! -#endif - - -#ifndef _TIFFCONF_ -#define _TIFFCONF_ - -/* The size of a `int', as computed by sizeof. */ -#define SIZEOF_INT 4 - -/* Compatibility stuff. */ - -/* Define as 0 or 1 according to the floating point format supported by the - machine */ -#define HAVE_IEEEFP 1 - -/* Set the native cpu bit order (FILLORDER_LSB2MSB or FILLORDER_MSB2LSB) */ -#define HOST_FILLORDER FILLORDER_LSB2MSB - -/* Native cpu byte order: 1 if big-endian (Motorola) or 0 if little-endian - (Intel) */ -#define HOST_BIGENDIAN 0 - -/* Support CCITT Group 3 & 4 algorithms */ -#define CCITT_SUPPORT 1 - -/* Support JPEG compression (requires IJG JPEG library) */ -/* #undef JPEG_SUPPORT */ - -/* Support LogLuv high dynamic range encoding */ -#define LOGLUV_SUPPORT 1 - -/* Support LZW algorithm */ -#define LZW_SUPPORT 1 - -/* Support NeXT 2-bit RLE algorithm */ -#define NEXT_SUPPORT 1 - -/* Support Old JPEG compresson (read contrib/ojpeg/README first! Compilation - fails with unpatched IJG JPEG library) */ -/* #undef OJPEG_SUPPORT */ - -/* Support Macintosh PackBits algorithm */ -#define PACKBITS_SUPPORT 1 - -/* Support Pixar log-format algorithm (requires Zlib) */ -/* #undef PIXARLOG_SUPPORT */ - -/* Support ThunderScan 4-bit RLE algorithm */ -#define THUNDER_SUPPORT 1 - -/* Support Deflate compression */ -/* #undef ZIP_SUPPORT */ - -/* Support strip chopping (whether or not to convert single-strip uncompressed - images to multiple strips of ~8Kb to reduce memory usage) */ -#define STRIPCHOP_DEFAULT TIFF_STRIPCHOP - -/* Enable SubIFD tag (330) support */ -#define SUBIFD_SUPPORT 1 - -/* Treat extra sample as alpha (default enabled). The RGBA interface will - treat a fourth sample with no EXTRASAMPLE_ value as being ASSOCALPHA. Many - packages produce RGBA files but don't mark the alpha properly. */ -#define DEFAULT_EXTRASAMPLE_AS_ALPHA 1 - -/* Pick up YCbCr subsampling info from the JPEG data stream to support files - lacking the tag (default enabled). */ -#define CHECK_JPEG_YCBCR_SUBSAMPLING 1 - -/* - * Feature support definitions. - * XXX: These macros are obsoleted. Don't use them in your apps! - * Macros stays here for backward compatibility and should be always defined. - */ -#define COLORIMETRY_SUPPORT -#define YCBCR_SUPPORT -#define CMYK_SUPPORT -#define ICC_SUPPORT -#define PHOTOSHOP_SUPPORT -#define IPTC_SUPPORT - -#endif /* _TIFFCONF_ */ -/* - * Local Variables: - * mode: c - * c-basic-offset: 8 - * fill-column: 78 - * End: - */ diff --git a/tools/tiffinfoce.c b/tools/tiffinfoce.c deleted file mode 100644 index b90f0382..00000000 --- a/tools/tiffinfoce.c +++ /dev/null @@ -1,484 +0,0 @@ -/* - * 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. - * - * Adapted from tifinfo.c by Mateusz Loskot (mateusz@loskot.net) - */ - -#if !defined(_WIN32_WCE) -# error "Only Windows CE target is supported!" -#endif - -#include "tif_config.h" - -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <wce_stdio.h> -#include <wce_stat.h> - -#include "tiffio.h" - -#define streq(a,b) (_stricmp(a,b) == 0) - -/* defined in port/getopt.c */ -int getopt(int argc, char * const argv[], const char *optstring); - -int showdata = 0; /* show data */ -int rawdata = 0; /* show raw/decoded data */ -int showwords = 0; /* show data as bytes/words */ -int readdata = 0; /* read data in file */ -int stoponerr = 1; /* stop on first read error */ - -static void usage(void); -static void tiffinfo(TIFF*, uint16, long); - -int -main(int argc, char* argv[]) -{ - int dirnum = -1, multiplefiles, c; - uint16 order = 0; - TIFF* tif; - extern int optind; - extern char* optarg; - long flags = 0; - uint32 diroff = 0; - int chopstrips = 0; /* disable strip chopping */ - - while ((c = getopt(argc, argv, "f:o:cdDSjilmrsvwz0123456789")) != -1) - switch (c) { - case '0': case '1': case '2': case '3': - case '4': case '5': case '6': case '7': - case '8': case '9': - dirnum = atoi(&argv[optind-1][1]); - break; - case 'd': - showdata++; - /* fall through... */ - case 'D': - readdata++; - break; - case 'c': - flags |= TIFFPRINT_COLORMAP | TIFFPRINT_CURVES; - break; - case 'f': /* fill order */ - if (streq(optarg, "lsb2msb")) - order = FILLORDER_LSB2MSB; - else if (streq(optarg, "msb2lsb")) - order = FILLORDER_MSB2LSB; - else - usage(); - break; - case 'i': - stoponerr = 0; - break; - case 'o': - diroff = strtoul(optarg, NULL, 0); - break; - case 'j': - flags |= TIFFPRINT_JPEGQTABLES | - TIFFPRINT_JPEGACTABLES | - TIFFPRINT_JPEGDCTABLES; - break; - case 'r': - rawdata = 1; - break; - case 's': - flags |= TIFFPRINT_STRIPS; - break; - case 'w': - showwords = 1; - break; - case 'z': - chopstrips = 1; - break; - case '?': - usage(); - /*NOTREACHED*/ - } - if (optind >= argc) - { - usage(); - } - - multiplefiles = (argc - optind > 1); - for (; optind < argc; optind++) - { - if (multiplefiles) - { - printf("%s:\n", argv[optind]); - } - - tif = TIFFOpen(argv[optind], chopstrips ? "rC" : "rc"); - if (tif != NULL) - { - if (dirnum != -1) - { - if (TIFFSetDirectory(tif, (tdir_t) dirnum)) - tiffinfo(tif, order, flags); - } else if (diroff != 0) { - if (TIFFSetSubDirectory(tif, diroff)) - tiffinfo(tif, order, flags); - } else { - do { - toff_t offset; - - tiffinfo(tif, order, flags); - if (TIFFGetField(tif, TIFFTAG_EXIFIFD, - &offset)) { - if (TIFFReadEXIFDirectory(tif, offset)) - tiffinfo(tif, order, flags); - } - } while (TIFFReadDirectory(tif)); - } - TIFFClose(tif); - } - } - - printf("\n<press any key to exit>\n"); - getc(stdin); - - return (0); -} - -char* stuff[] = { -"usage: tiffinfo [options] input...", -"where options are:", -" -D read data", -" -i ignore read errors", -" -c display data for grey/color response curve or colormap", -" -d display raw/decoded image data", -" -f lsb2msb force lsb-to-msb FillOrder for input", -" -f msb2lsb force msb-to-lsb FillOrder for input", -" -j show JPEG tables", -" -o offset set initial directory offset", -" -r read/display raw image data instead of decoded data", -" -s display strip offsets and byte counts", -" -w display raw data in words rather than bytes", -" -z enable strip chopping", -" -# set initial directory (first directory is # 0)", -NULL -}; - -static void -usage(void) -{ - /* char buf[BUFSIZ];*/ - int i; - - /* setbuf(stderr, buf); */ - fprintf(stderr, "%s\n\n", TIFFGetVersion()); - for (i = 0; stuff[i] != NULL; i++) - fprintf(stderr, "%s\n", stuff[i]); - exit(-1); -} - -static void -ShowStrip(tstrip_t strip, unsigned char* pp, uint32 nrow, tsize_t scanline) -{ - register tsize_t cc; - - printf("Strip %lu:\n", (unsigned long) strip); - while (nrow-- > 0) { - for (cc = 0; cc < scanline; cc++) { - printf(" %02x", *pp++); - if (((cc+1) % 24) == 0) - putchar('\n'); - } - putchar('\n'); - } -} - -void -TIFFReadContigStripData(TIFF* tif) -{ - unsigned char *buf; - tsize_t scanline = TIFFScanlineSize(tif); - - buf = (unsigned char *)_TIFFmalloc(TIFFStripSize(tif)); - if (buf) { - uint32 row, h; - uint32 rowsperstrip = (uint32)-1; - - TIFFGetField(tif, TIFFTAG_IMAGELENGTH, &h); - TIFFGetField(tif, TIFFTAG_ROWSPERSTRIP, &rowsperstrip); - for (row = 0; row < h; row += rowsperstrip) { - uint32 nrow = (row+rowsperstrip > h ? - h-row : rowsperstrip); - tstrip_t strip = TIFFComputeStrip(tif, row, 0); - if (TIFFReadEncodedStrip(tif, strip, buf, nrow*scanline) < 0) { - if (stoponerr) - break; - } else if (showdata) - ShowStrip(strip, buf, nrow, scanline); - } - _TIFFfree(buf); - } -} - -void -TIFFReadSeparateStripData(TIFF* tif) -{ - unsigned char *buf; - tsize_t scanline = TIFFScanlineSize(tif); - - buf = (unsigned char *)_TIFFmalloc(TIFFStripSize(tif)); - if (buf) { - uint32 row, h; - uint32 rowsperstrip = (uint32)-1; - tsample_t s, samplesperpixel; - - TIFFGetField(tif, TIFFTAG_IMAGELENGTH, &h); - TIFFGetField(tif, TIFFTAG_ROWSPERSTRIP, &rowsperstrip); - TIFFGetField(tif, TIFFTAG_SAMPLESPERPIXEL, &samplesperpixel); - for (row = 0; row < h; row += rowsperstrip) { - for (s = 0; s < samplesperpixel; s++) { - uint32 nrow = (row+rowsperstrip > h ? - h-row : rowsperstrip); - tstrip_t strip = TIFFComputeStrip(tif, row, s); - if (TIFFReadEncodedStrip(tif, strip, buf, nrow*scanline) < 0) { - if (stoponerr) - break; - } else if (showdata) - ShowStrip(strip, buf, nrow, scanline); - } - } - _TIFFfree(buf); - } -} - -static void -ShowTile(uint32 row, uint32 col, tsample_t sample, - unsigned char* pp, uint32 nrow, uint32 rowsize) -{ - uint32 cc; - - printf("Tile (%lu,%lu", (unsigned long) row, (unsigned long) col); - if (sample != (tsample_t) -1) - printf(",%u", sample); - printf("):\n"); - while (nrow-- > 0) { - for (cc = 0; cc < rowsize; cc++) { - printf(" %02x", *pp++); - if (((cc+1) % 24) == 0) - putchar('\n'); - } - putchar('\n'); - } -} - -void -TIFFReadContigTileData(TIFF* tif) -{ - unsigned char *buf; - tmsize_t rowsize = TIFFTileRowSize(tif); - tmsize_t tilesize = TIFFTileSize(tif); - - buf = (unsigned char *)_TIFFmalloc(tilesize); - if (buf) { - uint32 tw=0, th=0, w=0, h=0; - uint32 row, col; - - TIFFGetField(tif, TIFFTAG_IMAGEWIDTH, &w); - TIFFGetField(tif, TIFFTAG_IMAGELENGTH, &h); - TIFFGetField(tif, TIFFTAG_TILEWIDTH, &tw); - TIFFGetField(tif, TIFFTAG_TILELENGTH, &th); - if( rowsize == 0 || th > tilesize / rowsize ) - { - fprintf(stderr, "Cannot display data: th * rowsize > tilesize\n"); - _TIFFfree(buf); - return; - } - for (row = 0; row < h; row += th) { - for (col = 0; col < w; col += tw) { - if (TIFFReadTile(tif, buf, col, row, 0, 0) < 0) { - if (stoponerr) - break; - } else if (showdata) - ShowTile(row, col, (tsample_t) -1, buf, th, rowsize); - } - } - _TIFFfree(buf); - } -} - -void -TIFFReadSeparateTileData(TIFF* tif) -{ - unsigned char *buf; - tmsize_t rowsize = TIFFTileRowSize(tif); - tmsize_t tilesize = TIFFTileSize(tif); - - buf = (unsigned char *)_TIFFmalloc(tilesize); - if (buf) { - uint32 tw=0, th=0, w=0, h=0; - uint32 row, col; - tsample_t s, samplesperpixel; - - TIFFGetField(tif, TIFFTAG_IMAGEWIDTH, &w); - TIFFGetField(tif, TIFFTAG_IMAGELENGTH, &h); - TIFFGetField(tif, TIFFTAG_TILEWIDTH, &tw); - TIFFGetField(tif, TIFFTAG_TILELENGTH, &th); - TIFFGetField(tif, TIFFTAG_SAMPLESPERPIXEL, &samplesperpixel); - if( rowsize == 0 || th > tilesize / rowsize ) - { - fprintf(stderr, "Cannot display data: th * rowsize > tilesize\n"); - _TIFFfree(buf); - return; - } - for (row = 0; row < h; row += th) { - for (col = 0; col < w; col += tw) { - for (s = 0; s < samplesperpixel; s++) { - if (TIFFReadTile(tif, buf, col, row, 0, s) < 0) { - if (stoponerr) - break; - } else if (showdata) - ShowTile(row, col, s, buf, th, rowsize); - } - } - } - _TIFFfree(buf); - } -} - -void -TIFFReadData(TIFF* tif) -{ - uint16 config; - - TIFFGetField(tif, TIFFTAG_PLANARCONFIG, &config); - if (TIFFIsTiled(tif)) { - if (config == PLANARCONFIG_CONTIG) - TIFFReadContigTileData(tif); - else - TIFFReadSeparateTileData(tif); - } else { - if (config == PLANARCONFIG_CONTIG) - TIFFReadContigStripData(tif); - else - TIFFReadSeparateStripData(tif); - } -} - -static void -ShowRawBytes(unsigned char* pp, uint32 n) -{ - uint32 i; - - for (i = 0; i < n; i++) { - printf(" %02x", *pp++); - if (((i+1) % 24) == 0) - printf("\n "); - } - putchar('\n'); -} - -static void -ShowRawWords(uint16* pp, uint32 n) -{ - uint32 i; - - for (i = 0; i < n; i++) { - printf(" %04x", *pp++); - if (((i+1) % 15) == 0) - printf("\n "); - } - putchar('\n'); -} - -void -TIFFReadRawData(TIFF* tif, int bitrev) -{ - tstrip_t nstrips = TIFFNumberOfStrips(tif); - const char* what = TIFFIsTiled(tif) ? "Tile" : "Strip"; - uint64* stripbc; - - TIFFGetField(tif, TIFFTAG_STRIPBYTECOUNTS, &stripbc); - if (nstrips > 0) { - uint32 bufsize = stripbc[0]; - tdata_t buf = _TIFFmalloc(bufsize); - tstrip_t s; - - for (s = 0; s < nstrips; s++) { - if (stripbc[s] > bufsize) { - buf = _TIFFrealloc(buf, stripbc[s]); - bufsize = stripbc[s]; - } - if (buf == NULL) { - fprintf(stderr, - "Cannot allocate buffer to read strip %lu\n", - (unsigned long) s); - break; - } - if (TIFFReadRawStrip(tif, s, buf, stripbc[s]) < 0) { - fprintf(stderr, "Error reading strip %lu\n", - (unsigned long) s); - if (stoponerr) - break; - } else if (showdata) { - if (bitrev) { - TIFFReverseBits(buf, stripbc[s]); - printf("%s %lu: (bit reversed)\n ", - what, (unsigned long) s); - } else - printf("%s %lu:\n ", what, - (unsigned long) s); - if (showwords) - ShowRawWords((uint16*) buf, stripbc[s]>>1); - else - ShowRawBytes((unsigned char*) buf, stripbc[s]); - } - } - if (buf != NULL) - _TIFFfree(buf); - } -} - -static void -tiffinfo(TIFF* tif, uint16 order, long flags) -{ - TIFFPrintDirectory(tif, stdout, flags); - if (!readdata) - return; - if (rawdata) { - if (order) { - uint16 o; - TIFFGetFieldDefaulted(tif, - TIFFTAG_FILLORDER, &o); - TIFFReadRawData(tif, o != order); - } else - TIFFReadRawData(tif, 0); - } else { - if (order) - TIFFSetField(tif, TIFFTAG_FILLORDER, order); - TIFFReadData(tif); - } -} - -/* vim: set ts=8 sts=8 sw=8 noet: */ -/* - * Local Variables: - * mode: c - * c-basic-offset: 8 - * fill-column: 78 - * End: - */ |