Move jpeg files to sanei

merge-requests/1/head
Peter Fales 2003-07-26 17:07:36 +00:00
rodzic 2aca5cf9a2
commit aa9845ccd1
9 zmienionych plików z 30 dodań i 308 usunięć

Wyświetl plik

@ -30,8 +30,7 @@ V_MAJOR = @V_MAJOR@
V_MINOR = @V_MINOR@
V_REV = @V_REV@
DLL_PRELOAD = @DLL_PRELOAD@
DLL_PRELOAD_EXTRAS = $(foreach be,$(DLL_PRELOAD),$($(addprefix EXTRA_,$(be))))\
@DJPEG@
DLL_PRELOAD_EXTRAS = $(foreach be,$(DLL_PRELOAD),$($(addprefix EXTRA_,$(be))))
MKDIR = $(top_srcdir)/mkinstalldirs
INSTALL = @INSTALL@
@ -86,10 +85,10 @@ DISTFILES = abaton.c abaton.conf abaton.h agfafocus.c agfafocus.conf \
as6e.h avision.c avision.conf avision.h bh.c bh.conf bh.h canon.c \
canon.conf canon.h canon-sane.c canon-scsi.c canon630u.c canon630u-common.c \
canon630u.conf canon_pp.conf canon_pp.h canon_pp.c canon_pp-dev.c \
canon_pp-dev.h canon_pp-io.c canon_pp-io.h cderror.h cdjpeg.h coolscan.c \
canon_pp-dev.h canon_pp-io.c canon_pp-io.h coolscan.c \
coolscan.conf coolscan.h coolscan-scsidef.h coolscan2.c coolscan2.conf \
dc210.c dc210.conf dc210.h \
dc240.c dc240.conf dc240.h dc25.c dc25.conf dc25.h djpeg.c djpeg.README \
dc240.c dc240.conf dc240.h dc25.c dc25.conf dc25.h \
dll.aliases dll.c dll.conf dmc.c dmc.conf dmc.h \
epson.c epson_scsi.c epson_usb.c epson.conf epson.h epson_scsi.h \
epson_usb.h \
@ -108,7 +107,6 @@ DISTFILES = abaton.c abaton.conf abaton.h agfafocus.c agfafocus.conf \
hp5400_internal.c hp5400_internal.h hp5400_xfer.h \
hp5400_sane.c hp5400_sanei.c hp5400_sanei.h \
ibm.c ibm.conf ibm.h ibm-scsi.c \
jinclude.h \
leo.c leo.h leo.conf \
lm9830.h \
ma1509.c ma1509.conf ma1509.h \
@ -246,8 +244,6 @@ EXTRA_canon_pp = canon_pp-io canon_pp-dev
EXTRA_hp = hp-accessor hp-device hp-handle hp-hpmem hp-option hp-scl
EXTRA_umax_pp = umax_pp_low umax_pp_mid
EXTRA_epson = epson_scsi epson_usb
# EXTRA_dc210 = djpeg
# EXTRA_dc240 = djpeg
# When preloading dll, we need to add in all preloaded objects:
libsane-dll.la: $(addsuffix .lo,$(DLL_PRELOAD))
@ -293,8 +289,8 @@ libsane-coolscan2.la: ../sanei/sanei_constrain_value.lo
libsane-coolscan2.la: ../sanei/sanei_scsi.lo
libsane-coolscan2.la: ../sanei/sanei_usb.lo
libsane-dc25.la: ../sanei/sanei_constrain_value.lo
libsane-dc210.la: ../sanei/sanei_constrain_value.lo djpeg.lo
libsane-dc240.la: ../sanei/sanei_constrain_value.lo djpeg.lo
libsane-dc210.la: ../sanei/sanei_constrain_value.lo ../sanei/sanei_jpeg.lo
libsane-dc240.la: ../sanei/sanei_constrain_value.lo ../sanei/sanei_jpeg.lo
libsane-dmc.la: ../sanei/sanei_config2.lo
libsane-dmc.la: ../sanei/sanei_constrain_value.lo
libsane-dmc.la: ../sanei/sanei_scsi.lo
@ -308,7 +304,7 @@ libsane-fujitsu.la: ../sanei/sanei_config2.lo
libsane-fujitsu.la: ../sanei/sanei_constrain_value.lo
libsane-fujitsu.la: ../sanei/sanei_scsi.lo
libsane-fujitsu.la: ../sanei/sanei_usb.lo
libsane-gphoto2.la: ../sanei/sanei_constrain_value.lo djpeg.lo
libsane-gphoto2.la: ../sanei/sanei_constrain_value.lo ../sanei/sanei_jpeg.lo
libsane-gt68xx.la: ../sanei/sanei_constrain_value.lo
libsane-gt68xx.la: ../sanei/sanei_usb.lo
libsane-hp.la: ../sanei/sanei_config2.lo
@ -423,6 +419,10 @@ libsane-dll.la libsane.la: ../sanei/sanei_pv8630.lo
libsane-dll.la libsane.la: ../sanei/sanei_lm983x.lo
endif
ifneq ($(@SANEI_JPEG@),)
libsane-dll.la libsane.la: ../sanei/sanei_jpeg.lo
endif
depend:
makedepend $(INCLUDES) *.c

