mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-02-15 04:32:24 +00:00
remove more internal jpeg headers
This commit is contained in:
parent
d7e5206d6b
commit
0f36a57eff
4 changed files with 5 additions and 276 deletions
|
@ -48,8 +48,8 @@
|
|||
#include <setjmp.h>
|
||||
#include "GraphicsP.h"
|
||||
#include <jpeglib.h>
|
||||
#include "cdjpeg.h"
|
||||
#include "JpegUtilsI.h"
|
||||
#include "cdjpeg.h"
|
||||
|
||||
/*
|
||||
** Macro definitions
|
||||
|
@ -202,7 +202,7 @@ static boolean fill_input_buffer (
|
|||
nbytes = 0;
|
||||
src->buffer = (JOCTET *) (*cinfo->mem->alloc_small) (
|
||||
(j_common_ptr) cinfo, JPOOL_IMAGE,
|
||||
2 * SIZEOF(JOCTET));
|
||||
2 * sizeof(JOCTET));
|
||||
}
|
||||
else /* _DtGrFILE, read the next chunk of data */
|
||||
nbytes = _DtGrRead (src->buffer, 1, src->input_buf_size, src->stream);
|
||||
|
@ -294,7 +294,7 @@ static void jpeg_stream_src (
|
|||
*/
|
||||
cinfo->src = (struct jpeg_source_mgr *) (*cinfo->mem->alloc_small) (
|
||||
(j_common_ptr) cinfo, JPOOL_IMAGE,
|
||||
SIZEOF(stream_source_mgr));
|
||||
sizeof(stream_source_mgr));
|
||||
src = (stream_src_ptr) cinfo->src;
|
||||
|
||||
src->stream = stream;
|
||||
|
@ -311,7 +311,7 @@ static void jpeg_stream_src (
|
|||
{
|
||||
src->buffer = (JOCTET *) (*cinfo->mem->alloc_small) (
|
||||
(j_common_ptr) cinfo, JPOOL_IMAGE,
|
||||
INPUT_BUF_SIZE * SIZEOF(JOCTET));
|
||||
INPUT_BUF_SIZE * sizeof(JOCTET));
|
||||
src->input_buf_size = INPUT_BUF_SIZE;
|
||||
src->pub.bytes_in_buffer = 0; /* forces fill_input_buffer call */
|
||||
src->pub.next_input_byte = NULL; /* on first read */
|
||||
|
@ -410,7 +410,7 @@ djpeg_dest_ptr init_jpeg_dest_mgr (
|
|||
*/
|
||||
dest = (ximg_dest_ptr) (*cinfo->mem->alloc_small) (
|
||||
(j_common_ptr) cinfo, JPOOL_IMAGE,
|
||||
SIZEOF(ximg_dest_struct));
|
||||
sizeof(ximg_dest_struct));
|
||||
dest->pub.start_output = start_output_ximg;
|
||||
dest->pub.finish_output = finish_output_ximg;
|
||||
dest->pub.put_pixel_rows = copy_pixels;
|
||||
|
|
|
@ -1,155 +0,0 @@
|
|||
/*
|
||||
* CDE - Common Desktop Environment
|
||||
*
|
||||
* Copyright (c) 1993-2012, The Open Group. All rights reserved.
|
||||
*
|
||||
* These libraries and programs are free software; you can
|
||||
* redistribute them and/or modify them under the terms of the GNU
|
||||
* Lesser General Public License as published by the Free Software
|
||||
* Foundation; either version 2 of the License, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* These libraries and programs are distributed in the hope that
|
||||
* they will be useful, but WITHOUT ANY WARRANTY; without even the
|
||||
* implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
* PURPOSE. See the GNU Lesser General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with these libraries and programs; if not, write
|
||||
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
|
||||
* Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
/* $XConsortium: cderror.h /main/2 1996/05/09 03:45:18 drk $ */
|
||||
/*
|
||||
* cderror.h
|
||||
*
|
||||
* Copyright (C) 1994, 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 defines the error and message codes for the cjpeg/djpeg
|
||||
* applications. These strings are not needed as part of the JPEG library
|
||||
* proper.
|
||||
* Edit this file to add new codes, or to translate the message strings to
|
||||
* some other language.
|
||||
*/
|
||||
|
||||
/*
|
||||
* To define the enum list of message codes, include this file without
|
||||
* defining macro JMESSAGE. To create a message string table, include it
|
||||
* again with a suitable JMESSAGE definition (see jerror.c for an example).
|
||||
*/
|
||||
#ifndef JMESSAGE
|
||||
#ifndef CDERROR_H
|
||||
#define CDERROR_H
|
||||
/* First time through, define the enum list */
|
||||
#define JMAKE_ENUM_LIST
|
||||
#else
|
||||
/* Repeated inclusions of this file are no-ops unless JMESSAGE is defined */
|
||||
#define JMESSAGE(code,string)
|
||||
#endif /* CDERROR_H */
|
||||
#endif /* JMESSAGE */
|
||||
|
||||
#ifdef JMAKE_ENUM_LIST
|
||||
|
||||
typedef enum {
|
||||
|
||||
#define JMESSAGE(code,string) code ,
|
||||
|
||||
#endif /* JMAKE_ENUM_LIST */
|
||||
|
||||
JMESSAGE(JMSG_FIRSTADDONCODE=1000, NULL) /* Must be first entry! */
|
||||
|
||||
#ifdef BMP_SUPPORTED
|
||||
JMESSAGE(JERR_BMP_BADCMAP, "Unsupported BMP colormap format")
|
||||
JMESSAGE(JERR_BMP_BADDEPTH, "Only 8- and 24-bit BMP files are supported")
|
||||
JMESSAGE(JERR_BMP_BADHEADER, "Invalid BMP file: bad header length")
|
||||
JMESSAGE(JERR_BMP_BADPLANES, "Invalid BMP file: biPlanes not equal to 1")
|
||||
JMESSAGE(JERR_BMP_COLORSPACE, "BMP output must be grayscale or RGB")
|
||||
JMESSAGE(JERR_BMP_COMPRESSED, "Sorry, compressed BMPs not yet supported")
|
||||
JMESSAGE(JERR_BMP_NOT, "Not a BMP file - does not start with BM")
|
||||
JMESSAGE(JTRC_BMP, "%ux%u 24-bit BMP image")
|
||||
JMESSAGE(JTRC_BMP_MAPPED, "%ux%u 8-bit colormapped BMP image")
|
||||
JMESSAGE(JTRC_BMP_OS2, "%ux%u 24-bit OS2 BMP image")
|
||||
JMESSAGE(JTRC_BMP_OS2_MAPPED, "%ux%u 8-bit colormapped OS2 BMP image")
|
||||
#endif /* BMP_SUPPORTED */
|
||||
|
||||
#ifdef GIF_SUPPORTED
|
||||
JMESSAGE(JERR_GIF_BUG, "GIF output got confused")
|
||||
JMESSAGE(JERR_GIF_CODESIZE, "Bogus GIF codesize %d")
|
||||
JMESSAGE(JERR_GIF_COLORSPACE, "GIF output must be grayscale or RGB")
|
||||
JMESSAGE(JERR_GIF_IMAGENOTFOUND, "Too few images in GIF file")
|
||||
JMESSAGE(JERR_GIF_NOT, "Not a GIF file")
|
||||
JMESSAGE(JTRC_GIF, "%ux%ux%d GIF image")
|
||||
JMESSAGE(JTRC_GIF_BADVERSION,
|
||||
"Warning: unexpected GIF version number '%c%c%c'")
|
||||
JMESSAGE(JTRC_GIF_EXTENSION, "Ignoring GIF extension block of type 0x%02x")
|
||||
JMESSAGE(JTRC_GIF_NONSQUARE, "Caution: nonsquare pixels in input")
|
||||
JMESSAGE(JWRN_GIF_BADDATA, "Corrupt data in GIF file")
|
||||
JMESSAGE(JWRN_GIF_CHAR, "Bogus char 0x%02x in GIF file, ignoring")
|
||||
JMESSAGE(JWRN_GIF_ENDCODE, "Premature end of GIF image")
|
||||
JMESSAGE(JWRN_GIF_NOMOREDATA, "Ran out of GIF bits")
|
||||
#endif /* GIF_SUPPORTED */
|
||||
|
||||
#ifdef PPM_SUPPORTED
|
||||
JMESSAGE(JERR_PPM_COLORSPACE, "PPM output must be grayscale or RGB")
|
||||
JMESSAGE(JERR_PPM_NONNUMERIC, "Nonnumeric data in PPM file")
|
||||
JMESSAGE(JERR_PPM_NOT, "Not a PPM file")
|
||||
JMESSAGE(JTRC_PGM, "%ux%u PGM image")
|
||||
JMESSAGE(JTRC_PGM_TEXT, "%ux%u text PGM image")
|
||||
JMESSAGE(JTRC_PPM, "%ux%u PPM image")
|
||||
JMESSAGE(JTRC_PPM_TEXT, "%ux%u text PPM image")
|
||||
#endif /* PPM_SUPPORTED */
|
||||
|
||||
#ifdef RLE_SUPPORTED
|
||||
JMESSAGE(JERR_RLE_BADERROR, "Bogus error code from RLE library")
|
||||
JMESSAGE(JERR_RLE_COLORSPACE, "RLE output must be grayscale or RGB")
|
||||
JMESSAGE(JERR_RLE_DIMENSIONS, "Image dimensions (%ux%u) too large for RLE")
|
||||
JMESSAGE(JERR_RLE_EMPTY, "Empty RLE file")
|
||||
JMESSAGE(JERR_RLE_EOF, "Premature EOF in RLE header")
|
||||
JMESSAGE(JERR_RLE_MEM, "Insufficient memory for RLE header")
|
||||
JMESSAGE(JERR_RLE_NOT, "Not an RLE file")
|
||||
JMESSAGE(JERR_RLE_TOOMANYCHANNELS, "Cannot handle %d output channels for RLE")
|
||||
JMESSAGE(JERR_RLE_UNSUPPORTED, "Cannot handle this RLE setup")
|
||||
JMESSAGE(JTRC_RLE, "%ux%u full-color RLE file")
|
||||
JMESSAGE(JTRC_RLE_FULLMAP, "%ux%u full-color RLE file with map of length %d")
|
||||
JMESSAGE(JTRC_RLE_GRAY, "%ux%u grayscale RLE file")
|
||||
JMESSAGE(JTRC_RLE_MAPGRAY, "%ux%u grayscale RLE file with map of length %d")
|
||||
JMESSAGE(JTRC_RLE_MAPPED, "%ux%u colormapped RLE file with map of length %d")
|
||||
#endif /* RLE_SUPPORTED */
|
||||
|
||||
#ifdef TARGA_SUPPORTED
|
||||
JMESSAGE(JERR_TGA_BADCMAP, "Unsupported Targa colormap format")
|
||||
JMESSAGE(JERR_TGA_BADPARMS, "Invalid or unsupported Targa file")
|
||||
JMESSAGE(JERR_TGA_COLORSPACE, "Targa output must be grayscale or RGB")
|
||||
JMESSAGE(JTRC_TGA, "%ux%u RGB Targa image")
|
||||
JMESSAGE(JTRC_TGA_GRAY, "%ux%u grayscale Targa image")
|
||||
JMESSAGE(JTRC_TGA_MAPPED, "%ux%u colormapped Targa image")
|
||||
#else
|
||||
JMESSAGE(JERR_TGA_NOTCOMP, "Targa support was not compiled")
|
||||
#endif /* TARGA_SUPPORTED */
|
||||
|
||||
JMESSAGE(JERR_BAD_CMAP_FILE,
|
||||
"Color map file is invalid or of unsupported format")
|
||||
JMESSAGE(JERR_TOO_MANY_COLORS,
|
||||
"Output file format cannot handle %d colormap entries")
|
||||
JMESSAGE(JERR_UNGETC_FAILED, "ungetc failed")
|
||||
#ifdef TARGA_SUPPORTED
|
||||
JMESSAGE(JERR_UNKNOWN_FORMAT,
|
||||
"Unrecognized input file format --- perhaps you need -targa")
|
||||
#else
|
||||
JMESSAGE(JERR_UNKNOWN_FORMAT, "Unrecognized input file format")
|
||||
#endif
|
||||
JMESSAGE(JERR_UNSUPPORTED_FORMAT, "Unsupported output file format")
|
||||
|
||||
#ifdef JMAKE_ENUM_LIST
|
||||
|
||||
JMSG_LASTADDONCODE
|
||||
} ADDON_MESSAGE_CODE;
|
||||
|
||||
#undef JMAKE_ENUM_LIST
|
||||
#endif /* JMAKE_ENUM_LIST */
|
||||
|
||||
/* Zap JMESSAGE macro so that future re-inclusions do nothing by default */
|
||||
#undef JMESSAGE
|
|
@ -34,10 +34,8 @@
|
|||
|
||||
#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 */
|
||||
|
||||
|
||||
/*
|
||||
|
|
|
@ -1,114 +0,0 @@
|
|||
/*
|
||||
* CDE - Common Desktop Environment
|
||||
*
|
||||
* Copyright (c) 1993-2012, The Open Group. All rights reserved.
|
||||
*
|
||||
* These libraries and programs are free software; you can
|
||||
* redistribute them and/or modify them under the terms of the GNU
|
||||
* Lesser General Public License as published by the Free Software
|
||||
* Foundation; either version 2 of the License, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* These libraries and programs are distributed in the hope that
|
||||
* they will be useful, but WITHOUT ANY WARRANTY; without even the
|
||||
* implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
* PURPOSE. See the GNU Lesser General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with these libraries and programs; if not, write
|
||||
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
|
||||
* Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
/* $XConsortium: jinclude.h /main/2 1996/05/09 03:51:54 drk $ */
|
||||
/*
|
||||
* jinclude.h
|
||||
*
|
||||
* Copyright (C) 1991-1994, 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 exists to provide a single place to fix any problems with
|
||||
* including the wrong system include files. (Common problems are taken
|
||||
* care of by the standard jconfig symbols, but on really weird systems
|
||||
* you may have to edit this file.)
|
||||
*
|
||||
* NOTE: this file is NOT intended to be included by applications using the
|
||||
* JPEG library. Most applications need only include jpeglib.h.
|
||||
*/
|
||||
|
||||
|
||||
/* Include auto-config file to find out which system include files we need. */
|
||||
|
||||
#include <jconfig.h> /* auto configuration options */
|
||||
#define JCONFIG_INCLUDED /* so that jpeglib.h doesn't do it again */
|
||||
|
||||
/*
|
||||
* We need the NULL macro and size_t typedef.
|
||||
* On an ANSI-conforming system it is sufficient to include <stddef.h>.
|
||||
* Otherwise, we get them from <stdlib.h> or <stdio.h>; we may have to
|
||||
* pull in <sys/types.h> as well.
|
||||
* Note that the core JPEG library does not require <stdio.h>;
|
||||
* only the default error handler and data source/destination modules do.
|
||||
* But we must pull it in because of the references to FILE in jpeglib.h.
|
||||
* You can remove those references if you want to compile without <stdio.h>.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_STDDEF_H
|
||||
#include <stddef.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_STDLIB_H
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
|
||||
#ifdef NEED_SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
/*
|
||||
* We need memory copying and zeroing functions, plus strncpy().
|
||||
* ANSI and System V implementations declare these in <string.h>.
|
||||
* BSD doesn't have the mem() functions, but it does have bcopy()/bzero().
|
||||
* Some systems may declare memset and memcpy in <memory.h>.
|
||||
*
|
||||
* NOTE: we assume the size parameters to these functions are of type size_t.
|
||||
* Change the casts in these macros if not!
|
||||
*/
|
||||
|
||||
#ifdef NEED_BSD_STRINGS
|
||||
|
||||
#include <strings.h>
|
||||
#define MEMZERO(target,size) bzero((void *)(target), (size_t)(size))
|
||||
#define MEMCOPY(dest,src,size) bcopy((const void *)(src), (void *)(dest), (size_t)(size))
|
||||
|
||||
#else /* not BSD, assume ANSI/SysV string lib */
|
||||
|
||||
#include <string.h>
|
||||
#define MEMZERO(target,size) memset((void *)(target), 0, (size_t)(size))
|
||||
#define MEMCOPY(dest,src,size) memcpy((void *)(dest), (const void *)(src), (size_t)(size))
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
* In ANSI C, and indeed any rational implementation, size_t is also the
|
||||
* type returned by sizeof(). However, it seems there are some irrational
|
||||
* implementations out there, in which sizeof() returns an int even though
|
||||
* size_t is defined as long or unsigned long. To ensure consistent results
|
||||
* we always use this SIZEOF() macro in place of using sizeof() directly.
|
||||
*/
|
||||
|
||||
#define SIZEOF(object) ((size_t) sizeof(object))
|
||||
|
||||
/*
|
||||
* The modules that use fread() and fwrite() always invoke them through
|
||||
* these macros. On some systems you may need to twiddle the argument casts.
|
||||
* CAUTION: argument order is different from underlying functions!
|
||||
*/
|
||||
|
||||
#define JFREAD(file,buf,sizeofbuf) \
|
||||
((size_t) fread((void *) (buf), (size_t) 1, (size_t) (sizeofbuf), (file)))
|
||||
#define JFWRITE(file,buf,sizeofbuf) \
|
||||
((size_t) fwrite((const void *) (buf), (size_t) 1, (size_t) (sizeofbuf), (file)))
|
Loading…
Reference in a new issue