mirror of
https://github.com/deadw00d/AROS.git
synced 2025-12-07 22:14:08 +00:00
196 lines
5.2 KiB
Diff
196 lines
5.2 KiB
Diff
diff -ruN jpeg-9e/jconfig.h jpeg-9e.aros/jconfig.h
|
|
--- jpeg-9e/jconfig.h 1970-01-01 00:00:00.000000000 +0000
|
|
+++ jpeg-9e.aros/jconfig.h 2021-01-08 21:42:55.840000000 +0000
|
|
@@ -0,0 +1,59 @@
|
|
+/* jconfig.cfg --- source file edited by configure script */
|
|
+/* see jconfig.txt for explanations */
|
|
+
|
|
+#define HAVE_PROTOTYPES
|
|
+#define HAVE_UNSIGNED_CHAR
|
|
+#define HAVE_UNSIGNED_SHORT
|
|
+/* #undef void */
|
|
+/* #undef const */
|
|
+#undef CHAR_IS_UNSIGNED
|
|
+#define HAVE_STDDEF_H
|
|
+#define HAVE_STDLIB_H
|
|
+#undef HAVE_LOCALE_H
|
|
+#undef NEED_BSD_STRINGS
|
|
+#undef NEED_SYS_TYPES_H
|
|
+#undef NEED_FAR_POINTERS
|
|
+#undef NEED_SHORT_EXTERNAL_NAMES
|
|
+/* Define this if you get warnings about undefined structures. */
|
|
+#undef INCOMPLETE_TYPES_BROKEN
|
|
+/* Define "boolean" as unsigned char, not enum, on Windows systems. */
|
|
+#ifdef _WIN32
|
|
+#ifndef __RPCNDR_H__ /* don't conflict if rpcndr.h already read */
|
|
+typedef unsigned char boolean;
|
|
+#endif
|
|
+#ifndef FALSE /* in case these macros already exist */
|
|
+#define FALSE 0 /* values of boolean */
|
|
+#endif
|
|
+#ifndef TRUE
|
|
+#define TRUE 1
|
|
+#endif
|
|
+#define HAVE_BOOLEAN /* prevent jmorecfg.h from redefining it */
|
|
+#endif
|
|
+
|
|
+#ifdef JPEG_INTERNALS
|
|
+
|
|
+#undef RIGHT_SHIFT_IS_UNSIGNED
|
|
+#undef INLINE
|
|
+/* These are for configuring the JPEG memory manager. */
|
|
+#undef DEFAULT_MAX_MEM
|
|
+#undef NO_MKTEMP
|
|
+
|
|
+#endif /* JPEG_INTERNALS */
|
|
+
|
|
+#ifdef JPEG_CJPEG_DJPEG
|
|
+
|
|
+#define BMP_SUPPORTED /* BMP image file format */
|
|
+#define GIF_SUPPORTED /* GIF image file format */
|
|
+#define PPM_SUPPORTED /* PBMPLUS PPM/PGM image file format */
|
|
+#undef RLE_SUPPORTED /* Utah RLE image file format */
|
|
+#define TARGA_SUPPORTED /* Targa image file format */
|
|
+
|
|
+#undef TWO_FILE_COMMANDLINE
|
|
+#undef NEED_SIGNAL_CATCHER
|
|
+#undef DONT_USE_B_MODE
|
|
+
|
|
+/* Define this if you want percent-done progress reports from cjpeg/djpeg. */
|
|
+#undef PROGRESS_REPORT
|
|
+
|
|
+
|
|
+#endif /* JPEG_CJPEG_DJPEG */
|
|
diff -ruN jpeg-9e/jmemamiga.c jpeg-9e.aros/jmemamiga.c
|
|
--- jpeg-9e/jmemamiga.c 1970-01-01 00:00:00.000000000 +0000
|
|
+++ jpeg-9e.aros/jmemamiga.c 2021-01-08 20:47:14.070000000 +0000
|
|
@@ -0,0 +1,128 @@
|
|
+/*
|
|
+ * jmemamiga.c
|
|
+ *
|
|
+ * Copyright (C) 1992-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.
|
|
+ *
|
|
+ * Copyright (C) 2009-2011, The AROS development team.
|
|
+ *
|
|
+ * This file provides a simple implementation of the system-dependent portion
|
|
+ * of the JPEG memory manager using the Amiga API. This implementation
|
|
+ * assumes that no backing-store files are needed: all required space
|
|
+ * can be obtained from the system.
|
|
+ * You'll need to have lots of main memory (or virtual memory) if you want
|
|
+ * to process big images.
|
|
+ * Note that the max_memory_to_use option is ignored by this implementation.
|
|
+ */
|
|
+
|
|
+#include <proto/exec.h>
|
|
+#include <exec/memory.h>
|
|
+#include <exec/types.h>
|
|
+
|
|
+static APTR _mempool = NULL;
|
|
+
|
|
+#if defined(__AROS__)
|
|
+#undef GLOBAL
|
|
+#endif
|
|
+
|
|
+#define JPEG_INTERNALS
|
|
+#include "jinclude.h"
|
|
+#include "jpeglib.h"
|
|
+#include "jmemsys.h" /* import the system-dependent declarations */
|
|
+
|
|
+#include <aros/symbolsets.h>
|
|
+
|
|
+GLOBAL(void *)
|
|
+jpeg_get_small (j_common_ptr cinfo, size_t sizeofobject)
|
|
+{
|
|
+ return (void *) AllocPooled(_mempool, sizeofobject);
|
|
+}
|
|
+
|
|
+GLOBAL(void)
|
|
+jpeg_free_small (j_common_ptr cinfo, void * object, size_t sizeofobject)
|
|
+{
|
|
+ FreePooled(_mempool, object, sizeofobject);
|
|
+}
|
|
+
|
|
+
|
|
+/*
|
|
+ * "Large" objects are treated the same as "small" ones.
|
|
+ * NB: although we include FAR keywords in the routine declarations,
|
|
+ * this file won't actually work in 80x86 small/medium model; at least,
|
|
+ * you probably won't be able to process useful-size images in only 64KB.
|
|
+ */
|
|
+
|
|
+GLOBAL(void FAR *)
|
|
+jpeg_get_large (j_common_ptr cinfo, size_t sizeofobject)
|
|
+{
|
|
+ return (void FAR *) AllocPooled(_mempool, sizeofobject);
|
|
+}
|
|
+
|
|
+GLOBAL(void)
|
|
+jpeg_free_large (j_common_ptr cinfo, void FAR * object, size_t sizeofobject)
|
|
+{
|
|
+ FreePooled(_mempool, object, sizeofobject);
|
|
+}
|
|
+
|
|
+
|
|
+/*
|
|
+ * This routine computes the total memory space available for allocation.
|
|
+ * Here we always say, "we got all you want bud!"
|
|
+ */
|
|
+
|
|
+GLOBAL(long)
|
|
+jpeg_mem_available (j_common_ptr cinfo, long min_bytes_needed,
|
|
+ long max_bytes_needed, long already_allocated)
|
|
+{
|
|
+ long avail = (long)AvailMem(MEMF_LARGEST);
|
|
+
|
|
+ return max_bytes_needed > avail ? avail : max_bytes_needed;
|
|
+}
|
|
+
|
|
+
|
|
+/*
|
|
+ * Backing store (temporary file) management.
|
|
+ * Since jpeg_mem_available always promised the moon,
|
|
+ * this should never be called and we can just error out.
|
|
+ */
|
|
+
|
|
+GLOBAL(void)
|
|
+jpeg_open_backing_store (j_common_ptr cinfo, backing_store_ptr info,
|
|
+ long total_bytes_needed)
|
|
+{
|
|
+ ERREXIT(cinfo, JERR_NO_BACKING_STORE);
|
|
+}
|
|
+
|
|
+
|
|
+/*
|
|
+ * These routines take care of any system-dependent initialization and
|
|
+ * cleanup required.
|
|
+ */
|
|
+
|
|
+GLOBAL(long)
|
|
+jpeg_mem_init (j_common_ptr cinfo)
|
|
+{
|
|
+ return AvailMem(MEMF_LARGEST);
|
|
+}
|
|
+
|
|
+GLOBAL(void)
|
|
+jpeg_mem_term (j_common_ptr cinfo)
|
|
+{
|
|
+}
|
|
+
|
|
+static int JPEG_Init(struct Library * base)
|
|
+{
|
|
+ _mempool = CreatePool(MEMF_ANY | MEMF_SEM_PROTECTED, 65536L, 4096L);
|
|
+
|
|
+ return 1;
|
|
+}
|
|
+
|
|
+static void JPEG_Expunge(struct Library * base)
|
|
+{
|
|
+ DeletePool(_mempool);
|
|
+ _mempool = NULL;
|
|
+}
|
|
+
|
|
+ADD2INITLIB(JPEG_Init, 0);
|
|
+ADD2EXPUNGELIB(JPEG_Expunge, 0)
|