Wyświetl plik

@ -1,55 +0,0 @@
/*
* cdjpeg.h
*
* Copyright (C) 1994-1996, Thomas G. Lane.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
* This file contains common declarations for the sample applications
* cjpeg and djpeg. It is NOT used by the core JPEG library.
*/
#define JPEG_CJPEG_DJPEG /* define proper options in jconfig.h */
#define JPEG_INTERNAL_OPTIONS /* cjpeg.c,djpeg.c need to see xxx_SUPPORTED */
#include "jinclude.h"
#include "jpeglib.h"
#include "jerror.h" /* get library error codes too */
#include "cderror.h" /* get application-specific error codes */
/*
* Object interface for djpeg's output file encoding modules
*/
typedef struct djpeg_dest_struct * djpeg_dest_ptr;
struct djpeg_dest_struct {
/* start_output is called after jpeg_start_decompress finishes.
* The color map will be ready at this time, if one is needed.
*/
JMETHOD(void, start_output, (j_decompress_ptr cinfo,
djpeg_dest_ptr dinfo));
/* Emit the specified number of pixel rows from the buffer. */
JMETHOD(void, put_pixel_rows, (j_decompress_ptr cinfo,
djpeg_dest_ptr dinfo,
JDIMENSION rows_supplied,
char *data));
/* Finish up at the end of the image. */
JMETHOD(void, finish_output, (j_decompress_ptr cinfo,
djpeg_dest_ptr dinfo));
/* Target file spec; filled in by djpeg.c after object is created. */
FILE * output_file;
/* Output pixel-row buffer. Created by module init or start_output.
* Width is cinfo->output_width * cinfo->output_components;
* height is buffer_height.
*/
JSAMPARRAY buffer;
JDIMENSION buffer_height;
};
/* Module selection routines for I/O modules. */
EXTERN(djpeg_dest_ptr) sanei_jpeg_jinit_write_ppm JPP((j_decompress_ptr cinfo));
/* miscellaneous useful macros */

Wyświetl plik

@ -65,7 +65,7 @@
#include <unistd.h>
#include <fcntl.h>
#include <limits.h>
#include "cdjpeg.h"
#include "sane/sanei_jpeg.h"
#include <sys/ioctl.h>
#include "sane/sane.h"

Wyświetl plik

@ -68,7 +68,7 @@
#include <unistd.h>
#include <fcntl.h>
#include <limits.h>
#include "cdjpeg.h"
#include "sane/sanei_jpeg.h"
#include <sys/ioctl.h>
#include "sane/sane.h"

Wyświetl plik

