| [2] | 1 | /*
|
|---|
| 2 | * jmorecfg.h
|
|---|
| 3 | *
|
|---|
| 4 | * Copyright (C) 1991-1997, Thomas G. Lane.
|
|---|
| 5 | * This file is part of the Independent JPEG Group's software.
|
|---|
| 6 | * For conditions of distribution and use, see the accompanying README file.
|
|---|
| 7 | *
|
|---|
| 8 | * This file contains additional configuration options that customize the
|
|---|
| 9 | * JPEG software for special applications or support machine-dependent
|
|---|
| 10 | * optimizations. Most users will not need to touch this file.
|
|---|
| 11 | */
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 | /*
|
|---|
| 15 | * Define BITS_IN_JSAMPLE as either
|
|---|
| 16 | * 8 for 8-bit sample values (the usual setting)
|
|---|
| 17 | * 12 for 12-bit sample values
|
|---|
| 18 | * Only 8 and 12 are legal data precisions for lossy JPEG according to the
|
|---|
| 19 | * JPEG standard, and the IJG code does not support anything else!
|
|---|
| 20 | * We do not support run-time selection of data precision, sorry.
|
|---|
| 21 | */
|
|---|
| 22 |
|
|---|
| 23 | #define BITS_IN_JSAMPLE 8 /* use 8 or 12 */
|
|---|
| 24 |
|
|---|
| 25 |
|
|---|
| 26 | /*
|
|---|
| 27 | * Maximum number of components (color channels) allowed in JPEG image.
|
|---|
| 28 | * To meet the letter of the JPEG spec, set this to 255. However, darn
|
|---|
| 29 | * few applications need more than 4 channels (maybe 5 for CMYK + alpha
|
|---|
| 30 | * mask). We recommend 10 as a reasonable compromise; use 4 if you are
|
|---|
| 31 | * really short on memory. (Each allowed component costs a hundred or so
|
|---|
| 32 | * bytes of storage, whether actually used in an image or not.)
|
|---|
| 33 | */
|
|---|
| 34 |
|
|---|
| 35 | #define MAX_COMPONENTS 10 /* maximum number of image components */
|
|---|
| 36 |
|
|---|
| 37 |
|
|---|
| 38 | /*
|
|---|
| 39 | * Basic data types.
|
|---|
| 40 | * You may need to change these if you have a machine with unusual data
|
|---|
| 41 | * type sizes; for example, "char" not 8 bits, "short" not 16 bits,
|
|---|
| 42 | * or "long" not 32 bits. We don't care whether "int" is 16 or 32 bits,
|
|---|
| 43 | * but it had better be at least 16.
|
|---|
| 44 | */
|
|---|
| 45 |
|
|---|
| 46 | /* Representation of a single sample (pixel element value).
|
|---|
| 47 | * We frequently allocate large arrays of these, so it's important to keep
|
|---|
| 48 | * them small. But if you have memory to burn and access to char or short
|
|---|
| 49 | * arrays is very slow on your hardware, you might want to change these.
|
|---|
| 50 | */
|
|---|
| 51 |
|
|---|
| 52 | #if BITS_IN_JSAMPLE == 8
|
|---|
| 53 | /* JSAMPLE should be the smallest type that will hold the values 0..255.
|
|---|
| 54 | * You can use a signed char by having GETJSAMPLE mask it with 0xFF.
|
|---|
| 55 | */
|
|---|
| 56 |
|
|---|
| 57 | #ifdef HAVE_UNSIGNED_CHAR
|
|---|
| 58 |
|
|---|
| 59 | typedef unsigned char JSAMPLE;
|
|---|
| 60 | #define GETJSAMPLE(value) ((int) (value))
|
|---|
| 61 |
|
|---|
| 62 | #else /* not HAVE_UNSIGNED_CHAR */
|
|---|
| 63 |
|
|---|
| 64 | typedef char JSAMPLE;
|
|---|
| 65 | #ifdef CHAR_IS_UNSIGNED
|
|---|
| 66 | #define GETJSAMPLE(value) ((int) (value))
|
|---|
| 67 | #else
|
|---|
| 68 | #define GETJSAMPLE(value) ((int) (value) & 0xFF)
|
|---|
| 69 | #endif /* CHAR_IS_UNSIGNED */
|
|---|
| 70 |
|
|---|
| 71 | #endif /* HAVE_UNSIGNED_CHAR */
|
|---|
| 72 |
|
|---|
| 73 | #define MAXJSAMPLE 255
|
|---|
| 74 | #define CENTERJSAMPLE 128
|
|---|
| 75 |
|
|---|
| 76 | #endif /* BITS_IN_JSAMPLE == 8 */
|
|---|
| 77 |
|
|---|
| |
|---|