mirror of https://github.com/GNOME/gimp.git
parent
6323d782a4
commit
5112feded7
|
@ -1,3 +1,7 @@
|
|||
Thu Jan 27 14:55:00 CET 2000 Sven Neumann <sven@gimp.org>
|
||||
|
||||
* plug-ins/print/*: updated to version 3.0.5
|
||||
|
||||
Thu Jan 27 13:08:50 CET 2000 Sven Neumann <sven@gimp.org>
|
||||
|
||||
* plug-ins/ifscompose/ifscompose.[ch]: use gimp_color_buttons
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
Print plugin for the Gimp. Version 3.0 by Robert Krawitz
|
||||
Print plugin for the Gimp. Version 3.0.5 by Robert Krawitz
|
||||
<rlk@alum.mit.edu> based on version 2.0 by Michael Sweet
|
||||
<mike@easysw.com>.
|
||||
|
||||
|
@ -69,13 +69,11 @@ Some tips on tuning the output:
|
|||
|
||||
* One group of settings you might want to start with is:
|
||||
|
||||
Brightness 110
|
||||
Gamma 1.3
|
||||
Contrast 80
|
||||
Green 94
|
||||
Blue 89
|
||||
Saturation 1.15
|
||||
Density 1.6
|
||||
Brightness 45
|
||||
Gamma 1.5
|
||||
Contrast 105
|
||||
Saturation 1.4
|
||||
Density 0.8
|
||||
|
||||
|
||||
Makefile.standalone enables you to build this plugin as a standalone
|
||||
|
@ -84,4 +82,4 @@ plugin, without reference to a Gimp source tree.
|
|||
|
||||
Enjoy!
|
||||
|
||||
-Robert Krawitz, November 14, 1999
|
||||
-Robert Krawitz, January 13, 2000
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -3,7 +3,7 @@
|
|||
*
|
||||
* Print plug-in HP PCL driver for the GIMP.
|
||||
*
|
||||
* Copyright 1997-1999 Michael Sweet (mike@easysw.com) and
|
||||
* Copyright 1997-2000 Michael Sweet (mike@easysw.com) and
|
||||
* Robert Krawitz (rlk@alum.mit.edu)
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
|
@ -32,46 +32,14 @@
|
|||
* Revision History:
|
||||
*
|
||||
* $Log$
|
||||
* Revision 1.12 1999/12/16 19:44:01 olofk
|
||||
* Thu Dec 16 20:15:25 CET 1999 Olof S Kylande <olof@gimp.org>
|
||||
* Revision 1.13 2000/01/26 16:00:48 neo
|
||||
* updated print plug-in
|
||||
*
|
||||
* Fix of KDE/Kwm selection add/sub/inter problem
|
||||
* NOTE: This is a workaround, not a real fix.
|
||||
* Many Thanks to Matthias Ettrich
|
||||
*
|
||||
* * app/disp_callbacks.c
|
||||
* --Sven
|
||||
*
|
||||
* Updated unsharp-mask to version 0.10
|
||||
*
|
||||
* * plug-ins/unsharp/dialog_f.c
|
||||
* * plug-ins/unsharp/dialog_f.h
|
||||
* * plug-ins/unsharp/dialog_i.c
|
||||
* * plug-ins/unsharp/dialog_i.h
|
||||
* * plug-ins/unsharp/unsharp.c
|
||||
*
|
||||
* Updated print plug-in to version 3.0.1
|
||||
*
|
||||
* * plug-ins/print/README (new file)
|
||||
* * plug-ins/print/print-escp2.c
|
||||
* * plug-ins/print/print-pcl.c
|
||||
* * plug-ins/print/print-ps.c
|
||||
* * plug-ins/print/print-util.c
|
||||
* * plug-ins/print/print.c
|
||||
* * plug-ins/print/print.h
|
||||
*
|
||||
* Updated all files in the help/C/dialogs dir. This is
|
||||
* a first alpha glimpse of the help system. Please give
|
||||
* me feedback of the content. However since it's in alpha
|
||||
* stage it means that there is spell, grammatical, etc errors.
|
||||
* There is may also be pure errors which I hope "you" will
|
||||
* report to either olof@gimp.org or karin@gimp.org. Please
|
||||
* don't report spell, grammatical, etc error at this stage in dev.
|
||||
*
|
||||
* If you have any plans to commit to the help system please write
|
||||
* to olof@gimp.org. (This is mandatory not a please ;-).
|
||||
*
|
||||
* * help/C/welcome.html
|
||||
* * help/C/dialogs/about.html ..............
|
||||
* Revision 1.14 2000/01/08 23:30:56 rlk
|
||||
* Y2K copyright
|
||||
*
|
||||
* Revision 1.13 1999/11/23 02:11:37 rlk
|
||||
* Rationalize variables, pass 3
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
*
|
||||
* Print plug-in Adobe PostScript driver for the GIMP.
|
||||
*
|
||||
* Copyright 1997-1999 Michael Sweet (mike@easysw.com) and
|
||||
* Copyright 1997-2000 Michael Sweet (mike@easysw.com) and
|
||||
* Robert Krawitz (rlk@alum.mit.edu)
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
|
@ -33,49 +33,17 @@
|
|||
* Revision History:
|
||||
*
|
||||
* $Log$
|
||||
* Revision 1.16 1999/12/19 20:28:15 asbjoer
|
||||
* use g_strcasecmp()
|
||||
* Revision 1.17 2000/01/26 16:00:48 neo
|
||||
* updated print plug-in
|
||||
*
|
||||
* Revision 1.15 1999/12/16 19:44:01 olofk
|
||||
* Thu Dec 16 20:15:25 CET 1999 Olof S Kylande <olof@gimp.org>
|
||||
*
|
||||
* Fix of KDE/Kwm selection add/sub/inter problem
|
||||
* NOTE: This is a workaround, not a real fix.
|
||||
* Many Thanks to Matthias Ettrich
|
||||
* --Sven
|
||||
*
|
||||
* * app/disp_callbacks.c
|
||||
* Revision 1.12 2000/01/08 23:30:56 rlk
|
||||
* Y2K copyright
|
||||
*
|
||||
* Updated unsharp-mask to version 0.10
|
||||
*
|
||||
* * plug-ins/unsharp/dialog_f.c
|
||||
* * plug-ins/unsharp/dialog_f.h
|
||||
* * plug-ins/unsharp/dialog_i.c
|
||||
* * plug-ins/unsharp/dialog_i.h
|
||||
* * plug-ins/unsharp/unsharp.c
|
||||
*
|
||||
* Updated print plug-in to version 3.0.1
|
||||
*
|
||||
* * plug-ins/print/README (new file)
|
||||
* * plug-ins/print/print-escp2.c
|
||||
* * plug-ins/print/print-pcl.c
|
||||
* * plug-ins/print/print-ps.c
|
||||
* * plug-ins/print/print-util.c
|
||||
* * plug-ins/print/print.c
|
||||
* * plug-ins/print/print.h
|
||||
*
|
||||
* Updated all files in the help/C/dialogs dir. This is
|
||||
* a first alpha glimpse of the help system. Please give
|
||||
* me feedback of the content. However since it's in alpha
|
||||
* stage it means that there is spell, grammatical, etc errors.
|
||||
* There is may also be pure errors which I hope "you" will
|
||||
* report to either olof@gimp.org or karin@gimp.org. Please
|
||||
* don't report spell, grammatical, etc error at this stage in dev.
|
||||
*
|
||||
* If you have any plans to commit to the help system please write
|
||||
* to olof@gimp.org. (This is mandatory not a please ;-).
|
||||
*
|
||||
* * help/C/welcome.html
|
||||
* * help/C/dialogs/about.html ..............
|
||||
* Revision 1.11 2000/01/03 13:25:13 rlk
|
||||
* Fix from Salvador Pinto Abreu <spa@khromeleque.dmat.uevora.pt>
|
||||
*
|
||||
* Revision 1.10 1999/11/23 02:11:37 rlk
|
||||
* Rationalize variables, pass 3
|
||||
|
@ -477,10 +445,10 @@ ps_parameters(int model, /* I - Printer model */
|
|||
if (sscanf(line, "*%s %[^/:]", lname, loption) != 2)
|
||||
continue;
|
||||
|
||||
if (g_strcasecmp(lname, name) == 0)
|
||||
if (strcasecmp(lname, name) == 0)
|
||||
{
|
||||
valptrs[(*count)] = malloc(strlen(media_sizes[*count]) + 1);
|
||||
strcpy(valptrs[(*count)], media_sizes[*count]);
|
||||
valptrs[(*count)] = malloc(strlen(loption) + 1);
|
||||
strcpy(valptrs[(*count)], loption);
|
||||
(*count) ++;
|
||||
}
|
||||
}
|
||||
|
@ -1156,7 +1124,7 @@ ppd_find(char *ppd_file, /* I - Name of PPD file */
|
|||
if (line[0] != '*')
|
||||
continue;
|
||||
|
||||
if (g_strncasecmp(line, "*OrderDependency:", 17) == 0 && order != NULL)
|
||||
if (strncasecmp(line, "*OrderDependency:", 17) == 0 && order != NULL)
|
||||
{
|
||||
sscanf(line, "%*s%d", order);
|
||||
continue;
|
||||
|
@ -1164,8 +1132,8 @@ ppd_find(char *ppd_file, /* I - Name of PPD file */
|
|||
else if (sscanf(line, "*%s %[^/:]", lname, loption) != 2)
|
||||
continue;
|
||||
|
||||
if (g_strcasecmp(lname, name) == 0 &&
|
||||
g_strcasecmp(loption, option) == 0)
|
||||
if (strcasecmp(lname, name) == 0 &&
|
||||
strcasecmp(loption, option) == 0)
|
||||
{
|
||||
opt = strchr(line, ':') + 1;
|
||||
while (*opt == ' ' || *opt == '\t')
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
*
|
||||
* Print plug-in driver utility functions for the GIMP.
|
||||
*
|
||||
* Copyright 1997-1999 Michael Sweet (mike@easysw.com) and
|
||||
* Copyright 1997-2000 Michael Sweet (mike@easysw.com) and
|
||||
* Robert Krawitz (rlk@alum.mit.edu)
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
|
@ -38,46 +38,52 @@
|
|||
* Revision History:
|
||||
*
|
||||
* $Log$
|
||||
* Revision 1.11 1999/12/16 19:44:01 olofk
|
||||
* Thu Dec 16 20:15:25 CET 1999 Olof S Kylande <olof@gimp.org>
|
||||
* Revision 1.12 2000/01/26 16:00:48 neo
|
||||
* updated print plug-in
|
||||
*
|
||||
* Fix of KDE/Kwm selection add/sub/inter problem
|
||||
* NOTE: This is a workaround, not a real fix.
|
||||
* Many Thanks to Matthias Ettrich
|
||||
*
|
||||
* * app/disp_callbacks.c
|
||||
* --Sven
|
||||
*
|
||||
* Updated unsharp-mask to version 0.10
|
||||
* Revision 1.49.2.1 2000/01/13 23:41:29 rlk
|
||||
* Deal with null black pointer
|
||||
*
|
||||
* * plug-ins/unsharp/dialog_f.c
|
||||
* * plug-ins/unsharp/dialog_f.h
|
||||
* * plug-ins/unsharp/dialog_i.c
|
||||
* * plug-ins/unsharp/dialog_i.h
|
||||
* * plug-ins/unsharp/unsharp.c
|
||||
* Revision 1.49 2000/01/08 23:30:37 rlk
|
||||
* Some tweaking
|
||||
*
|
||||
* Updated print plug-in to version 3.0.1
|
||||
* Revision 1.48 1999/12/30 23:58:07 rlk
|
||||
* Silly little bug...
|
||||
*
|
||||
* * plug-ins/print/README (new file)
|
||||
* * plug-ins/print/print-escp2.c
|
||||
* * plug-ins/print/print-pcl.c
|
||||
* * plug-ins/print/print-ps.c
|
||||
* * plug-ins/print/print-util.c
|
||||
* * plug-ins/print/print.c
|
||||
* * plug-ins/print/print.h
|
||||
* Revision 1.47 1999/12/26 19:02:46 rlk
|
||||
* Performance stuff
|
||||
*
|
||||
* Updated all files in the help/C/dialogs dir. This is
|
||||
* a first alpha glimpse of the help system. Please give
|
||||
* me feedback of the content. However since it's in alpha
|
||||
* stage it means that there is spell, grammatical, etc errors.
|
||||
* There is may also be pure errors which I hope "you" will
|
||||
* report to either olof@gimp.org or karin@gimp.org. Please
|
||||
* don't report spell, grammatical, etc error at this stage in dev.
|
||||
* Revision 1.46 1999/12/25 17:47:17 rlk
|
||||
* Cleanup
|
||||
*
|
||||
* If you have any plans to commit to the help system please write
|
||||
* to olof@gimp.org. (This is mandatory not a please ;-).
|
||||
* Revision 1.45 1999/12/25 00:41:01 rlk
|
||||
* some minor improvement
|
||||
*
|
||||
* * help/C/welcome.html
|
||||
* * help/C/dialogs/about.html ..............
|
||||
* Revision 1.44 1999/12/24 12:57:38 rlk
|
||||
* Reduce grain; improve red
|
||||
*
|
||||
* Revision 1.43 1999/12/22 03:24:34 rlk
|
||||
* round length up, not down
|
||||
*
|
||||
* Revision 1.42 1999/12/22 03:12:17 rlk
|
||||
* More constant fiddling
|
||||
*
|
||||
* Revision 1.41 1999/12/22 01:34:28 rlk
|
||||
* Reverse direction each pass
|
||||
*
|
||||
* Revision 1.40 1999/12/18 23:45:07 rlk
|
||||
* typo
|
||||
*
|
||||
* Revision 1.39 1999/12/12 20:49:01 rlk
|
||||
* Various changes
|
||||
*
|
||||
* Revision 1.38 1999/12/11 23:12:06 rlk
|
||||
* Better matching between cmy/k
|
||||
*
|
||||
* Smoother dither!
|
||||
*
|
||||
* Revision 1.37 1999/12/05 23:24:08 rlk
|
||||
* don't want PRINT_LUT in release
|
||||
|
@ -335,7 +341,7 @@ dither_black(unsigned short *gray, /* I - Grayscale pixels */
|
|||
|
||||
xstep = src_width / dst_width;
|
||||
xmod = src_width % dst_width;
|
||||
length = (dst_width) / 8;
|
||||
length = (dst_width + 7) / 8;
|
||||
|
||||
kerror0 = error[row & 1][3];
|
||||
kerror1 = error[1 - (row & 1)][3];
|
||||
|
@ -411,27 +417,36 @@ dither_black(unsigned short *gray, /* I - Grayscale pixels */
|
|||
*/
|
||||
|
||||
#define NU_C 1
|
||||
#define DE_C 3
|
||||
#define DE_C 1
|
||||
#define NU_M 1
|
||||
#define DE_M 3
|
||||
#define DE_M 1
|
||||
#define NU_Y 1
|
||||
#define DE_Y 3
|
||||
#define DE_Y 1
|
||||
|
||||
#define I_RATIO_C NU_C / DE_C
|
||||
#define I_RATIO_C1 NU_C / (DE_C + NU_C)
|
||||
#define RATIO_C DE_C / NU_C
|
||||
#define RATIO_C1 (DE_C + NU_C) / NU_C
|
||||
|
||||
const static int C_CONST_0 = 65536 * I_RATIO_C1;
|
||||
const static int C_CONST_1 = 65536 * I_RATIO_C1;
|
||||
|
||||
#define I_RATIO_M NU_M / DE_M
|
||||
#define I_RATIO_M1 NU_M / (DE_M + NU_M)
|
||||
#define RATIO_M DE_M / NU_M
|
||||
#define RATIO_M1 (DE_M + NU_M) / NU_M
|
||||
|
||||
const static int M_CONST_0 = 65536 * I_RATIO_M1;
|
||||
const static int M_CONST_1 = 65536 * I_RATIO_M1;
|
||||
|
||||
#define I_RATIO_Y NU_Y / DE_Y
|
||||
#define I_RATIO_Y1 NU_Y / (DE_Y + NU_Y)
|
||||
#define RATIO_Y DE_Y / NU_Y
|
||||
#define RATIO_Y1 (DE_Y + NU_Y) / NU_Y
|
||||
|
||||
const static int Y_CONST_0 = 65536 * I_RATIO_Y1;
|
||||
const static int Y_CONST_1 = 65536 * I_RATIO_Y1;
|
||||
|
||||
/*
|
||||
* Lower and upper bounds for mixing CMY with K to produce gray scale.
|
||||
* Reducing KDARKNESS_LOWER results in more black being used with relatively
|
||||
|
@ -439,8 +454,8 @@ dither_black(unsigned short *gray, /* I - Grayscale pixels */
|
|||
* in more CMY being used in dark tones, which results in less pure black.
|
||||
* Decreasing the gap too much results in sharp crossover and stairstepping.
|
||||
*/
|
||||
#define KDARKNESS_LOWER (32 * 256)
|
||||
#define KDARKNESS_UPPER (96 * 256)
|
||||
#define KDARKNESS_LOWER (12 * 256)
|
||||
#define KDARKNESS_UPPER (128 * 256)
|
||||
|
||||
/*
|
||||
* Randomizing values for deciding when to output a bit. Normally with the
|
||||
|
@ -450,10 +465,10 @@ dither_black(unsigned short *gray, /* I - Grayscale pixels */
|
|||
* result in greater randomizing. We use less randomness for black output
|
||||
* to avoid production of black speckles in light regions.
|
||||
*/
|
||||
#define C_RANDOMIZER 2
|
||||
#define M_RANDOMIZER 2
|
||||
#define Y_RANDOMIZER 2
|
||||
#define K_RANDOMIZER 8
|
||||
#define C_RANDOMIZER 0
|
||||
#define M_RANDOMIZER 0
|
||||
#define Y_RANDOMIZER 0
|
||||
#define K_RANDOMIZER 4
|
||||
|
||||
#ifdef PRINT_DEBUG
|
||||
#define UPDATE_COLOR_DBG(r) \
|
||||
|
@ -482,22 +497,11 @@ do { \
|
|||
I_RATIO_##R##1); \
|
||||
} while (0)
|
||||
|
||||
#define PRINT_D3(r, R, d1, d2) \
|
||||
#define PRINT_D3(n, r, R, d1, d2) \
|
||||
do { \
|
||||
fprintf(dbg, "Case 2: o" #r " %lld " #r \
|
||||
fprintf(dbg, "Case %d: o" #r " %lld " #r \
|
||||
" %lld ditherbit" #d1 " %d ditherbit" #d2 " %d " \
|
||||
"num %lld den %lld test1 %lld test2 %lld\n", \
|
||||
o##r, r, ditherbit##d1, ditherbit##d2, \
|
||||
o##r, 65536ll, \
|
||||
((32767 + (((long long) ditherbit##d2 / 1) - 32768)) * o##r / \
|
||||
65536), cutoff); \
|
||||
} while (0)
|
||||
|
||||
#define PRINT_D4(r, R, d1, d2) \
|
||||
do { \
|
||||
fprintf(dbg, "Case 3: o" #r " %lld " #r \
|
||||
" %lld ditherbit" #d1 " %d ditherbit" #d2 " %d " \
|
||||
"num %lld den %lld test1 %lld test2 %lld\n", \
|
||||
"num %lld den %lld test1 %lld test2 %lld\n", n, \
|
||||
o##r, r, ditherbit##d1, ditherbit##d2, \
|
||||
o##r, 65536ll, \
|
||||
((32767 + (((long long) ditherbit##d2 / 1) - 32768)) * o##r / \
|
||||
|
@ -509,8 +513,7 @@ do { \
|
|||
#define UPDATE_COLOR_DBG(r) do {} while (0)
|
||||
#define PRINT_D1(r, R, d1, d2) do {} while (0)
|
||||
#define PRINT_D2(r, R, d1, d2) do {} while (0)
|
||||
#define PRINT_D3(r, R, d1, d2) do {} while (0)
|
||||
#define PRINT_D4(r, R, d1, d2) do {} while (0)
|
||||
#define PRINT_D3(n, r, R, d1, d2) do {} while (0)
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -521,103 +524,107 @@ do { \
|
|||
UPDATE_COLOR_DBG(r); \
|
||||
} while (0)
|
||||
|
||||
#define PRINT_COLOR(color, r, R, d1, d2) \
|
||||
do { \
|
||||
if (!l##color) \
|
||||
{ \
|
||||
if (r > (32767 + (((long long) ditherbit##d2 / R##_RANDOMIZER) - \
|
||||
(32768 / R##_RANDOMIZER)))) \
|
||||
{ \
|
||||
PRINT_D1(r, R, d1, d2); \
|
||||
if (r##bits++ % horizontal_overdensity == 0) \
|
||||
if (! (*kptr & bit)) \
|
||||
*r##ptr |= bit; \
|
||||
r -= 65535; \
|
||||
} \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
if (r <= (65536 * I_RATIO_##R##1 * 2 / 3)) \
|
||||
{ \
|
||||
if (r > (32767 + (((long long) ditherbit##d2 / R##_RANDOMIZER) - \
|
||||
(32768 / R##_RANDOMIZER))) * I_RATIO_##R##1) \
|
||||
{ \
|
||||
PRINT_D2(r, R, d1, d2); \
|
||||
if (l##r##bits++ % horizontal_overdensity == 0) \
|
||||
if (! (*kptr & bit)) \
|
||||
*l##r##ptr |= bit; \
|
||||
r -= 65535 * I_RATIO_##R##1; \
|
||||
} \
|
||||
} \
|
||||
else if (r > (32767 + (((long long) ditherbit##d2 / R##_RANDOMIZER) - \
|
||||
(32768 / R##_RANDOMIZER))) * I_RATIO_##R##1) \
|
||||
{ \
|
||||
int cutoff = ((density - (65536 * I_RATIO_##R##1 * 2 / 3)) * \
|
||||
65536 / (65536 - (65536 * I_RATIO_##R##1 * 2 / 3))); \
|
||||
long long sub = (65535ll * I_RATIO_##R##1) + \
|
||||
((65535ll - (65535ll * I_RATIO_##R##1)) * cutoff / 65536); \
|
||||
if (ditherbit##d1 > cutoff) \
|
||||
{ \
|
||||
PRINT_D3(r, R, d1, d2); \
|
||||
if (l##r##bits++ % horizontal_overdensity == 0) \
|
||||
if (! (*kptr & bit)) \
|
||||
*l##r##ptr |= bit; \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
PRINT_D4(r, R, d1, d2); \
|
||||
if (r##bits++ % horizontal_overdensity == 0) \
|
||||
if (! (*kptr & bit)) \
|
||||
*r##ptr |= bit; \
|
||||
} \
|
||||
if (sub < (65535 * I_RATIO_##R##1)) \
|
||||
r -= (65535 * I_RATIO_##R##1); \
|
||||
else if (sub > 65535) \
|
||||
r -= 65535; \
|
||||
else \
|
||||
r -= sub; \
|
||||
} \
|
||||
} \
|
||||
#define DO_PRINT_COLOR(color) \
|
||||
do { \
|
||||
if (color##bits++ == horizontal_overdensity) \
|
||||
{ \
|
||||
*color##ptr |= bit; \
|
||||
color##bits = 1; \
|
||||
} \
|
||||
} while(0)
|
||||
|
||||
#define PRINT_COLOR(color, r, R, d1, d2) \
|
||||
do { \
|
||||
int comp0 = (32767 + ((ditherbit##d2 >> R##_RANDOMIZER) - \
|
||||
(32768 >> R##_RANDOMIZER))); \
|
||||
if (!l##color) \
|
||||
{ \
|
||||
if (r > comp0) \
|
||||
{ \
|
||||
PRINT_D1(r, R, d1, d2); \
|
||||
DO_PRINT_COLOR(r); \
|
||||
r -= 65535; \
|
||||
} \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
int compare = comp0 * I_RATIO_##R##1; \
|
||||
if (r <= (R##_CONST_1)) \
|
||||
{ \
|
||||
if (r > compare) \
|
||||
{ \
|
||||
PRINT_D2(r, R, d1, d2); \
|
||||
DO_PRINT_COLOR(l##r); \
|
||||
r -= R##_CONST_0; \
|
||||
} \
|
||||
} \
|
||||
else if (r > compare) \
|
||||
{ \
|
||||
int cutoff = ((density - R##_CONST_1) * 65536 / \
|
||||
(65536 - R##_CONST_1)); \
|
||||
long long sub; \
|
||||
if (cutoff >= 0) \
|
||||
sub = R##_CONST_0 + (((65535ll - R##_CONST_0) * cutoff) >> 16); \
|
||||
else \
|
||||
sub = R##_CONST_0 + ((65535ll - R##_CONST_0) * cutoff / 65536); \
|
||||
if (ditherbit##d1 > cutoff) \
|
||||
{ \
|
||||
PRINT_D3(3, r, R, d1, d2); \
|
||||
DO_PRINT_COLOR(l##r); \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
PRINT_D3(4, r, R, d1, d2); \
|
||||
DO_PRINT_COLOR(r); \
|
||||
} \
|
||||
if (sub < R##_CONST_0) \
|
||||
r -= R##_CONST_0; \
|
||||
else if (sub > 65535) \
|
||||
r -= 65535; \
|
||||
else \
|
||||
r -= sub; \
|
||||
} \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#if 1
|
||||
#define UPDATE_DITHER(r, d2, x, width) \
|
||||
do { \
|
||||
if (ditherbit##d2 & bit) \
|
||||
{ \
|
||||
if (x > 0) \
|
||||
r##error1[-1] += r; \
|
||||
else \
|
||||
r##error1[0] = r; \
|
||||
r##error1[0] += 3 * r; \
|
||||
r##error1[1] = r; \
|
||||
dither##r = r##error0[1] + 3 * r; \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
if (x > 0) \
|
||||
r##error1[-1] += r * 3 / 4; \
|
||||
else \
|
||||
r##error1[0] = r * 3 / 4; \
|
||||
r##error1[0] += r * 3 / 2; \
|
||||
r##error1[1] = r * 3 / 4; \
|
||||
dither##r = r##error0[1] + 5 * r; \
|
||||
} \
|
||||
} while (0)
|
||||
#define UPDATE_DITHER(r, d2, x, width) \
|
||||
do { \
|
||||
int offset = (15 - (((o##r & 0xf000) >> 12)) * horizontal_overdensity) \
|
||||
>> 1; \
|
||||
if (x < offset) \
|
||||
offset = x; \
|
||||
else if (x > dst_width - offset - 1) \
|
||||
offset = dst_width - x - 1; \
|
||||
if (ditherbit##d2 & bit) \
|
||||
{ \
|
||||
r##error1[-offset] += r; \
|
||||
r##error1[0] += 3 * r; \
|
||||
r##error1[offset] += r; \
|
||||
dither##r = r##error0[direction] + 3 * r; \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
r##error1[-offset] += r; \
|
||||
r##error1[0] += r; \
|
||||
r##error1[offset] += r; \
|
||||
dither##r = r##error0[direction] + 5 * r; \
|
||||
} \
|
||||
} while (0)
|
||||
#else
|
||||
#define UPDATE_DITHER(r, d2, x, width) \
|
||||
do { \
|
||||
if (ditherbit##d2 & bit) \
|
||||
{ \
|
||||
r##error1[0] = 5 * r; \
|
||||
dither##r = r##error0[1] + 3 * r; \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
r##error1[0] = 3 * r; \
|
||||
dither##r = r##error0[1] + 5 * r; \
|
||||
} \
|
||||
} while (0)
|
||||
#define UPDATE_DITHER(r, d2, x, width) \
|
||||
do { \
|
||||
if (ditherbit##d2 & bit) \
|
||||
{ \
|
||||
r##error1[0] = 5 * r; \
|
||||
dither##r = r##error0[direction] + 3 * r; \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
r##error1[0] = 3 * r; \
|
||||
dither##r = r##error0[direction] + 5 * r; \
|
||||
} \
|
||||
} while (0)
|
||||
#endif
|
||||
|
||||
void
|
||||
|
@ -678,19 +685,44 @@ dither_cmyk(unsigned short *rgb, /* I - RGB pixels */
|
|||
* at zero each line to avoid having a line of bits near the edge of the
|
||||
* image.
|
||||
*/
|
||||
static int cbits = 0;
|
||||
static int mbits = 0;
|
||||
static int ybits = 0;
|
||||
static int kbits = 0;
|
||||
static int lcbits = 0;
|
||||
static int lmbits = 0;
|
||||
static int lybits = 0;
|
||||
static int cbits = 1;
|
||||
static int mbits = 1;
|
||||
static int ybits = 1;
|
||||
static int kbits = 1;
|
||||
static int lcbits = 1;
|
||||
static int lmbits = 1;
|
||||
static int lybits = 1;
|
||||
int overdensity_bits = 0;
|
||||
|
||||
#ifdef PRINT_DEBUG
|
||||
long long odk, odc, odm, ody, dk, dc, dm, dy, xk, xc, xm, xy, yc, ym, yy;
|
||||
FILE *dbg;
|
||||
#endif
|
||||
|
||||
int terminate;
|
||||
int direction = row & 1 ? 1 : -1;
|
||||
|
||||
switch (horizontal_overdensity)
|
||||
{
|
||||
case 0:
|
||||
case 1:
|
||||
overdensity_bits = 0;
|
||||
break;
|
||||
case 2:
|
||||
overdensity_bits = 1;
|
||||
break;
|
||||
case 4:
|
||||
overdensity_bits = 2;
|
||||
break;
|
||||
case 8:
|
||||
overdensity_bits = 3;
|
||||
break;
|
||||
}
|
||||
|
||||
bit = (direction == 1) ? 128 : 1 << (7 - ((dst_width - 1) & 7));
|
||||
x = (direction == 1) ? 0 : dst_width - 1;
|
||||
terminate = (direction == 1) ? dst_width : -1;
|
||||
|
||||
xstep = 3 * (src_width / dst_width);
|
||||
xmod = src_width % dst_width;
|
||||
length = (dst_width + 7) / 8;
|
||||
|
@ -706,6 +738,44 @@ dither_cmyk(unsigned short *rgb, /* I - RGB pixels */
|
|||
|
||||
kerror0 = error[row & 1][3];
|
||||
kerror1 = error[1 - (row & 1)][3];
|
||||
memset(kerror1, 0, dst_width * sizeof(int));
|
||||
memset(cerror1, 0, dst_width * sizeof(int));
|
||||
memset(merror1, 0, dst_width * sizeof(int));
|
||||
memset(yerror1, 0, dst_width * sizeof(int));
|
||||
cptr = cyan;
|
||||
mptr = magenta;
|
||||
yptr = yellow;
|
||||
lcptr = lcyan;
|
||||
lmptr = lmagenta;
|
||||
lyptr = lyellow;
|
||||
kptr = black;
|
||||
xerror = 0;
|
||||
if (direction == -1)
|
||||
{
|
||||
cerror0 += dst_width - 1;
|
||||
cerror1 += dst_width - 1;
|
||||
merror0 += dst_width - 1;
|
||||
merror1 += dst_width - 1;
|
||||
yerror0 += dst_width - 1;
|
||||
yerror1 += dst_width - 1;
|
||||
kerror0 += dst_width - 1;
|
||||
kerror1 += dst_width - 1;
|
||||
cptr = cyan + length - 1;
|
||||
if (lcptr)
|
||||
lcptr = lcyan + length - 1;
|
||||
mptr = magenta + length - 1;
|
||||
if (lmptr)
|
||||
lmptr = lmagenta + length - 1;
|
||||
yptr = yellow + length - 1;
|
||||
if (lyptr)
|
||||
lyptr = lyellow + length - 1;
|
||||
if (kptr)
|
||||
kptr = black + length - 1;
|
||||
xstep = -xstep;
|
||||
rgb += 3 * (src_width - 1);
|
||||
xerror = ((dst_width - 1) * xmod) % dst_width;
|
||||
xmod = -xmod;
|
||||
}
|
||||
|
||||
memset(cyan, 0, length);
|
||||
if (lcyan)
|
||||
|
@ -726,10 +796,7 @@ dither_cmyk(unsigned short *rgb, /* I - RGB pixels */
|
|||
/*
|
||||
* Main loop starts here!
|
||||
*/
|
||||
for (x = 0, bit = 128,
|
||||
cptr = cyan, mptr = magenta, yptr = yellow, lcptr = lcyan,
|
||||
lmptr = lmagenta, lyptr = lyellow, kptr = black, xerror = 0,
|
||||
ditherbit = rand(),
|
||||
for (ditherbit = rand(),
|
||||
ditherc = cerror0[0], ditherm = merror0[0], dithery = yerror0[0],
|
||||
ditherk = kerror0[0],
|
||||
ditherbit0 = ditherbit & 0xffff,
|
||||
|
@ -738,9 +805,16 @@ dither_cmyk(unsigned short *rgb, /* I - RGB pixels */
|
|||
((ditherbit & 0x100) << 7)),
|
||||
ditherbit3 = (((ditherbit >> 24) & 0x7f) + ((ditherbit & 1) << 7) +
|
||||
((ditherbit >> 8) & 0xff00));
|
||||
x < dst_width;
|
||||
x ++, cerror0 ++, cerror1 ++, merror0 ++, merror1 ++, yerror0 ++,
|
||||
yerror1 ++, kerror0 ++, kerror1 ++)
|
||||
x != terminate;
|
||||
x += direction,
|
||||
cerror0 += direction,
|
||||
cerror1 += direction,
|
||||
merror0 += direction,
|
||||
merror1 += direction,
|
||||
yerror0 += direction,
|
||||
yerror1 += direction,
|
||||
kerror0 += direction,
|
||||
kerror1 += direction)
|
||||
{
|
||||
|
||||
/*
|
||||
|
@ -775,14 +849,14 @@ dither_cmyk(unsigned short *rgb, /* I - RGB pixels */
|
|||
* Since we're printing black, adjust the black level based upon
|
||||
* the amount of color in the pixel (colorful pixels get less black)...
|
||||
*/
|
||||
long long xdiff = (abs(c - m) + abs(c - y) + abs(m - y)) / 3;
|
||||
int xdiff = (abs(c - m) + abs(c - y) + abs(m - y)) / 3;
|
||||
|
||||
diff = 65536 - xdiff;
|
||||
diff = diff * diff * diff / (65536ll * 65536ll); /* diff = diff^3 */
|
||||
diff = (diff * diff * diff) >> 32; /* diff = diff^3 */
|
||||
diff--;
|
||||
if (diff < 0)
|
||||
diff = 0;
|
||||
k = diff * k / 65535ll;
|
||||
k = (diff * k) >> 16;
|
||||
ak = k;
|
||||
divk = 65535 - k;
|
||||
if (divk == 0)
|
||||
|
@ -794,9 +868,9 @@ dither_cmyk(unsigned short *rgb, /* I - RGB pixels */
|
|||
* CMY as necessary to give better blues, greens, and reds... :)
|
||||
*/
|
||||
|
||||
c = (65535 - (unsigned) rgb[1] / 4) * (c - k) / divk;
|
||||
m = (65535 - (unsigned) rgb[2] / 4) * (m - k) / divk;
|
||||
y = (65535 - (unsigned) rgb[0] / 4) * (y - k) / divk;
|
||||
c = (65535 - ((rgb[2] + rgb[1]) >> 3)) * (c - k) / divk;
|
||||
m = (65535 - ((rgb[1] + rgb[0]) >> 3)) * (m - k) / divk;
|
||||
y = (65535 - ((rgb[0] + rgb[2]) >> 3)) * (y - k) / divk;
|
||||
}
|
||||
#ifdef PRINT_DEBUG
|
||||
yc = c;
|
||||
|
@ -811,17 +885,11 @@ dither_cmyk(unsigned short *rgb, /* I - RGB pixels */
|
|||
*/
|
||||
ok = k;
|
||||
nk = k + (ditherk) / 8;
|
||||
kdarkness = MAX((c + c / 3 + m + 2 * y / 3) / 4, ak);
|
||||
/*
|
||||
kdarkness = ak;
|
||||
*/
|
||||
kdarkness = MAX((c + ((c + c + c) >> 3) + m +
|
||||
((y + y + y + y + y) >> 3)) >> 2, ak);
|
||||
if (kdarkness < KDARKNESS_UPPER)
|
||||
{
|
||||
int rb;
|
||||
/*
|
||||
ub = KDARKNESS_UPPER - kdarkness;
|
||||
lb = ub * KDARKNESS_LOWER / KDARKNESS_UPPER;
|
||||
*/
|
||||
ub = KDARKNESS_UPPER;
|
||||
lb = KDARKNESS_LOWER;
|
||||
rb = ub - lb;
|
||||
|
@ -866,9 +934,10 @@ dither_cmyk(unsigned short *rgb, /* I - RGB pixels */
|
|||
*/
|
||||
if (lmagenta)
|
||||
{
|
||||
c += ck * 10 / 8;
|
||||
m += ck * 19 / 16;
|
||||
y += ck * 3 / 2;
|
||||
int addon = 2 * ck;
|
||||
c += addon;
|
||||
m += addon;
|
||||
y += addon;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -890,36 +959,14 @@ dither_cmyk(unsigned short *rgb, /* I - RGB pixels */
|
|||
odk = ditherk;
|
||||
dk = k;
|
||||
#endif
|
||||
if (k > (32767 + ((ditherbit0 / K_RANDOMIZER) - (32768 / K_RANDOMIZER))))
|
||||
if (k > (32767 + ((ditherbit0 >> K_RANDOMIZER) -
|
||||
(32768 >> K_RANDOMIZER))))
|
||||
{
|
||||
if (kbits++ % horizontal_overdensity == 0)
|
||||
*kptr |= bit;
|
||||
DO_PRINT_COLOR(k);
|
||||
k -= 65535;
|
||||
}
|
||||
|
||||
UPDATE_DITHER(k, 1, x, src_width);
|
||||
#if 0
|
||||
if (ditherbit0 & bit)
|
||||
{
|
||||
if (x > 0)
|
||||
kerror1[-1] += k;
|
||||
else
|
||||
kerror1[0] = k;
|
||||
kerror1[0] += 2 * k;
|
||||
kerror1[1] = k;
|
||||
ditherk = kerror0[1] + 3 * k;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (x > 0)
|
||||
kerror1[-1] += k / 2;
|
||||
else
|
||||
kerror1[0] = k / 2;
|
||||
kerror1[0] += k;
|
||||
kerror1[1] = k / 2;
|
||||
ditherk = kerror0[1] + 5 * k;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -934,31 +981,22 @@ dither_cmyk(unsigned short *rgb, /* I - RGB pixels */
|
|||
y = (65535 - rgb[0] / 4) * (y - k) / 65535 + k;
|
||||
}
|
||||
|
||||
|
||||
density = (c + m + y) >> overdensity_bits;
|
||||
UPDATE_COLOR(c);
|
||||
UPDATE_COLOR(m);
|
||||
UPDATE_COLOR(y);
|
||||
density = (c + m + y) / horizontal_overdensity;
|
||||
density += (c + m + y) >> overdensity_bits;
|
||||
/* density >>= 1; */
|
||||
|
||||
if (!kptr || !(*kptr & bit))
|
||||
{
|
||||
PRINT_COLOR(cyan, c, C, 1, 2);
|
||||
PRINT_COLOR(magenta, m, M, 2, 3);
|
||||
PRINT_COLOR(yellow, y, Y, 3, 0);
|
||||
}
|
||||
|
||||
/*****************************************************************
|
||||
* Cyan
|
||||
*****************************************************************/
|
||||
if (! (*kptr & bit))
|
||||
PRINT_COLOR(cyan, c, C, 1, 2);
|
||||
UPDATE_DITHER(c, 2, x, dst_width);
|
||||
|
||||
/*****************************************************************
|
||||
* Magenta
|
||||
*****************************************************************/
|
||||
if (! (*kptr & bit))
|
||||
PRINT_COLOR(magenta, m, M, 2, 3);
|
||||
UPDATE_DITHER(m, 3, x, dst_width);
|
||||
|
||||
/*****************************************************************
|
||||
* Yellow
|
||||
*****************************************************************/
|
||||
if (! (*kptr & bit))
|
||||
PRINT_COLOR(yellow, y, Y, 3, 0);
|
||||
UPDATE_DITHER(y, 0, x, dst_width);
|
||||
|
||||
/*****************************************************************
|
||||
|
@ -984,57 +1022,70 @@ dither_cmyk(unsigned short *rgb, /* I - RGB pixels */
|
|||
(black && (*kptr & bit)) ? 'k' : ' ',
|
||||
odk, odc, odm, ody,
|
||||
kdarkness, ck, bk, nk, ub, lb);
|
||||
fprintf(dbg, "x %d dir %d c %x %x m %x %x y %x %x k %x %x rgb %x bit %x\n",
|
||||
x, direction, cptr, cyan, mptr, magenta, yptr, yellow, kptr, black,
|
||||
rgb, bit);
|
||||
#endif
|
||||
|
||||
if (bit == 1)
|
||||
|
||||
ditherbit = rand();
|
||||
ditherbit0 = ditherbit & 0xffff;
|
||||
ditherbit1 = ((ditherbit >> 8) & 0xffff);
|
||||
ditherbit2 = ((ditherbit >> 16) & 0x7fff) + ((ditherbit & 0x100) << 7);
|
||||
ditherbit3 = ((ditherbit >> 24) & 0x7f) + ((ditherbit & 1) << 7) +
|
||||
((ditherbit >> 8) & 0xff00);
|
||||
if (direction == 1)
|
||||
{
|
||||
cptr ++;
|
||||
if (lcptr)
|
||||
lcptr ++;
|
||||
mptr ++;
|
||||
if (lmptr)
|
||||
lmptr ++;
|
||||
yptr ++;
|
||||
if (lyptr)
|
||||
lyptr ++;
|
||||
if (kptr)
|
||||
kptr ++;
|
||||
ditherbit = rand();
|
||||
ditherbit0 = ditherbit & 0xffff;
|
||||
ditherbit1 = ((ditherbit >> 8) & 0xffff);
|
||||
ditherbit2 = ((ditherbit >> 16) & 0x7fff) + ((ditherbit & 0x100) << 7);
|
||||
ditherbit3 = ((ditherbit >> 24) & 0x7f) + ((ditherbit & 1) << 7) +
|
||||
((ditherbit >> 8) & 0xff00);
|
||||
bit = 128;
|
||||
if (bit == 1)
|
||||
{
|
||||
cptr ++;
|
||||
if (lcptr)
|
||||
lcptr ++;
|
||||
mptr ++;
|
||||
if (lmptr)
|
||||
lmptr ++;
|
||||
yptr ++;
|
||||
if (lyptr)
|
||||
lyptr ++;
|
||||
if (kptr)
|
||||
kptr ++;
|
||||
bit = 128;
|
||||
}
|
||||
else
|
||||
bit >>= 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
ditherbit = rand();
|
||||
ditherbit0 = ditherbit & 0xffff;
|
||||
ditherbit1 = ((ditherbit >> 8) & 0xffff);
|
||||
ditherbit2 = ((ditherbit >> 16) & 0x7fff) + ((ditherbit & 0x100) << 7);
|
||||
ditherbit3 = ((ditherbit >> 24) & 0x7f) + ((ditherbit & 1) << 7) +
|
||||
((ditherbit >> 8) & 0xff00);
|
||||
#if 0
|
||||
int dithertmp0 = (ditherbit1 >> 14) ^ ((ditherbit3 &0x3fff) << 2);
|
||||
int dithertmp1 = (ditherbit2 >> 14) ^ ((ditherbit2 &0x3fff) << 2);
|
||||
int dithertmp2 = (ditherbit3 >> 14) ^ ((ditherbit1 &0x3fff) << 2);
|
||||
int dithertmp3 = (ditherbit0 >> 14) ^ ((ditherbit0 &0x3fff) << 2);
|
||||
ditherbit0 = dithertmp0;
|
||||
ditherbit1 = dithertmp1;
|
||||
ditherbit2 = dithertmp2;
|
||||
ditherbit3 = dithertmp3;
|
||||
#endif
|
||||
bit >>= 1;
|
||||
if (bit == 128)
|
||||
{
|
||||
cptr --;
|
||||
if (lcptr)
|
||||
lcptr --;
|
||||
mptr --;
|
||||
if (lmptr)
|
||||
lmptr --;
|
||||
yptr --;
|
||||
if (lyptr)
|
||||
lyptr --;
|
||||
if (kptr)
|
||||
kptr --;
|
||||
bit = 1;
|
||||
}
|
||||
else
|
||||
bit <<= 1;
|
||||
}
|
||||
|
||||
rgb += xstep;
|
||||
xerror += xmod;
|
||||
if (xerror >= dst_width)
|
||||
{
|
||||
xerror -= dst_width;
|
||||
rgb += 3;
|
||||
}
|
||||
{
|
||||
xerror -= dst_width;
|
||||
rgb += 3 * direction;
|
||||
}
|
||||
else if (xerror < 0)
|
||||
{
|
||||
xerror += dst_width;
|
||||
rgb += 3 * direction;
|
||||
}
|
||||
}
|
||||
/*
|
||||
* Main loop ends here!
|
||||
|
@ -1990,72 +2041,34 @@ compute_lut(lut_t *lut,
|
|||
pow(green_pixel, print_gamma));
|
||||
blue_pixel = 256.0 * (256.0 - 256.0 *
|
||||
pow(blue_pixel, print_gamma));
|
||||
#if 0
|
||||
if (red > 1.0)
|
||||
red_pixel = 65536.0 + ((pixel - 65536.0) / red);
|
||||
else
|
||||
red_pixel = pixel * red;
|
||||
if (green > 1.0)
|
||||
green_pixel = 65536.0 + ((pixel - 65536.0) / green);
|
||||
else
|
||||
green_pixel = pixel * green;
|
||||
if (blue > 1.0)
|
||||
blue_pixel = 65536.0 + ((pixel - 65536.0) / blue);
|
||||
else
|
||||
blue_pixel = pixel * blue;
|
||||
#endif
|
||||
|
||||
if (pixel <= 0.0)
|
||||
{
|
||||
lut->composite[i] = 0;
|
||||
}
|
||||
lut->composite[i] = 0;
|
||||
else if (pixel >= 65535.0)
|
||||
{
|
||||
lut->composite[i] = 65535;
|
||||
}
|
||||
lut->composite[i] = 65535;
|
||||
else
|
||||
{
|
||||
lut->composite[i] = (unsigned)(pixel + 0.5);
|
||||
}
|
||||
lut->composite[i] = (unsigned)(pixel);
|
||||
|
||||
if (red_pixel <= 0.0)
|
||||
{
|
||||
lut->red[i] = 0;
|
||||
}
|
||||
lut->red[i] = 0;
|
||||
else if (red_pixel >= 65535.0)
|
||||
{
|
||||
lut->red[i] = 65535;
|
||||
}
|
||||
lut->red[i] = 65535;
|
||||
else
|
||||
{
|
||||
lut->red[i] = (unsigned)(red_pixel + 0.5);
|
||||
}
|
||||
lut->red[i] = (unsigned)(red_pixel);
|
||||
|
||||
if (green_pixel <= 0.0)
|
||||
{
|
||||
lut->green[i] = 0;
|
||||
}
|
||||
lut->green[i] = 0;
|
||||
else if (green_pixel >= 65535.0)
|
||||
{
|
||||
lut->green[i] = 65535;
|
||||
}
|
||||
lut->green[i] = 65535;
|
||||
else
|
||||
{
|
||||
lut->green[i] = (unsigned)(green_pixel + 0.5);
|
||||
}
|
||||
lut->green[i] = (unsigned)(green_pixel);
|
||||
|
||||
if (blue_pixel <= 0.0)
|
||||
{
|
||||
lut->blue[i] = 0;
|
||||
}
|
||||
lut->blue[i] = 0;
|
||||
else if (blue_pixel >= 65535.0)
|
||||
{
|
||||
lut->blue[i] = 65535;
|
||||
}
|
||||
lut->blue[i] = 65535;
|
||||
else
|
||||
{
|
||||
lut->blue[i] = (unsigned)(blue_pixel + 0.5);
|
||||
}
|
||||
lut->blue[i] = (unsigned)(blue_pixel);
|
||||
}
|
||||
#ifdef PRINT_LUT
|
||||
fprintf(ltfile, "%3i %5d %5d %5d %5d %f %f %f %f %f %f %f %f\n",
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
*
|
||||
* Print plug-in for the GIMP.
|
||||
*
|
||||
* Copyright 1997-1999 Michael Sweet (mike@easysw.com) and
|
||||
* Copyright 1997-2000 Michael Sweet (mike@easysw.com) and
|
||||
* Robert Krawitz (rlk@alum.mit.edu)
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
|
@ -47,6 +47,10 @@
|
|||
/*
|
||||
* All Gimp-specific code is in this file.
|
||||
*/
|
||||
#include <gtk/gtk.h>
|
||||
#include <libgimp/gimp.h>
|
||||
#define PLUG_IN_VERSION "3.0.5 - 13 Jan 2000"
|
||||
#define PLUG_IN_NAME "Print"
|
||||
|
||||
#include <math.h>
|
||||
#include <signal.h>
|
||||
|
@ -56,8 +60,38 @@
|
|||
#include <os2.h>
|
||||
#endif
|
||||
|
||||
#include "libgimp/gimpui.h"
|
||||
#include "libgimp/stdplugins-intl.h"
|
||||
#include <libgimp/gimpui.h>
|
||||
#if 0
|
||||
#include <libgimp/stdplugins-intl.h>
|
||||
#else
|
||||
#include <libgimp/gimpintl.h>
|
||||
#include <locale.h>
|
||||
|
||||
#ifndef LOCALEDIR
|
||||
#define LOCALEDIR g_strconcat (gimp_data_directory (), \
|
||||
G_DIR_SEPARATOR_S, \
|
||||
"locale", \
|
||||
NULL)
|
||||
#endif
|
||||
#ifdef HAVE_LC_MESSAGES
|
||||
#define INIT_I18N() \
|
||||
setlocale(LC_MESSAGES, ""); \
|
||||
bindtextdomain("gimp-std-plugins", LOCALEDIR); \
|
||||
textdomain("gimp-std-plugins")
|
||||
#define INIT_I18N_UI() \
|
||||
gtk_set_locale(); \
|
||||
setlocale (LC_NUMERIC, "C"); \
|
||||
INIT_I18N();
|
||||
#else
|
||||
#define INIT_I18N() \
|
||||
bindtextdomain("gimp-std-plugins", LOCALEDIR); \
|
||||
textdomain("gimp-std-plugins")
|
||||
#define INIT_I18N_UI() \
|
||||
gtk_set_locale(); \
|
||||
setlocale (LC_NUMERIC, "C"); \
|
||||
INIT_I18N();
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Constants for GUI...
|
||||
|
@ -236,7 +270,7 @@ printer_t printers[] = /* List of supported printer types */
|
|||
escp2_parameters, default_media_size, escp2_imageable_area, escp2_print },
|
||||
{ N_("EPSON Stylus Photo EX"), "escp2-ex", 1, 7, 0.585, 0.646,
|
||||
escp2_parameters, default_media_size, escp2_imageable_area, escp2_print },
|
||||
{ N_("EPSON Stylus Photo EX"), "escp2-photo", 1, 8, 0.585, 0.646,
|
||||
{ N_("EPSON Stylus Photo"), "escp2-photo", 1, 8, 0.585, 0.646,
|
||||
escp2_parameters, default_media_size, escp2_imageable_area, escp2_print },
|
||||
};
|
||||
|
||||
|
@ -797,7 +831,7 @@ do_print_dialog(void)
|
|||
* Top-level table for dialog...
|
||||
*/
|
||||
|
||||
table = gtk_table_new(9, 4, FALSE);
|
||||
table = gtk_table_new(17, 4, FALSE);
|
||||
gtk_container_border_width(GTK_CONTAINER(table), 6);
|
||||
gtk_table_set_col_spacings(GTK_TABLE(table), 4);
|
||||
gtk_table_set_row_spacings(GTK_TABLE(table), 8);
|
||||
|
@ -956,6 +990,15 @@ do_print_dialog(void)
|
|||
gtk_box_pack_start(GTK_BOX(box), button, FALSE, FALSE, 0);
|
||||
gtk_widget_show(button);
|
||||
|
||||
label = gtk_label_new(_("Density:"));
|
||||
gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5);
|
||||
gtk_table_attach(GTK_TABLE(table), label, 2, 3, 7, 8, GTK_FILL, GTK_FILL, 0, 0);
|
||||
gtk_widget_show(label);
|
||||
|
||||
box = gtk_hbox_new(FALSE, 8);
|
||||
gtk_table_attach(GTK_TABLE(table), box, 3, 4, 7, 8, GTK_FILL, GTK_FILL, 0, 0);
|
||||
gtk_widget_show(box);
|
||||
|
||||
linear_off = button = gtk_radio_button_new_with_label(NULL, _("Normal scale"));
|
||||
linear_group = gtk_radio_button_group(GTK_RADIO_BUTTON(button));
|
||||
if (vars.linear == 0)
|
||||
|
@ -966,7 +1009,7 @@ do_print_dialog(void)
|
|||
gtk_box_pack_start(GTK_BOX(box), button, FALSE, FALSE, 0);
|
||||
gtk_widget_show(button);
|
||||
|
||||
linear_on = button = gtk_radio_button_new_with_label(linear_group, _("Linear scale"));
|
||||
linear_on = button = gtk_radio_button_new_with_label(linear_group, _("Experimental linear scale"));
|
||||
if (vars.linear == 1)
|
||||
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), TRUE);
|
||||
gtk_signal_connect(GTK_OBJECT(button), "toggled",
|
||||
|
@ -981,11 +1024,11 @@ do_print_dialog(void)
|
|||
|
||||
label = gtk_label_new(_("Scaling:"));
|
||||
gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5);
|
||||
gtk_table_attach(GTK_TABLE(table), label, 0, 1, 7, 8, GTK_FILL, GTK_FILL, 0, 0);
|
||||
gtk_table_attach(GTK_TABLE(table), label, 0, 1, 8, 9, GTK_FILL, GTK_FILL, 0, 0);
|
||||
gtk_widget_show(label);
|
||||
|
||||
box = gtk_hbox_new(FALSE, 8);
|
||||
gtk_table_attach(GTK_TABLE(table), box, 1, 4, 7, 8, GTK_FILL, GTK_FILL, 0, 0);
|
||||
gtk_table_attach(GTK_TABLE(table), box, 1, 4, 8, 9, GTK_FILL, GTK_FILL, 0, 0);
|
||||
gtk_widget_show(box);
|
||||
|
||||
if (vars.scaling < 0.0)
|
||||
|
@ -1037,11 +1080,11 @@ do_print_dialog(void)
|
|||
|
||||
label = gtk_label_new(_("Brightness:"));
|
||||
gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5);
|
||||
gtk_table_attach(GTK_TABLE(table), label, 0, 1, 8, 9, GTK_FILL, GTK_FILL, 0, 0);
|
||||
gtk_table_attach(GTK_TABLE(table), label, 0, 1, 9, 10, GTK_FILL, GTK_FILL, 0, 0);
|
||||
gtk_widget_show(label);
|
||||
|
||||
box = gtk_hbox_new(FALSE, 8);
|
||||
gtk_table_attach(GTK_TABLE(table), box, 1, 4, 8, 9, GTK_FILL, GTK_FILL, 0, 0);
|
||||
gtk_table_attach(GTK_TABLE(table), box, 1, 4, 9, 10, GTK_FILL, GTK_FILL, 0, 0);
|
||||
gtk_widget_show(box);
|
||||
|
||||
brightness_adjustment = scale_data =
|
||||
|
@ -1072,11 +1115,11 @@ do_print_dialog(void)
|
|||
|
||||
label = gtk_label_new(_("Gamma:"));
|
||||
gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5);
|
||||
gtk_table_attach(GTK_TABLE(table), label, 0, 1, 9, 10, GTK_FILL, GTK_FILL, 0, 0);
|
||||
gtk_table_attach(GTK_TABLE(table), label, 0, 1, 10, 11, GTK_FILL, GTK_FILL, 0, 0);
|
||||
gtk_widget_show(label);
|
||||
|
||||
box = gtk_hbox_new(FALSE, 8);
|
||||
gtk_table_attach(GTK_TABLE(table), box, 1, 4, 9, 10, GTK_FILL, GTK_FILL, 0, 0);
|
||||
gtk_table_attach(GTK_TABLE(table), box, 1, 4, 10, 11, GTK_FILL, GTK_FILL, 0, 0);
|
||||
gtk_widget_show(box);
|
||||
|
||||
gamma_adjustment = scale_data =
|
||||
|
@ -1115,10 +1158,10 @@ do_print_dialog(void)
|
|||
|
||||
label = gtk_label_new(_("Contrast:"));
|
||||
gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5);
|
||||
gtk_table_attach(GTK_TABLE(table), label, 0, 1, 10, 11, GTK_FILL, GTK_FILL, 0, 0);
|
||||
gtk_table_attach(GTK_TABLE(table), label, 0, 1, 11, 12, GTK_FILL, GTK_FILL, 0, 0);
|
||||
gtk_widget_show(label);
|
||||
box = gtk_hbox_new(FALSE, 8);
|
||||
gtk_table_attach(GTK_TABLE(table), box, 1, 4, 10, 11, GTK_FILL, GTK_FILL, 0, 0);
|
||||
gtk_table_attach(GTK_TABLE(table), box, 1, 4, 11, 12, GTK_FILL, GTK_FILL, 0, 0);
|
||||
gtk_widget_show(box);
|
||||
|
||||
contrast_adjustment = scale_data =
|
||||
|
@ -1149,11 +1192,11 @@ do_print_dialog(void)
|
|||
|
||||
label = gtk_label_new(_("Red:"));
|
||||
gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5);
|
||||
gtk_table_attach(GTK_TABLE(table), label, 0, 1, 11, 12, GTK_FILL, GTK_FILL, 0, 0);
|
||||
gtk_table_attach(GTK_TABLE(table), label, 0, 1, 12, 13, GTK_FILL, GTK_FILL, 0, 0);
|
||||
gtk_widget_show(label);
|
||||
|
||||
box = gtk_hbox_new(FALSE, 8);
|
||||
gtk_table_attach(GTK_TABLE(table), box, 1, 4, 11, 12, GTK_FILL, GTK_FILL, 0, 0);
|
||||
gtk_table_attach(GTK_TABLE(table), box, 1, 4, 12, 13, GTK_FILL, GTK_FILL, 0, 0);
|
||||
gtk_widget_show(box);
|
||||
|
||||
red_adjustment = scale_data =
|
||||
|
@ -1184,11 +1227,11 @@ do_print_dialog(void)
|
|||
|
||||
label = gtk_label_new(_("Green:"));
|
||||
gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5);
|
||||
gtk_table_attach(GTK_TABLE(table), label, 0, 1, 12, 13, GTK_FILL, GTK_FILL, 0, 0);
|
||||
gtk_table_attach(GTK_TABLE(table), label, 0, 1, 13, 14, GTK_FILL, GTK_FILL, 0, 0);
|
||||
gtk_widget_show(label);
|
||||
|
||||
box = gtk_hbox_new(FALSE, 8);
|
||||
gtk_table_attach(GTK_TABLE(table), box, 1, 4, 12, 13, GTK_FILL, GTK_FILL, 0, 0);
|
||||
gtk_table_attach(GTK_TABLE(table), box, 1, 4, 13, 14, GTK_FILL, GTK_FILL, 0, 0);
|
||||
gtk_widget_show(box);
|
||||
|
||||
green_adjustment = scale_data =
|
||||
|
@ -1219,11 +1262,11 @@ do_print_dialog(void)
|
|||
|
||||
label = gtk_label_new(_("Blue:"));
|
||||
gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5);
|
||||
gtk_table_attach(GTK_TABLE(table), label, 0, 1, 13, 14, GTK_FILL, GTK_FILL, 0, 0);
|
||||
gtk_table_attach(GTK_TABLE(table), label, 0, 1, 14, 15, GTK_FILL, GTK_FILL, 0, 0);
|
||||
gtk_widget_show(label);
|
||||
|
||||
box = gtk_hbox_new(FALSE, 8);
|
||||
gtk_table_attach(GTK_TABLE(table), box, 1, 4, 13, 14, GTK_FILL, GTK_FILL, 0, 0);
|
||||
gtk_table_attach(GTK_TABLE(table), box, 1, 4, 14, 15, GTK_FILL, GTK_FILL, 0, 0);
|
||||
gtk_widget_show(box);
|
||||
|
||||
blue_adjustment = scale_data =
|
||||
|
@ -1254,11 +1297,11 @@ do_print_dialog(void)
|
|||
|
||||
label = gtk_label_new(_("Saturation:"));
|
||||
gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5);
|
||||
gtk_table_attach(GTK_TABLE(table), label, 0, 1, 14, 15, GTK_FILL, GTK_FILL, 0, 0);
|
||||
gtk_table_attach(GTK_TABLE(table), label, 0, 1, 15, 16, GTK_FILL, GTK_FILL, 0, 0);
|
||||
gtk_widget_show(label);
|
||||
|
||||
box = gtk_hbox_new(FALSE, 8);
|
||||
gtk_table_attach(GTK_TABLE(table), box, 1, 4, 14, 15, GTK_FILL, GTK_FILL, 0, 0);
|
||||
gtk_table_attach(GTK_TABLE(table), box, 1, 4, 15, 16, GTK_FILL, GTK_FILL, 0, 0);
|
||||
gtk_widget_show(box);
|
||||
|
||||
saturation_adjustment = scale_data =
|
||||
|
@ -1289,11 +1332,11 @@ do_print_dialog(void)
|
|||
|
||||
label = gtk_label_new(_("Density:"));
|
||||
gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5);
|
||||
gtk_table_attach(GTK_TABLE(table), label, 0, 1, 15, 16, GTK_FILL, GTK_FILL, 0, 0);
|
||||
gtk_table_attach(GTK_TABLE(table), label, 0, 1, 16, 17, GTK_FILL, GTK_FILL, 0, 0);
|
||||
gtk_widget_show(label);
|
||||
|
||||
box = gtk_hbox_new(FALSE, 8);
|
||||
gtk_table_attach(GTK_TABLE(table), box, 1, 4, 15, 16, GTK_FILL, GTK_FILL, 0, 0);
|
||||
gtk_table_attach(GTK_TABLE(table), box, 1, 4, 16, 17, GTK_FILL, GTK_FILL, 0, 0);
|
||||
gtk_widget_show(box);
|
||||
|
||||
density_adjustment = scale_data =
|
||||
|
@ -1367,13 +1410,8 @@ do_print_dialog(void)
|
|||
* Print, cancel buttons...
|
||||
*/
|
||||
|
||||
gtk_container_set_border_width (GTK_CONTAINER (GTK_DIALOG (dialog)->action_area), 2);
|
||||
gtk_box_set_homogeneous(GTK_BOX(GTK_DIALOG(dialog)->action_area), FALSE);
|
||||
|
||||
hbbox = gtk_hbutton_box_new ();
|
||||
gtk_button_box_set_spacing (GTK_BUTTON_BOX (hbbox), 4);
|
||||
gtk_box_pack_end (GTK_BOX (GTK_DIALOG (dialog)->action_area), hbbox, FALSE,FALSE, 0);
|
||||
gtk_widget_show (hbbox);
|
||||
gtk_box_set_spacing(GTK_BOX(GTK_DIALOG(dialog)->action_area), 0);
|
||||
|
||||
button = gtk_button_new_with_label (_("Print"));
|
||||
GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
|
||||
|
@ -3166,8 +3204,8 @@ get_printers(void)
|
|||
for (i = 1; i <= pnum; i++)
|
||||
{
|
||||
sprintf(plist[plist_count].name, "LPT%d:", i);
|
||||
sprintf(plist[plist_count].v.output_to, "PRINT /D:LPT%d /B ", i);
|
||||
strcpy(plist[plist_count].v.driver, "ps2");
|
||||
sprintf(plist[plist_count].output_to, "PRINT /D:LPT%d /B ", i);
|
||||
strcpy(plist[plist_count].driver, "ps2");
|
||||
initialize_printer(&plist[plist_count]);
|
||||
plist_count ++;
|
||||
}
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
/*
|
||||
* "$Id$"
|
||||
*
|
||||
* Print plug-in header file for the GIMP.
|
||||
*
|
||||
* Copyright 1997-1999 Michael Sweet (mike@easysw.com) and
|
||||
* Copyright 1997-2000 Michael Sweet (mike@easysw.com) and
|
||||
* Robert Krawitz (rlk@alum.mit.edu)
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
|
@ -24,10 +25,23 @@
|
|||
* See ChangeLog
|
||||
*/
|
||||
|
||||
/*
|
||||
*
|
||||
* This file must not include any gimp, glib, gtk, etc. headers.
|
||||
*
|
||||
* Eventually I intend to port this to GhostScript and/or CUPS. The only
|
||||
* file that should have GIMP-specific code is print.c. The rest of this
|
||||
* program should be completely generic.
|
||||
*
|
||||
* rlk 20000112
|
||||
*/
|
||||
|
||||
/*
|
||||
* Include necessary header files...
|
||||
*/
|
||||
#include "config.h"
|
||||
#ifndef HAVE_UNISTD_H
|
||||
#define HAVE_UNISTD_H
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
@ -39,17 +53,10 @@
|
|||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
#include <libgimp/gimp.h>
|
||||
|
||||
|
||||
/*
|
||||
* Constants...
|
||||
*/
|
||||
|
||||
|
||||
#define PLUG_IN_VERSION "3.0.1 - 05 Dec 1999"
|
||||
#define PLUG_IN_NAME "Print"
|
||||
#define OUTPUT_GRAY 0 /* Grayscale output */
|
||||
#define OUTPUT_COLOR 1 /* Color output */
|
||||
|
||||
|
@ -229,3 +236,6 @@ extern void indexed_to_gray(unsigned char *, unsigned char *, int, int,
|
|||
lut_t *, unsigned char *, float);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* End of "$Id$".
|
||||
*/
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
Thu Jan 27 14:53:00 CET 2000 Sven Neumann <sven@gimp.org>
|
||||
|
||||
* de.po: updates from Daniel Egger
|
||||
|
||||
2000-01-27 Michael Natterer <mitch@gimp.org>
|
||||
|
||||
* uk.po: fixed two translations to make it compile.
|
||||
|
|
Loading…
Reference in New Issue