*** empty log message ***

This commit is contained in:
Marc Lehmann 1999-07-11 16:53:04 +00:00
parent 16041ddbd4
commit 64e0bca9d8
3 changed files with 23 additions and 18 deletions

View file

@ -1,3 +1,8 @@
Sun Jul 11 17:35:01 CEST 1999 Marc Lehmann <pcg@goof.com>
* plug-ins/unsharp/unsharp.c: rename round to round2int to avoid
clashes with the upcoming c9x standard.
Sun Jul 11 15:19:34 CEST 1999 Marc Lehmann <pcg@goof.com>
* plug-ins/common/png.c: add abort() to save_image, as to catch

View file

@ -68,7 +68,7 @@ static inline void blur_line(gdouble* ctable, gdouble* cmatrix, gint cmatrix_len
gint y, glong bytes);
static int gen_convolve_matrix(double std_dev, double** cmatrix);
static gdouble* gen_lookup_table(gdouble* cmatrix, gint cmatrix_length);
static inline gint round(gdouble i);
static inline gint round2int(gdouble i);
static void unsharp_region (GPixelRgn srcPTR, GPixelRgn dstPTR,
gint width, gint height, gint bytes,
gdouble radius, gdouble amount,
@ -434,7 +434,7 @@ static void unsharp_region (GPixelRgn srcPR, GPixelRgn destPR,
gimp_progress_init("Merging...");
/* find integer value of threshold */
threshold = round( unsharp_params.threshold * 255.0 );
threshold = round2int( unsharp_params.threshold * 255.0 );
/* merge the source and destination images */
for (row = 0; row < y; row++) {
@ -499,7 +499,7 @@ static inline void blur_line(gdouble* ctable, gdouble* cmatrix,
for (j = cmatrix_length/2 - row; j<cmatrix_length; j++) {
sum += cur_col[(row + j-cmatrix_length/2)*bytes + i] * cmatrix[j];
}
dest_col[row*bytes + i] = (guchar)round(sum / scale);
dest_col[row*bytes + i] = (guchar)round2int(sum / scale);
}
}
/* go through each pixel in each col */
@ -509,7 +509,7 @@ static inline void blur_line(gdouble* ctable, gdouble* cmatrix,
for (j = 0; j<cmatrix_length; j++) {
sum += cur_col[(row + j-cmatrix_length/2)*bytes + i] * cmatrix[j];
}
dest_col[row*bytes + i] = (guchar)round(sum);
dest_col[row*bytes + i] = (guchar)round2int(sum);
}
}
/* for the edge condition , we only use available info, and scale to one */
@ -523,7 +523,7 @@ static inline void blur_line(gdouble* ctable, gdouble* cmatrix,
for (j = 0; j<y-row + cmatrix_length/2; j++) {
sum += cur_col[(row + j-cmatrix_length/2)*bytes + i] * cmatrix[j];
}
dest_col[row*bytes + i] = (guchar)round(sum / scale);
dest_col[row*bytes + i] = (guchar)round2int(sum / scale);
}
}
#endif
@ -553,7 +553,7 @@ static inline void blur_line(gdouble* ctable, gdouble* cmatrix,
for (j = cmatrix_middle - row; j<cmatrix_length; j++) {
sum += cur_col[(row + j-cmatrix_middle)*bytes + i] * cmatrix[j];
}
dest_col[row*bytes + i] = (guchar)round(sum / scale);
dest_col[row*bytes + i] = (guchar)round2int(sum / scale);
}
}
/* go through each pixel in each col */
@ -571,7 +571,7 @@ static inline void blur_line(gdouble* ctable, gdouble* cmatrix,
ctable_p += 256; /* * sizeof(gdouble); */
}
cur_col_p++;
*(dest_col_p++) = round(sum);
*(dest_col_p++) = round2int(sum);
}
}
@ -586,14 +586,14 @@ static inline void blur_line(gdouble* ctable, gdouble* cmatrix,
for (j = 0; j<y-row + cmatrix_middle; j++) {
sum += cur_col[(row + j-cmatrix_middle)*bytes + i] * cmatrix[j];
}
dest_col[row*bytes + i] = (guchar)round(sum / scale);
dest_col[row*bytes + i] = (guchar)round2int(sum / scale);
}
}
#endif
}
static inline gint round(gdouble i) {
static inline gint round2int(gdouble i) {
return (gint)(i + 0.5);
}

View file

@ -68,7 +68,7 @@ static inline void blur_line(gdouble* ctable, gdouble* cmatrix, gint cmatrix_len
gint y, glong bytes);
static int gen_convolve_matrix(double std_dev, double** cmatrix);
static gdouble* gen_lookup_table(gdouble* cmatrix, gint cmatrix_length);
static inline gint round(gdouble i);
static inline gint round2int(gdouble i);
static void unsharp_region (GPixelRgn srcPTR, GPixelRgn dstPTR,
gint width, gint height, gint bytes,
gdouble radius, gdouble amount,
@ -434,7 +434,7 @@ static void unsharp_region (GPixelRgn srcPR, GPixelRgn destPR,
gimp_progress_init("Merging...");
/* find integer value of threshold */
threshold = round( unsharp_params.threshold * 255.0 );
threshold = round2int( unsharp_params.threshold * 255.0 );
/* merge the source and destination images */
for (row = 0; row < y; row++) {
@ -499,7 +499,7 @@ static inline void blur_line(gdouble* ctable, gdouble* cmatrix,
for (j = cmatrix_length/2 - row; j<cmatrix_length; j++) {
sum += cur_col[(row + j-cmatrix_length/2)*bytes + i] * cmatrix[j];
}
dest_col[row*bytes + i] = (guchar)round(sum / scale);
dest_col[row*bytes + i] = (guchar)round2int(sum / scale);
}
}
/* go through each pixel in each col */
@ -509,7 +509,7 @@ static inline void blur_line(gdouble* ctable, gdouble* cmatrix,
for (j = 0; j<cmatrix_length; j++) {
sum += cur_col[(row + j-cmatrix_length/2)*bytes + i] * cmatrix[j];
}
dest_col[row*bytes + i] = (guchar)round(sum);
dest_col[row*bytes + i] = (guchar)round2int(sum);
}
}
/* for the edge condition , we only use available info, and scale to one */
@ -523,7 +523,7 @@ static inline void blur_line(gdouble* ctable, gdouble* cmatrix,
for (j = 0; j<y-row + cmatrix_length/2; j++) {
sum += cur_col[(row + j-cmatrix_length/2)*bytes + i] * cmatrix[j];
}
dest_col[row*bytes + i] = (guchar)round(sum / scale);
dest_col[row*bytes + i] = (guchar)round2int(sum / scale);
}
}
#endif
@ -553,7 +553,7 @@ static inline void blur_line(gdouble* ctable, gdouble* cmatrix,
for (j = cmatrix_middle - row; j<cmatrix_length; j++) {
sum += cur_col[(row + j-cmatrix_middle)*bytes + i] * cmatrix[j];
}
dest_col[row*bytes + i] = (guchar)round(sum / scale);
dest_col[row*bytes + i] = (guchar)round2int(sum / scale);
}
}
/* go through each pixel in each col */
@ -571,7 +571,7 @@ static inline void blur_line(gdouble* ctable, gdouble* cmatrix,
ctable_p += 256; /* * sizeof(gdouble); */
}
cur_col_p++;
*(dest_col_p++) = round(sum);
*(dest_col_p++) = round2int(sum);
}
}
@ -586,14 +586,14 @@ static inline void blur_line(gdouble* ctable, gdouble* cmatrix,
for (j = 0; j<y-row + cmatrix_middle; j++) {
sum += cur_col[(row + j-cmatrix_middle)*bytes + i] * cmatrix[j];
}
dest_col[row*bytes + i] = (guchar)round(sum / scale);
dest_col[row*bytes + i] = (guchar)round2int(sum / scale);
}
}
#endif
}
static inline gint round(gdouble i) {
static inline gint round2int(gdouble i) {
return (gint)(i + 0.5);
}