@ -1,229 +0,0 @@
/*
Code for JPEG decompression by the Independent JPEG Group. Please see
README.jpeg in the top level directory.
*/
#include "cdjpeg.h"
typedef struct
{
struct djpeg_dest_struct pub; /* public fields */
/* Usually these two pointers point to the same place: */
char *iobuffer; /* fwrite's I/O buffer */
JSAMPROW pixrow; /* decompressor output buffer */
size_t buffer_width; /* width of I/O buffer */
JDIMENSION samples_per_row; /* JSAMPLEs per output row */
}
ppm_dest_struct;
typedef ppm_dest_struct *ppm_dest_ptr;
/*
* For 12-bit JPEG data, we either downscale the values to 8 bits
* (to write standard byte-per-sample PPM/PGM files), or output
* nonstandard word-per-sample PPM/PGM files. Downscaling is done
* if PPM_NORAWWORD is defined (this can be done in the Makefile
* or in jconfig.h).
* (When the core library supports data precision reduction, a cleaner
* implementation will be to ask for that instead.)
*/
#if BITS_IN_JSAMPLE==8
#define PUTPPMSAMPLE(ptr,v) *ptr++=(char) (v)
#define BYTESPERSAMPLE 1
#define PPM_MAXVAL 255
#else
#ifdef PPM_NORAWWORD
#define PUTPPMSAMPLE(ptr,v) *ptr++=(char) ((v) >> (BITS_IN_JSAMPLE-8))
#define BYTESPERSAMPLE 1
#define PPM_MAXVAL 255
#else
/* The word-per-sample format always puts the LSB first. */
#define PUTPPMSAMPLE(ptr,v) \
{ register int val_=v; \
*ptr++=(char) (val_ & 0xFF); \
*ptr++=(char) ((val_ >> 8) & 0xFF); \
}
#define BYTESPERSAMPLE 2
#define PPM_MAXVAL ((1<<BITS_IN_JSAMPLE)-1)
#endif
#endif
METHODDEF (void)
sanei_jpeg_start_output_ppm (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo)
{
cinfo = cinfo;
dinfo = dinfo;
/* header image is supplied for us */
}
METHODDEF (void)
sanei_jpeg_finish_output_ppm (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo)
{
cinfo = cinfo;
dinfo = dinfo;
/* nothing to do */
}
/*
* Write some pixel data.
* In this module rows_supplied will always be 1.
*
* put_pixel_rows handles the "normal" 8-bit case where the decompressor
* output buffer is physically the same as the fwrite buffer.
*/
METHODDEF (void)
sanei_jpeg_put_pixel_rows (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo,
JDIMENSION rows_supplied, char *data)
{
ppm_dest_ptr dest = (ppm_dest_ptr) dinfo;
cinfo = cinfo;
dinfo = dinfo;
rows_supplied = rows_supplied;
memcpy (data, dest->iobuffer, dest->buffer_width);
}
/*
* This code is used when we have to copy the data and apply a pixel
* format translation. Typically this only happens in 12-bit mode.
*/
METHODDEF (void)
sanei_jpeg_copy_pixel_rows (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo,
JDIMENSION rows_supplied, char *data)
{
ppm_dest_ptr dest = (ppm_dest_ptr) dinfo;
register char *bufferptr;
register JSAMPROW ptr;
register JDIMENSION col;
cinfo = cinfo;
dinfo = dinfo;
rows_supplied = rows_supplied;
ptr = dest->pub.buffer[0];
bufferptr = dest->iobuffer;
for (col = dest->samples_per_row; col > 0; col--)
{
PUTPPMSAMPLE (bufferptr, GETJSAMPLE (*ptr++));
}
memcpy (data, dest->iobuffer, dest->buffer_width);
}
/*
* Write some pixel data when color quantization is in effect.
* We have to demap the color index values to straight data.
*/
METHODDEF (void)
sanei_jpeg_put_demapped_rgb (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo,
JDIMENSION rows_supplied, char *data)
{
ppm_dest_ptr dest = (ppm_dest_ptr) dinfo;
register char *bufferptr;
register int pixval;
register JSAMPROW ptr;
register JSAMPROW color_map0 = cinfo->colormap[0];
register JSAMPROW color_map1 = cinfo->colormap[1];
register JSAMPROW color_map2 = cinfo->colormap[2];
register JDIMENSION col;
rows_supplied = rows_supplied;
ptr = dest->pub.buffer[0];
bufferptr = dest->iobuffer;
for (col = cinfo->output_width; col > 0; col--)
{
pixval = GETJSAMPLE (*ptr++);
PUTPPMSAMPLE (bufferptr, GETJSAMPLE (color_map0[pixval]));
PUTPPMSAMPLE (bufferptr, GETJSAMPLE (color_map1[pixval]));
PUTPPMSAMPLE (bufferptr, GETJSAMPLE (color_map2[pixval]));
}
memcpy (data, dest->iobuffer, dest->buffer_width);
}
METHODDEF (void)
sanei_jpeg_put_demapped_gray (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo,
JDIMENSION rows_supplied, char *data)
{
ppm_dest_ptr dest = (ppm_dest_ptr) dinfo;
register char *bufferptr;
register JSAMPROW ptr;
register JSAMPROW color_map = cinfo->colormap[0];
register JDIMENSION col;
rows_supplied = rows_supplied;
ptr = dest->pub.buffer[0];
bufferptr = dest->iobuffer;
for (col = cinfo->output_width; col > 0; col--)
{
PUTPPMSAMPLE (bufferptr,
GETJSAMPLE (color_map[GETJSAMPLE (*ptr++)]));
}
memcpy (data, dest->iobuffer, dest->buffer_width);
}
GLOBAL (djpeg_dest_ptr)
sanei_jpeg_jinit_write_ppm (j_decompress_ptr cinfo)
{
ppm_dest_ptr dest;
/* Create module interface object, fill in method pointers */
dest = (ppm_dest_ptr)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
SIZEOF (ppm_dest_struct));
dest->pub.start_output = sanei_jpeg_start_output_ppm;
dest->pub.finish_output = sanei_jpeg_finish_output_ppm;
/* Calculate output image dimensions so we can allocate space */
jpeg_calc_output_dimensions (cinfo);
/* Create physical I/O buffer. Note we make this near on a PC. */
dest->samples_per_row = cinfo->output_width * cinfo->out_color_components;
dest->buffer_width = dest->samples_per_row * (BYTESPERSAMPLE * SIZEOF (char));
dest->iobuffer = (char *) (*cinfo->mem->alloc_small)
((j_common_ptr) cinfo, JPOOL_IMAGE, dest->buffer_width);
if (cinfo->quantize_colors || BITS_IN_JSAMPLE != 8 ||
SIZEOF (JSAMPLE) != SIZEOF (char))
{
/* When quantizing, we need an output buffer for clrmap indexes
* that's separate from the physical I/O buffer. We also need a
* separate buffer if pixel format translation must take place.
*/
dest->pub.buffer = (*cinfo->mem->alloc_sarray)
((j_common_ptr) cinfo, JPOOL_IMAGE,
cinfo->output_width * cinfo->output_components,
(JDIMENSION) 1);
dest->pub.buffer_height = 1;
if (!cinfo->quantize_colors)
dest->pub.put_pixel_rows = sanei_jpeg_copy_pixel_rows;
else if (cinfo->out_color_space == JCS_GRAYSCALE)
dest->pub.put_pixel_rows = sanei_jpeg_put_demapped_gray;
else
dest->pub.put_pixel_rows = sanei_jpeg_put_demapped_rgb;
}
else
{
/* We will fwrite() directly from decompressor output buffer. */
/* Synthesize a JSAMPARRAY pointer structure */
/* Cast here implies near->far pointer conversion on PCs */
dest->pixrow = (JSAMPROW) dest->iobuffer;
dest->pub.buffer = &dest->pixrow;
dest->pub.buffer_height = 1;
dest->pub.put_pixel_rows = sanei_jpeg_put_pixel_rows;
}
return (djpeg_dest_ptr) dest;
}

