summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2022-09-21 14:18:08 +0100
committerSam James <sam@gentoo.org>2022-10-02 04:31:25 +0100
commita529111f77ff46f4836fe7312e70953bc16587cf (patch)
tree9dc3924cb1a6ef3ef853b7bb45f735365e0b4e6d /tiff/contrib/dbs
parentImport Ghostscript 9.56.1 (diff)
downloadghostscript-gpl-patches-2233e6caad8b2bc1199d7a9c17fd6996bdbf07e9.tar.gz
ghostscript-gpl-patches-2233e6caad8b2bc1199d7a9c17fd6996bdbf07e9.tar.bz2
ghostscript-gpl-patches-2233e6caad8b2bc1199d7a9c17fd6996bdbf07e9.zip
Import Ghostscript 10.0ghostscript-10.0ghostscript-10
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'tiff/contrib/dbs')
-rw-r--r--tiff/contrib/dbs/CMakeLists.txt12
-rw-r--r--tiff/contrib/dbs/Makefile.in13
-rw-r--r--tiff/contrib/dbs/tiff-grayscale.c6
-rw-r--r--tiff/contrib/dbs/tiff-palette.c8
-rw-r--r--tiff/contrib/dbs/tiff-rgb.c4
-rw-r--r--tiff/contrib/dbs/xtiff/CMakeLists.txt29
-rw-r--r--tiff/contrib/dbs/xtiff/Makefile.am1
-rw-r--r--tiff/contrib/dbs/xtiff/Makefile.in12
-rw-r--r--tiff/contrib/dbs/xtiff/xtiff.c40
9 files changed, 46 insertions, 79 deletions
diff --git a/tiff/contrib/dbs/CMakeLists.txt b/tiff/contrib/dbs/CMakeLists.txt
index ff3ce20c..b5681777 100644
--- a/tiff/contrib/dbs/CMakeLists.txt
+++ b/tiff/contrib/dbs/CMakeLists.txt
@@ -22,25 +22,17 @@
# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
# OF THIS SOFTWARE.
-include_directories(${PROJECT_SOURCE_DIR}/libtiff
- ${PROJECT_BINARY_DIR}/libtiff
- ${CMAKE_CURRENT_BINARY_DIR})
-
add_executable(tiff-bi tiff-bi.c)
target_link_libraries(tiff-bi tiff port)
add_executable(tiff-grayscale tiff-grayscale.c)
-target_link_libraries(tiff-grayscale tiff port)
+target_link_libraries(tiff-grayscale tiff port CMath::CMath)
add_executable(tiff-palette tiff-palette.c)
target_link_libraries(tiff-palette tiff port)
add_executable(tiff-rgb tiff-rgb.c)
-target_link_libraries(tiff-rgb tiff port)
-
-add_subdirectory(xtiff)
-
-extra_dist(README)
+target_link_libraries(tiff-rgb tiff port CMath::CMath)
if(WEBP_SUPPORT AND EMSCRIPTEN)
# Emscripten is pretty finnicky about linker flags.
diff --git a/tiff/contrib/dbs/Makefile.in b/tiff/contrib/dbs/Makefile.in
index 0f44fdd1..eb6a255d 100644
--- a/tiff/contrib/dbs/Makefile.in
+++ b/tiff/contrib/dbs/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.16.2 from Makefile.am.
+# Makefile.in generated by automake 1.16.1 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2020 Free Software Foundation, Inc.
+# Copyright (C) 1994-2018 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -125,8 +125,10 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/libtiff/tif_config.h \
- $(top_builddir)/libtiff/tiffconf.h
+CONFIG_HEADER = $(top_builddir)/config.h \
+ $(top_builddir)/libtiff/tif_config.h \
+ $(top_builddir)/libtiff/tiffconf.h \
+ $(top_builddir)/port/libport_config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
PROGRAMS = $(noinst_PROGRAMS)
@@ -158,7 +160,7 @@ AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =
-DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/libtiff
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) -I$(top_builddir)/libtiff -I$(top_builddir)/port
depcomp = $(SHELL) $(top_srcdir)/config/depcomp
am__maybe_remake_depfiles = depfiles
am__depfiles_remade = ./$(DEPDIR)/tiff-bi.Po \
@@ -395,6 +397,7 @@ pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
+runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
diff --git a/tiff/contrib/dbs/tiff-grayscale.c b/tiff/contrib/dbs/tiff-grayscale.c
index 92c7b904..644eb9ee 100644
--- a/tiff/contrib/dbs/tiff-grayscale.c
+++ b/tiff/contrib/dbs/tiff-grayscale.c
@@ -41,7 +41,7 @@ int main(int argc, char **argv)
int bits_per_pixel = 8, cmsize, i, j, k,
gray_index, chunk_size = 32, nchunks = 16;
unsigned char * scan_line;
- uint16 * gray;
+ uint16_t * gray;
float refblackwhite[2*1];
TIFF * tif;
@@ -73,11 +73,11 @@ int main(int argc, char **argv)
}
cmsize = nchunks * nchunks;
- gray = (uint16 *) malloc(cmsize * sizeof(uint16));
+ gray = (uint16_t *) malloc(cmsize * sizeof(uint16_t));
gray[0] = 3000;
for (i = 1; i < cmsize; i++)
- gray[i] = (uint16) (-log10((double) i / (cmsize - 1)) * 1000);
+ gray[i] = (uint16_t) (-log10((double) i / (cmsize - 1)) * 1000);
refblackwhite[0] = 0.0;
refblackwhite[1] = (float)((1L<<bits_per_pixel) - 1);
diff --git a/tiff/contrib/dbs/tiff-palette.c b/tiff/contrib/dbs/tiff-palette.c
index 7b3d433f..9f8ea105 100644
--- a/tiff/contrib/dbs/tiff-palette.c
+++ b/tiff/contrib/dbs/tiff-palette.c
@@ -40,7 +40,7 @@ int main(int argc, char **argv)
int bits_per_pixel = 8, cmsize, i, j, k,
cmap_index, chunk_size = 32, nchunks = 16;
unsigned char * scan_line;
- uint16 *red, *green, *blue;
+ uint16_t *red, *green, *blue;
TIFF * tif;
programName = argv[0];
@@ -79,9 +79,9 @@ int main(int argc, char **argv)
} else {
cmsize = 2;
}
- red = (uint16 *) malloc(cmsize * sizeof(uint16));
- green = (uint16 *) malloc(cmsize * sizeof(uint16));
- blue = (uint16 *) malloc(cmsize * sizeof(uint16));
+ red = (uint16_t *) malloc(cmsize * sizeof(uint16_t));
+ green = (uint16_t *) malloc(cmsize * sizeof(uint16_t));
+ blue = (uint16_t *) malloc(cmsize * sizeof(uint16_t));
switch (bits_per_pixel) {
case 8:
diff --git a/tiff/contrib/dbs/tiff-rgb.c b/tiff/contrib/dbs/tiff-rgb.c
index d14ed005..f912cb99 100644
--- a/tiff/contrib/dbs/tiff-rgb.c
+++ b/tiff/contrib/dbs/tiff-rgb.c
@@ -29,7 +29,7 @@
#include "tiffio.h"
-#define ROUND(x) (uint16) ((x) + 0.5)
+#define ROUND(x) (uint16_t) ((x) + 0.5)
#define CMSIZE 256
#define WIDTH 525
#define HEIGHT 512
@@ -45,7 +45,7 @@ int main(int argc, char **argv)
int i, j;
TIFF * tif;
unsigned char * scan_line;
- uint16 red[CMSIZE], green[CMSIZE], blue[CMSIZE];
+ uint16_t red[CMSIZE], green[CMSIZE], blue[CMSIZE];
float refblackwhite[2*3];
programName = argv[0];
diff --git a/tiff/contrib/dbs/xtiff/CMakeLists.txt b/tiff/contrib/dbs/xtiff/CMakeLists.txt
deleted file mode 100644
index fec4d0d8..00000000
--- a/tiff/contrib/dbs/xtiff/CMakeLists.txt
+++ /dev/null
@@ -1,29 +0,0 @@
-# CMake build for libtiff
-#
-# Copyright © 2015 Open Microscopy Environment / University of Dundee
-# Written by Roger Leigh <rleigh@codelibre.net>
-#
-# 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.
-
-extra_dist(
- README
- patchlevel.h
- xtiff.c
- xtifficon.h)
diff --git a/tiff/contrib/dbs/xtiff/Makefile.am b/tiff/contrib/dbs/xtiff/Makefile.am
index a138c90a..cd810472 100644
--- a/tiff/contrib/dbs/xtiff/Makefile.am
+++ b/tiff/contrib/dbs/xtiff/Makefile.am
@@ -27,7 +27,6 @@
#LIBTIFF = $(top_builddir)/libtiff/libtiff.la
EXTRA_DIST = \
- CMakeLists.txt \
README \
patchlevel.h \
xtiff.c \
diff --git a/tiff/contrib/dbs/xtiff/Makefile.in b/tiff/contrib/dbs/xtiff/Makefile.in
index 4be51fd8..50b6bf09 100644
--- a/tiff/contrib/dbs/xtiff/Makefile.in
+++ b/tiff/contrib/dbs/xtiff/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.16.2 from Makefile.am.
+# Makefile.in generated by automake 1.16.1 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2020 Free Software Foundation, Inc.
+# Copyright (C) 1994-2018 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -125,8 +125,10 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/libtiff/tif_config.h \
- $(top_builddir)/libtiff/tiffconf.h
+CONFIG_HEADER = $(top_builddir)/config.h \
+ $(top_builddir)/libtiff/tif_config.h \
+ $(top_builddir)/libtiff/tiffconf.h \
+ $(top_builddir)/port/libport_config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
AM_V_P = $(am__v_P_@AM_V@)
@@ -290,6 +292,7 @@ pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
+runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
@@ -300,7 +303,6 @@ top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
EXTRA_DIST = \
- CMakeLists.txt \
README \
patchlevel.h \
xtiff.c \
diff --git a/tiff/contrib/dbs/xtiff/xtiff.c b/tiff/contrib/dbs/xtiff/xtiff.c
index bc10b670..a9518f83 100644
--- a/tiff/contrib/dbs/xtiff/xtiff.c
+++ b/tiff/contrib/dbs/xtiff/xtiff.c
@@ -70,7 +70,7 @@
#include "xtifficon.h"
#define TIFF_GAMMA "2.2" /* default gamma from the TIFF 5.0 spec */
-#define ROUND(x) (uint16) ((x) + 0.5)
+#define ROUND(x) (uint16_t) ((x) + 0.5)
#define SCALE(x, s) (((x) * 65535L) / (s))
#define MCHECK(m) if (!m) { fprintf(stderr, "malloc failed\n"); exit(0); }
#define MIN(a, b) (((a) < (b)) ? (a) : (b))
@@ -131,8 +131,8 @@ typedef struct {
Boolean help;
float gamma;
Boolean usePixmap;
- uint32 viewportWidth;
- uint32 viewportHeight;
+ uint32_t viewportWidth;
+ uint32_t viewportHeight;
int translate;
Boolean verbose;
} AppData, *AppDataPtr;
@@ -236,8 +236,8 @@ unsigned char basePixel = 0;
* TIFF data structures
*/
TIFF * tfFile = NULL;
-uint32 tfImageWidth, tfImageHeight;
-uint16 tfBitsPerSample, tfSamplesPerPixel, tfPlanarConfiguration,
+uint32_t tfImageWidth, tfImageHeight;
+uint16_t tfBitsPerSample, tfSamplesPerPixel, tfPlanarConfiguration,
tfPhotometricInterpretation, tfGrayResponseUnit,
tfImageDepth, tfBytesPerRow;
int tfDirectory = 0, tfMultiPage = False;
@@ -253,7 +253,7 @@ double *dRed, *dGreen, *dBlue;
/*
* shared data structures
*/
-uint16 * redMap = NULL, *greenMap = NULL, *blueMap = NULL,
+uint16_t * redMap = NULL, *greenMap = NULL, *blueMap = NULL,
*grayMap = NULL, colormapSize;
char * imageMemory;
char * fileName;
@@ -451,9 +451,9 @@ GetTIFFHeader()
*/
switch (tfPhotometricInterpretation) {
case PHOTOMETRIC_RGB:
- redMap = (uint16 *) malloc(colormapSize * sizeof(uint16));
- greenMap = (uint16 *) malloc(colormapSize * sizeof(uint16));
- blueMap = (uint16 *) malloc(colormapSize * sizeof(uint16));
+ redMap = (uint16_t *) malloc(colormapSize * sizeof(uint16_t));
+ greenMap = (uint16_t *) malloc(colormapSize * sizeof(uint16_t));
+ blueMap = (uint16_t *) malloc(colormapSize * sizeof(uint16_t));
MCHECK(redMap); MCHECK(greenMap); MCHECK(blueMap);
for (i = 0; i < colormapSize; i++)
dRed[i] = dGreen[i] = dBlue[i]
@@ -462,9 +462,9 @@ GetTIFFHeader()
case PHOTOMETRIC_PALETTE:
if (!TIFFGetField(tfFile, TIFFTAG_COLORMAP,
&redMap, &greenMap, &blueMap)) {
- redMap = (uint16 *) malloc(colormapSize * sizeof(uint16));
- greenMap = (uint16 *) malloc(colormapSize * sizeof(uint16));
- blueMap = (uint16 *) malloc(colormapSize * sizeof(uint16));
+ redMap = (uint16_t *) malloc(colormapSize * sizeof(uint16_t));
+ greenMap = (uint16_t *) malloc(colormapSize * sizeof(uint16_t));
+ blueMap = (uint16_t *) malloc(colormapSize * sizeof(uint16_t));
MCHECK(redMap); MCHECK(greenMap); MCHECK(blueMap);
for (i = 0; i < colormapSize; i++)
dRed[i] = dGreen[i] = dBlue[i]
@@ -479,18 +479,18 @@ GetTIFFHeader()
}
break;
case PHOTOMETRIC_MINISWHITE:
- redMap = (uint16 *) malloc(colormapSize * sizeof(uint16));
- greenMap = (uint16 *) malloc(colormapSize * sizeof(uint16));
- blueMap = (uint16 *) malloc(colormapSize * sizeof(uint16));
+ redMap = (uint16_t *) malloc(colormapSize * sizeof(uint16_t));
+ greenMap = (uint16_t *) malloc(colormapSize * sizeof(uint16_t));
+ blueMap = (uint16_t *) malloc(colormapSize * sizeof(uint16_t));
MCHECK(redMap); MCHECK(greenMap); MCHECK(blueMap);
for (i = 0; i < colormapSize; i++)
dRed[i] = dGreen[i] = dBlue[i] = (double)
SCALE(colormapSize-1-i, colormapSize-1);
break;
case PHOTOMETRIC_MINISBLACK:
- redMap = (uint16 *) malloc(colormapSize * sizeof(uint16));
- greenMap = (uint16 *) malloc(colormapSize * sizeof(uint16));
- blueMap = (uint16 *) malloc(colormapSize * sizeof(uint16));
+ redMap = (uint16_t *) malloc(colormapSize * sizeof(uint16_t));
+ greenMap = (uint16_t *) malloc(colormapSize * sizeof(uint16_t));
+ blueMap = (uint16_t *) malloc(colormapSize * sizeof(uint16_t));
MCHECK(redMap); MCHECK(greenMap); MCHECK(blueMap);
for (i = 0; i < colormapSize; i++)
dRed[i] = dGreen[i] = dBlue[i] = (double) SCALE(i, colormapSize-1);
@@ -736,8 +736,8 @@ GetTIFFImage()
{
int pixel_map[3], red_shift, green_shift, blue_shift;
char *scan_line, *output_p, *input_p;
- uint32 i, j;
- uint16 s;
+ uint32_t i, j;
+ uint16_t s;
scan_line = (char *) malloc(tfBytesPerRow = TIFFScanlineSize(tfFile));
MCHECK(scan_line);