Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
GIMP
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
2,776
Issues
2,776
List
Boards
Labels
Service Desk
Milestones
Merge Requests
39
Merge Requests
39
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
External Wiki
External Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
GNOME
GIMP
Commits
a0cb639b
Commit
a0cb639b
authored
Oct 04, 2000
by
Manish Singh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.1.27 stuff
-Yosh
parent
227468ba
Changes
79
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
79 changed files
with
17156 additions
and
15200 deletions
+17156
-15200
ChangeLog
ChangeLog
+4
-0
app/convert.c
app/convert.c
+46
-41
app/core/gimpimage-convert.c
app/core/gimpimage-convert.c
+46
-41
app/gimpimage-convert.c
app/gimpimage-convert.c
+46
-41
configure.in
configure.in
+1
-1
plug-ins/perl/po/ca.po
plug-ins/perl/po/ca.po
+1
-1
plug-ins/perl/po/cs.po
plug-ins/perl/po/cs.po
+1
-1
plug-ins/perl/po/da.po
plug-ins/perl/po/da.po
+1
-1
plug-ins/perl/po/de.po
plug-ins/perl/po/de.po
+1
-1
plug-ins/perl/po/en_GB.po
plug-ins/perl/po/en_GB.po
+1
-1
plug-ins/perl/po/es.po
plug-ins/perl/po/es.po
+124
-75
plug-ins/perl/po/fi.po
plug-ins/perl/po/fi.po
+1
-1
plug-ins/perl/po/fr.po
plug-ins/perl/po/fr.po
+806
-519
plug-ins/perl/po/ga.po
plug-ins/perl/po/ga.po
+1
-1
plug-ins/perl/po/gl.po
plug-ins/perl/po/gl.po
+1
-1
plug-ins/perl/po/hu.po
plug-ins/perl/po/hu.po
+1
-1
plug-ins/perl/po/it.po
plug-ins/perl/po/it.po
+1
-1
plug-ins/perl/po/ja.po
plug-ins/perl/po/ja.po
+1
-1
plug-ins/perl/po/ko.po
plug-ins/perl/po/ko.po
+1
-1
plug-ins/perl/po/nl.po
plug-ins/perl/po/nl.po
+1
-1
plug-ins/perl/po/no.po
plug-ins/perl/po/no.po
+1
-1
plug-ins/perl/po/pl.po
plug-ins/perl/po/pl.po
+1
-1
plug-ins/perl/po/pt_BR.po
plug-ins/perl/po/pt_BR.po
+1038
-618
plug-ins/perl/po/ru.po
plug-ins/perl/po/ru.po
+1
-1
plug-ins/perl/po/sk.po
plug-ins/perl/po/sk.po
+1
-1
plug-ins/perl/po/sv.po
plug-ins/perl/po/sv.po
+1
-1
plug-ins/perl/po/uk.po
plug-ins/perl/po/uk.po
+1
-1
plug-ins/print/Makefile.am
plug-ins/print/Makefile.am
+1
-1
po-libgimp/cs.po
po-libgimp/cs.po
+1
-1
po-libgimp/es.po
po-libgimp/es.po
+1
-1
po-libgimp/fr.po
po-libgimp/fr.po
+1
-1
po-plug-ins/ca.po
po-plug-ins/ca.po
+420
-394
po-plug-ins/cs.po
po-plug-ins/cs.po
+455
-403
po-plug-ins/da.po
po-plug-ins/da.po
+455
-403
po-plug-ins/de.po
po-plug-ins/de.po
+459
-406
po-plug-ins/en_GB.po
po-plug-ins/en_GB.po
+430
-397
po-plug-ins/es.po
po-plug-ins/es.po
+636
-569
po-plug-ins/fi.po
po-plug-ins/fi.po
+424
-395
po-plug-ins/fr.po
po-plug-ins/fr.po
+179
-131
po-plug-ins/ga.po
po-plug-ins/ga.po
+418
-394
po-plug-ins/gl.po
po-plug-ins/gl.po
+420
-394
po-plug-ins/hu.po
po-plug-ins/hu.po
+418
-394
po-plug-ins/it.po
po-plug-ins/it.po
+456
-411
po-plug-ins/ja.po
po-plug-ins/ja.po
+455
-403
po-plug-ins/ko.po
po-plug-ins/ko.po
+456
-407
po-plug-ins/nl.po
po-plug-ins/nl.po
+418
-394
po-plug-ins/no.po
po-plug-ins/no.po
+456
-407
po-plug-ins/pl.po
po-plug-ins/pl.po
+453
-404
po-plug-ins/pt_BR.po
po-plug-ins/pt_BR.po
+2924
-2690
po-plug-ins/ru.po
po-plug-ins/ru.po
+455
-403
po-plug-ins/sk.po
po-plug-ins/sk.po
+418
-394
po-plug-ins/sv.po
po-plug-ins/sv.po
+434
-402
po-plug-ins/uk.po
po-plug-ins/uk.po
+474
-415
po-script-fu/cs.po
po-script-fu/cs.po
+37
-37
po-script-fu/es.po
po-script-fu/es.po
+1
-2
po-script-fu/fr.po
po-script-fu/fr.po
+1
-1
po-script-fu/pt_BR.po
po-script-fu/pt_BR.po
+1
-1
po/ca.po
po/ca.po
+136
-132
po/cs.po
po/cs.po
+137
-132
po/da.po
po/da.po
+22
-22
po/de.po
po/de.po
+22
-22
po/en_GB.po
po/en_GB.po
+131
-130
po/es.po
po/es.po
+588
-570
po/fi.po
po/fi.po
+137
-132
po/fr.po
po/fr.po
+22
-22
po/ga.po
po/ga.po
+131
-130
po/gl.po
po/gl.po
+137
-132
po/hu.po
po/hu.po
+136
-134
po/it.po
po/it.po
+137
-132
po/ja.po
po/ja.po
+137
-132
po/ko.po
po/ko.po
+136
-132
po/nl.po
po/nl.po
+133
-132
po/no.po
po/no.po
+137
-132
po/pl.po
po/pl.po
+136
-132
po/pt_BR.po
po/pt_BR.po
+137
-132
po/ru.po
po/ru.po
+22
-22
po/sk.po
po/sk.po
+136
-132
po/sv.po
po/sv.po
+22
-22
po/uk.po
po/uk.po
+137
-132
No files found.
ChangeLog
View file @
a0cb639b
Wed Oct 4 16:18:11 PDT 2000 Manish Singh <yosh@gimp.org>
* Made 1.1.27 release (1.2pre)
2000-10-05 Simon Budig <simon@gimp.org>
* app/paths_dialog.c: Made the import path command work as
...
...
app/convert.c
View file @
a0cb639b
...
...
@@ -90,18 +90,23 @@
#include <string.h>
#include "appenv.h"
#include "brightness_contrast.h"
#include "color_balance.h"
#include "convert.h"
#include "cursorutil.h"
#include "curves.h"
#include "drawable.h"
#include "floating_sel.h"
#include "fsdither.h"
#include "gdisplay.h"
#include "gimpui.h"
#include "hue_saturation.h"
#include "levels.h"
#include "undo.h"
#include "palette.h"
#include "palette_select.h"
#include "posterize.h"
#include "threshold.h"
#include "libgimp/gimpcolorspace.h"
#include "libgimp/gimpmath.h"
...
...
@@ -321,7 +326,7 @@ typedef void (* Pass2i_Func) (QuantizeObj *);
typedef
void
(
*
Pass2_Func
)
(
QuantizeObj
*
,
Layer
*
,
TileManager
*
);
typedef
void
(
*
Cleanup_Func
)
(
QuantizeObj
*
);
typedef
unsigned
long
ColorFreq
;
typedef
ColorFreq
*
Histogram
;
typedef
ColorFreq
*
CF
Histogram
;
struct
_Color
{
...
...
@@ -340,8 +345,8 @@ struct _QuantizeObj
int
desired_number_of_colors
;
/* Number of colors we will allow */
int
actual_number_of_colors
;
/* Number of colors actually needed */
Color
cmap
[
256
];
/* colormap created by quantization */
unsigned
long
index_used_count
[
256
];
/* how many times an index was used */
Histogram
histogram
;
/* holds the histogram */
gulong
index_used_count
[
256
];
/* how many times an index was used */
CFHistogram
histogram
;
/* holds the histogram */
int
want_alpha_dither
;
int
error_freedom
;
/* 0=much bleed, 1=controlled bleed */
...
...
@@ -408,17 +413,17 @@ static void indexed_palette_select_destroy_callback (GtkWidget *widget, gpointer
static
void
rgb_converter
(
Layer
*
,
TileManager
*
,
int
);
static
void
grayscale_converter
(
Layer
*
,
TileManager
*
,
int
);
static
void
zero_histogram_gray
(
Histogram
);
static
void
zero_histogram_rgb
(
Histogram
);
static
void
generate_histogram_gray
(
Histogram
,
Layer
*
,
int
alpha_dither
);
static
void
generate_histogram_rgb
(
Histogram
,
Layer
*
,
int
col_limit
,
int
alpha_dither
);
static
void
zero_histogram_gray
(
CF
Histogram
);
static
void
zero_histogram_rgb
(
CF
Histogram
);
static
void
generate_histogram_gray
(
CF
Histogram
,
Layer
*
,
int
alpha_dither
);
static
void
generate_histogram_rgb
(
CF
Histogram
,
Layer
*
,
int
col_limit
,
int
alpha_dither
);
static
QuantizeObj
*
initialize_median_cut
(
int
,
int
,
ConvertDitherType
,
ConvertPaletteType
,
int
);
static
void
compute_color_rgb
(
QuantizeObj
*
quantobj
,
Histogram
histogram
,
CFHistogram
histogram
,
boxptr
boxp
,
int
icolor
);
...
...
@@ -1590,7 +1595,7 @@ grayscale_converter (Layer *layer,
*/
static
void
zero_histogram_gray
(
Histogram
histogram
)
zero_histogram_gray
(
CF
Histogram
histogram
)
{
int
i
;
...
...
@@ -1600,7 +1605,7 @@ zero_histogram_gray (Histogram histogram)
static
void
zero_histogram_rgb
(
Histogram
histogram
)
zero_histogram_rgb
(
CF
Histogram
histogram
)
{
int
r
,
g
,
b
;
...
...
@@ -1612,9 +1617,9 @@ zero_histogram_rgb (Histogram histogram)
static
void
generate_histogram_gray
(
Histogram
histogram
,
Layer
*
layer
,
int
alpha_dither
)
generate_histogram_gray
(
CF
Histogram
histogram
,
Layer
*
layer
,
int
alpha_dither
)
{
PixelRegion
srcPR
;
unsigned
char
*
data
;
...
...
@@ -1641,10 +1646,10 @@ generate_histogram_gray (Histogram histogram,
static
void
generate_histogram_rgb
(
Histogram
histogram
,
Layer
*
layer
,
int
col_limit
,
int
alpha_dither
)
generate_histogram_rgb
(
CF
Histogram
histogram
,
Layer
*
layer
,
int
col_limit
,
int
alpha_dither
)
{
PixelRegion
srcPR
;
unsigned
char
*
data
;
...
...
@@ -1882,8 +1887,8 @@ find_biggest_volume (boxptr boxlist,
static
void
update_box_gray
(
Histogram
histogram
,
boxptr
boxp
)
update_box_gray
(
CF
Histogram
histogram
,
boxptr
boxp
)
/* Shrink the min/max bounds of a box to enclose only nonzero elements, */
/* and recompute its volume and population */
{
...
...
@@ -1934,8 +1939,8 @@ update_box_gray (Histogram histogram,
}
static
void
update_box_rgb
(
Histogram
histogram
,
boxptr
boxp
)
update_box_rgb
(
CF
Histogram
histogram
,
boxptr
boxp
)
/* Shrink the min/max bounds of a box to enclose only nonzero elements, */
/* and recompute its volume, population and error */
{
...
...
@@ -2203,10 +2208,10 @@ update_box_rgb (Histogram histogram,
static
int
median_cut_gray
(
Histogram
histogram
,
boxptr
boxlist
,
int
numboxes
,
int
desired_colors
)
median_cut_gray
(
CF
Histogram
histogram
,
boxptr
boxlist
,
int
numboxes
,
int
desired_colors
)
/* Repeatedly select and split the largest box until we have enough boxes */
{
int
lb
;
...
...
@@ -2255,10 +2260,10 @@ median_cut_gray (Histogram histogram,
}
static
int
median_cut_rgb
(
Histogram
histogram
,
boxptr
boxlist
,
int
numboxes
,
int
desired_colors
)
median_cut_rgb
(
CF
Histogram
histogram
,
boxptr
boxlist
,
int
numboxes
,
int
desired_colors
)
/* Repeatedly select and split the largest box until we have enough boxes */
{
int
n
,
lb
;
...
...
@@ -2344,7 +2349,7 @@ median_cut_rgb (Histogram histogram,
static
void
compute_color_gray
(
QuantizeObj
*
quantobj
,
Histogram
histogram
,
CFHistogram
histogram
,
boxptr
boxp
,
int
icolor
)
/* Compute representative color for a box, put it in colormap[icolor] */
...
...
@@ -2389,7 +2394,7 @@ compute_color_gray (QuantizeObj *quantobj,
static
void
compute_color_rgb
(
QuantizeObj
*
quantobj
,
Histogram
histogram
,
CFHistogram
histogram
,
boxptr
boxp
,
int
icolor
)
/* Compute representative color for a box, put it in colormap[icolor] */
...
...
@@ -2447,7 +2452,7 @@ compute_color_rgb (QuantizeObj *quantobj,
static
void
select_colors_gray
(
QuantizeObj
*
quantobj
,
Histogram
histogram
)
CFHistogram
histogram
)
/* Master routine for color selection */
{
boxptr
boxlist
;
...
...
@@ -2476,7 +2481,7 @@ select_colors_gray (QuantizeObj *quantobj,
static
void
select_colors_rgb
(
QuantizeObj
*
quantobj
,
Histogram
histogram
)
CFHistogram
histogram
)
/* Master routine for color selection */
{
boxptr
boxlist
;
...
...
@@ -2803,7 +2808,7 @@ find_best_colors (QuantizeObj *quantobj,
static
void
fill_inverse_cmap_gray
(
QuantizeObj
*
quantobj
,
Histogram
histogram
,
CFHistogram
histogram
,
int
pixel
)
/* Fill the inverse-colormap entries in the update box that contains */
/* histogram cell R/G/B. (Only that one cell MUST be filled, but */
...
...
@@ -2839,7 +2844,7 @@ fill_inverse_cmap_gray (QuantizeObj *quantobj,
static
void
fill_inverse_cmap_rgb
(
QuantizeObj
*
quantobj
,
Histogram
histogram
,
CFHistogram
histogram
,
int
R
,
int
G
,
int
B
)
...
...
@@ -2966,7 +2971,7 @@ median_cut_pass2_no_dither_gray (QuantizeObj *quantobj,
TileManager
*
new_tiles
)
{
PixelRegion
srcPR
,
destPR
;
Histogram
histogram
=
quantobj
->
histogram
;
CF
Histogram
histogram
=
quantobj
->
histogram
;
ColorFreq
*
cachep
;
unsigned
char
*
src
,
*
dest
;
int
row
,
col
;
...
...
@@ -3027,7 +3032,7 @@ median_cut_pass2_fixed_dither_gray (QuantizeObj *quantobj,
TileManager
*
new_tiles
)
{
PixelRegion
srcPR
,
destPR
;
Histogram
histogram
=
quantobj
->
histogram
;
CF
Histogram
histogram
=
quantobj
->
histogram
;
ColorFreq
*
cachep
;
Color
*
color
;
unsigned
char
*
src
,
*
dest
;
...
...
@@ -3104,7 +3109,7 @@ median_cut_pass2_no_dither_rgb (QuantizeObj *quantobj,
TileManager
*
new_tiles
)
{
PixelRegion
srcPR
,
destPR
;
Histogram
histogram
=
quantobj
->
histogram
;
CF
Histogram
histogram
=
quantobj
->
histogram
;
ColorFreq
*
cachep
;
unsigned
char
*
src
,
*
dest
;
int
R
,
G
,
B
;
...
...
@@ -3179,7 +3184,7 @@ median_cut_pass2_fixed_dither_rgb (QuantizeObj *quantobj,
TileManager
*
new_tiles
)
{
PixelRegion
srcPR
,
destPR
;
Histogram
histogram
=
quantobj
->
histogram
;
CF
Histogram
histogram
=
quantobj
->
histogram
;
ColorFreq
*
cachep
;
Color
*
color
;
unsigned
char
*
src
,
*
dest
;
...
...
@@ -3460,7 +3465,7 @@ median_cut_pass2_fs_dither_gray (QuantizeObj *quantobj,
TileManager
*
new_tiles
)
{
PixelRegion
srcPR
,
destPR
;
Histogram
histogram
=
quantobj
->
histogram
;
CF
Histogram
histogram
=
quantobj
->
histogram
;
ColorFreq
*
cachep
;
Color
*
color
;
int
*
error_limiter
;
...
...
@@ -3656,7 +3661,7 @@ median_cut_pass2_fs_dither_rgb (QuantizeObj *quantobj,
TileManager
*
new_tiles
)
{
PixelRegion
srcPR
,
destPR
;
Histogram
histogram
=
quantobj
->
histogram
;
CF
Histogram
histogram
=
quantobj
->
histogram
;
ColorFreq
*
cachep
;
Color
*
color
;
int
*
error_limiter
;
...
...
app/core/gimpimage-convert.c
View file @
a0cb639b
...
...
@@ -90,18 +90,23 @@
#include <string.h>
#include "appenv.h"
#include "brightness_contrast.h"
#include "color_balance.h"
#include "convert.h"
#include "cursorutil.h"
#include "curves.h"
#include "drawable.h"
#include "floating_sel.h"
#include "fsdither.h"
#include "gdisplay.h"
#include "gimpui.h"
#include "hue_saturation.h"
#include "levels.h"
#include "undo.h"
#include "palette.h"
#include "palette_select.h"
#include "posterize.h"
#include "threshold.h"
#include "libgimp/gimpcolorspace.h"
#include "libgimp/gimpmath.h"
...
...
@@ -321,7 +326,7 @@ typedef void (* Pass2i_Func) (QuantizeObj *);
typedef
void
(
*
Pass2_Func
)
(
QuantizeObj
*
,
Layer
*
,
TileManager
*
);
typedef
void
(
*
Cleanup_Func
)
(
QuantizeObj
*
);
typedef
unsigned
long
ColorFreq
;
typedef
ColorFreq
*
Histogram
;
typedef
ColorFreq
*
CF
Histogram
;
struct
_Color
{
...
...
@@ -340,8 +345,8 @@ struct _QuantizeObj
int
desired_number_of_colors
;
/* Number of colors we will allow */
int
actual_number_of_colors
;
/* Number of colors actually needed */
Color
cmap
[
256
];
/* colormap created by quantization */
unsigned
long
index_used_count
[
256
];
/* how many times an index was used */
Histogram
histogram
;
/* holds the histogram */
gulong
index_used_count
[
256
];
/* how many times an index was used */
CFHistogram
histogram
;
/* holds the histogram */
int
want_alpha_dither
;
int
error_freedom
;
/* 0=much bleed, 1=controlled bleed */
...
...
@@ -408,17 +413,17 @@ static void indexed_palette_select_destroy_callback (GtkWidget *widget, gpointer
static
void
rgb_converter
(
Layer
*
,
TileManager
*
,
int
);
static
void
grayscale_converter
(
Layer
*
,
TileManager
*
,
int
);
static
void
zero_histogram_gray
(
Histogram
);
static
void
zero_histogram_rgb
(
Histogram
);
static
void
generate_histogram_gray
(
Histogram
,
Layer
*
,
int
alpha_dither
);
static
void
generate_histogram_rgb
(
Histogram
,
Layer
*
,
int
col_limit
,
int
alpha_dither
);
static
void
zero_histogram_gray
(
CF
Histogram
);
static
void
zero_histogram_rgb
(
CF
Histogram
);
static
void
generate_histogram_gray
(
CF
Histogram
,
Layer
*
,
int
alpha_dither
);
static
void
generate_histogram_rgb
(
CF
Histogram
,
Layer
*
,
int
col_limit
,
int
alpha_dither
);
static
QuantizeObj
*
initialize_median_cut
(
int
,
int
,
ConvertDitherType
,
ConvertPaletteType
,
int
);
static
void
compute_color_rgb
(
QuantizeObj
*
quantobj
,
Histogram
histogram
,
CFHistogram
histogram
,
boxptr
boxp
,
int
icolor
);
...
...
@@ -1590,7 +1595,7 @@ grayscale_converter (Layer *layer,
*/
static
void
zero_histogram_gray
(
Histogram
histogram
)
zero_histogram_gray
(
CF
Histogram
histogram
)
{
int
i
;
...
...
@@ -1600,7 +1605,7 @@ zero_histogram_gray (Histogram histogram)
static
void
zero_histogram_rgb
(
Histogram
histogram
)
zero_histogram_rgb
(
CF
Histogram
histogram
)
{
int
r
,
g
,
b
;
...
...
@@ -1612,9 +1617,9 @@ zero_histogram_rgb (Histogram histogram)
static
void
generate_histogram_gray
(
Histogram
histogram
,
Layer
*
layer
,
int
alpha_dither
)
generate_histogram_gray
(
CF
Histogram
histogram
,
Layer
*
layer
,
int
alpha_dither
)
{
PixelRegion
srcPR
;
unsigned
char
*
data
;
...
...
@@ -1641,10 +1646,10 @@ generate_histogram_gray (Histogram histogram,
static
void
generate_histogram_rgb
(
Histogram
histogram
,
Layer
*
layer
,
int
col_limit
,
int
alpha_dither
)
generate_histogram_rgb
(
CF
Histogram
histogram
,
Layer
*
layer
,
int
col_limit
,
int
alpha_dither
)
{
PixelRegion
srcPR
;
unsigned
char
*
data
;
...
...
@@ -1882,8 +1887,8 @@ find_biggest_volume (boxptr boxlist,
static
void
update_box_gray
(
Histogram
histogram
,
boxptr
boxp
)
update_box_gray
(
CF
Histogram
histogram
,
boxptr
boxp
)
/* Shrink the min/max bounds of a box to enclose only nonzero elements, */
/* and recompute its volume and population */
{
...
...
@@ -1934,8 +1939,8 @@ update_box_gray (Histogram histogram,
}
static
void
update_box_rgb
(
Histogram
histogram
,
boxptr
boxp
)
update_box_rgb
(
CF
Histogram
histogram
,
boxptr
boxp
)
/* Shrink the min/max bounds of a box to enclose only nonzero elements, */
/* and recompute its volume, population and error */
{
...
...
@@ -2203,10 +2208,10 @@ update_box_rgb (Histogram histogram,
static
int
median_cut_gray
(
Histogram
histogram
,
boxptr
boxlist
,
int
numboxes
,
int
desired_colors
)
median_cut_gray
(
CF
Histogram
histogram
,
boxptr
boxlist
,
int
numboxes
,
int
desired_colors
)
/* Repeatedly select and split the largest box until we have enough boxes */
{
int
lb
;
...
...
@@ -2255,10 +2260,10 @@ median_cut_gray (Histogram histogram,
}
static
int
median_cut_rgb
(
Histogram
histogram
,
boxptr
boxlist
,
int
numboxes
,
int
desired_colors
)
median_cut_rgb
(
CF
Histogram
histogram
,
boxptr
boxlist
,
int
numboxes
,
int
desired_colors
)
/* Repeatedly select and split the largest box until we have enough boxes */
{
int
n
,
lb
;
...
...
@@ -2344,7 +2349,7 @@ median_cut_rgb (Histogram histogram,
static
void
compute_color_gray
(
QuantizeObj
*
quantobj
,
Histogram
histogram
,
CFHistogram
histogram
,
boxptr
boxp
,
int
icolor
)
/* Compute representative color for a box, put it in colormap[icolor] */
...
...
@@ -2389,7 +2394,7 @@ compute_color_gray (QuantizeObj *quantobj,
static
void
compute_color_rgb
(
QuantizeObj
*
quantobj
,
Histogram
histogram
,
CFHistogram
histogram
,
boxptr
boxp
,
int
icolor
)
/* Compute representative color for a box, put it in colormap[icolor] */
...
...
@@ -2447,7 +2452,7 @@ compute_color_rgb (QuantizeObj *quantobj,
static
void
select_colors_gray
(
QuantizeObj
*
quantobj
,
Histogram
histogram
)
CFHistogram
histogram
)
/* Master routine for color selection */
{
boxptr
boxlist
;
...
...
@@ -2476,7 +2481,7 @@ select_colors_gray (QuantizeObj *quantobj,
static
void
select_colors_rgb
(
QuantizeObj
*
quantobj
,
Histogram
histogram
)
CFHistogram
histogram
)
/* Master routine for color selection */
{
boxptr
boxlist
;
...
...
@@ -2803,7 +2808,7 @@ find_best_colors (QuantizeObj *quantobj,
static
void
fill_inverse_cmap_gray
(
QuantizeObj
*
quantobj
,
Histogram
histogram
,
CFHistogram
histogram
,
int
pixel
)
/* Fill the inverse-colormap entries in the update box that contains */
/* histogram cell R/G/B. (Only that one cell MUST be filled, but */
...
...
@@ -2839,7 +2844,7 @@ fill_inverse_cmap_gray (QuantizeObj *quantobj,
static
void
fill_inverse_cmap_rgb
(
QuantizeObj
*
quantobj
,
Histogram
histogram
,
CFHistogram
histogram
,
int
R
,
int
G
,
int
B
)
...
...
@@ -2966,7 +2971,7 @@ median_cut_pass2_no_dither_gray (QuantizeObj *quantobj,
TileManager
*
new_tiles
)
{
PixelRegion
srcPR
,
destPR
;
Histogram
histogram
=
quantobj
->
histogram
;
CF
Histogram
histogram
=
quantobj
->
histogram
;
ColorFreq
*
cachep
;
unsigned
char
*
src
,
*
dest
;
int
row
,
col
;
...
...
@@ -3027,7 +3032,7 @@ median_cut_pass2_fixed_dither_gray (QuantizeObj *quantobj,
TileManager
*
new_tiles
)
{
PixelRegion
srcPR
,
destPR
;
Histogram
histogram
=
quantobj
->
histogram
;
CF
Histogram
histogram
=
quantobj
->
histogram
;
ColorFreq
*
cachep
;
Color
*
color
;
unsigned
char
*
src
,
*
dest
;
...
...
@@ -3104,7 +3109,7 @@ median_cut_pass2_no_dither_rgb (QuantizeObj *quantobj,
TileManager
*
new_tiles
)
{
PixelRegion
srcPR
,
destPR
;
Histogram
histogram
=
quantobj
->
histogram
;
CF
Histogram
histogram
=
quantobj
->
histogram
;
ColorFreq
*
cachep
;
unsigned
char
*
src
,
*
dest
;
int
R
,
G
,
B
;
...
...
@@ -3179,7 +3184,7 @@ median_cut_pass2_fixed_dither_rgb (QuantizeObj *quantobj,
TileManager
*
new_tiles
)
{
PixelRegion
srcPR
,
destPR
;
Histogram
histogram
=
quantobj
->
histogram
;
CF
Histogram
histogram
=
quantobj
->
histogram
;
ColorFreq
*
cachep
;
Color
*
color
;
unsigned
char
*
src
,
*
dest
;
...
...
@@ -3460,7 +3465,7 @@ median_cut_pass2_fs_dither_gray (QuantizeObj *quantobj,
TileManager
*
new_tiles
)
{
PixelRegion
srcPR
,
destPR
;
Histogram
histogram
=
quantobj
->
histogram
;
CF
Histogram
histogram
=
quantobj
->
histogram
;
ColorFreq
*
cachep
;
Color
*
color
;
int
*
error_limiter
;
...
...
@@ -3656,7 +3661,7 @@ median_cut_pass2_fs_dither_rgb (QuantizeObj *quantobj,
TileManager
*
new_tiles
)
{
PixelRegion
srcPR
,
destPR
;
Histogram
histogram
=
quantobj
->
histogram
;
CF
Histogram
histogram
=
quantobj
->
histogram
;
ColorFreq
*
cachep
;
Color
*
color
;
int
*
error_limiter
;
...
...
app/gimpimage-convert.c
View file @
a0cb639b
...
...
@@ -90,18 +90,23 @@
#include <string.h>
#include "appenv.h"
#include "brightness_contrast.h"
#include "color_balance.h"
#include "convert.h"
#include "cursorutil.h"
#include "curves.h"
#include "drawable.h"
#include "floating_sel.h"
#include "fsdither.h"
#include "gdisplay.h"
#include "gimpui.h"
#include "hue_saturation.h"
#include "levels.h"
#include "undo.h"
#include "palette.h"
#include "palette_select.h"
#include "posterize.h"
#include "threshold.h"
#include "libgimp/gimpcolorspace.h"
#include "libgimp/gimpmath.h"
...
...
@@ -321,7 +326,7 @@ typedef void (* Pass2i_Func) (QuantizeObj *);
typedef
void
(
*
Pass2_Func
)
(
QuantizeObj
*
,
Layer
*
,
TileManager
*
);
typedef
void
(
*
Cleanup_Func
)
(
QuantizeObj
*
);
typedef
unsigned
long
ColorFreq
;
typedef
ColorFreq
*
Histogram
;
typedef
ColorFreq
*
CF
Histogram
;
struct
_Color
{
...
...
@@ -340,8 +345,8 @@ struct _QuantizeObj
int
desired_number_of_colors
;
/* Number of colors we will allow */
int
actual_number_of_colors
;
/* Number of colors actually needed */
Color
cmap
[
256
];
/* colormap created by quantization */
unsigned
long
index_used_count
[
256
];
/* how many times an index was used */
Histogram
histogram
;
/* holds the histogram */
gulong
index_used_count
[
256
];
/* how many times an index was used */
CFHistogram
histogram
;
/* holds the histogram */
int
want_alpha_dither
;
int
error_freedom
;
/* 0=much bleed, 1=controlled bleed */
...
...
@@ -408,17 +413,17 @@ static void indexed_palette_select_destroy_callback (GtkWidget *widget, gpointer
static
void
rgb_converter
(
Layer
*
,
TileManager
*
,
int
);
static
void
grayscale_converter
(
Layer
*
,
TileManager
*
,
int
);
static
void
zero_histogram_gray
(
Histogram
);
static
void
zero_histogram_rgb
(
Histogram
);
static
void
generate_histogram_gray
(
Histogram
,
Layer
*
,
int
alpha_dither
);
static
void
generate_histogram_rgb
(
Histogram
,
Layer
*
,
int
col_limit
,
int
alpha_dither
);
static
void
zero_histogram_gray
(
CF
Histogram
);
static
void
zero_histogram_rgb
(
CF
Histogram
);
static
void
generate_histogram_gray
(
CF
Histogram
,
Layer
*
,
int
alpha_dither
);
static
void
generate_histogram_rgb
(
CF
Histogram
,
Layer
*
,
int
col_limit
,
int
alpha_dither
);
static
QuantizeObj
*
initialize_median_cut
(
int
,
int
,
ConvertDitherType
,
ConvertPaletteType
,
int
);
static
void
compute_color_rgb
(
QuantizeObj
*
quantobj
,
Histogram
histogram
,
CFHistogram
histogram
,
boxptr
boxp
,
int
icolor
);
...
...
@@ -1590,7 +1595,7 @@ grayscale_converter (Layer *layer,
*/
static
void
zero_histogram_gray
(
Histogram
histogram
)
zero_histogram_gray
(
CF
Histogram
histogram
)
{
int
i
;
...
...
@@ -1600,7 +1605,7 @@ zero_histogram_gray (Histogram histogram)
static
void
zero_histogram_rgb
(
Histogram
histogram
)
zero_histogram_rgb
(
CF
Histogram
histogram
)
{
int
r
,
g
,
b
;
...
...
@@ -1612,9 +1617,9 @@ zero_histogram_rgb (Histogram histogram)