Wyświetl plik

@ -85,7 +85,7 @@
#include <unistd.h>
#include <fcntl.h>
#include <limits.h>
#include "cdjpeg.h"
#include "sane/sanei_jpeg.h"
#include <sys/ioctl.h>
#include "sane/sane.h"

17
configure vendored
Wyświetl plik

@ -463,7 +463,7 @@ ac_includes_default="\
# include <unistd.h>
#endif"
ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS V_MAJOR V_MINOR V_REV PACKAGE VERSION NUMBER_VERSION build build_cpu build_vendor build_os host host_cpu host_vendor host_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA SET_MAKE CPP EGREP SANE_CONFIG_PATH MSGFMT XGETTEXT MSGMERGE LATEX DVIPS MAKEINDEX INCLUDES LINKER_RPATH DL_LIB DYNAMIC_FLAG HAVE_GPHOTO2 ac_ct_HAVE_GPHOTO2 ALLOCA LIBOBJS LN_S ECHO AR ac_ct_AR RANLIB ac_ct_RANLIB STRIP ac_ct_STRIP DLLTOOL ac_ct_DLLTOOL AS ac_ct_AS OBJDUMP ac_ct_OBJDUMP CXX CXXFLAGS ac_ct_CXX CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL SANED DJPEG BACKENDS DLL_PRELOAD INSTALL_TRANSLATIONS USE_LATEX DISTCLEAN_FILES LTLIBOBJS'
ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS V_MAJOR V_MINOR V_REV PACKAGE VERSION NUMBER_VERSION build build_cpu build_vendor build_os host host_cpu host_vendor host_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA SET_MAKE CPP EGREP SANE_CONFIG_PATH MSGFMT XGETTEXT MSGMERGE LATEX DVIPS MAKEINDEX INCLUDES LINKER_RPATH DL_LIB DYNAMIC_FLAG HAVE_GPHOTO2 ac_ct_HAVE_GPHOTO2 ALLOCA LIBOBJS LN_S ECHO AR ac_ct_AR RANLIB ac_ct_RANLIB STRIP ac_ct_STRIP DLLTOOL ac_ct_DLLTOOL AS ac_ct_AS OBJDUMP ac_ct_OBJDUMP CXX CXXFLAGS ac_ct_CXX CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL SANED SANEI_JPEG SANEI_JPEG_LO BACKENDS DLL_PRELOAD INSTALL_TRANSLATIONS USE_LATEX DISTCLEAN_FILES LTLIBOBJS'
ac_subst_files=''
# Initialize some variables set by options.
@ -2394,12 +2394,12 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(exit $ac_status); }; }; then
for ac_declaration in \
''\
'#include <stdlib.h>' \
'extern "C" void std::exit (int) throw (); using std::exit;' \
'extern "C" void std::exit (int); using std::exit;' \
'extern "C" void exit (int) throw ();' \
'extern "C" void exit (int);' \
'void exit (int);' \
'#include <stdlib.h>'
'void exit (int);'
do
cat >conftest.$ac_ext <<_ACEOF
#line $LINENO "configure"
@ -9993,12 +9993,12 @@ else
fi
for ac_declaration in \
''\
'#include <stdlib.h>' \
'extern "C" void std::exit (int) throw (); using std::exit;' \
'extern "C" void std::exit (int); using std::exit;' \
'extern "C" void exit (int) throw ();' \
'extern "C" void exit (int);' \
'void exit (int);' \
'#include <stdlib.h>'
'void exit (int);'
do
cat >conftest.$ac_ext <<_ACEOF
#line $LINENO "configure"
@ -23644,10 +23644,12 @@ echo "$as_me: Manually selected backends: ${BACKENDS}" >&6;}
echo "*** disabling DC240 backend (failed to find JPEG library)"
else
BACKENDS="${BACKENDS} dc210 dc240"
DJPEG=djpeg
SANEI_JPEG="sanei_jpeg.o"
SANEI_JPEG_LO="sanei_jpeg.lo"
fi
if test "${sane_cv_use_libieee1284}" != "yes"
then
echo "*** disabling CANON_PP backend (failed to find libieee1284 library)"
@ -24492,7 +24494,8 @@ s,@FFLAGS@,$FFLAGS,;t t
s,@ac_ct_F77@,$ac_ct_F77,;t t
s,@LIBTOOL@,$LIBTOOL,;t t
s,@SANED@,$SANED,;t t
s,@DJPEG@,$DJPEG,;t t
s,@SANEI_JPEG@,$SANEI_JPEG,;t t
s,@SANEI_JPEG_LO@,$SANEI_JPEG_LO,;t t
s,@BACKENDS@,$BACKENDS,;t t
s,@DLL_PRELOAD@,$DLL_PRELOAD,;t t
s,@INSTALL_TRANSLATIONS@,$INSTALL_TRANSLATIONS,;t t

