mirror of https://github.com/GNOME/gimp.git
Rename colour and greyscale to color and grayscale respectively
This commit is contained in:
parent
c2da46d810
commit
264d09b417
|
@ -373,7 +373,7 @@ gimp_brush_real_transform_mask (GimpBrush *brush,
|
||||||
*
|
*
|
||||||
* The algorithm used is exactly the same as for the brush mask
|
* The algorithm used is exactly the same as for the brush mask
|
||||||
* (gimp_brush_real_transform_mask) except it accounts for 3 color channels
|
* (gimp_brush_real_transform_mask) except it accounts for 3 color channels
|
||||||
* instead of 1 greyscale channel.
|
* instead of 1 grayscale channel.
|
||||||
*
|
*
|
||||||
* Rather than calculating the inverse transform for each point in the
|
* Rather than calculating the inverse transform for each point in the
|
||||||
* transformed image, this algorithm uses the inverse transformed
|
* transformed image, this algorithm uses the inverse transformed
|
||||||
|
|
|
@ -22,17 +22,17 @@
|
||||||
* worse or better depending on what you enjoy...). [adam@gimp.org]
|
* worse or better depending on what you enjoy...). [adam@gimp.org]
|
||||||
*
|
*
|
||||||
* 2004-12-12 - Use a slower but much nicer technique for finding the
|
* 2004-12-12 - Use a slower but much nicer technique for finding the
|
||||||
* two best colours to dither between when using fixed/positional
|
* two best colors to dither between when using fixed/positional
|
||||||
* dither methods. Makes positional dither much less lame. [adam@gimp.org]
|
* dither methods. Makes positional dither much less lame. [adam@gimp.org]
|
||||||
*
|
*
|
||||||
* 2002-02-10 - Quantizer version 3.0 (the rest of the commit started
|
* 2002-02-10 - Quantizer version 3.0 (the rest of the commit started
|
||||||
* a year ago -- whoops). Divide colours within CIE L*a*b* space using
|
* a year ago -- whoops). Divide colors within CIE L*a*b* space using
|
||||||
* CPercep module (cpercep.[ch]), colour-match and dither likewise,
|
* CPercep module (cpercep.[ch]), color-match and dither likewise,
|
||||||
* change the underlying box selection criteria and division point
|
* change the underlying box selection criteria and division point
|
||||||
* logic, bump luminance precision upwards, etc.etc. Generally
|
* logic, bump luminance precision upwards, etc.etc. Generally
|
||||||
* chooses a much richer colour set, especially for low numbers of
|
* chooses a much richer color set, especially for low numbers of
|
||||||
* colours. n.b.: Less luminance-sloppy in straight remapping which is
|
* colors. n.b.: Less luminance-sloppy in straight remapping which is
|
||||||
* good for colour but a bit worse for high-frequency detail (that's
|
* good for color but a bit worse for high-frequency detail (that's
|
||||||
* partly what fs-dithering is for -- use it). [adam@gimp.org]
|
* partly what fs-dithering is for -- use it). [adam@gimp.org]
|
||||||
*
|
*
|
||||||
* 2001-03-25 - Define accessor function/macro for histogram reads and
|
* 2001-03-25 - Define accessor function/macro for histogram reads and
|
||||||
|
@ -40,7 +40,7 @@
|
||||||
* dirty tricks we used when we knew that the histogram was a straight
|
* dirty tricks we used when we knew that the histogram was a straight
|
||||||
* 3d array, so I've recovered some of the speed loss by implementing
|
* 3d array, so I've recovered some of the speed loss by implementing
|
||||||
* a 5d accessor function with good locality of reference. This change
|
* a 5d accessor function with good locality of reference. This change
|
||||||
* is the first step towards quantizing in a more interesting colourspace
|
* is the first step towards quantizing in a more interesting colorspace
|
||||||
* than frumpy old RGB. [Adam]
|
* than frumpy old RGB. [Adam]
|
||||||
*
|
*
|
||||||
* 2000/01/30 - Use palette_selector instead of option_menu for custom
|
* 2000/01/30 - Use palette_selector instead of option_menu for custom
|
||||||
|
@ -48,14 +48,14 @@
|
||||||
*
|
*
|
||||||
* 99/09/01 - Created a low-bleed FS-dither option. [Adam]
|
* 99/09/01 - Created a low-bleed FS-dither option. [Adam]
|
||||||
*
|
*
|
||||||
* 99/08/29 - Deterministic colour dithering to arbitrary palettes.
|
* 99/08/29 - Deterministic color dithering to arbitrary palettes.
|
||||||
* Ideal for animations that are going to be delta-optimized or simply
|
* Ideal for animations that are going to be delta-optimized or simply
|
||||||
* don't want to look 'busy' in static areas. Also a bunch of bugfixes
|
* don't want to look 'busy' in static areas. Also a bunch of bugfixes
|
||||||
* and tweaks. [Adam]
|
* and tweaks. [Adam]
|
||||||
*
|
*
|
||||||
* 99/08/28 - Deterministic alpha dithering over layers, reduced bleeding
|
* 99/08/28 - Deterministic alpha dithering over layers, reduced bleeding
|
||||||
* of transparent values into opaque values, added optional stage to
|
* of transparent values into opaque values, added optional stage to
|
||||||
* remove duplicate or unused colour entries from final colourmap. [Adam]
|
* remove duplicate or unused color entries from final colormap. [Adam]
|
||||||
*
|
*
|
||||||
* 99/02/24 - Many revisions to the box-cut quantizer used in RGB->INDEXED
|
* 99/02/24 - Many revisions to the box-cut quantizer used in RGB->INDEXED
|
||||||
* conversion. Box to be cut is chosen on the basis of possessing an axis
|
* conversion. Box to be cut is chosen on the basis of possessing an axis
|
||||||
|
@ -71,7 +71,7 @@
|
||||||
* 98/07/25 - Convert-to-indexed now remembers the last invocation's
|
* 98/07/25 - Convert-to-indexed now remembers the last invocation's
|
||||||
* settings. Also, GRAY->INDEXED is more flexible. [Adam]
|
* settings. Also, GRAY->INDEXED is more flexible. [Adam]
|
||||||
*
|
*
|
||||||
* 98/07/05 - Sucked the warning about quantizing to too many colours into
|
* 98/07/05 - Sucked the warning about quantizing to too many colors into
|
||||||
* a text widget embedded in the dialog, improved intelligence of dialog
|
* a text widget embedded in the dialog, improved intelligence of dialog
|
||||||
* to default 'custom palette' selection to 'Web' if available, and
|
* to default 'custom palette' selection to 'Web' if available, and
|
||||||
* in this case not bother to present the native WWW-palette radio
|
* in this case not bother to present the native WWW-palette radio
|
||||||
|
@ -86,10 +86,10 @@
|
||||||
* 97/11/14 - added a proper pdb interface and support for dithering
|
* 97/11/14 - added a proper pdb interface and support for dithering
|
||||||
* to custom palettes (based on a patch by Eric Hernes) [Yosh]
|
* to custom palettes (based on a patch by Eric Hernes) [Yosh]
|
||||||
*
|
*
|
||||||
* 97/11/04 - fixed the accidental use of the colour-counting case
|
* 97/11/04 - fixed the accidental use of the color-counting case
|
||||||
* when palette_type is WEB or MONO. [Adam]
|
* when palette_type is WEB or MONO. [Adam]
|
||||||
*
|
*
|
||||||
* 97/10/25 - colour-counting implemented (could use some hashing, but
|
* 97/10/25 - color-counting implemented (could use some hashing, but
|
||||||
* performance actually seems okay) - now RGB->INDEXED conversion isn't
|
* performance actually seems okay) - now RGB->INDEXED conversion isn't
|
||||||
* destructive if it doesn't have to be. [Adam]
|
* destructive if it doesn't have to be. [Adam]
|
||||||
*
|
*
|
||||||
|
@ -848,9 +848,9 @@ gimp_image_convert_type (GimpImage *image,
|
||||||
else
|
else
|
||||||
zero_histogram_rgb (quantobj->histogram);
|
zero_histogram_rgb (quantobj->histogram);
|
||||||
|
|
||||||
/* To begin, assume that there are fewer colours in
|
/* To begin, assume that there are fewer colors in
|
||||||
* the image than the user actually asked for. In that
|
* the image than the user actually asked for. In that
|
||||||
* case, we don't need to quantize or colour-dither.
|
* case, we don't need to quantize or color-dither.
|
||||||
*/
|
*/
|
||||||
needs_quantize = FALSE;
|
needs_quantize = FALSE;
|
||||||
num_found_cols = 0;
|
num_found_cols = 0;
|
||||||
|
@ -871,7 +871,7 @@ gimp_image_convert_type (GimpImage *image,
|
||||||
progress, nth_layer, n_layers);
|
progress, nth_layer, n_layers);
|
||||||
|
|
||||||
/* Note: generate_histogram_rgb may set needs_quantize if
|
/* Note: generate_histogram_rgb may set needs_quantize if
|
||||||
* the image contains more colours than the limit specified
|
* the image contains more colors than the limit specified
|
||||||
* by the user.
|
* by the user.
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
@ -886,7 +886,7 @@ gimp_image_convert_type (GimpImage *image,
|
||||||
palette_type == GIMP_MAKE_PALETTE)
|
palette_type == GIMP_MAKE_PALETTE)
|
||||||
{
|
{
|
||||||
/* If this is an RGB image, and the user wanted a custom-built
|
/* If this is an RGB image, and the user wanted a custom-built
|
||||||
* generated palette, and this image has no more colours than
|
* generated palette, and this image has no more colors than
|
||||||
* the user asked for, we don't need the first pass (quantization).
|
* the user asked for, we don't need the first pass (quantization).
|
||||||
*
|
*
|
||||||
* There's also no point in dithering, since there's no error to
|
* There's also no point in dithering, since there's no error to
|
||||||
|
@ -1333,26 +1333,26 @@ generate_histogram_rgb (CFHistogram histogram,
|
||||||
goto already_found;
|
goto already_found;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Colour was not in the table of
|
/* Color was not in the table of
|
||||||
* existing colours
|
* existing colors
|
||||||
*/
|
*/
|
||||||
|
|
||||||
num_found_cols++;
|
num_found_cols++;
|
||||||
|
|
||||||
if (num_found_cols > col_limit)
|
if (num_found_cols > col_limit)
|
||||||
{
|
{
|
||||||
/* There are more colours in the image
|
/* There are more colors in the image
|
||||||
* than were allowed. We switch to plain
|
* than were allowed. We switch to plain
|
||||||
* histogram calculation with a view to
|
* histogram calculation with a view to
|
||||||
* quantizing at a later stage.
|
* quantizing at a later stage.
|
||||||
*/
|
*/
|
||||||
needs_quantize = TRUE;
|
needs_quantize = TRUE;
|
||||||
/* g_print ("\nmax colours exceeded - needs quantize.\n");*/
|
/* g_print ("\nmax colors exceeded - needs quantize.\n");*/
|
||||||
goto already_found;
|
goto already_found;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* Remember the new colour we just found.
|
/* Remember the new color we just found.
|
||||||
*/
|
*/
|
||||||
found_cols[num_found_cols-1][0] = data[RED];
|
found_cols[num_found_cols-1][0] = data[RED];
|
||||||
found_cols[num_found_cols-1][1] = data[GREEN];
|
found_cols[num_found_cols-1][1] = data[GREEN];
|
||||||
|
@ -1399,14 +1399,14 @@ find_split_candidate (const boxptr boxlist,
|
||||||
*which_axis = AXIS_UNDEF;
|
*which_axis = AXIS_UNDEF;
|
||||||
|
|
||||||
/* we only perform the initial L-split bias /at all/ if the final
|
/* we only perform the initial L-split bias /at all/ if the final
|
||||||
number of desired colours is quite low, otherwise it all comes
|
number of desired colors is quite low, otherwise it all comes
|
||||||
out in the wash anyway and this initial bias generally only hurts
|
out in the wash anyway and this initial bias generally only hurts
|
||||||
us in the long run. */
|
us in the long run. */
|
||||||
if (desired_colors <= 16)
|
if (desired_colors <= 16)
|
||||||
{
|
{
|
||||||
#define BIAS_FACTOR 2.66F
|
#define BIAS_FACTOR 2.66F
|
||||||
#define BIAS_NUMBER 2 /* 0 */
|
#define BIAS_NUMBER 2 /* 0 */
|
||||||
/* we bias towards splitting across L* for first few colours */
|
/* we bias towards splitting across L* for first few colors */
|
||||||
Lbias = (numboxes > BIAS_NUMBER) ? 1.0F : ((double)(BIAS_NUMBER+1) -
|
Lbias = (numboxes > BIAS_NUMBER) ? 1.0F : ((double)(BIAS_NUMBER+1) -
|
||||||
((double)numboxes)) /
|
((double)numboxes)) /
|
||||||
((double)BIAS_NUMBER / BIAS_FACTOR);
|
((double)BIAS_NUMBER / BIAS_FACTOR);
|
||||||
|
@ -2113,7 +2113,7 @@ compute_color_gray (QuantizeObj *quantobj,
|
||||||
}
|
}
|
||||||
else /* The only situation where total==0 is if the image was null or
|
else /* The only situation where total==0 is if the image was null or
|
||||||
* all-transparent. In that case we just put a dummy value in
|
* all-transparent. In that case we just put a dummy value in
|
||||||
* the colourmap.
|
* the colormap.
|
||||||
*/
|
*/
|
||||||
{
|
{
|
||||||
quantobj->cmap[icolor].red =
|
quantobj->cmap[icolor].red =
|
||||||
|
@ -2180,7 +2180,7 @@ compute_color_rgb (QuantizeObj *quantobj,
|
||||||
}
|
}
|
||||||
else /* The only situation where total==0 is if the image was null or
|
else /* The only situation where total==0 is if the image was null or
|
||||||
* all-transparent. In that case we just put a dummy value in
|
* all-transparent. In that case we just put a dummy value in
|
||||||
* the colourmap.
|
* the colormap.
|
||||||
*/
|
*/
|
||||||
{
|
{
|
||||||
quantobj->cmap[icolor].red = 0;
|
quantobj->cmap[icolor].red = 0;
|
||||||
|
@ -2237,7 +2237,7 @@ compute_color_lin8 (QuantizeObj *quantobj,
|
||||||
}
|
}
|
||||||
else /* The only situation where total==0 is if the image was null or
|
else /* The only situation where total==0 is if the image was null or
|
||||||
* all-transparent. In that case we just put a dummy value in
|
* all-transparent. In that case we just put a dummy value in
|
||||||
* the colourmap.
|
* the colormap.
|
||||||
*/
|
*/
|
||||||
{
|
{
|
||||||
g_warning("eep.");
|
g_warning("eep.");
|
||||||
|
@ -3019,16 +3019,16 @@ median_cut_pass2_fixed_dither_gray (QuantizeObj *quantobj,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* not enough colours to bother looking for an 'alternative'
|
/* not enough colors to bother looking for an 'alternative'
|
||||||
colour (we may fail to do so anyway), so decide that
|
color (we may fail to do so anyway), so decide that
|
||||||
the alternative colour is simply the other cmap entry. */
|
the alternative color is simply the other cmap entry. */
|
||||||
pixval2 = (pixval1 + 1) %
|
pixval2 = (pixval1 + 1) %
|
||||||
(quantobj->actual_number_of_colors);
|
(quantobj->actual_number_of_colors);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* always deterministically sort pixval1 and pixval2, to
|
/* always deterministically sort pixval1 and pixval2, to
|
||||||
avoid artifacts in the dither range due to inverting our
|
avoid artifacts in the dither range due to inverting our
|
||||||
relative colour viewpoint -- most obvious in 1-bit dither. */
|
relative color viewpoint -- most obvious in 1-bit dither. */
|
||||||
if (pixval1 > pixval2)
|
if (pixval1 > pixval2)
|
||||||
{
|
{
|
||||||
gint tmpval = pixval1;
|
gint tmpval = pixval1;
|
||||||
|
@ -3333,12 +3333,12 @@ median_cut_pass2_fixed_dither_rgb (QuantizeObj *quantobj,
|
||||||
if (*cachep == 0)
|
if (*cachep == 0)
|
||||||
fill_inverse_cmap_rgb (quantobj, histogram, R, G, B);
|
fill_inverse_cmap_rgb (quantobj, histogram, R, G, B);
|
||||||
|
|
||||||
/* We now try to find a colour which, when mixed in some fashion
|
/* We now try to find a color which, when mixed in some fashion
|
||||||
with the closest match, yields something closer to the
|
with the closest match, yields something closer to the
|
||||||
desired colour. We do this by repeatedly extrapolating the
|
desired color. We do this by repeatedly extrapolating the
|
||||||
colour vector from one to the other until we find another
|
color vector from one to the other until we find another
|
||||||
colour cell. Then we assess the distance of both mixer
|
color cell. Then we assess the distance of both mixer
|
||||||
colours from the intended colour to determine their relative
|
colors from the intended color to determine their relative
|
||||||
probabilities of being chosen. */
|
probabilities of being chosen. */
|
||||||
pixval1 = *cachep - 1;
|
pixval1 = *cachep - 1;
|
||||||
color1 = &quantobj->cmap[pixval1];
|
color1 = &quantobj->cmap[pixval1];
|
||||||
|
@ -3376,16 +3376,16 @@ median_cut_pass2_fixed_dither_rgb (QuantizeObj *quantobj,
|
||||||
|
|
||||||
if (quantobj->actual_number_of_colors <= 2
|
if (quantobj->actual_number_of_colors <= 2
|
||||||
/* || pixval1 == pixval2 */) {
|
/* || pixval1 == pixval2 */) {
|
||||||
/* not enough colours to bother looking for an 'alternative'
|
/* not enough colors to bother looking for an 'alternative'
|
||||||
colour (we may fail to do so anyway), so decide that
|
color (we may fail to do so anyway), so decide that
|
||||||
the alternative colour is simply the other cmap entry. */
|
the alternative color is simply the other cmap entry. */
|
||||||
pixval2 = (pixval1 + 1) %
|
pixval2 = (pixval1 + 1) %
|
||||||
(quantobj->actual_number_of_colors);
|
(quantobj->actual_number_of_colors);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* always deterministically sort pixval1 and pixval2, to
|
/* always deterministically sort pixval1 and pixval2, to
|
||||||
avoid artifacts in the dither range due to inverting our
|
avoid artifacts in the dither range due to inverting our
|
||||||
relative colour viewpoint -- most obvious in 1-bit dither. */
|
relative color viewpoint -- most obvious in 1-bit dither. */
|
||||||
if (pixval1 > pixval2)
|
if (pixval1 > pixval2)
|
||||||
{
|
{
|
||||||
gint tmpval = pixval1;
|
gint tmpval = pixval1;
|
||||||
|
@ -3525,7 +3525,7 @@ median_cut_pass2_nodestruct_dither_rgb (QuantizeObj *quantobj,
|
||||||
(lastgreen == src[green_pix]) &&
|
(lastgreen == src[green_pix]) &&
|
||||||
(lastblue == src[blue_pix]))
|
(lastblue == src[blue_pix]))
|
||||||
{
|
{
|
||||||
/* same pixel colour as last time */
|
/* same pixel color as last time */
|
||||||
dest[INDEXED] = lastindex;
|
dest[INDEXED] = lastindex;
|
||||||
if (has_alpha)
|
if (has_alpha)
|
||||||
dest[ALPHA_I] = 255;
|
dest[ALPHA_I] = 255;
|
||||||
|
@ -3547,12 +3547,12 @@ median_cut_pass2_nodestruct_dither_rgb (QuantizeObj *quantobj,
|
||||||
lastblue = src[blue_pix];
|
lastblue = src[blue_pix];
|
||||||
lastindex = i;
|
lastindex = i;
|
||||||
|
|
||||||
goto got_colour;
|
goto got_color;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
g_error ("Non-existant colour was expected to "
|
g_error ("Non-existant color was expected to "
|
||||||
"be in non-destructive colourmap.");
|
"be in non-destructive colormap.");
|
||||||
got_colour:
|
got_color:
|
||||||
dest[INDEXED] = lastindex;
|
dest[INDEXED] = lastindex;
|
||||||
if (has_alpha)
|
if (has_alpha)
|
||||||
dest[ALPHA_I] = 255;
|
dest[ALPHA_I] = 255;
|
||||||
|
@ -3890,7 +3890,7 @@ median_cut_pass2_rgb_init (QuantizeObj *quantobj)
|
||||||
/* Mark all indices as currently unused */
|
/* Mark all indices as currently unused */
|
||||||
memset (quantobj->index_used_count, 0, 256 * sizeof (unsigned long));
|
memset (quantobj->index_used_count, 0, 256 * sizeof (unsigned long));
|
||||||
|
|
||||||
/* Make a version of our discovered colourmap in linear space */
|
/* Make a version of our discovered colormap in linear space */
|
||||||
for (i = 0; i < quantobj->actual_number_of_colors; i++)
|
for (i = 0; i < quantobj->actual_number_of_colors; i++)
|
||||||
{
|
{
|
||||||
rgb_to_unshifted_lin (quantobj->cmap[i].red,
|
rgb_to_unshifted_lin (quantobj->cmap[i].red,
|
||||||
|
@ -3980,7 +3980,7 @@ median_cut_pass2_fs_dither_rgb (QuantizeObj *quantobj,
|
||||||
error_limiter = init_error_limit (quantobj->error_freedom);
|
error_limiter = init_error_limit (quantobj->error_freedom);
|
||||||
range_limiter = range_array + 256;
|
range_limiter = range_array + 256;
|
||||||
|
|
||||||
/* find the bounding box of the palette colours --
|
/* find the bounding box of the palette colors --
|
||||||
we use this for hard-clamping our error-corrected
|
we use this for hard-clamping our error-corrected
|
||||||
values so that we can't continuously accelerate outside
|
values so that we can't continuously accelerate outside
|
||||||
of our attainable gamut, which looks icky. */
|
of our attainable gamut, which looks icky. */
|
||||||
|
@ -4194,7 +4194,7 @@ median_cut_pass2_fs_dither_rgb (QuantizeObj *quantobj,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* colour pretty much undefined now; nullify error. */
|
/* color pretty much undefined now; nullify error. */
|
||||||
re = ge = be = 0;
|
re = ge = be = 0;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -70,7 +70,7 @@ cie94 (gfloat* src1,
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* CIE 2000 delta E colour comparison
|
* CIE 2000 delta E color comparison
|
||||||
*/
|
*/
|
||||||
static gdouble
|
static gdouble
|
||||||
delta_e (gfloat* src1,
|
delta_e (gfloat* src1,
|
||||||
|
|
|
@ -108,7 +108,7 @@ static GimpImageBaseType imagetype;
|
||||||
static GimpImageType drawabletype_alpha;
|
static GimpImageType drawabletype_alpha;
|
||||||
static guchar pixelstep;
|
static guchar pixelstep;
|
||||||
static guchar *palette;
|
static guchar *palette;
|
||||||
static gint ncolours;
|
static gint ncolors;
|
||||||
static operatingMode opmode;
|
static operatingMode opmode;
|
||||||
|
|
||||||
|
|
||||||
|
@ -467,8 +467,8 @@ do_optimizations (GimpRunMode run_mode,
|
||||||
|
|
||||||
if (imagetype == GIMP_INDEXED)
|
if (imagetype == GIMP_INDEXED)
|
||||||
{
|
{
|
||||||
palette = gimp_image_get_colormap (image_id, &ncolours);
|
palette = gimp_image_get_colormap (image_id, &ncolors);
|
||||||
gimp_image_set_colormap (new_image_id, palette, ncolours);
|
gimp_image_set_colormap (new_image_id, palette, ncolors);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 1
|
#if 1
|
||||||
|
@ -483,7 +483,7 @@ do_optimizations (GimpRunMode run_mode,
|
||||||
guchar **green;
|
guchar **green;
|
||||||
guchar **blue;
|
guchar **blue;
|
||||||
guint **count;
|
guint **count;
|
||||||
guint *num_colours;
|
guint *num_colors;
|
||||||
|
|
||||||
these_rows = g_new (guchar *, total_frames);
|
these_rows = g_new (guchar *, total_frames);
|
||||||
red = g_new (guchar *, total_frames);
|
red = g_new (guchar *, total_frames);
|
||||||
|
@ -491,7 +491,7 @@ do_optimizations (GimpRunMode run_mode,
|
||||||
blue = g_new (guchar *, total_frames);
|
blue = g_new (guchar *, total_frames);
|
||||||
count = g_new (guint *, total_frames);
|
count = g_new (guint *, total_frames);
|
||||||
|
|
||||||
num_colours = g_new (guint, width);
|
num_colors = g_new (guint, width);
|
||||||
|
|
||||||
for (this_frame_num=0; this_frame_num<total_frames; this_frame_num++)
|
for (this_frame_num=0; this_frame_num<total_frames; this_frame_num++)
|
||||||
{
|
{
|
||||||
|
@ -506,7 +506,7 @@ do_optimizations (GimpRunMode run_mode,
|
||||||
|
|
||||||
for (row = 0; row < height; row++)
|
for (row = 0; row < height; row++)
|
||||||
{
|
{
|
||||||
memset(num_colours, 0, width * sizeof(guint));
|
memset(num_colors, 0, width * sizeof(guint));
|
||||||
|
|
||||||
for (this_frame_num=0; this_frame_num<total_frames; this_frame_num++)
|
for (this_frame_num=0; this_frame_num<total_frames; this_frame_num++)
|
||||||
{
|
{
|
||||||
|
@ -534,7 +534,7 @@ do_optimizations (GimpRunMode run_mode,
|
||||||
if (these_rows[this_frame_num][i * pixelstep + pixelstep -1]
|
if (these_rows[this_frame_num][i * pixelstep + pixelstep -1]
|
||||||
>= 128)
|
>= 128)
|
||||||
{
|
{
|
||||||
for (j=0; j<num_colours[i]; j++)
|
for (j=0; j<num_colors[i]; j++)
|
||||||
{
|
{
|
||||||
|
|
||||||
switch (pixelstep)
|
switch (pixelstep)
|
||||||
|
@ -565,17 +565,17 @@ do_optimizations (GimpRunMode run_mode,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
count[num_colours[i]][i] = 1;
|
count[num_colors[i]][i] = 1;
|
||||||
red[num_colours[i]][i] =
|
red[num_colors[i]][i] =
|
||||||
these_rows[this_frame_num][i * pixelstep];
|
these_rows[this_frame_num][i * pixelstep];
|
||||||
if (pixelstep == 4)
|
if (pixelstep == 4)
|
||||||
{
|
{
|
||||||
green[num_colours[i]][i] =
|
green[num_colors[i]][i] =
|
||||||
these_rows[this_frame_num][i * 4 +1];
|
these_rows[this_frame_num][i * 4 +1];
|
||||||
blue[num_colours[i]][i] =
|
blue[num_colors[i]][i] =
|
||||||
these_rows[this_frame_num][i * 4 +2];
|
these_rows[this_frame_num][i * 4 +2];
|
||||||
}
|
}
|
||||||
num_colours[i]++;
|
num_colors[i]++;
|
||||||
}
|
}
|
||||||
same:
|
same:
|
||||||
/* nop */;
|
/* nop */;
|
||||||
|
@ -587,7 +587,7 @@ do_optimizations (GimpRunMode run_mode,
|
||||||
guint best_count = 0;
|
guint best_count = 0;
|
||||||
guchar best_r = 255, best_g = 0, best_b = 255;
|
guchar best_r = 255, best_g = 0, best_b = 255;
|
||||||
|
|
||||||
for (j=0; j<num_colours[i]; j++)
|
for (j=0; j<num_colors[i]; j++)
|
||||||
{
|
{
|
||||||
if (count[j][i] > best_count)
|
if (count[j][i] > best_count)
|
||||||
{
|
{
|
||||||
|
@ -631,7 +631,7 @@ do_optimizations (GimpRunMode run_mode,
|
||||||
g_free (green);
|
g_free (green);
|
||||||
g_free (blue);
|
g_free (blue);
|
||||||
g_free (count);
|
g_free (count);
|
||||||
g_free (num_colours);
|
g_free (num_colors);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -802,7 +802,7 @@ do_optimizations (GimpRunMode run_mode,
|
||||||
goto decided;
|
goto decided;
|
||||||
}
|
}
|
||||||
/* If 'last' and 'this' are opaque, we have
|
/* If 'last' and 'this' are opaque, we have
|
||||||
* to check if they're the same colour - we
|
* to check if they're the same color - we
|
||||||
* only have to keep the pixel if 'last' or
|
* only have to keep the pixel if 'last' or
|
||||||
* 'this' are opaque and different.
|
* 'this' are opaque and different.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -159,7 +159,7 @@ static gint32 *layers = NULL;
|
||||||
static gint32 total_layers = 0;
|
static gint32 total_layers = 0;
|
||||||
static GimpImageBaseType imagetype;
|
static GimpImageBaseType imagetype;
|
||||||
static guchar *palette = NULL;
|
static guchar *palette = NULL;
|
||||||
static gint ncolours;
|
static gint ncolors;
|
||||||
|
|
||||||
static GtkWidget *drawing_area = NULL;
|
static GtkWidget *drawing_area = NULL;
|
||||||
static guchar *drawing_area_data = NULL;
|
static guchar *drawing_area_data = NULL;
|
||||||
|
@ -1098,7 +1098,7 @@ initialize (void)
|
||||||
|
|
||||||
if (imagetype == GIMP_INDEXED)
|
if (imagetype == GIMP_INDEXED)
|
||||||
{
|
{
|
||||||
palette = gimp_image_get_colormap (image_id, &ncolours);
|
palette = gimp_image_get_colormap (image_id, &ncolors);
|
||||||
}
|
}
|
||||||
else if (imagetype == GIMP_GRAY)
|
else if (imagetype == GIMP_GRAY)
|
||||||
{
|
{
|
||||||
|
@ -1109,7 +1109,7 @@ initialize (void)
|
||||||
for (i = 0; i < 256; i++)
|
for (i = 0; i < 256; i++)
|
||||||
palette[i * 3] = palette[i * 3 + 1] = palette[i * 3 + 2] = i;
|
palette[i * 3] = palette[i * 3 + 1] = palette[i * 3 + 2] = i;
|
||||||
|
|
||||||
ncolours = 256;
|
ncolors = 256;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!window)
|
if (!window)
|
||||||
|
|
|
@ -354,7 +354,7 @@ blindsapply (guchar *srow,
|
||||||
/* The angle is the conceptual 'rotation' of each of these segments */
|
/* The angle is the conceptual 'rotation' of each of these segments */
|
||||||
|
|
||||||
/* Note the row is considered to be made up of a two dim array actual
|
/* Note the row is considered to be made up of a two dim array actual
|
||||||
* pixel locations and the RGB colour at these locations.
|
* pixel locations and the RGB color at these locations.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* In the process copy the src row to the destination row */
|
/* In the process copy the src row to the destination row */
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
* to another while keeping the original image visually unmodified.
|
* to another while keeping the original image visually unmodified.
|
||||||
*
|
*
|
||||||
* Such functionality is useful for creating graphics files for applications
|
* Such functionality is useful for creating graphics files for applications
|
||||||
* which expect certain indices to contain some specific colours.
|
* which expect certain indices to contain some specific colors.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
@ -22,10 +22,10 @@
|
||||||
|
|
||||||
|
|
||||||
/* This plugin performs almost the same operation as the 'contrast
|
/* This plugin performs almost the same operation as the 'contrast
|
||||||
* autostretch' plugin, except that it won't allow the colour channels
|
* autostretch' plugin, except that it won't allow the color channels
|
||||||
* to normalize independently. This is actually what most people probably
|
* to normalize independently. This is actually what most people probably
|
||||||
* want instead of contrast-autostretch; use c-a only if you wish to remove
|
* want instead of contrast-autostretch; use c-a only if you wish to remove
|
||||||
* an undesirable colour-tint from a source image which is supposed to
|
* an undesirable color-tint from a source image which is supposed to
|
||||||
* contain pure-white and pure-black.
|
* contain pure-white and pure-black.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
@ -322,7 +322,7 @@ load_image (const gchar *file,
|
||||||
bpp; /* Bits per pixel */
|
bpp; /* Bits per pixel */
|
||||||
gint height, width, /* Dimensions of image */
|
gint height, width, /* Dimensions of image */
|
||||||
offx, offy, /* Layer offets */
|
offx, offy, /* Layer offets */
|
||||||
colours; /* Number of colours */
|
colors; /* Number of colors */
|
||||||
|
|
||||||
gint32 image, /* Image */
|
gint32 image, /* Image */
|
||||||
layer; /* Layer */
|
layer; /* Layer */
|
||||||
|
@ -361,7 +361,7 @@ load_image (const gchar *file,
|
||||||
|
|
||||||
if (strncmp ((const gchar *) header, "KiSS", 4))
|
if (strncmp ((const gchar *) header, "KiSS", 4))
|
||||||
{
|
{
|
||||||
colours= 16;
|
colors= 16;
|
||||||
bpp = 4;
|
bpp = 4;
|
||||||
width = header[0] + (256 * header[1]);
|
width = header[0] + (256 * header[1]);
|
||||||
height = header[2] + (256 * header[3]);
|
height = header[2] + (256 * header[3]);
|
||||||
|
@ -393,7 +393,7 @@ load_image (const gchar *file,
|
||||||
case 4:
|
case 4:
|
||||||
case 8:
|
case 8:
|
||||||
case 32:
|
case 32:
|
||||||
colours = (1 << bpp);
|
colors = (1 << bpp);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
|
g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
|
||||||
|
@ -579,20 +579,20 @@ load_image (const gchar *file,
|
||||||
|
|
||||||
if (fp != NULL)
|
if (fp != NULL)
|
||||||
{
|
{
|
||||||
colours = load_palette (palette_file, fp, palette, error);
|
colors = load_palette (palette_file, fp, palette, error);
|
||||||
fclose (fp);
|
fclose (fp);
|
||||||
if (colours < 0 || *error)
|
if (colors < 0 || *error)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
for (i= 0; i < colours; ++i)
|
for (i= 0; i < colors; ++i)
|
||||||
{
|
{
|
||||||
palette[i * 3] = palette[i * 3 + 1] = palette[i * 3 + 2]= i * 256 / colours;
|
palette[i * 3] = palette[i * 3 + 1] = palette[i * 3 + 2]= i * 256 / colors;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
gimp_image_set_colormap (image, palette + 3, colours - 1);
|
gimp_image_set_colormap (image, palette + 3, colors - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Now get everything redrawn and hand back the finished image */
|
/* Now get everything redrawn and hand back the finished image */
|
||||||
|
@ -613,7 +613,7 @@ load_palette (const gchar *file,
|
||||||
guchar header[32]; /* File header */
|
guchar header[32]; /* File header */
|
||||||
guchar buffer[2];
|
guchar buffer[2];
|
||||||
guchar file_mark, bpp;
|
guchar file_mark, bpp;
|
||||||
gint i, colours = 0;
|
gint i, colors = 0;
|
||||||
size_t n_read;
|
size_t n_read;
|
||||||
|
|
||||||
n_read = fread (header, 4, 1, fp);
|
n_read = fread (header, 4, 1, fp);
|
||||||
|
@ -656,19 +656,19 @@ load_palette (const gchar *file,
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
colours = header[8] + header[9] * 256;
|
colors = header[8] + header[9] * 256;
|
||||||
if (colours != 16 && colours != 256)
|
if (colors != 16 && colors != 256)
|
||||||
{
|
{
|
||||||
g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
|
g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
|
||||||
_("'%s': illegal number of colors: %u"),
|
_("'%s': illegal number of colors: %u"),
|
||||||
gimp_filename_to_utf8 (file), colours);
|
gimp_filename_to_utf8 (file), colors);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (bpp)
|
switch (bpp)
|
||||||
{
|
{
|
||||||
case 12:
|
case 12:
|
||||||
for (i = 0; i < colours; ++i)
|
for (i = 0; i < colors; ++i)
|
||||||
{
|
{
|
||||||
n_read = fread (buffer, 1, 2, fp);
|
n_read = fread (buffer, 1, 2, fp);
|
||||||
|
|
||||||
|
@ -687,7 +687,7 @@ load_palette (const gchar *file,
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 24:
|
case 24:
|
||||||
n_read = fread (palette, colours, 3, fp);
|
n_read = fread (palette, colors, 3, fp);
|
||||||
|
|
||||||
if (n_read < 3)
|
if (n_read < 3)
|
||||||
{
|
{
|
||||||
|
@ -703,9 +703,9 @@ load_palette (const gchar *file,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
colours = 16;
|
colors = 16;
|
||||||
fseek (fp, 0, SEEK_SET);
|
fseek (fp, 0, SEEK_SET);
|
||||||
for (i= 0; i < colours; ++i)
|
for (i= 0; i < colors; ++i)
|
||||||
{
|
{
|
||||||
n_read = fread (buffer, 1, 2, fp);
|
n_read = fread (buffer, 1, 2, fp);
|
||||||
|
|
||||||
|
@ -723,7 +723,7 @@ load_palette (const gchar *file,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return colours;
|
return colors;
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
|
@ -739,7 +739,7 @@ save_image (const gchar *file,
|
||||||
gint height;
|
gint height;
|
||||||
guchar header[32]; /* File header */
|
guchar header[32]; /* File header */
|
||||||
gint bpp; /* Bit per pixel */
|
gint bpp; /* Bit per pixel */
|
||||||
gint colours, type; /* Number of colours, type of layer */
|
gint colors, type; /* Number of colors, type of layer */
|
||||||
gint offx, offy; /* Layer offsets */
|
gint offx, offy; /* Layer offsets */
|
||||||
guchar *buf; /* Temporary buffer */
|
guchar *buf; /* Temporary buffer */
|
||||||
guchar *line; /* Pixel data */
|
guchar *line; /* Pixel data */
|
||||||
|
@ -789,9 +789,9 @@ save_image (const gchar *file,
|
||||||
/* Work out whether to save as 8bit or 4bit */
|
/* Work out whether to save as 8bit or 4bit */
|
||||||
if (bpp < 32)
|
if (bpp < 32)
|
||||||
{
|
{
|
||||||
g_free (gimp_image_get_colormap (image, &colours));
|
g_free (gimp_image_get_colormap (image, &colors));
|
||||||
|
|
||||||
if (colours > 15)
|
if (colors > 15)
|
||||||
{
|
{
|
||||||
header[5] = 8;
|
header[5] = 8;
|
||||||
}
|
}
|
||||||
|
@ -841,7 +841,7 @@ save_image (const gchar *file,
|
||||||
|
|
||||||
fwrite (buf, width, 4, fp);
|
fwrite (buf, width, 4, fp);
|
||||||
}
|
}
|
||||||
else if (colours > 16)
|
else if (colors > 16)
|
||||||
{
|
{
|
||||||
for (j = 0, k = 0; j < width * 2; j += 2, ++k)
|
for (j = 0, k = 0; j < width * 2; j += 2, ++k)
|
||||||
{
|
{
|
||||||
|
|
|
@ -60,7 +60,7 @@
|
||||||
*
|
*
|
||||||
* - PDB stuff for comments
|
* - PDB stuff for comments
|
||||||
*
|
*
|
||||||
* - Remove unused colourmap entries for GRAYSCALE images.
|
* - Remove unused colormap entries for GRAYSCALE images.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
@ -219,8 +219,8 @@ run (const gchar *name,
|
||||||
* So if we're not careful, repeated load/save of a transparent GIF
|
* So if we're not careful, repeated load/save of a transparent GIF
|
||||||
* without intermediate indexed->RGB->indexed pumps up the number of
|
* without intermediate indexed->RGB->indexed pumps up the number of
|
||||||
* bits used, as we add an index each time for the transparent
|
* bits used, as we add an index each time for the transparent
|
||||||
* colour. Ouch. We either do some heavier analysis at save-time,
|
* color. Ouch. We either do some heavier analysis at save-time,
|
||||||
* or trim down the number of GIMP colours at load-time. We do the
|
* or trim down the number of GIMP colors at load-time. We do the
|
||||||
* latter for now.
|
* latter for now.
|
||||||
*/
|
*/
|
||||||
#ifdef GIFDEBUG
|
#ifdef GIFDEBUG
|
||||||
|
@ -970,7 +970,7 @@ ReadImage (FILE *fd,
|
||||||
frame_number);
|
frame_number);
|
||||||
gimp_progress_pulse ();
|
gimp_progress_pulse ();
|
||||||
|
|
||||||
/* If the colourmap is now different, we have to promote to RGB! */
|
/* If the colormap is now different, we have to promote to RGB! */
|
||||||
if (! promote_to_rgb)
|
if (! promote_to_rgb)
|
||||||
{
|
{
|
||||||
for (i = 0; i < ncols; i++)
|
for (i = 0; i < ncols; i++)
|
||||||
|
|
|
@ -343,7 +343,7 @@ run (const gchar *name,
|
||||||
typedef int (*ifunptr) (int, int);
|
typedef int (*ifunptr) (int, int);
|
||||||
|
|
||||||
|
|
||||||
static gint find_unused_ia_colour (const guchar *pixels,
|
static gint find_unused_ia_color (const guchar *pixels,
|
||||||
gint numpixels,
|
gint numpixels,
|
||||||
gint num_indices,
|
gint num_indices,
|
||||||
gint *colors);
|
gint *colors);
|
||||||
|
@ -395,7 +395,7 @@ static void flush_char (void);
|
||||||
|
|
||||||
|
|
||||||
static gint
|
static gint
|
||||||
find_unused_ia_colour (const guchar *pixels,
|
find_unused_ia_color (const guchar *pixels,
|
||||||
gint numpixels,
|
gint numpixels,
|
||||||
gint num_indices,
|
gint num_indices,
|
||||||
gint *colors)
|
gint *colors)
|
||||||
|
@ -422,21 +422,21 @@ find_unused_ia_colour (const guchar *pixels,
|
||||||
if (! ix_used[i])
|
if (! ix_used[i])
|
||||||
{
|
{
|
||||||
#ifdef GIFDEBUG
|
#ifdef GIFDEBUG
|
||||||
g_printerr ("GIF: Found unused colour index %d.\n", (int) i);
|
g_printerr ("GIF: Found unused color index %d.\n", (int) i);
|
||||||
#endif
|
#endif
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Couldn't find an unused colour index within the number of
|
/* Couldn't find an unused color index within the number of
|
||||||
bits per pixel we wanted. Will have to increment the number
|
bits per pixel we wanted. Will have to increment the number
|
||||||
of colours in the image and assign a transparent pixel there. */
|
of colors in the image and assign a transparent pixel there. */
|
||||||
if (*colors < 256)
|
if (*colors < 256)
|
||||||
{
|
{
|
||||||
(*colors)++;
|
(*colors)++;
|
||||||
|
|
||||||
g_printerr ("GIF: 2nd pass "
|
g_printerr ("GIF: 2nd pass "
|
||||||
"- Increasing bounds and using colour index %d.\n",
|
"- Increasing bounds and using color index %d.\n",
|
||||||
*colors - 1);
|
*colors - 1);
|
||||||
return ((*colors) - 1);
|
return ((*colors) - 1);
|
||||||
}
|
}
|
||||||
|
@ -455,7 +455,7 @@ special_flatten_indexed_alpha (guchar *pixels,
|
||||||
guint32 i;
|
guint32 i;
|
||||||
|
|
||||||
/* Each transparent pixel in the image is mapped to a uniform value for
|
/* Each transparent pixel in the image is mapped to a uniform value for
|
||||||
encoding, if image already has <=255 colours */
|
encoding, if image already has <=255 colors */
|
||||||
|
|
||||||
if (transparent == -1) /* tough, no indices left for the trans. index */
|
if (transparent == -1) /* tough, no indices left for the trans. index */
|
||||||
{
|
{
|
||||||
|
@ -737,7 +737,7 @@ save_image (const gchar *filename,
|
||||||
|
|
||||||
|
|
||||||
/* find earliest index in palette which is closest to the background
|
/* find earliest index in palette which is closest to the background
|
||||||
colour, and ATTEMPT to use that as the GIF's default background colour. */
|
color, and ATTEMPT to use that as the GIF's default background color. */
|
||||||
for (i = 255; i >= 0; --i)
|
for (i = 255; i >= 0; --i)
|
||||||
{
|
{
|
||||||
guint local_error = 0;
|
guint local_error = 0;
|
||||||
|
@ -787,7 +787,7 @@ save_image (const gchar *filename,
|
||||||
|
|
||||||
if (drawable_type == GIMP_INDEXEDA_IMAGE)
|
if (drawable_type == GIMP_INDEXEDA_IMAGE)
|
||||||
{
|
{
|
||||||
g_printerr ("GIF: Too many colours?\n");
|
g_printerr ("GIF: Too many colors?\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -841,7 +841,7 @@ save_image (const gchar *filename,
|
||||||
image, for a transparency index. */
|
image, for a transparency index. */
|
||||||
|
|
||||||
transparent =
|
transparent =
|
||||||
find_unused_ia_colour (pixels,
|
find_unused_ia_color (pixels,
|
||||||
cols * rows,
|
cols * rows,
|
||||||
bpp_to_colors (colors_to_bpp (colors)),
|
bpp_to_colors (colors_to_bpp (colors)),
|
||||||
&colors);
|
&colors);
|
||||||
|
@ -1221,7 +1221,7 @@ colors_to_bpp (int colors)
|
||||||
bpp = 8;
|
bpp = 8;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
g_warning ("GIF: colors_to_bpp - Eep! too many colours: %d\n", colors);
|
g_warning ("GIF: colors_to_bpp - Eep! too many colors: %d\n", colors);
|
||||||
return 8;
|
return 8;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1409,7 +1409,7 @@ gif_encode_header (FILE *fp,
|
||||||
put_word (RHeight, fp);
|
put_word (RHeight, fp);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Indicate that there is a global colour map
|
* Indicate that there is a global color map
|
||||||
*/
|
*/
|
||||||
B = 0x80; /* Yes, there is a color map */
|
B = 0x80; /* Yes, there is a color map */
|
||||||
|
|
||||||
|
@ -1429,7 +1429,7 @@ gif_encode_header (FILE *fp,
|
||||||
fputc (B, fp);
|
fputc (B, fp);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Write out the Background colour
|
* Write out the Background color
|
||||||
*/
|
*/
|
||||||
fputc (Background, fp);
|
fputc (Background, fp);
|
||||||
|
|
||||||
|
@ -1439,7 +1439,7 @@ gif_encode_header (FILE *fp,
|
||||||
fputc (0, fp);
|
fputc (0, fp);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Write out the Global Colour Map
|
* Write out the Global Color Map
|
||||||
*/
|
*/
|
||||||
for (i = 0; i < ColorMapSize; i++)
|
for (i = 0; i < ColorMapSize; i++)
|
||||||
{
|
{
|
||||||
|
@ -1480,7 +1480,7 @@ gif_encode_graphic_control_ext (FILE *fp,
|
||||||
curx = cury = 0;
|
curx = cury = 0;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Write out extension for transparent colour index, if necessary.
|
* Write out extension for transparent color index, if necessary.
|
||||||
*/
|
*/
|
||||||
if ( (Transparent >= 0) || (NumFramesInImage > 1) )
|
if ( (Transparent >= 0) || (NumFramesInImage > 1) )
|
||||||
{
|
{
|
||||||
|
|
|
@ -175,7 +175,7 @@ load_image (const gchar *filename,
|
||||||
gint width;
|
gint width;
|
||||||
gint height;
|
gint height;
|
||||||
gint num_components;
|
gint num_components;
|
||||||
gint colourspace_family;
|
gint colorspace_family;
|
||||||
GeglBuffer *buffer;
|
GeglBuffer *buffer;
|
||||||
gint i, j, k;
|
gint i, j, k;
|
||||||
guchar *pixels;
|
guchar *pixels;
|
||||||
|
@ -223,8 +223,8 @@ load_image (const gchar *filename,
|
||||||
height = jas_image_height (image);
|
height = jas_image_height (image);
|
||||||
|
|
||||||
/* determine image type */
|
/* determine image type */
|
||||||
colourspace_family = jas_clrspc_fam (jas_image_clrspc (image));
|
colorspace_family = jas_clrspc_fam (jas_image_clrspc (image));
|
||||||
switch (colourspace_family)
|
switch (colorspace_family)
|
||||||
{
|
{
|
||||||
case JAS_CLRSPC_FAM_GRAY:
|
case JAS_CLRSPC_FAM_GRAY:
|
||||||
base_type = GIMP_GRAY;
|
base_type = GIMP_GRAY;
|
||||||
|
|
|
@ -200,7 +200,7 @@ static mng_bool mywritedata (mng_handle handle,
|
||||||
static gint32 parse_chunks_type_from_layer_name (const gchar *str);
|
static gint32 parse_chunks_type_from_layer_name (const gchar *str);
|
||||||
static gint32 parse_disposal_type_from_layer_name (const gchar *str);
|
static gint32 parse_disposal_type_from_layer_name (const gchar *str);
|
||||||
static gint32 parse_ms_tag_from_layer_name (const gchar *str);
|
static gint32 parse_ms_tag_from_layer_name (const gchar *str);
|
||||||
static gint find_unused_ia_colour (guchar *pixels,
|
static gint find_unused_ia_color (guchar *pixels,
|
||||||
gint numpixels,
|
gint numpixels,
|
||||||
gint *colors);
|
gint *colors);
|
||||||
static gboolean ia_has_transparent_pixels (guchar *pixels,
|
static gboolean ia_has_transparent_pixels (guchar *pixels,
|
||||||
|
@ -364,11 +364,11 @@ parse_ms_tag_from_layer_name (const gchar *str)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Try to find a colour in the palette which isn't actually
|
/* Try to find a color in the palette which isn't actually
|
||||||
* used in the image, so that we can use it as the transparency
|
* used in the image, so that we can use it as the transparency
|
||||||
* index. Taken from png.c */
|
* index. Taken from png.c */
|
||||||
static gint
|
static gint
|
||||||
find_unused_ia_colour (guchar *pixels,
|
find_unused_ia_color (guchar *pixels,
|
||||||
gint numpixels,
|
gint numpixels,
|
||||||
gint *colors)
|
gint *colors)
|
||||||
{
|
{
|
||||||
|
@ -383,7 +383,7 @@ find_unused_ia_colour (guchar *pixels,
|
||||||
|
|
||||||
for (i = 0; i < numpixels; i++)
|
for (i = 0; i < numpixels; i++)
|
||||||
{
|
{
|
||||||
/* If alpha is over a threshold, the colour index in the
|
/* If alpha is over a threshold, the color index in the
|
||||||
* palette is taken. Otherwise, this pixel is transparent. */
|
* palette is taken. Otherwise, this pixel is transparent. */
|
||||||
if (pixels[i * 2 + 1] > 127)
|
if (pixels[i * 2 + 1] > 127)
|
||||||
ix_used[pixels[i * 2]] = TRUE;
|
ix_used[pixels[i * 2]] = TRUE;
|
||||||
|
@ -403,9 +403,9 @@ find_unused_ia_colour (guchar *pixels,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Couldn't find an unused colour index within the number of
|
/* Couldn't find an unused color index within the number of
|
||||||
bits per pixel we wanted. Will have to increment the number
|
bits per pixel we wanted. Will have to increment the number
|
||||||
of colours in the image and assign a transparent pixel there. */
|
of colors in the image and assign a transparent pixel there. */
|
||||||
if ((*colors) < 256)
|
if ((*colors) < 256)
|
||||||
{
|
{
|
||||||
(*colors)++;
|
(*colors)++;
|
||||||
|
@ -487,7 +487,7 @@ respin_cmap (png_structp pp,
|
||||||
|
|
||||||
if (ia_has_transparent_pixels (pixels, numpixels))
|
if (ia_has_transparent_pixels (pixels, numpixels))
|
||||||
{
|
{
|
||||||
transparent = find_unused_ia_colour (pixels, numpixels, &colors);
|
transparent = find_unused_ia_color (pixels, numpixels, &colors);
|
||||||
|
|
||||||
if (transparent != -1)
|
if (transparent != -1)
|
||||||
{
|
{
|
||||||
|
|
|
@ -36,7 +36,7 @@
|
||||||
* - 8-bit (.matte, .alpha, or .mask) images
|
* - 8-bit (.matte, .alpha, or .mask) images
|
||||||
*
|
*
|
||||||
* NOTE: pix and matte files do not support alpha channels or indexed
|
* NOTE: pix and matte files do not support alpha channels or indexed
|
||||||
* colour, so neither does this plug-in
|
* color, so neither does this plug-in
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
|
@ -1133,7 +1133,7 @@ load_image (const gchar *filename,
|
||||||
|
|
||||||
#if defined(PNG_iCCP_SUPPORTED)
|
#if defined(PNG_iCCP_SUPPORTED)
|
||||||
/*
|
/*
|
||||||
* Get the iCCP (colour profile) chunk, if any, and attach it as
|
* Get the iCCP (color profile) chunk, if any, and attach it as
|
||||||
* a parasite
|
* a parasite
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
@ -904,7 +904,7 @@ pnmsaverow_ascii_pbm (PNMRowInfo *ri,
|
||||||
write (ri->fd, ri->rowbuf, len);
|
write (ri->fd, ri->rowbuf, len);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Writes out RGB and greyscale raw rows */
|
/* Writes out RGB and grayscale raw rows */
|
||||||
static void
|
static void
|
||||||
pnmsaverow_raw (PNMRowInfo *ri,
|
pnmsaverow_raw (PNMRowInfo *ri,
|
||||||
const guchar *data)
|
const guchar *data)
|
||||||
|
@ -930,7 +930,7 @@ pnmsaverow_raw_indexed (PNMRowInfo *ri,
|
||||||
write (ri->fd, ri->rowbuf, ri->xres * 3);
|
write (ri->fd, ri->rowbuf, ri->xres * 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Writes out RGB and greyscale ascii rows */
|
/* Writes out RGB and grayscale ascii rows */
|
||||||
static void
|
static void
|
||||||
pnmsaverow_ascii (PNMRowInfo *ri,
|
pnmsaverow_ascii (PNMRowInfo *ri,
|
||||||
const guchar *data)
|
const guchar *data)
|
||||||
|
@ -947,7 +947,7 @@ pnmsaverow_ascii (PNMRowInfo *ri,
|
||||||
write (ri->fd, ri->rowbuf, strlen ((gchar *) ri->rowbuf));
|
write (ri->fd, ri->rowbuf, strlen ((gchar *) ri->rowbuf));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Writes out RGB and greyscale ascii rows */
|
/* Writes out RGB and grayscale ascii rows */
|
||||||
static void
|
static void
|
||||||
pnmsaverow_ascii_indexed (PNMRowInfo *ri,
|
pnmsaverow_ascii_indexed (PNMRowInfo *ri,
|
||||||
const guchar *data)
|
const guchar *data)
|
||||||
|
|
|
@ -125,7 +125,7 @@ static PSLoadVals plvals =
|
||||||
826, 1170, /* default width/height (A4) */
|
826, 1170, /* default width/height (A4) */
|
||||||
TRUE, /* try to use BoundingBox */
|
TRUE, /* try to use BoundingBox */
|
||||||
"1", /* pages to load */
|
"1", /* pages to load */
|
||||||
6, /* use ppm (colour) */
|
6, /* use ppm (color) */
|
||||||
1, /* dont use text antialiasing */
|
1, /* dont use text antialiasing */
|
||||||
1 /* dont use graphics antialiasing */
|
1 /* dont use graphics antialiasing */
|
||||||
};
|
};
|
||||||
|
@ -535,7 +535,7 @@ query (void)
|
||||||
{ GIMP_PDB_INT32, "height", "Desired height" },
|
{ GIMP_PDB_INT32, "height", "Desired height" },
|
||||||
{ GIMP_PDB_INT32, "check-bbox", "0: Use width/height, 1: Use BoundingBox" },
|
{ GIMP_PDB_INT32, "check-bbox", "0: Use width/height, 1: Use BoundingBox" },
|
||||||
{ GIMP_PDB_STRING, "pages", "Pages to load (e.g.: 1,3,5-7)" },
|
{ GIMP_PDB_STRING, "pages", "Pages to load (e.g.: 1,3,5-7)" },
|
||||||
{ GIMP_PDB_INT32, "coloring", "4: b/w, 5: grey, 6: colour image, 7: automatic" },
|
{ GIMP_PDB_INT32, "coloring", "4: b/w, 5: grey, 6: color image, 7: automatic" },
|
||||||
{ GIMP_PDB_INT32, "text-alpha-bits", "1, 2, or 4" },
|
{ GIMP_PDB_INT32, "text-alpha-bits", "1, 2, or 4" },
|
||||||
{ GIMP_PDB_INT32, "graphic-alpha-bits", "1, 2, or 4" }
|
{ GIMP_PDB_INT32, "graphic-alpha-bits", "1, 2, or 4" }
|
||||||
};
|
};
|
||||||
|
@ -1001,7 +1001,7 @@ load_image (const gchar *filename,
|
||||||
g_print ("load_image:\n resolution = %d\n", plvals.resolution);
|
g_print ("load_image:\n resolution = %d\n", plvals.resolution);
|
||||||
g_print (" %dx%d pixels\n", plvals.width, plvals.height);
|
g_print (" %dx%d pixels\n", plvals.width, plvals.height);
|
||||||
g_print (" BoundingBox: %d\n", plvals.use_bbox);
|
g_print (" BoundingBox: %d\n", plvals.use_bbox);
|
||||||
g_print (" Colouring: %d\n", plvals.pnm_type);
|
g_print (" Coloring: %d\n", plvals.pnm_type);
|
||||||
g_print (" TextAlphaBits: %d\n", plvals.textalpha);
|
g_print (" TextAlphaBits: %d\n", plvals.textalpha);
|
||||||
g_print (" GraphicsAlphaBits: %d\n", plvals.graphicsalpha);
|
g_print (" GraphicsAlphaBits: %d\n", plvals.graphicsalpha);
|
||||||
#endif
|
#endif
|
||||||
|
@ -2180,7 +2180,7 @@ save_ps_trailer (FILE *ofp)
|
||||||
fprintf (ofp, "end\n%%%%EOF\n");
|
fprintf (ofp, "end\n%%%%EOF\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Do a Floyd-Steinberg dithering on a greyscale scanline. */
|
/* Do a Floyd-Steinberg dithering on a grayscale scanline. */
|
||||||
/* linecount must keep the counter for the actual scanline (0, 1, 2, ...). */
|
/* linecount must keep the counter for the actual scanline (0, 1, 2, ...). */
|
||||||
/* If linecount is less than zero, all used memory is freed. */
|
/* If linecount is less than zero, all used memory is freed. */
|
||||||
|
|
||||||
|
@ -2374,7 +2374,7 @@ save_ps_preview (FILE *ofp,
|
||||||
for (x = 0; x < width; x++)
|
for (x = 0; x < width; x++)
|
||||||
{
|
{
|
||||||
src_ptr = src_row + ((x * gegl_buffer_get_width (buffer)) / width);
|
src_ptr = src_row + ((x * gegl_buffer_get_width (buffer)) / width);
|
||||||
cind = *src_ptr; /* Get colour index and convert to grey */
|
cind = *src_ptr; /* Get color index and convert to grey */
|
||||||
src_ptr = (cind >= ncols) ? cmap : (cmap + 3*cind);
|
src_ptr = (cind >= ncols) ? cmap : (cmap + 3*cind);
|
||||||
*(greyptr++) = (3*src_ptr[0] + 6*src_ptr[1] + src_ptr[2]) / 10;
|
*(greyptr++) = (3*src_ptr[0] + 6*src_ptr[1] + src_ptr[2]) / 10;
|
||||||
}
|
}
|
||||||
|
@ -2385,7 +2385,7 @@ save_ps_preview (FILE *ofp,
|
||||||
*(greyptr++) = *(src_row + ((x * gegl_buffer_get_width (buffer)) / width));
|
*(greyptr++) = *(src_row + ((x * gegl_buffer_get_width (buffer)) / width));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Now we have a greyscale line for the desired width. */
|
/* Now we have a grayscale line for the desired width. */
|
||||||
/* Dither it to b/w */
|
/* Dither it to b/w */
|
||||||
dither_grey (grey, bw, width, y);
|
dither_grey (grey, bw, width, y);
|
||||||
|
|
||||||
|
@ -3150,7 +3150,7 @@ load_dialog (const gchar *filename,
|
||||||
gtk_widget_show (vbox);
|
gtk_widget_show (vbox);
|
||||||
gtk_widget_show (frame);
|
gtk_widget_show (frame);
|
||||||
|
|
||||||
/* Colouring */
|
/* Coloring */
|
||||||
frame = gimp_int_radio_group_new (TRUE, _("Coloring"),
|
frame = gimp_int_radio_group_new (TRUE, _("Coloring"),
|
||||||
G_CALLBACK (gimp_radio_button_update),
|
G_CALLBACK (gimp_radio_button_update),
|
||||||
&plvals.pnm_type, plvals.pnm_type,
|
&plvals.pnm_type, plvals.pnm_type,
|
||||||
|
|
|
@ -515,7 +515,7 @@ typedef struct
|
||||||
guchar metric;
|
guchar metric;
|
||||||
guint16 compression;
|
guint16 compression;
|
||||||
guint16 depth;
|
guint16 depth;
|
||||||
guchar greyscale;
|
guchar grayscale;
|
||||||
guint32 active_layer;
|
guint32 active_layer;
|
||||||
guint16 layer_count;
|
guint16 layer_count;
|
||||||
} PSPimage;
|
} PSPimage;
|
||||||
|
@ -787,8 +787,8 @@ read_general_image_attribute_block (FILE *f,
|
||||||
|| fread (&ia->metric, 1, 1, f) < 1
|
|| fread (&ia->metric, 1, 1, f) < 1
|
||||||
|| fread (&ia->compression, 2, 1, f) < 1
|
|| fread (&ia->compression, 2, 1, f) < 1
|
||||||
|| fread (&ia->depth, 2, 1, f) < 1
|
|| fread (&ia->depth, 2, 1, f) < 1
|
||||||
|| fread (buf, 2+4, 1, f) < 1 /* Skip plane and colour count */
|
|| fread (buf, 2+4, 1, f) < 1 /* Skip plane and color count */
|
||||||
|| fread (&ia->greyscale, 1, 1, f) < 1
|
|| fread (&ia->grayscale, 1, 1, f) < 1
|
||||||
|| fread (buf, 4, 1, f) < 1 /* Skip total image size */
|
|| fread (buf, 4, 1, f) < 1 /* Skip total image size */
|
||||||
|| fread (&ia->active_layer, 4, 1, f) < 1
|
|| fread (&ia->active_layer, 4, 1, f) < 1
|
||||||
|| fread (&ia->layer_count, 2, 1, f) < 1
|
|| fread (&ia->layer_count, 2, 1, f) < 1
|
||||||
|
@ -1442,7 +1442,7 @@ read_layer_block (FILE *f,
|
||||||
null_layer = TRUE;
|
null_layer = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ia->greyscale)
|
if (ia->grayscale)
|
||||||
if (!null_layer && bitmap_count == 1)
|
if (!null_layer && bitmap_count == 1)
|
||||||
drawable_type = GIMP_GRAY_IMAGE, bytespp = 1;
|
drawable_type = GIMP_GRAY_IMAGE, bytespp = 1;
|
||||||
else
|
else
|
||||||
|
@ -1787,7 +1787,7 @@ load_image (const gchar *filename,
|
||||||
compression_name (ia.compression));
|
compression_name (ia.compression));
|
||||||
|
|
||||||
image_ID = gimp_image_new (ia.width, ia.height,
|
image_ID = gimp_image_new (ia.width, ia.height,
|
||||||
ia.greyscale ? GIMP_GRAY : GIMP_RGB);
|
ia.grayscale ? GIMP_GRAY : GIMP_RGB);
|
||||||
if (image_ID == -1)
|
if (image_ID == -1)
|
||||||
{
|
{
|
||||||
goto error;
|
goto error;
|
||||||
|
|
|
@ -420,7 +420,7 @@ load_image (const gchar *filename,
|
||||||
gimp_quit ();
|
gimp_quit ();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Is there a RGB colourmap ? */
|
/* Is there a RGB colormap ? */
|
||||||
if ((sunhdr.l_ras_maptype == 1) && (sunhdr.l_ras_maplength > 0))
|
if ((sunhdr.l_ras_maptype == 1) && (sunhdr.l_ras_maplength > 0))
|
||||||
{
|
{
|
||||||
suncolmap = g_new (guchar, sunhdr.l_ras_maplength);
|
suncolmap = g_new (guchar, sunhdr.l_ras_maplength);
|
||||||
|
@ -493,7 +493,7 @@ load_image (const gchar *filename,
|
||||||
image_ID = load_sun_d1 (filename, ifp, &sunhdr, suncolmap);
|
image_ID = load_sun_d1 (filename, ifp, &sunhdr, suncolmap);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 8: /* 256 colours */
|
case 8: /* 256 colors */
|
||||||
image_ID = load_sun_d8 (filename, ifp, &sunhdr, suncolmap);
|
image_ID = load_sun_d8 (filename, ifp, &sunhdr, suncolmap);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -876,7 +876,7 @@ write_sun_header (FILE *ofp,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Read the sun colourmap */
|
/* Read the sun colormap */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
read_sun_cols (FILE *ifp,
|
read_sun_cols (FILE *ifp,
|
||||||
|
@ -896,7 +896,7 @@ read_sun_cols (FILE *ifp,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Write a sun colourmap */
|
/* Write a sun colormap */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
write_sun_cols (FILE *ofp,
|
write_sun_cols (FILE *ofp,
|
||||||
|
@ -910,7 +910,7 @@ write_sun_cols (FILE *ofp,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Set a GIMP colourtable using the sun colourmap */
|
/* Set a GIMP colortable using the sun colormap */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
set_color_table (gint32 image_ID,
|
set_color_table (gint32 image_ID,
|
||||||
|
@ -1014,12 +1014,12 @@ load_sun_d1 (const gchar *filename,
|
||||||
tile_height = gimp_tile_height ();
|
tile_height = gimp_tile_height ();
|
||||||
data = g_malloc (tile_height * width);
|
data = g_malloc (tile_height * width);
|
||||||
|
|
||||||
if (suncolmap != NULL) /* Set up the specified colour map */
|
if (suncolmap != NULL) /* Set up the specified color map */
|
||||||
{
|
{
|
||||||
set_color_table (image_ID, sunhdr, suncolmap);
|
set_color_table (image_ID, sunhdr, suncolmap);
|
||||||
}
|
}
|
||||||
else /* No colourmap available. Set up a dummy b/w-colourmap */
|
else /* No colormap available. Set up a dummy b/w-colormap */
|
||||||
{ /* Copy the original header and simulate b/w-colourmap */
|
{ /* Copy the original header and simulate b/w-colormap */
|
||||||
memcpy ((char *)&sun_bwhdr,(char *)sunhdr,sizeof (L_SUNFILEHEADER));
|
memcpy ((char *)&sun_bwhdr,(char *)sunhdr,sizeof (L_SUNFILEHEADER));
|
||||||
sun_bwhdr.l_ras_maptype = 2;
|
sun_bwhdr.l_ras_maptype = 2;
|
||||||
sun_bwhdr.l_ras_maplength = 6;
|
sun_bwhdr.l_ras_maplength = 6;
|
||||||
|
@ -1098,7 +1098,7 @@ load_sun_d8 (const gchar *filename,
|
||||||
guchar *suncolmap)
|
guchar *suncolmap)
|
||||||
{
|
{
|
||||||
int width, height, linepad, i, j;
|
int width, height, linepad, i, j;
|
||||||
int greyscale, ncols;
|
int grayscale, ncols;
|
||||||
int scan_lines, tile_height;
|
int scan_lines, tile_height;
|
||||||
guchar *dest, *data;
|
guchar *dest, *data;
|
||||||
gint32 layer_ID, image_ID;
|
gint32 layer_ID, image_ID;
|
||||||
|
@ -1109,10 +1109,10 @@ load_sun_d8 (const gchar *filename,
|
||||||
width = sunhdr->l_ras_width;
|
width = sunhdr->l_ras_width;
|
||||||
height = sunhdr->l_ras_height;
|
height = sunhdr->l_ras_height;
|
||||||
|
|
||||||
/* This could also be a greyscale image. Check it */
|
/* This could also be a grayscale image. Check it */
|
||||||
ncols = sunhdr->l_ras_maplength / 3;
|
ncols = sunhdr->l_ras_maplength / 3;
|
||||||
|
|
||||||
greyscale = 1; /* Also greyscale if no colourmap present */
|
grayscale = 1; /* Also grayscale if no colormap present */
|
||||||
|
|
||||||
if ((ncols > 0) && (suncolmap != NULL))
|
if ((ncols > 0) && (suncolmap != NULL))
|
||||||
{
|
{
|
||||||
|
@ -1122,20 +1122,20 @@ load_sun_d8 (const gchar *filename,
|
||||||
|| (suncolmap[j+ncols] != j)
|
|| (suncolmap[j+ncols] != j)
|
||||||
|| (suncolmap[j+2*ncols] != j))
|
|| (suncolmap[j+2*ncols] != j))
|
||||||
{
|
{
|
||||||
greyscale = 0;
|
grayscale = 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
image_ID = create_new_image (filename, width, height,
|
image_ID = create_new_image (filename, width, height,
|
||||||
greyscale ? GIMP_GRAY : GIMP_INDEXED,
|
grayscale ? GIMP_GRAY : GIMP_INDEXED,
|
||||||
&layer_ID, &drawable, &pixel_rgn);
|
&layer_ID, &drawable, &pixel_rgn);
|
||||||
|
|
||||||
tile_height = gimp_tile_height ();
|
tile_height = gimp_tile_height ();
|
||||||
data = g_malloc (tile_height * width);
|
data = g_malloc (tile_height * width);
|
||||||
|
|
||||||
if (!greyscale)
|
if (!grayscale)
|
||||||
set_color_table (image_ID, sunhdr, suncolmap);
|
set_color_table (image_ID, sunhdr, suncolmap);
|
||||||
|
|
||||||
linepad = (sunhdr->l_ras_width % 2);
|
linepad = (sunhdr->l_ras_width % 2);
|
||||||
|
@ -1411,7 +1411,7 @@ save_index (FILE *ofp,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bw = (ncols == 2); /* Maybe this is a two-colour image */
|
bw = (ncols == 2); /* Maybe this is a two-color image */
|
||||||
if (bw)
|
if (bw)
|
||||||
{
|
{
|
||||||
bwline = g_malloc ((width+7)/8);
|
bwline = g_malloc ((width+7)/8);
|
||||||
|
@ -1420,7 +1420,7 @@ save_index (FILE *ofp,
|
||||||
|
|
||||||
is_bw = is_wb = 0;
|
is_bw = is_wb = 0;
|
||||||
if (bw) /* The Sun-OS imagetool generates index 0 for white and */
|
if (bw) /* The Sun-OS imagetool generates index 0 for white and */
|
||||||
{ /* index 1 for black. Do the same without colourtable. */
|
{ /* index 1 for black. Do the same without colortable. */
|
||||||
is_bw = (memcmp (suncolmap, sun_bwmap, 6) == 0);
|
is_bw = (memcmp (suncolmap, sun_bwmap, 6) == 0);
|
||||||
is_wb = (memcmp (suncolmap, sun_wbmap, 6) == 0);
|
is_wb = (memcmp (suncolmap, sun_wbmap, 6) == 0);
|
||||||
}
|
}
|
||||||
|
@ -1436,15 +1436,15 @@ save_index (FILE *ofp,
|
||||||
sunhdr.l_ras_depth = bw ? 1 : 8;
|
sunhdr.l_ras_depth = bw ? 1 : 8;
|
||||||
sunhdr.l_ras_length = (bpl+linepad) * height;
|
sunhdr.l_ras_length = (bpl+linepad) * height;
|
||||||
sunhdr.l_ras_type = (rle) ? RAS_TYPE_RLE : RAS_TYPE_STD;
|
sunhdr.l_ras_type = (rle) ? RAS_TYPE_RLE : RAS_TYPE_STD;
|
||||||
if (is_bw || is_wb) /* No colourtable for real b/w images */
|
if (is_bw || is_wb) /* No colortable for real b/w images */
|
||||||
{
|
{
|
||||||
sunhdr.l_ras_maptype = 0; /* No colourmap */
|
sunhdr.l_ras_maptype = 0; /* No colormap */
|
||||||
sunhdr.l_ras_maplength = 0; /* Length of colourmap */
|
sunhdr.l_ras_maplength = 0; /* Length of colormap */
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sunhdr.l_ras_maptype = 1; /* RGB colourmap */
|
sunhdr.l_ras_maptype = 1; /* RGB colormap */
|
||||||
sunhdr.l_ras_maplength = ncols*3; /* Length of colourmap */
|
sunhdr.l_ras_maplength = ncols*3; /* Length of colormap */
|
||||||
}
|
}
|
||||||
|
|
||||||
write_sun_header (ofp, &sunhdr);
|
write_sun_header (ofp, &sunhdr);
|
||||||
|
@ -1461,7 +1461,7 @@ save_index (FILE *ofp,
|
||||||
if (rle) { write_fun = (WRITE_FUN *)&rle_fwrite; rle_startwrite (ofp); }
|
if (rle) { write_fun = (WRITE_FUN *)&rle_fwrite; rle_startwrite (ofp); }
|
||||||
else write_fun = (WRITE_FUN *)&my_fwrite;
|
else write_fun = (WRITE_FUN *)&my_fwrite;
|
||||||
|
|
||||||
if (bw) /* Two colour image */
|
if (bw) /* Two color image */
|
||||||
{
|
{
|
||||||
for (i = 0; i < height; i++)
|
for (i = 0; i < height; i++)
|
||||||
{
|
{
|
||||||
|
@ -1475,7 +1475,7 @@ save_index (FILE *ofp,
|
||||||
gimp_progress_update ((double) i / (double) height);
|
gimp_progress_update ((double) i / (double) height);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else /* Colour or grey-image */
|
else /* Color or grey-image */
|
||||||
{
|
{
|
||||||
for (i = 0; i < height; i++)
|
for (i = 0; i < height; i++)
|
||||||
{
|
{
|
||||||
|
@ -1546,8 +1546,8 @@ save_rgb (FILE *ofp,
|
||||||
sunhdr.l_ras_depth = 8 * bpp;
|
sunhdr.l_ras_depth = 8 * bpp;
|
||||||
sunhdr.l_ras_length = (width*bpp + linepad)*height;
|
sunhdr.l_ras_length = (width*bpp + linepad)*height;
|
||||||
sunhdr.l_ras_type = (rle) ? RAS_TYPE_RLE : RAS_TYPE_STD;
|
sunhdr.l_ras_type = (rle) ? RAS_TYPE_RLE : RAS_TYPE_STD;
|
||||||
sunhdr.l_ras_maptype = 0; /* No colourmap */
|
sunhdr.l_ras_maptype = 0; /* No colormap */
|
||||||
sunhdr.l_ras_maplength = 0; /* Length of colourmap */
|
sunhdr.l_ras_maplength = 0; /* Length of colormap */
|
||||||
|
|
||||||
write_sun_header (ofp, &sunhdr);
|
write_sun_header (ofp, &sunhdr);
|
||||||
|
|
||||||
|
|
|
@ -971,7 +971,7 @@ create_selection_tab (GtkWidget *notebook,
|
||||||
|
|
||||||
group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
|
group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
|
||||||
|
|
||||||
/* Film height/colour */
|
/* Film height/color */
|
||||||
frame = gimp_frame_new (_("Filmstrip"));
|
frame = gimp_frame_new (_("Filmstrip"));
|
||||||
gtk_box_pack_start (GTK_BOX (vbox2), frame, FALSE, FALSE, 0);
|
gtk_box_pack_start (GTK_BOX (vbox2), frame, FALSE, FALSE, 0);
|
||||||
gtk_widget_show (frame);
|
gtk_widget_show (frame);
|
||||||
|
@ -1033,7 +1033,7 @@ create_selection_tab (GtkWidget *notebook,
|
||||||
G_CALLBACK (gimp_color_button_get_color),
|
G_CALLBACK (gimp_color_button_get_color),
|
||||||
&filmvals.film_color);
|
&filmvals.film_color);
|
||||||
|
|
||||||
/* Film numbering: Startindex/Font/colour */
|
/* Film numbering: Startindex/Font/color */
|
||||||
frame = gimp_frame_new (_("Numbering"));
|
frame = gimp_frame_new (_("Numbering"));
|
||||||
gtk_box_pack_start (GTK_BOX (vbox2), frame, TRUE, TRUE, 0);
|
gtk_box_pack_start (GTK_BOX (vbox2), frame, TRUE, TRUE, 0);
|
||||||
gtk_widget_show (frame);
|
gtk_widget_show (frame);
|
||||||
|
|
|
@ -19,13 +19,13 @@
|
||||||
/*
|
/*
|
||||||
* hot.c - Scan an image for pixels with RGB values that will give
|
* hot.c - Scan an image for pixels with RGB values that will give
|
||||||
* "unsafe" values of chrominance signal or composite signal
|
* "unsafe" values of chrominance signal or composite signal
|
||||||
* amplitude when encoded into an NTSC or PAL colour signal.
|
* amplitude when encoded into an NTSC or PAL color signal.
|
||||||
* (This happens for certain high-intensity high-saturation colours
|
* (This happens for certain high-intensity high-saturation colors
|
||||||
* that are rare in real scenes, but can easily be present
|
* that are rare in real scenes, but can easily be present
|
||||||
* in synthetic images.)
|
* in synthetic images.)
|
||||||
*
|
*
|
||||||
* Such pixels can be flagged so the user may then choose other
|
* Such pixels can be flagged so the user may then choose other
|
||||||
* colours. Or, the offending pixels can be made "safe"
|
* colors. Or, the offending pixels can be made "safe"
|
||||||
* in a manner that preserves hue.
|
* in a manner that preserves hue.
|
||||||
*
|
*
|
||||||
* There are two reasonable ways to make a pixel "safe":
|
* There are two reasonable ways to make a pixel "safe":
|
||||||
|
@ -58,7 +58,7 @@
|
||||||
* monochrome white, and is always safe. 120 is the absolute
|
* monochrome white, and is always safe. 120 is the absolute
|
||||||
* limit for NTSC broadcasting, since the transmitter's carrier
|
* limit for NTSC broadcasting, since the transmitter's carrier
|
||||||
* goes to zero with 120 IRE input signal. Generally, 110
|
* goes to zero with 120 IRE input signal. Generally, 110
|
||||||
* is a good compromise - it allows somewhat brighter colours
|
* is a good compromise - it allows somewhat brighter colors
|
||||||
* than 100, while staying safely away from the hard limit.
|
* than 100, while staying safely away from the hard limit.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
@ -79,7 +79,7 @@
|
||||||
#define BARTLETT(x,y) (((oversample/2)+1-ABS(x)) * ((oversample/2)+1-ABS(y)))
|
#define BARTLETT(x,y) (((oversample/2)+1-ABS(x)) * ((oversample/2)+1-ABS(y)))
|
||||||
#define WGT(x,y) wgt[((y+oversample/2)*oversample) + x+oversample/2]
|
#define WGT(x,y) wgt[((y+oversample/2)*oversample) + x+oversample/2]
|
||||||
|
|
||||||
/* colourspaces we can separate to: */
|
/* colorspaces we can separate to: */
|
||||||
#define CS_GREY 0
|
#define CS_GREY 0
|
||||||
#define CS_RGB 1
|
#define CS_RGB 1
|
||||||
#define CS_CMYK 2
|
#define CS_CMYK 2
|
||||||
|
@ -184,10 +184,10 @@ typedef struct
|
||||||
gint cell_width;
|
gint cell_width;
|
||||||
|
|
||||||
/* screening section: */
|
/* screening section: */
|
||||||
gint colourspace; /* 0: RGB, 1: CMYK, 2: Luminance */
|
gint colorspace; /* 0: RGB, 1: CMYK, 2: Luminance */
|
||||||
gint k_pullout; /* percentage of black to pull out */
|
gint k_pullout; /* percentage of black to pull out */
|
||||||
|
|
||||||
/* grey screen (only used if greyscale drawable) */
|
/* grey screen (only used if grayscale drawable) */
|
||||||
gdouble gry_ang;
|
gdouble gry_ang;
|
||||||
gint gry_spotfn;
|
gint gry_spotfn;
|
||||||
|
|
||||||
|
@ -254,7 +254,7 @@ typedef struct
|
||||||
/* Notebook for the channels (one per colorspace) */
|
/* Notebook for the channels (one per colorspace) */
|
||||||
GtkWidget *channel_notebook[NUM_CS];
|
GtkWidget *channel_notebook[NUM_CS];
|
||||||
|
|
||||||
/* room for up to 4 channels per colourspace */
|
/* room for up to 4 channels per colorspace */
|
||||||
channel_st *chst[NUM_CS][4];
|
channel_st *chst[NUM_CS][4];
|
||||||
} NewsprintDialog_st;
|
} NewsprintDialog_st;
|
||||||
|
|
||||||
|
@ -409,8 +409,8 @@ static const chan_tmpl luminance_tmpl[] =
|
||||||
{ NULL, NULL, NULL, NULL, NULL }
|
{ NULL, NULL, NULL, NULL, NULL }
|
||||||
};
|
};
|
||||||
|
|
||||||
/* cspace_chan_tmpl is indexed by colourspace, and gives an array of
|
/* cspace_chan_tmpl is indexed by colorspace, and gives an array of
|
||||||
* channel templates for that colourspace */
|
* channel templates for that colorspace */
|
||||||
static const chan_tmpl *cspace_chan_tmpl[] =
|
static const chan_tmpl *cspace_chan_tmpl[] =
|
||||||
{
|
{
|
||||||
grey_tmpl,
|
grey_tmpl,
|
||||||
|
@ -422,7 +422,7 @@ static const chan_tmpl *cspace_chan_tmpl[] =
|
||||||
#define NCHANS(x) ((sizeof(x) / sizeof(chan_tmpl)) - 1)
|
#define NCHANS(x) ((sizeof(x) / sizeof(chan_tmpl)) - 1)
|
||||||
|
|
||||||
/* cspace_nchans gives a quick way of finding the number of channels
|
/* cspace_nchans gives a quick way of finding the number of channels
|
||||||
* in a colourspace. Alternatively, if you're walking the channel
|
* in a colorspace. Alternatively, if you're walking the channel
|
||||||
* template, you can use the NULL entry at the end to stop. */
|
* template, you can use the NULL entry at the end to stop. */
|
||||||
static const gint cspace_nchans[] =
|
static const gint cspace_nchans[] =
|
||||||
{
|
{
|
||||||
|
@ -576,7 +576,7 @@ run (const gchar *name,
|
||||||
}
|
}
|
||||||
|
|
||||||
pvals.cell_width = param[3].data.d_int32;
|
pvals.cell_width = param[3].data.d_int32;
|
||||||
pvals.colourspace = param[4].data.d_int32;
|
pvals.colorspace = param[4].data.d_int32;
|
||||||
pvals.k_pullout = param[5].data.d_int32;
|
pvals.k_pullout = param[5].data.d_int32;
|
||||||
pvals.gry_ang = param[6].data.d_float;
|
pvals.gry_ang = param[6].data.d_float;
|
||||||
pvals.gry_spotfn = param[7].data.d_int32;
|
pvals.gry_spotfn = param[7].data.d_int32;
|
||||||
|
@ -593,7 +593,7 @@ run (const gchar *name,
|
||||||
!VALID_SPOTFN (pvals.red_spotfn) ||
|
!VALID_SPOTFN (pvals.red_spotfn) ||
|
||||||
!VALID_SPOTFN (pvals.grn_spotfn) ||
|
!VALID_SPOTFN (pvals.grn_spotfn) ||
|
||||||
!VALID_SPOTFN (pvals.blu_spotfn) ||
|
!VALID_SPOTFN (pvals.blu_spotfn) ||
|
||||||
!VALID_CS (pvals.colourspace) ||
|
!VALID_CS (pvals.colorspace) ||
|
||||||
pvals.k_pullout < 0 || pvals.k_pullout > 100)
|
pvals.k_pullout < 0 || pvals.k_pullout > 100)
|
||||||
{
|
{
|
||||||
status = GIMP_PDB_CALLING_ERROR;
|
status = GIMP_PDB_CALLING_ERROR;
|
||||||
|
@ -927,13 +927,13 @@ newsprint_defaults_callback (GtkWidget *widget,
|
||||||
saved_lock = pvals_ui.lock_channels;
|
saved_lock = pvals_ui.lock_channels;
|
||||||
pvals_ui.lock_channels = FALSE;
|
pvals_ui.lock_channels = FALSE;
|
||||||
|
|
||||||
/* for each colourspace, reset its channel info */
|
/* for each colorspace, reset its channel info */
|
||||||
for (cspace = 0; cspace < NUM_CS; cspace++)
|
for (cspace = 0; cspace < NUM_CS; cspace++)
|
||||||
{
|
{
|
||||||
chst = st->chst[cspace];
|
chst = st->chst[cspace];
|
||||||
ct = cspace_chan_tmpl[cspace];
|
ct = cspace_chan_tmpl[cspace];
|
||||||
|
|
||||||
/* skip this colourspace if we haven't used it yet */
|
/* skip this colorspace if we haven't used it yet */
|
||||||
if (!chst[0])
|
if (!chst[0])
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
@ -1087,11 +1087,11 @@ new_channel (const chan_tmpl *ct, GtkWidget *preview)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Make all the channels needed for "colourspace", and fill in
|
/* Make all the channels needed for "colorspace", and fill in
|
||||||
* the respective channel state fields in "st". */
|
* the respective channel state fields in "st". */
|
||||||
static void
|
static void
|
||||||
gen_channels (NewsprintDialog_st *st,
|
gen_channels (NewsprintDialog_st *st,
|
||||||
gint colourspace,
|
gint colorspace,
|
||||||
GtkWidget *preview)
|
GtkWidget *preview)
|
||||||
{
|
{
|
||||||
const chan_tmpl *ct;
|
const chan_tmpl *ct;
|
||||||
|
@ -1099,16 +1099,16 @@ gen_channels (NewsprintDialog_st *st,
|
||||||
channel_st *base = NULL;
|
channel_st *base = NULL;
|
||||||
gint i;
|
gint i;
|
||||||
|
|
||||||
chst = st->chst[colourspace];
|
chst = st->chst[colorspace];
|
||||||
ct = cspace_chan_tmpl[colourspace];
|
ct = cspace_chan_tmpl[colorspace];
|
||||||
i = 0;
|
i = 0;
|
||||||
|
|
||||||
st->channel_notebook[colourspace] = gtk_notebook_new ();
|
st->channel_notebook[colorspace] = gtk_notebook_new ();
|
||||||
gtk_box_pack_start (GTK_BOX (st->vbox), st->channel_notebook[colourspace],
|
gtk_box_pack_start (GTK_BOX (st->vbox), st->channel_notebook[colorspace],
|
||||||
FALSE, FALSE, 0);
|
FALSE, FALSE, 0);
|
||||||
gtk_box_reorder_child (GTK_BOX (st->vbox),
|
gtk_box_reorder_child (GTK_BOX (st->vbox),
|
||||||
st->channel_notebook[colourspace], 3);
|
st->channel_notebook[colorspace], 3);
|
||||||
gtk_widget_show (st->channel_notebook[colourspace]);
|
gtk_widget_show (st->channel_notebook[colorspace]);
|
||||||
|
|
||||||
while (ct->name)
|
while (ct->name)
|
||||||
{
|
{
|
||||||
|
@ -1119,7 +1119,7 @@ gen_channels (NewsprintDialog_st *st,
|
||||||
else
|
else
|
||||||
base = chst[i];
|
base = chst[i];
|
||||||
|
|
||||||
gtk_notebook_append_page (GTK_NOTEBOOK (st->channel_notebook[colourspace]),
|
gtk_notebook_append_page (GTK_NOTEBOOK (st->channel_notebook[colorspace]),
|
||||||
chst[i]->vbox,
|
chst[i]->vbox,
|
||||||
gtk_label_new_with_mnemonic (gettext (ct->name)));
|
gtk_label_new_with_mnemonic (gettext (ct->name)));
|
||||||
gtk_widget_show (chst[i]->vbox);
|
gtk_widget_show (chst[i]->vbox);
|
||||||
|
@ -1165,15 +1165,15 @@ newsprint_dialog (GimpDrawable *drawable)
|
||||||
if (gimp_drawable_has_alpha (drawable->drawable_id))
|
if (gimp_drawable_has_alpha (drawable->drawable_id))
|
||||||
bpp--;
|
bpp--;
|
||||||
|
|
||||||
/* force greyscale if it's the only thing we can do */
|
/* force grayscale if it's the only thing we can do */
|
||||||
if (bpp == 1)
|
if (bpp == 1)
|
||||||
{
|
{
|
||||||
pvals.colourspace = CS_GREY;
|
pvals.colorspace = CS_GREY;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (pvals.colourspace == CS_GREY)
|
if (pvals.colorspace == CS_GREY)
|
||||||
pvals.colourspace = CS_RGB;
|
pvals.colorspace = CS_RGB;
|
||||||
}
|
}
|
||||||
|
|
||||||
dialog = gimp_dialog_new (_("Newsprint"), PLUG_IN_ROLE,
|
dialog = gimp_dialog_new (_("Newsprint"), PLUG_IN_ROLE,
|
||||||
|
@ -1312,7 +1312,7 @@ newsprint_dialog (GimpDrawable *drawable)
|
||||||
0, 100, 1, 10, 0,
|
0, 100, 1, 10, 0,
|
||||||
TRUE, 0, 0,
|
TRUE, 0, 0,
|
||||||
NULL, NULL);
|
NULL, NULL);
|
||||||
gtk_widget_set_sensitive (st.pull_table, (pvals.colourspace == CS_CMYK));
|
gtk_widget_set_sensitive (st.pull_table, (pvals.colorspace == CS_CMYK));
|
||||||
gtk_widget_show (st.pull_table);
|
gtk_widget_show (st.pull_table);
|
||||||
|
|
||||||
g_signal_connect (st.pull, "value-changed",
|
g_signal_connect (st.pull, "value-changed",
|
||||||
|
@ -1337,7 +1337,7 @@ newsprint_dialog (GimpDrawable *drawable)
|
||||||
group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (toggle));
|
group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (toggle));
|
||||||
gtk_box_pack_start (GTK_BOX (hbox), toggle, TRUE, TRUE, 0);
|
gtk_box_pack_start (GTK_BOX (hbox), toggle, TRUE, TRUE, 0);
|
||||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle),
|
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle),
|
||||||
(pvals.colourspace == CS_RGB));
|
(pvals.colorspace == CS_RGB));
|
||||||
gtk_widget_show (toggle);
|
gtk_widget_show (toggle);
|
||||||
|
|
||||||
g_object_set_data (G_OBJECT (toggle), "dialog", &st);
|
g_object_set_data (G_OBJECT (toggle), "dialog", &st);
|
||||||
|
@ -1354,7 +1354,7 @@ newsprint_dialog (GimpDrawable *drawable)
|
||||||
group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (toggle));
|
group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (toggle));
|
||||||
gtk_box_pack_start (GTK_BOX (hbox), toggle, TRUE, TRUE, 0);
|
gtk_box_pack_start (GTK_BOX (hbox), toggle, TRUE, TRUE, 0);
|
||||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle),
|
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle),
|
||||||
(pvals.colourspace == CS_CMYK));
|
(pvals.colorspace == CS_CMYK));
|
||||||
gtk_widget_show (toggle);
|
gtk_widget_show (toggle);
|
||||||
|
|
||||||
g_object_set_data (G_OBJECT (toggle), "dialog", &st);
|
g_object_set_data (G_OBJECT (toggle), "dialog", &st);
|
||||||
|
@ -1371,7 +1371,7 @@ newsprint_dialog (GimpDrawable *drawable)
|
||||||
group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (toggle));
|
group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (toggle));
|
||||||
gtk_box_pack_start (GTK_BOX (hbox), toggle, TRUE, TRUE, 0);
|
gtk_box_pack_start (GTK_BOX (hbox), toggle, TRUE, TRUE, 0);
|
||||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle),
|
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle),
|
||||||
(pvals.colourspace == CS_LUMINANCE));
|
(pvals.colorspace == CS_LUMINANCE));
|
||||||
gtk_widget_show (toggle);
|
gtk_widget_show (toggle);
|
||||||
|
|
||||||
g_object_set_data (G_OBJECT (toggle), "dialog", &st);
|
g_object_set_data (G_OBJECT (toggle), "dialog", &st);
|
||||||
|
@ -1417,14 +1417,14 @@ newsprint_dialog (GimpDrawable *drawable)
|
||||||
preview);
|
preview);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Make the channels appropriate for this colourspace and
|
/* Make the channels appropriate for this colorspace and
|
||||||
* currently selected defaults. They may have already been
|
* currently selected defaults. They may have already been
|
||||||
* created as a result of callbacks to cspace_update from
|
* created as a result of callbacks to cspace_update from
|
||||||
* gtk_toggle_button_set_active().
|
* gtk_toggle_button_set_active().
|
||||||
*/
|
*/
|
||||||
if (!st.chst[pvals.colourspace][0])
|
if (!st.chst[pvals.colorspace][0])
|
||||||
{
|
{
|
||||||
gen_channels (&st, pvals.colourspace, preview);
|
gen_channels (&st, pvals.colorspace, preview);
|
||||||
}
|
}
|
||||||
|
|
||||||
gtk_widget_show (st.vbox);
|
gtk_widget_show (st.vbox);
|
||||||
|
@ -1456,7 +1456,7 @@ newsprint_dialog (GimpDrawable *drawable)
|
||||||
|
|
||||||
gtk_widget_show (dialog);
|
gtk_widget_show (dialog);
|
||||||
|
|
||||||
preview_update(st.chst[pvals.colourspace][0]);
|
preview_update(st.chst[pvals.colorspace][0]);
|
||||||
|
|
||||||
run = (gimp_dialog_run (GIMP_DIALOG (dialog)) == GTK_RESPONSE_OK);
|
run = (gimp_dialog_run (GIMP_DIALOG (dialog)) == GTK_RESPONSE_OK);
|
||||||
|
|
||||||
|
@ -1473,7 +1473,7 @@ newsprint_cspace_update (GtkWidget *widget,
|
||||||
{
|
{
|
||||||
NewsprintDialog_st *st;
|
NewsprintDialog_st *st;
|
||||||
gint new_cs = GPOINTER_TO_INT (data);
|
gint new_cs = GPOINTER_TO_INT (data);
|
||||||
gint old_cs = pvals.colourspace;
|
gint old_cs = pvals.colorspace;
|
||||||
GtkWidget *preview;
|
GtkWidget *preview;
|
||||||
|
|
||||||
st = g_object_get_data (G_OBJECT (widget), "dialog");
|
st = g_object_get_data (G_OBJECT (widget), "dialog");
|
||||||
|
@ -1496,10 +1496,10 @@ newsprint_cspace_update (GtkWidget *widget,
|
||||||
if (! active)
|
if (! active)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
pvals.colourspace = new_cs;
|
pvals.colorspace = new_cs;
|
||||||
|
|
||||||
/* make sure we have the necessary channels for the new
|
/* make sure we have the necessary channels for the new
|
||||||
* colourspace */
|
* colorspace */
|
||||||
if (!st->chst[new_cs][0])
|
if (!st->chst[new_cs][0])
|
||||||
gen_channels (st, new_cs, preview);
|
gen_channels (st, new_cs, preview);
|
||||||
|
|
||||||
|
@ -1527,7 +1527,7 @@ newsprint_cspace_update (GtkWidget *widget,
|
||||||
|
|
||||||
|
|
||||||
/* Spot functions define the order in which pixels should be whitened
|
/* Spot functions define the order in which pixels should be whitened
|
||||||
* as a cell lightened in colour. They are defined over the entire
|
* as a cell lightened in color. They are defined over the entire
|
||||||
* cell, and are called over each pixel in the cell. The cell
|
* cell, and are called over each pixel in the cell. The cell
|
||||||
* co-ordinate space ranges from -1.0 .. +1.0 inclusive, in both x- and
|
* co-ordinate space ranges from -1.0 .. +1.0 inclusive, in both x- and
|
||||||
* y-axes.
|
* y-axes.
|
||||||
|
@ -1663,7 +1663,7 @@ order_cmp (const void *va,
|
||||||
* as pre-balanced is bad: you'll end up with dark areas becoming too
|
* as pre-balanced is bad: you'll end up with dark areas becoming too
|
||||||
* dark or too light, and vice versa for light areas. This is most
|
* dark or too light, and vice versa for light areas. This is most
|
||||||
* easily checked by halftoning an area, then bluring it back - you
|
* easily checked by halftoning an area, then bluring it back - you
|
||||||
* should get the same colour back again. The only way of getting a
|
* should get the same color back again. The only way of getting a
|
||||||
* correctly balanced function is by getting a formula for the spot's
|
* correctly balanced function is by getting a formula for the spot's
|
||||||
* area as a function of x and y - this can be fairly tough (ie
|
* area as a function of x and y - this can be fairly tough (ie
|
||||||
* possiblly an integral in two dimensions that must be solved
|
* possiblly an integral in two dimensions that must be solved
|
||||||
|
@ -1753,7 +1753,7 @@ newsprint (GimpDrawable *drawable,
|
||||||
gdouble r;
|
gdouble r;
|
||||||
gdouble theta;
|
gdouble theta;
|
||||||
gdouble rot[4];
|
gdouble rot[4];
|
||||||
gint bpp, colour_bpp;
|
gint bpp, color_bpp;
|
||||||
gint has_alpha;
|
gint has_alpha;
|
||||||
gint b;
|
gint b;
|
||||||
gint tile_width;
|
gint tile_width;
|
||||||
|
@ -1766,7 +1766,7 @@ newsprint (GimpDrawable *drawable,
|
||||||
gint rx, ry;
|
gint rx, ry;
|
||||||
gint progress, max_progress;
|
gint progress, max_progress;
|
||||||
gint oversample;
|
gint oversample;
|
||||||
gint colourspace;
|
gint colorspace;
|
||||||
gpointer pr;
|
gpointer pr;
|
||||||
gint w002;
|
gint w002;
|
||||||
guchar *preview_buffer = NULL;
|
guchar *preview_buffer = NULL;
|
||||||
|
@ -1805,16 +1805,16 @@ newsprint (GimpDrawable *drawable,
|
||||||
}
|
}
|
||||||
|
|
||||||
has_alpha = gimp_drawable_has_alpha (drawable->drawable_id);
|
has_alpha = gimp_drawable_has_alpha (drawable->drawable_id);
|
||||||
colour_bpp = has_alpha ? bpp-1 : bpp;
|
color_bpp = has_alpha ? bpp-1 : bpp;
|
||||||
colourspace= pvals.colourspace;
|
colorspace= pvals.colorspace;
|
||||||
if (colour_bpp == 1)
|
if (color_bpp == 1)
|
||||||
{
|
{
|
||||||
colourspace = CS_GREY;
|
colorspace = CS_GREY;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (colourspace == CS_GREY)
|
if (colorspace == CS_GREY)
|
||||||
colourspace = CS_RGB;
|
colorspace = CS_RGB;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Bartlett window matrix optimisation */
|
/* Bartlett window matrix optimisation */
|
||||||
|
@ -1838,7 +1838,7 @@ do { \
|
||||||
} while(0)
|
} while(0)
|
||||||
|
|
||||||
/* calculate the RGB / CMYK rotations and threshold matrices */
|
/* calculate the RGB / CMYK rotations and threshold matrices */
|
||||||
if (colour_bpp == 1 || colourspace == CS_LUMINANCE)
|
if (color_bpp == 1 || colorspace == CS_LUMINANCE)
|
||||||
{
|
{
|
||||||
rot[0] = DEG2RAD (pvals.gry_ang);
|
rot[0] = DEG2RAD (pvals.gry_ang);
|
||||||
thresh[0] = spot2thresh (pvals.gry_spotfn, width);
|
thresh[0] = spot2thresh (pvals.gry_spotfn, width);
|
||||||
|
@ -1866,7 +1866,7 @@ do { \
|
||||||
spotfn_list[bf].thresh = spot2thresh (bf, width);
|
spotfn_list[bf].thresh = spot2thresh (bf, width);
|
||||||
thresh[2] = spotfn_list[bf].thresh;
|
thresh[2] = spotfn_list[bf].thresh;
|
||||||
|
|
||||||
if (colourspace == CS_CMYK)
|
if (colorspace == CS_CMYK)
|
||||||
{
|
{
|
||||||
rot[3] = DEG2RAD (pvals.gry_ang);
|
rot[3] = DEG2RAD (pvals.gry_ang);
|
||||||
gf = pvals.gry_spotfn;
|
gf = pvals.gry_spotfn;
|
||||||
|
@ -1925,11 +1925,11 @@ do { \
|
||||||
r = sqrt (((double)rx)*rx + ((double)ry)*ry);
|
r = sqrt (((double)rx)*rx + ((double)ry)*ry);
|
||||||
theta = atan2 (((gdouble)ry), ((gdouble)rx));
|
theta = atan2 (((gdouble)ry), ((gdouble)rx));
|
||||||
|
|
||||||
for (b = 0; b < colour_bpp; b++)
|
for (b = 0; b < color_bpp; b++)
|
||||||
data[b] = src[b];
|
data[b] = src[b];
|
||||||
|
|
||||||
/* do colour space conversion */
|
/* do color space conversion */
|
||||||
switch (colourspace)
|
switch (colorspace)
|
||||||
{
|
{
|
||||||
case CS_CMYK:
|
case CS_CMYK:
|
||||||
{
|
{
|
||||||
|
@ -1960,7 +1960,7 @@ do { \
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (b = 0; b < cspace_nchans[colourspace]; b++)
|
for (b = 0; b < cspace_nchans[colorspace]; b++)
|
||||||
{
|
{
|
||||||
rx = RINT (r * cos (theta + rot[b]));
|
rx = RINT (r * cos (theta + rot[b]));
|
||||||
ry = RINT (r * sin (theta + rot[b]));
|
ry = RINT (r * sin (theta + rot[b]));
|
||||||
|
@ -1996,10 +1996,10 @@ do { \
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (has_alpha)
|
if (has_alpha)
|
||||||
dest[colour_bpp] = src[colour_bpp];
|
dest[color_bpp] = src[color_bpp];
|
||||||
|
|
||||||
/* re-pack the colours into RGB */
|
/* re-pack the colors into RGB */
|
||||||
switch (colourspace)
|
switch (colorspace)
|
||||||
{
|
{
|
||||||
case CS_CMYK:
|
case CS_CMYK:
|
||||||
data[0] = CLAMPED_ADD (data[0], data[3]);
|
data[0] = CLAMPED_ADD (data[0], data[3]);
|
||||||
|
@ -2013,7 +2013,7 @@ do { \
|
||||||
case CS_LUMINANCE:
|
case CS_LUMINANCE:
|
||||||
if (has_alpha)
|
if (has_alpha)
|
||||||
{
|
{
|
||||||
dest[colour_bpp] = data[0];
|
dest[color_bpp] = data[0];
|
||||||
data[0] = 0xff;
|
data[0] = 0xff;
|
||||||
}
|
}
|
||||||
data[1] = data[1] * data[0] / 0xff;
|
data[1] = data[1] * data[0] / 0xff;
|
||||||
|
@ -2026,7 +2026,7 @@ do { \
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (b = 0; b < colour_bpp; b++)
|
for (b = 0; b < color_bpp; b++)
|
||||||
dest[b] = data[b];
|
dest[b] = data[b];
|
||||||
|
|
||||||
src += src_rgn.bpp;
|
src += src_rgn.bpp;
|
||||||
|
|
|
@ -147,7 +147,7 @@ query (void)
|
||||||
"to image channels. Noise may be additive "
|
"to image channels. Noise may be additive "
|
||||||
"(uncorrelated) or multiplicative (correlated - "
|
"(uncorrelated) or multiplicative (correlated - "
|
||||||
"also known as speckle noise). "
|
"also known as speckle noise). "
|
||||||
"For colour images colour channels may be treated "
|
"For color images color channels may be treated "
|
||||||
"together or independently.",
|
"together or independently.",
|
||||||
"Torsten Martinsen",
|
"Torsten Martinsen",
|
||||||
"Torsten Martinsen",
|
"Torsten Martinsen",
|
||||||
|
@ -163,8 +163,8 @@ query (void)
|
||||||
gimp_install_procedure (NOISIFY_PROC,
|
gimp_install_procedure (NOISIFY_PROC,
|
||||||
"Adds random noise to image channels ",
|
"Adds random noise to image channels ",
|
||||||
"Add normally distributed random values to "
|
"Add normally distributed random values to "
|
||||||
"image channels. For colour images each "
|
"image channels. For color images each "
|
||||||
"colour channel may be treated together or "
|
"color channel may be treated together or "
|
||||||
"independently.",
|
"independently.",
|
||||||
"Torsten Martinsen",
|
"Torsten Martinsen",
|
||||||
"Torsten Martinsen",
|
"Torsten Martinsen",
|
||||||
|
|
|
@ -600,8 +600,8 @@ render_wind_row (guchar *sb,
|
||||||
gint i, j;
|
gint i, j;
|
||||||
gint bleed_length;
|
gint bleed_length;
|
||||||
gint blend_amt_R, blend_amt_G, blend_amt_B, blend_amt_A = 0 ;
|
gint blend_amt_R, blend_amt_G, blend_amt_B, blend_amt_A = 0 ;
|
||||||
gint blend_colour_R, blend_colour_G, blend_colour_B, blend_colour_A = 0 ;
|
gint blend_color_R, blend_color_G, blend_color_B, blend_color_A = 0 ;
|
||||||
gint target_colour_R, target_colour_G, target_colour_B, target_colour_A = 0;
|
gint target_color_R, target_color_G, target_color_B, target_color_A = 0;
|
||||||
gint bleed_variation;
|
gint bleed_variation;
|
||||||
gint n;
|
gint n;
|
||||||
gint sbi; /* starting bleed index */
|
gint sbi; /* starting bleed index */
|
||||||
|
@ -629,17 +629,17 @@ render_wind_row (guchar *sb,
|
||||||
|
|
||||||
/* we have found an edge, do bleeding */
|
/* we have found an edge, do bleeding */
|
||||||
sbi = Ri + comp_stride;
|
sbi = Ri + comp_stride;
|
||||||
blend_colour_R = sb[Ri];
|
blend_color_R = sb[Ri];
|
||||||
blend_colour_G = sb[Gi];
|
blend_color_G = sb[Gi];
|
||||||
blend_colour_B = sb[Bi];
|
blend_color_B = sb[Bi];
|
||||||
target_colour_R = sb[sbi];
|
target_color_R = sb[sbi];
|
||||||
target_colour_G = sb[sbi+1];
|
target_color_G = sb[sbi+1];
|
||||||
target_colour_B = sb[sbi+2];
|
target_color_B = sb[sbi+2];
|
||||||
|
|
||||||
if (bytes > 3)
|
if (bytes > 3)
|
||||||
{
|
{
|
||||||
blend_colour_A = sb[Ai];
|
blend_color_A = sb[Ai];
|
||||||
target_colour_A = sb[sbi+3];
|
target_color_A = sb[sbi+3];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (g_random_int_range (0, 3)) /* introduce weighted randomness */
|
if (g_random_int_range (0, 3)) /* introduce weighted randomness */
|
||||||
|
@ -661,19 +661,19 @@ render_wind_row (guchar *sb,
|
||||||
|
|
||||||
bleed_length = bleed_variation;
|
bleed_length = bleed_variation;
|
||||||
|
|
||||||
blend_amt_R = target_colour_R - blend_colour_R;
|
blend_amt_R = target_color_R - blend_color_R;
|
||||||
blend_amt_G = target_colour_G - blend_colour_G;
|
blend_amt_G = target_color_G - blend_color_G;
|
||||||
blend_amt_B = target_colour_B - blend_colour_B;
|
blend_amt_B = target_color_B - blend_color_B;
|
||||||
if (bytes > 3)
|
if (bytes > 3)
|
||||||
{
|
{
|
||||||
blend_amt_A = target_colour_A - blend_colour_A;
|
blend_amt_A = target_color_A - blend_color_A;
|
||||||
}
|
}
|
||||||
denominator = bleed_length * bleed_length + bleed_length;
|
denominator = bleed_length * bleed_length + bleed_length;
|
||||||
denominator = 2.0 / denominator;
|
denominator = 2.0 / denominator;
|
||||||
n = bleed_length;
|
n = bleed_length;
|
||||||
for (i = sbi; i < lbi; i += bytes)
|
for (i = sbi; i < lbi; i += bytes)
|
||||||
{
|
{
|
||||||
/* check against original colour */
|
/* check against original color */
|
||||||
if (!threshold_exceeded (sb + Ri,
|
if (!threshold_exceeded (sb + Ri,
|
||||||
sb + i,
|
sb + i,
|
||||||
edge,
|
edge,
|
||||||
|
@ -684,40 +684,40 @@ render_wind_row (guchar *sb,
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
blend_colour_R += blend_amt_R * n * denominator;
|
blend_color_R += blend_amt_R * n * denominator;
|
||||||
blend_colour_G += blend_amt_G * n * denominator;
|
blend_color_G += blend_amt_G * n * denominator;
|
||||||
blend_colour_B += blend_amt_B * n * denominator;
|
blend_color_B += blend_amt_B * n * denominator;
|
||||||
|
|
||||||
if (bytes > 3)
|
if (bytes > 3)
|
||||||
{
|
{
|
||||||
blend_colour_A += blend_amt_A * n * denominator;
|
blend_color_A += blend_amt_A * n * denominator;
|
||||||
if (blend_colour_A > 255)
|
if (blend_color_A > 255)
|
||||||
blend_colour_A = 255;
|
blend_color_A = 255;
|
||||||
else if (blend_colour_A < 0)
|
else if (blend_color_A < 0)
|
||||||
blend_colour_A = 0;
|
blend_color_A = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (blend_colour_R > 255)
|
if (blend_color_R > 255)
|
||||||
blend_colour_R = 255;
|
blend_color_R = 255;
|
||||||
else if (blend_colour_R < 0)
|
else if (blend_color_R < 0)
|
||||||
blend_colour_R = 0;
|
blend_color_R = 0;
|
||||||
|
|
||||||
if (blend_colour_G > 255)
|
if (blend_color_G > 255)
|
||||||
blend_colour_G = 255;
|
blend_color_G = 255;
|
||||||
else if (blend_colour_G < 0)
|
else if (blend_color_G < 0)
|
||||||
blend_colour_G = 0;
|
blend_color_G = 0;
|
||||||
|
|
||||||
if (blend_colour_B > 255)
|
if (blend_color_B > 255)
|
||||||
blend_colour_B = 255;
|
blend_color_B = 255;
|
||||||
else if (blend_colour_B < 0)
|
else if (blend_color_B < 0)
|
||||||
blend_colour_B = 0;
|
blend_color_B = 0;
|
||||||
|
|
||||||
sb[i + 0] = (blend_colour_R * 2 + sb[i + 0]) / 3;
|
sb[i + 0] = (blend_color_R * 2 + sb[i + 0]) / 3;
|
||||||
sb[i + 1] = (blend_colour_G * 2 + sb[i + 1]) / 3;
|
sb[i + 1] = (blend_color_G * 2 + sb[i + 1]) / 3;
|
||||||
sb[i + 2] = (blend_colour_B * 2 + sb[i + 2]) / 3;
|
sb[i + 2] = (blend_color_B * 2 + sb[i + 2]) / 3;
|
||||||
|
|
||||||
if (bytes > 3)
|
if (bytes > 3)
|
||||||
sb[i + 3] = (blend_colour_A * 2 + sb[i + 3]) / 3;
|
sb[i + 3] = (blend_color_A * 2 + sb[i + 3]) / 3;
|
||||||
|
|
||||||
if (threshold_exceeded (sb + i,
|
if (threshold_exceeded (sb + i,
|
||||||
sb + i + comp_stride,
|
sb + i + comp_stride,
|
||||||
|
@ -725,16 +725,16 @@ render_wind_row (guchar *sb,
|
||||||
threshold,
|
threshold,
|
||||||
bytes > 3))
|
bytes > 3))
|
||||||
{
|
{
|
||||||
target_colour_R = sb[i + comp_stride + 0];
|
target_color_R = sb[i + comp_stride + 0];
|
||||||
target_colour_G = sb[i + comp_stride + 1];
|
target_color_G = sb[i + comp_stride + 1];
|
||||||
target_colour_B = sb[i + comp_stride + 2];
|
target_color_B = sb[i + comp_stride + 2];
|
||||||
if (bytes > 3)
|
if (bytes > 3)
|
||||||
target_colour_A = sb[i + comp_stride + 3];
|
target_color_A = sb[i + comp_stride + 3];
|
||||||
blend_amt_R = target_colour_R - blend_colour_R;
|
blend_amt_R = target_color_R - blend_color_R;
|
||||||
blend_amt_G = target_colour_G - blend_colour_G;
|
blend_amt_G = target_color_G - blend_color_G;
|
||||||
blend_amt_B = target_colour_B - blend_colour_B;
|
blend_amt_B = target_color_B - blend_color_B;
|
||||||
if (bytes > 3)
|
if (bytes > 3)
|
||||||
blend_amt_A = target_colour_A - blend_colour_A;
|
blend_amt_A = target_color_A - blend_color_A;
|
||||||
denominator = n * n + n;
|
denominator = n * n + n;
|
||||||
denominator = 2.0 / denominator;
|
denominator = 2.0 / denominator;
|
||||||
}
|
}
|
||||||
|
|
|
@ -897,7 +897,7 @@ create_fits_header (FitsFile *ofp,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Save direct colours (GRAY, GRAYA, RGB, RGBA) */
|
/* Save direct colors (GRAY, GRAYA, RGB, RGBA) */
|
||||||
static gint
|
static gint
|
||||||
save_fits (FitsFile *ofp,
|
save_fits (FitsFile *ofp,
|
||||||
gint32 image_ID,
|
gint32 image_ID,
|
||||||
|
|
|
@ -3,7 +3,7 @@ Load
|
||||||
Photoshop 2.0 and lower files are not supported due to lack of
|
Photoshop 2.0 and lower files are not supported due to lack of
|
||||||
file specs and test files.
|
file specs and test files.
|
||||||
|
|
||||||
Add text names for colour modes
|
Add text names for color modes
|
||||||
|
|
||||||
Parasite for layer blending ranges per channel?
|
Parasite for layer blending ranges per channel?
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@ Image resources:
|
||||||
width and height units dropped.
|
width and height units dropped.
|
||||||
|
|
||||||
1007 - Display info
|
1007 - Display info
|
||||||
save colour space & colour as parasite if unable to display.
|
save color space & color as parasite if unable to display.
|
||||||
|
|
||||||
1008 - caption - Add to XMP data block.
|
1008 - caption - Add to XMP data block.
|
||||||
|
|
||||||
|
|
|
@ -25,19 +25,19 @@
|
||||||
|
|
||||||
PSD_PS2_IMAGE_INFO = 1000, Dropped * 0x03e8 - Obsolete - ps 2.0 image info *
|
PSD_PS2_IMAGE_INFO = 1000, Dropped * 0x03e8 - Obsolete - ps 2.0 image info *
|
||||||
PSD_MAC_PRINT_INFO = 1001, PS Only * 0x03e9 - Optional - Mac print manager print info record *
|
PSD_MAC_PRINT_INFO = 1001, PS Only * 0x03e9 - Optional - Mac print manager print info record *
|
||||||
PSD_PS2_COLOR_TAB = 1003, Dropped * 0x03eb - Obsolete - ps 2.0 indexed colour table *
|
PSD_PS2_COLOR_TAB = 1003, Dropped * 0x03eb - Obsolete - ps 2.0 indexed color table *
|
||||||
PSD_RESN_INFO = 1005, Loaded * 0x03ed - ResolutionInfo structure *
|
PSD_RESN_INFO = 1005, Loaded * 0x03ed - ResolutionInfo structure *
|
||||||
PSD_ALPHA_NAMES = 1006, Loaded * 0x03ee - Alpha channel names *
|
PSD_ALPHA_NAMES = 1006, Loaded * 0x03ee - Alpha channel names *
|
||||||
PSD_DISPLAY_INFO = 1007, Loaded * 0x03ef - DisplayInfo structure *
|
PSD_DISPLAY_INFO = 1007, Loaded * 0x03ef - DisplayInfo structure *
|
||||||
PSD_CAPTION = 1008, Loaded * 0x03f0 - Optional - Caption string *
|
PSD_CAPTION = 1008, Loaded * 0x03f0 - Optional - Caption string *
|
||||||
PSD_BORDER_INFO = 1009, * 0x03f1 - Border info *
|
PSD_BORDER_INFO = 1009, * 0x03f1 - Border info *
|
||||||
PSD_BACKGROUND_COL = 1010, * 0x03f2 - Background colour *
|
PSD_BACKGROUND_COL = 1010, * 0x03f2 - Background color *
|
||||||
PSD_PRINT_FLAGS = 1011, * 0x03f3 - Print flags *
|
PSD_PRINT_FLAGS = 1011, * 0x03f3 - Print flags *
|
||||||
PSD_GREY_HALFTONE = 1012, * 0x03f4 - Greyscale and multichannel halftoning info *
|
PSD_GREY_HALFTONE = 1012, * 0x03f4 - Greyscale and multichannel halftoning info *
|
||||||
PSD_COLOR_HALFTONE = 1013, * 0x03f5 - Colour halftoning info *
|
PSD_COLOR_HALFTONE = 1013, * 0x03f5 - Color halftoning info *
|
||||||
PSD_DUOTONE_HALFTONE = 1014, * 0x03f6 - Duotone halftoning info *
|
PSD_DUOTONE_HALFTONE = 1014, * 0x03f6 - Duotone halftoning info *
|
||||||
PSD_GREY_XFER = 1015, * 0x03f7 - Greyscale and multichannel transfer functions *
|
PSD_GREY_XFER = 1015, * 0x03f7 - Greyscale and multichannel transfer functions *
|
||||||
PSD_COLOR_XFER = 1016, * 0x03f8 - Colour transfer functions *
|
PSD_COLOR_XFER = 1016, * 0x03f8 - Color transfer functions *
|
||||||
PSD_DUOTONE_XFER = 1017, * 0x03f9 - Duotone transfer functions *
|
PSD_DUOTONE_XFER = 1017, * 0x03f9 - Duotone transfer functions *
|
||||||
PSD_DUOTONE_INFO = 1018, * 0x03fa - Duotone image information *
|
PSD_DUOTONE_INFO = 1018, * 0x03fa - Duotone image information *
|
||||||
PSD_EFFECTIVE_BW = 1019, * 0x03fb - Effective black & white values for dot range *
|
PSD_EFFECTIVE_BW = 1019, * 0x03fb - Effective black & white values for dot range *
|
||||||
|
@ -58,7 +58,7 @@
|
||||||
PSD_URL = 1035, * 0x040b - URL string *
|
PSD_URL = 1035, * 0x040b - URL string *
|
||||||
PSD_THUMB_RES2 = 1036, Special * 0x040c - Thumbnail resource *
|
PSD_THUMB_RES2 = 1036, Special * 0x040c - Thumbnail resource *
|
||||||
PSD_GLOBAL_ANGLE = 1037, * 0x040d - Global angle *
|
PSD_GLOBAL_ANGLE = 1037, * 0x040d - Global angle *
|
||||||
PSD_COLOR_SAMPLER = 1038, * 0x040e - Colour samplers resource *
|
PSD_COLOR_SAMPLER = 1038, * 0x040e - Color samplers resource *
|
||||||
PSD_ICC_PROFILE = 1039, Loaded * 0x040f - ICC Profile *
|
PSD_ICC_PROFILE = 1039, Loaded * 0x040f - ICC Profile *
|
||||||
PSD_WATERMARK = 1040, * 0x0410 - Watermark *
|
PSD_WATERMARK = 1040, * 0x0410 - Watermark *
|
||||||
PSD_ICC_UNTAGGED = 1041, * 0x0411 - Do not use ICC profile flag *
|
PSD_ICC_UNTAGGED = 1041, * 0x0411 - Do not use ICC profile flag *
|
||||||
|
@ -66,8 +66,8 @@
|
||||||
PSD_SPOT_HALFTONE = 1043, * 0x0413 - Spot halftone *
|
PSD_SPOT_HALFTONE = 1043, * 0x0413 - Spot halftone *
|
||||||
PSD_DOC_IDS = 1044, * 0x0414 - Document specific IDs *
|
PSD_DOC_IDS = 1044, * 0x0414 - Document specific IDs *
|
||||||
PSD_ALPHA_NAMES_UNI = 1045, Loaded * 0x0415 - Unicode alpha names *
|
PSD_ALPHA_NAMES_UNI = 1045, Loaded * 0x0415 - Unicode alpha names *
|
||||||
PSD_IDX_COL_TAB_CNT = 1046, Loaded * 0x0416 - Indexed colour table count *
|
PSD_IDX_COL_TAB_CNT = 1046, Loaded * 0x0416 - Indexed color table count *
|
||||||
PSD_IDX_TRANSPARENT = 1047, * 0x0417 - Index of transparent colour (if any) *
|
PSD_IDX_TRANSPARENT = 1047, * 0x0417 - Index of transparent color (if any) *
|
||||||
PSD_GLOBAL_ALT = 1049, * 0x0419 - Global altitude *
|
PSD_GLOBAL_ALT = 1049, * 0x0419 - Global altitude *
|
||||||
PSD_SLICES = 1050, * 0x041a - Slices *
|
PSD_SLICES = 1050, * 0x041a - Slices *
|
||||||
PSD_WORKFLOW_URL_UNI = 1051, * 0x041b - Workflow URL - Unicode string *
|
PSD_WORKFLOW_URL_UNI = 1051, * 0x041b - Workflow URL - Unicode string *
|
||||||
|
|
|
@ -141,8 +141,8 @@ load_image (const gchar *filename,
|
||||||
goto load_error;
|
goto load_error;
|
||||||
gimp_progress_update (0.1);
|
gimp_progress_update (0.1);
|
||||||
|
|
||||||
/* ----- Read the PSD file Colour Mode block ----- */
|
/* ----- Read the PSD file Color Mode block ----- */
|
||||||
IFDBG(2) g_debug ("Read colour mode block");
|
IFDBG(2) g_debug ("Read color mode block");
|
||||||
if (read_color_mode_block (&img_a, f, &error) < 0)
|
if (read_color_mode_block (&img_a, f, &error) < 0)
|
||||||
goto load_error;
|
goto load_error;
|
||||||
gimp_progress_update (0.2);
|
gimp_progress_update (0.2);
|
||||||
|
@ -173,7 +173,7 @@ load_image (const gchar *filename,
|
||||||
goto load_error;
|
goto load_error;
|
||||||
gimp_progress_update (0.6);
|
gimp_progress_update (0.6);
|
||||||
|
|
||||||
/* ----- Add colour map ----- */
|
/* ----- Add color map ----- */
|
||||||
IFDBG(2) g_debug ("Add color map");
|
IFDBG(2) g_debug ("Add color map");
|
||||||
if (add_color_map (image_id, &img_a) < 0)
|
if (add_color_map (image_id, &img_a) < 0)
|
||||||
goto load_error;
|
goto load_error;
|
||||||
|
@ -428,7 +428,7 @@ read_color_mode_block (PSDimage *img_a,
|
||||||
memcpy (img_a->color_map, cmap, img_a->color_map_len);
|
memcpy (img_a->color_map, cmap, img_a->color_map_len);
|
||||||
img_a->color_map_entries = 2;
|
img_a->color_map_entries = 2;
|
||||||
}
|
}
|
||||||
IFDBG(2) g_debug ("Colour map data length %d", img_a->color_map_len);
|
IFDBG(2) g_debug ("Color map data length %d", img_a->color_map_len);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -90,8 +90,8 @@ load_thumbnail_image (const gchar *filename,
|
||||||
goto load_error;
|
goto load_error;
|
||||||
gimp_progress_update (0.2);
|
gimp_progress_update (0.2);
|
||||||
|
|
||||||
/* ----- Read the PSD file Colour Mode block ----- */
|
/* ----- Read the PSD file Color Mode block ----- */
|
||||||
IFDBG(2) g_debug ("Read colour mode block");
|
IFDBG(2) g_debug ("Read color mode block");
|
||||||
if (read_color_mode_block (&img_a, f, &error) < 0)
|
if (read_color_mode_block (&img_a, f, &error) < 0)
|
||||||
goto load_error;
|
goto load_error;
|
||||||
gimp_progress_update (0.4);
|
gimp_progress_update (0.4);
|
||||||
|
|
|
@ -134,7 +134,7 @@
|
||||||
|
|
||||||
/* PSD spec enums */
|
/* PSD spec enums */
|
||||||
|
|
||||||
/* Image colour modes */
|
/* Image color modes */
|
||||||
typedef enum {
|
typedef enum {
|
||||||
PSD_BITMAP = 0, /* Bitmap image */
|
PSD_BITMAP = 0, /* Bitmap image */
|
||||||
PSD_GRAYSCALE = 1, /* Greyscale image */
|
PSD_GRAYSCALE = 1, /* Greyscale image */
|
||||||
|
@ -146,13 +146,13 @@ typedef enum {
|
||||||
PSD_LAB = 9 /* L*a*b image */
|
PSD_LAB = 9 /* L*a*b image */
|
||||||
} PSDColorMode;
|
} PSDColorMode;
|
||||||
|
|
||||||
/* Image colour spaces */
|
/* Image color spaces */
|
||||||
typedef enum {
|
typedef enum {
|
||||||
PSD_CS_RGB = 0, /* RGB */
|
PSD_CS_RGB = 0, /* RGB */
|
||||||
PSD_CS_HSB = 1, /* Hue, Saturation, Brightness */
|
PSD_CS_HSB = 1, /* Hue, Saturation, Brightness */
|
||||||
PSD_CS_CMYK = 2, /* CMYK */
|
PSD_CS_CMYK = 2, /* CMYK */
|
||||||
PSD_CS_PANTONE = 3, /* Pantone matching system (Lab)*/
|
PSD_CS_PANTONE = 3, /* Pantone matching system (Lab)*/
|
||||||
PSD_CS_FOCOLTONE = 4, /* Focoltone colour system (CMYK)*/
|
PSD_CS_FOCOLTONE = 4, /* Focoltone color system (CMYK)*/
|
||||||
PSD_CS_TRUMATCH = 5, /* Trumatch color (CMYK)*/
|
PSD_CS_TRUMATCH = 5, /* Trumatch color (CMYK)*/
|
||||||
PSD_CS_TOYO = 6, /* Toyo 88 colorfinder 1050 (Lab)*/
|
PSD_CS_TOYO = 6, /* Toyo 88 colorfinder 1050 (Lab)*/
|
||||||
PSD_CS_LAB = 7, /* L*a*b*/
|
PSD_CS_LAB = 7, /* L*a*b*/
|
||||||
|
@ -166,19 +166,19 @@ typedef enum {
|
||||||
typedef enum {
|
typedef enum {
|
||||||
PSD_PS2_IMAGE_INFO = 1000, /* 0x03e8 - Obsolete - ps 2.0 image info */
|
PSD_PS2_IMAGE_INFO = 1000, /* 0x03e8 - Obsolete - ps 2.0 image info */
|
||||||
PSD_MAC_PRINT_INFO = 1001, /* 0x03e9 - Optional - Mac print manager print info record */
|
PSD_MAC_PRINT_INFO = 1001, /* 0x03e9 - Optional - Mac print manager print info record */
|
||||||
PSD_PS2_COLOR_TAB = 1003, /* 0x03eb - Obsolete - ps 2.0 indexed colour table */
|
PSD_PS2_COLOR_TAB = 1003, /* 0x03eb - Obsolete - ps 2.0 indexed color table */
|
||||||
PSD_RESN_INFO = 1005, /* 0x03ed - ResolutionInfo structure */
|
PSD_RESN_INFO = 1005, /* 0x03ed - ResolutionInfo structure */
|
||||||
PSD_ALPHA_NAMES = 1006, /* 0x03ee - Alpha channel names */
|
PSD_ALPHA_NAMES = 1006, /* 0x03ee - Alpha channel names */
|
||||||
PSD_DISPLAY_INFO = 1007, /* 0x03ef - DisplayInfo structure */
|
PSD_DISPLAY_INFO = 1007, /* 0x03ef - DisplayInfo structure */
|
||||||
PSD_CAPTION = 1008, /* 0x03f0 - Optional - Caption string */
|
PSD_CAPTION = 1008, /* 0x03f0 - Optional - Caption string */
|
||||||
PSD_BORDER_INFO = 1009, /* 0x03f1 - Border info */
|
PSD_BORDER_INFO = 1009, /* 0x03f1 - Border info */
|
||||||
PSD_BACKGROUND_COL = 1010, /* 0x03f2 - Background colour */
|
PSD_BACKGROUND_COL = 1010, /* 0x03f2 - Background color */
|
||||||
PSD_PRINT_FLAGS = 1011, /* 0x03f3 - Print flags */
|
PSD_PRINT_FLAGS = 1011, /* 0x03f3 - Print flags */
|
||||||
PSD_GREY_HALFTONE = 1012, /* 0x03f4 - Greyscale and multichannel halftoning info */
|
PSD_GREY_HALFTONE = 1012, /* 0x03f4 - Greyscale and multichannel halftoning info */
|
||||||
PSD_COLOR_HALFTONE = 1013, /* 0x03f5 - Colour halftoning info */
|
PSD_COLOR_HALFTONE = 1013, /* 0x03f5 - Color halftoning info */
|
||||||
PSD_DUOTONE_HALFTONE = 1014, /* 0x03f6 - Duotone halftoning info */
|
PSD_DUOTONE_HALFTONE = 1014, /* 0x03f6 - Duotone halftoning info */
|
||||||
PSD_GREY_XFER = 1015, /* 0x03f7 - Greyscale and multichannel transfer functions */
|
PSD_GREY_XFER = 1015, /* 0x03f7 - Greyscale and multichannel transfer functions */
|
||||||
PSD_COLOR_XFER = 1016, /* 0x03f8 - Colour transfer functions */
|
PSD_COLOR_XFER = 1016, /* 0x03f8 - Color transfer functions */
|
||||||
PSD_DUOTONE_XFER = 1017, /* 0x03f9 - Duotone transfer functions */
|
PSD_DUOTONE_XFER = 1017, /* 0x03f9 - Duotone transfer functions */
|
||||||
PSD_DUOTONE_INFO = 1018, /* 0x03fa - Duotone image information */
|
PSD_DUOTONE_INFO = 1018, /* 0x03fa - Duotone image information */
|
||||||
PSD_EFFECTIVE_BW = 1019, /* 0x03fb - Effective black & white values for dot range */
|
PSD_EFFECTIVE_BW = 1019, /* 0x03fb - Effective black & white values for dot range */
|
||||||
|
@ -199,7 +199,7 @@ typedef enum {
|
||||||
PSD_URL = 1035, /* 0x040b - URL string */
|
PSD_URL = 1035, /* 0x040b - URL string */
|
||||||
PSD_THUMB_RES2 = 1036, /* 0x040c - Thumbnail resource */
|
PSD_THUMB_RES2 = 1036, /* 0x040c - Thumbnail resource */
|
||||||
PSD_GLOBAL_ANGLE = 1037, /* 0x040d - Global angle */
|
PSD_GLOBAL_ANGLE = 1037, /* 0x040d - Global angle */
|
||||||
PSD_COLOR_SAMPLER = 1038, /* 0x040e - Colour samplers resource */
|
PSD_COLOR_SAMPLER = 1038, /* 0x040e - Color samplers resource */
|
||||||
PSD_ICC_PROFILE = 1039, /* 0x040f - ICC Profile */
|
PSD_ICC_PROFILE = 1039, /* 0x040f - ICC Profile */
|
||||||
PSD_WATERMARK = 1040, /* 0x0410 - Watermark */
|
PSD_WATERMARK = 1040, /* 0x0410 - Watermark */
|
||||||
PSD_ICC_UNTAGGED = 1041, /* 0x0411 - Do not use ICC profile flag */
|
PSD_ICC_UNTAGGED = 1041, /* 0x0411 - Do not use ICC profile flag */
|
||||||
|
@ -207,8 +207,8 @@ typedef enum {
|
||||||
PSD_SPOT_HALFTONE = 1043, /* 0x0413 - Spot halftone */
|
PSD_SPOT_HALFTONE = 1043, /* 0x0413 - Spot halftone */
|
||||||
PSD_DOC_IDS = 1044, /* 0x0414 - Document specific IDs */
|
PSD_DOC_IDS = 1044, /* 0x0414 - Document specific IDs */
|
||||||
PSD_ALPHA_NAMES_UNI = 1045, /* 0x0415 - Unicode alpha names */
|
PSD_ALPHA_NAMES_UNI = 1045, /* 0x0415 - Unicode alpha names */
|
||||||
PSD_IDX_COL_TAB_CNT = 1046, /* 0x0416 - Indexed colour table count */
|
PSD_IDX_COL_TAB_CNT = 1046, /* 0x0416 - Indexed color table count */
|
||||||
PSD_IDX_TRANSPARENT = 1047, /* 0x0417 - Index of transparent colour (if any) */
|
PSD_IDX_TRANSPARENT = 1047, /* 0x0417 - Index of transparent color (if any) */
|
||||||
PSD_GLOBAL_ALT = 1049, /* 0x0419 - Global altitude */
|
PSD_GLOBAL_ALT = 1049, /* 0x0419 - Global altitude */
|
||||||
PSD_SLICES = 1050, /* 0x041a - Slices */
|
PSD_SLICES = 1050, /* 0x041a - Slices */
|
||||||
PSD_WORKFLOW_URL_UNI = 1051, /* 0x041b - Workflow URL - Unicode string */
|
PSD_WORKFLOW_URL_UNI = 1051, /* 0x041b - Workflow URL - Unicode string */
|
||||||
|
@ -294,7 +294,7 @@ typedef enum {
|
||||||
typedef gint32 Fixed; /* Represents a fixed point implied decimal */
|
typedef gint32 Fixed; /* Represents a fixed point implied decimal */
|
||||||
|
|
||||||
|
|
||||||
/* Apple colour space data structures */
|
/* Apple color space data structures */
|
||||||
|
|
||||||
/* RGB Color Value
|
/* RGB Color Value
|
||||||
A color value expressed in the RGB color space is composed of red, green,
|
A color value expressed in the RGB color space is composed of red, green,
|
||||||
|
@ -412,7 +412,7 @@ typedef struct {
|
||||||
|
|
||||||
/* Channel display info data */
|
/* Channel display info data */
|
||||||
typedef struct {
|
typedef struct {
|
||||||
gint16 colorSpace; /* Colour space from PSDColorSpace */
|
gint16 colorSpace; /* Color space from PSDColorSpace */
|
||||||
guint16 color[4]; /* 4 * 16 bit color components */
|
guint16 color[4]; /* 4 * 16 bit color components */
|
||||||
gint16 opacity; /* Opacity 0 to 100 */
|
gint16 opacity; /* Opacity 0 to 100 */
|
||||||
gchar kind; /* Selected = 0, Protected = 1 */
|
gchar kind; /* Selected = 0, Protected = 1 */
|
||||||
|
@ -451,9 +451,9 @@ typedef struct
|
||||||
gint32 left; /* Layer left */
|
gint32 left; /* Layer left */
|
||||||
gint32 bottom; /* Layer bottom */
|
gint32 bottom; /* Layer bottom */
|
||||||
gint32 right; /* Layer right */
|
gint32 right; /* Layer right */
|
||||||
guchar def_color; /* Default background colour */
|
guchar def_color; /* Default background color */
|
||||||
guchar flags; /* Layer flags */
|
guchar flags; /* Layer flags */
|
||||||
guchar extra_def_color; /* Real default background colour */
|
guchar extra_def_color; /* Real default background color */
|
||||||
guchar extra_flags; /* Real layer flags */
|
guchar extra_flags; /* Real layer flags */
|
||||||
MaskFlags mask_flags; /* Flags */
|
MaskFlags mask_flags; /* Flags */
|
||||||
} LayerMask;
|
} LayerMask;
|
||||||
|
@ -509,8 +509,8 @@ typedef struct
|
||||||
GimpRGB gimp_color; /* Gimp RGB color */
|
GimpRGB gimp_color; /* Gimp RGB color */
|
||||||
gint16 opacity; /* Opacity */
|
gint16 opacity; /* Opacity */
|
||||||
guchar ps_kind; /* PS type flag */
|
guchar ps_kind; /* PS type flag */
|
||||||
gint16 ps_cspace; /* PS colour space */
|
gint16 ps_cspace; /* PS color space */
|
||||||
CMColor ps_color; /* PS colour */
|
CMColor ps_color; /* PS color */
|
||||||
} PSDchanneldata;
|
} PSDchanneldata;
|
||||||
|
|
||||||
/* PSD Image Resource data structure */
|
/* PSD Image Resource data structure */
|
||||||
|
@ -540,12 +540,12 @@ typedef struct
|
||||||
guint32 rows; /* Number of rows: 1 - 30000 */
|
guint32 rows; /* Number of rows: 1 - 30000 */
|
||||||
guint32 columns; /* Number of columns: 1 - 30000 */
|
guint32 columns; /* Number of columns: 1 - 30000 */
|
||||||
guint16 bps; /* Bits per channel: 1, 8 or 16 */
|
guint16 bps; /* Bits per channel: 1, 8 or 16 */
|
||||||
guint16 color_mode; /* Image colour mode: {PSDColorMode} */
|
guint16 color_mode; /* Image color mode: {PSDColorMode} */
|
||||||
GimpImageBaseType base_type; /* Image base colour mode: (GIMP) */
|
GimpImageBaseType base_type; /* Image base color mode: (GIMP) */
|
||||||
guint16 comp_mode; /* Merged image compression mode */
|
guint16 comp_mode; /* Merged image compression mode */
|
||||||
guchar *color_map; /* Colour map data */
|
guchar *color_map; /* Color map data */
|
||||||
guint32 color_map_len; /* Colour map data length */
|
guint32 color_map_len; /* Color map data length */
|
||||||
guint32 color_map_entries; /* Colour map number of entries */
|
guint32 color_map_entries; /* Color map number of entries */
|
||||||
guint32 image_res_start; /* Image resource block start address */
|
guint32 image_res_start; /* Image resource block start address */
|
||||||
guint32 image_res_len; /* Image resource block length */
|
guint32 image_res_len; /* Image resource block length */
|
||||||
guint32 mask_layer_start; /* Mask & layer block start address */
|
guint32 mask_layer_start; /* Mask & layer block start address */
|
||||||
|
|
|
@ -45,7 +45,7 @@ Control points can be hidden.
|
||||||
To aid alignment of objects a "grid" can be placed on the drawing area.
|
To aid alignment of objects a "grid" can be placed on the drawing area.
|
||||||
This can be either a normal rectangular grid or a polar type grid centered
|
This can be either a normal rectangular grid or a polar type grid centered
|
||||||
in the drawing area.
|
in the drawing area.
|
||||||
The spacings of the grid can be changed as well as the colours used to draw the
|
The spacings of the grid can be changed as well as the colors used to draw the
|
||||||
grid lines. When "Snap to grid" is checked then all operations will be
|
grid lines. When "Snap to grid" is checked then all operations will be
|
||||||
constrained to fall on a grid intersection. (Fun when using the polar grid).
|
constrained to fall on a grid intersection. (Fun when using the polar grid).
|
||||||
Additionally the third mouse button will constrain the point movement to be
|
Additionally the third mouse button will constrain the point movement to be
|
||||||
|
@ -67,13 +67,13 @@ There are three possible mode when painting.
|
||||||
Brush
|
Brush
|
||||||
~~~~~
|
~~~~~
|
||||||
When the paint button is pressed each object will be rendered/drawn onto
|
When the paint button is pressed each object will be rendered/drawn onto
|
||||||
the image using the currently selected ink colour. The objects can be drawn
|
the image using the currently selected ink color. The objects can be drawn
|
||||||
onto the original layer or onto a new layer (either a single layer or
|
onto the original layer or onto a new layer (either a single layer or
|
||||||
multiple layers - latter is good for animations). When new layers are
|
multiple layers - latter is good for animations). When new layers are
|
||||||
created the background can either be:-
|
created the background can either be:-
|
||||||
|
|
||||||
Transparent.
|
Transparent.
|
||||||
Background (the current BG colour).
|
Background (the current BG color).
|
||||||
White.
|
White.
|
||||||
Copy.
|
Copy.
|
||||||
|
|
||||||
|
|
|
@ -187,7 +187,7 @@ find_grid_pos_polar (GdkPoint *p,
|
||||||
/* return the new position in the passed point */
|
/* return the new position in the passed point */
|
||||||
|
|
||||||
void
|
void
|
||||||
gfig_grid_colours (GtkWidget *widget)
|
gfig_grid_colors (GtkWidget *widget)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -38,7 +38,7 @@
|
||||||
|
|
||||||
extern gint grid_gc_type;
|
extern gint grid_gc_type;
|
||||||
|
|
||||||
void gfig_grid_colours (GtkWidget *widget);
|
void gfig_grid_colors (GtkWidget *widget);
|
||||||
void find_grid_pos (GdkPoint *p,
|
void find_grid_pos (GdkPoint *p,
|
||||||
GdkPoint *gp,
|
GdkPoint *gp,
|
||||||
guint state);
|
guint state);
|
||||||
|
|
|
@ -142,7 +142,7 @@ gfig_preview_realize (GtkWidget *widget)
|
||||||
|
|
||||||
gdk_window_set_cursor (gtk_widget_get_window (gfig_context->preview),
|
gdk_window_set_cursor (gtk_widget_get_window (gfig_context->preview),
|
||||||
gdk_cursor_new_for_display (display, GDK_CROSSHAIR));
|
gdk_cursor_new_for_display (display, GDK_CROSSHAIR));
|
||||||
gfig_grid_colours (widget);
|
gfig_grid_colors (widget);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
@ -125,7 +125,7 @@ query (void)
|
||||||
"including Lines, Circles, Ellipses, Curves, Polygons, "
|
"including Lines, Circles, Ellipses, Curves, Polygons, "
|
||||||
"pointed stars, Bezier curves, and Spirals. "
|
"pointed stars, Bezier curves, and Spirals. "
|
||||||
"Objects can be painted using Brushes or other tools"
|
"Objects can be painted using Brushes or other tools"
|
||||||
"or filled using colours or patterns. "
|
"or filled using colors or patterns. "
|
||||||
"Gfig objects can also be used to create selections. ",
|
"Gfig objects can also be used to create selections. ",
|
||||||
"Andy Thomas",
|
"Andy Thomas",
|
||||||
"Andy Thomas",
|
"Andy Thomas",
|
||||||
|
|
|
@ -130,7 +130,7 @@ render_indexed_image(Preview_t *preview_base, GimpPixelRgn *srcrgn)
|
||||||
gint dwidth, dheight, pwidth, pheight;
|
gint dwidth, dheight, pwidth, pheight;
|
||||||
gint *src_col;
|
gint *src_col;
|
||||||
gint bpp, alpha, has_alpha;
|
gint bpp, alpha, has_alpha;
|
||||||
guchar *cmap, *colour;
|
guchar *cmap, *color;
|
||||||
gint ncols;
|
gint ncols;
|
||||||
gboolean gray = get_map_info()->show_gray;
|
gboolean gray = get_map_info()->show_gray;
|
||||||
GtkWidget *preview = preview_base->preview;
|
GtkWidget *preview = preview_base->preview;
|
||||||
|
@ -162,18 +162,18 @@ render_indexed_image(Preview_t *preview_base, GimpPixelRgn *srcrgn)
|
||||||
|
|
||||||
for (col = 0; col < pwidth; col++) {
|
for (col = 0; col < pwidth; col++) {
|
||||||
src = &src_row[src_col[col]];
|
src = &src_row[src_col[col]];
|
||||||
colour = cmap + 3 * (int)(*src);
|
color = cmap + 3 * (int)(*src);
|
||||||
|
|
||||||
if (gray) {
|
if (gray) {
|
||||||
guchar avg = (299 * colour[0] + 587 * colour[1] +
|
guchar avg = (299 * color[0] + 587 * color[1] +
|
||||||
114 * colour[2]) / 1000;
|
114 * color[2]) / 1000;
|
||||||
*dest++ = avg;
|
*dest++ = avg;
|
||||||
*dest++ = avg;
|
*dest++ = avg;
|
||||||
*dest++ = avg;
|
*dest++ = avg;
|
||||||
} else {
|
} else {
|
||||||
*dest++ = colour[0];
|
*dest++ = color[0];
|
||||||
*dest++ = colour[1];
|
*dest++ = color[1];
|
||||||
*dest++ = colour[2];
|
*dest++ = color[2];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,14 +18,14 @@
|
||||||
;
|
;
|
||||||
; Version 0.2 10.6.97 Changed to new script-fu interface in 0.99.10
|
; Version 0.2 10.6.97 Changed to new script-fu interface in 0.99.10
|
||||||
|
|
||||||
; Delta the colour by the given amount. Check for boundary conditions
|
; Delta the color by the given amount. Check for boundary conditions
|
||||||
; If < 0 set to zero
|
; If < 0 set to zero
|
||||||
; If > 255 set to 255
|
; If > 255 set to 255
|
||||||
; Return the new value
|
; Return the new value
|
||||||
|
|
||||||
(define (script-fu-addborder aimg adraw xsize ysize colour dvalue)
|
(define (script-fu-addborder aimg adraw xsize ysize color dvalue)
|
||||||
|
|
||||||
(define (deltacolour col delta)
|
(define (deltacolor col delta)
|
||||||
(let* ((newcol (+ col delta)))
|
(let* ((newcol (+ col delta)))
|
||||||
(if (< newcol 0) (set! newcol 0))
|
(if (< newcol 0) (set! newcol 0))
|
||||||
(if (> newcol 255) (set! newcol 255))
|
(if (> newcol 255) (set! newcol 255))
|
||||||
|
@ -33,8 +33,8 @@
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
(define (adjcolour col delta)
|
(define (adjcolor col delta)
|
||||||
(mapcar (lambda (x) (deltacolour x delta)) col)
|
(mapcar (lambda (x) (deltacolor x delta)) col)
|
||||||
)
|
)
|
||||||
|
|
||||||
(define (gen_top_array xsize ysize owidth oheight width height)
|
(define (gen_top_array xsize ysize owidth oheight width height)
|
||||||
|
@ -122,26 +122,26 @@
|
||||||
(gimp-image-insert-layer img layer 0 0)
|
(gimp-image-insert-layer img layer 0 0)
|
||||||
(gimp-drawable-fill layer TRANSPARENT-FILL)
|
(gimp-drawable-fill layer TRANSPARENT-FILL)
|
||||||
|
|
||||||
(gimp-context-set-background (adjcolour colour dvalue))
|
(gimp-context-set-background (adjcolor color dvalue))
|
||||||
(gimp-image-select-polygon img
|
(gimp-image-select-polygon img
|
||||||
CHANNEL-OP-REPLACE
|
CHANNEL-OP-REPLACE
|
||||||
10
|
10
|
||||||
(gen_top_array xsize ysize owidth oheight width height))
|
(gen_top_array xsize ysize owidth oheight width height))
|
||||||
(gimp-edit-fill layer BACKGROUND-FILL)
|
(gimp-edit-fill layer BACKGROUND-FILL)
|
||||||
(gimp-context-set-background (adjcolour colour (/ dvalue 2)))
|
(gimp-context-set-background (adjcolor color (/ dvalue 2)))
|
||||||
(gimp-image-select-polygon img
|
(gimp-image-select-polygon img
|
||||||
CHANNEL-OP-REPLACE
|
CHANNEL-OP-REPLACE
|
||||||
10
|
10
|
||||||
(gen_left_array xsize ysize owidth oheight width height))
|
(gen_left_array xsize ysize owidth oheight width height))
|
||||||
(gimp-edit-fill layer BACKGROUND-FILL)
|
(gimp-edit-fill layer BACKGROUND-FILL)
|
||||||
(gimp-context-set-background (adjcolour colour (- 0 (/ dvalue 2))))
|
(gimp-context-set-background (adjcolor color (- 0 (/ dvalue 2))))
|
||||||
(gimp-image-select-polygon img
|
(gimp-image-select-polygon img
|
||||||
CHANNEL-OP-REPLACE
|
CHANNEL-OP-REPLACE
|
||||||
10
|
10
|
||||||
(gen_right_array xsize ysize owidth oheight width height))
|
(gen_right_array xsize ysize owidth oheight width height))
|
||||||
|
|
||||||
(gimp-edit-fill layer BACKGROUND-FILL)
|
(gimp-edit-fill layer BACKGROUND-FILL)
|
||||||
(gimp-context-set-background (adjcolour colour (- 0 dvalue)))
|
(gimp-context-set-background (adjcolor color (- 0 dvalue)))
|
||||||
(gimp-image-select-polygon img
|
(gimp-image-select-polygon img
|
||||||
CHANNEL-OP-REPLACE
|
CHANNEL-OP-REPLACE
|
||||||
10
|
10
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
; This script requires a grayscale image containing a single layer.
|
; This script requires a grayscale image containing a single layer.
|
||||||
; This layer is used as the mask for the carving effect
|
; This layer is used as the mask for the carving effect
|
||||||
; NOTE: This script requires the image to be carved to either be an
|
; NOTE: This script requires the image to be carved to either be an
|
||||||
; RGB colour or grayscale image with a single layer. An indexed file
|
; RGB color or grayscale image with a single layer. An indexed file
|
||||||
; can not be used due to the use of gimp-histogram and gimp-levels.
|
; can not be used due to the use of gimp-histogram and gimp-levels.
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
;
|
;
|
||||||
; fuzzy-border
|
; fuzzy-border
|
||||||
;
|
;
|
||||||
; Do a cool fade to a given colour at the border of an image (optional shadow)
|
; Do a cool fade to a given color at the border of an image (optional shadow)
|
||||||
; Will make image RGB if it isn't already.
|
; Will make image RGB if it isn't already.
|
||||||
;
|
;
|
||||||
; Chris Gutteridge (cjg@ecs.soton.ac.uk)
|
; Chris Gutteridge (cjg@ecs.soton.ac.uk)
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
; Set Colormap v1.1 September 29, 2004
|
; Set Colormap v1.1 September 29, 2004
|
||||||
; by Kevin Cozens <kcozens@interlog.com>
|
; by Kevin Cozens <kcozens@interlog.com>
|
||||||
;
|
;
|
||||||
; Change the colourmap of an image to the colours in a specified palette.
|
; Change the colormap of an image to the colors in a specified palette.
|
||||||
; Included is script-fu-make-cmap-array (available for use in scripts) which
|
; Included is script-fu-make-cmap-array (available for use in scripts) which
|
||||||
; returns an INT8ARRAY containing the colours from a specified palette.
|
; returns an INT8ARRAY containing the colors from a specified palette.
|
||||||
; This array can be used as the cmap argument for gimp-image-set-colormap.
|
; This array can be used as the cmap argument for gimp-image-set-colormap.
|
||||||
|
|
||||||
; GIMP - The GNU Image Manipulation Program
|
; GIMP - The GNU Image Manipulation Program
|
||||||
|
@ -24,17 +24,17 @@
|
||||||
|
|
||||||
(define (script-fu-make-cmap-array palette)
|
(define (script-fu-make-cmap-array palette)
|
||||||
(let* (
|
(let* (
|
||||||
(num-colours (car (gimp-palette-get-info palette)))
|
(num-colors (car (gimp-palette-get-info palette)))
|
||||||
(cmap (cons-array (* num-colours 3) 'byte))
|
(cmap (cons-array (* num-colors 3) 'byte))
|
||||||
(colour 0)
|
(color 0)
|
||||||
(i 0)
|
(i 0)
|
||||||
)
|
)
|
||||||
|
|
||||||
(while (< i num-colours)
|
(while (< i num-colors)
|
||||||
(set! colour (car (gimp-palette-entry-get-color palette i)))
|
(set! color (car (gimp-palette-entry-get-color palette i)))
|
||||||
(aset cmap (* i 3) (car colour))
|
(aset cmap (* i 3) (car color))
|
||||||
(aset cmap (+ (* i 3) 1) (cadr colour))
|
(aset cmap (+ (* i 3) 1) (cadr color))
|
||||||
(aset cmap (+ (* i 3) 2) (caddr colour))
|
(aset cmap (+ (* i 3) 2) (caddr color))
|
||||||
(set! i (+ i 1))
|
(set! i (+ i 1))
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
;
|
;
|
||||||
; Tiny-Fu first successfully ran this script at 2:07am on March 6, 2004.
|
; Tiny-Fu first successfully ran this script at 2:07am on March 6, 2004.
|
||||||
|
|
||||||
(define (script-fu-helloworld text font size colour)
|
(define (script-fu-helloworld text font size color)
|
||||||
(let* (
|
(let* (
|
||||||
(width 10)
|
(width 10)
|
||||||
(height 10)
|
(height 10)
|
||||||
|
@ -34,7 +34,7 @@
|
||||||
(gimp-context-push)
|
(gimp-context-push)
|
||||||
|
|
||||||
(gimp-image-undo-disable img)
|
(gimp-image-undo-disable img)
|
||||||
(gimp-context-set-foreground colour)
|
(gimp-context-set-foreground color)
|
||||||
|
|
||||||
(set! text-layer (car (gimp-text-fontname img -1 0 0 text 10 TRUE size PIXELS font)))
|
(set! text-layer (car (gimp-text-fontname img -1 0 0 text 10 TRUE size PIXELS font)))
|
||||||
(set! width (car (gimp-drawable-width text-layer)))
|
(set! width (car (gimp-drawable-width text-layer)))
|
||||||
|
|
Loading…
Reference in New Issue