Wyświetl plik

@ -279,9 +279,11 @@ else
echo "*** disabling DC240 backend (failed to find JPEG library)"
else
BACKENDS="${BACKENDS} dc210 dc240"
DJPEG=djpeg
SANEI_JPEG="sanei_jpeg.o"
SANEI_JPEG_LO="sanei_jpeg.lo"
fi
AC_SUBST(DJPEG)
AC_SUBST(SANEI_JPEG)
AC_SUBST(SANEI_JPEG_LO)
if test "${sane_cv_use_libieee1284}" != "yes"
then

Wyświetl plik

@ -50,13 +50,14 @@ DISTCLEAN_FILES = @DISTCLEAN_FILES@
LIBSANEI_OBJS = sanei_ab306.o sanei_constrain_value.o sanei_init_debug.o \
sanei_net.o sanei_wire.o sanei_codec_ascii.o sanei_codec_bin.o \
sanei_scsi.o sanei_config.o sanei_config2.o sanei_pio.o sanei_pa4s2.o \
sanei_auth.o sanei_usb.o sanei_thread.o sanei_pv8630.o sanei_lm983x.o
sanei_auth.o sanei_usb.o sanei_thread.o sanei_pv8630.o \
sanei_lm983x.o @SANEI_JPEG@
LIBSANEI_LTOBJS = sanei_ab306.lo sanei_constrain_value.lo sanei_init_debug.lo \
sanei_net.lo sanei_wire.lo sanei_codec_ascii.lo sanei_codec_bin.lo \
sanei_scsi.lo sanei_config.lo sanei_config2.lo sanei_pio.lo \
sanei_pa4s2.lo sanei_auth.lo sanei_usb.lo sanei_thread.lo \
sanei_pv8630.lo sanei_lm983x.lo
sanei_pv8630.lo sanei_lm983x.lo @SANEI_JPEG_LO@
TARGETS = libsanei.a $(LIBSANEI_LTOBJS)
TESTPROGRAMS = test_wire