mirror of https://github.com/GNOME/gimp.git
cleanup. Removed trailing whitespace in generated output.
2003-07-14 Michael Natterer <mitch@gimp.org> * tools/kernelgen.c: cleanup. Removed trailing whitespace in generated output. * app/paint/gimppaintcore-kernels.h: regenerated.
This commit is contained in:
parent
5f74672450
commit
3b7383b127
|
@ -1,3 +1,10 @@
|
|||
2003-07-14 Michael Natterer <mitch@gimp.org>
|
||||
|
||||
* tools/kernelgen.c: cleanup. Removed trailing whitespace in
|
||||
generated output.
|
||||
|
||||
* app/paint/gimppaintcore-kernels.h: regenerated.
|
||||
|
||||
2003-07-14 Michael Natterer <mitch@gimp.org>
|
||||
|
||||
* app/tools/tool_manager.c: check if the active_tool is a
|
||||
|
|
|
@ -20,36 +20,36 @@ static const int subsample[5][5][9] =
|
|||
{ 25, 102, 0, 25, 102, 0, 0, 0, 0, },
|
||||
{ 0, 128, 0, 0, 128, 0, 0, 0, 0, },
|
||||
{ 0, 102, 25, 0, 102, 25, 0, 0, 0, },
|
||||
{ 0, 64, 64, 0, 64, 64, 0, 0, 0, }
|
||||
{ 0, 64, 64, 0, 64, 64, 0, 0, 0, }
|
||||
},
|
||||
{
|
||||
{ 25, 25, 0, 102, 102, 0, 0, 0, 0, },
|
||||
{ 6, 43, 0, 43, 162, 0, 0, 0, 0, },
|
||||
{ 0, 50, 0, 0, 205, 0, 0, 0, 0, },
|
||||
{ 0, 43, 6, 0, 162, 43, 0, 0, 0, },
|
||||
{ 0, 25, 25, 0, 102, 102, 0, 0, 0, }
|
||||
{ 0, 25, 25, 0, 102, 102, 0, 0, 0, }
|
||||
},
|
||||
{
|
||||
{ 0, 0, 0, 128, 128, 0, 0, 0, 0, },
|
||||
{ 0, 0, 0, 50, 205, 0, 0, 0, 0, },
|
||||
{ 0, 0, 0, 0, 256, 0, 0, 0, 0, },
|
||||
{ 0, 0, 0, 0, 205, 50, 0, 0, 0, },
|
||||
{ 0, 0, 0, 0, 128, 128, 0, 0, 0, }
|
||||
{ 0, 0, 0, 0, 128, 128, 0, 0, 0, }
|
||||
},
|
||||
{
|
||||
{ 0, 0, 0, 102, 102, 0, 25, 25, 0, },
|
||||
{ 0, 0, 0, 43, 162, 0, 6, 43, 0, },
|
||||
{ 0, 0, 0, 0, 205, 0, 0, 50, 0, },
|
||||
{ 0, 0, 0, 0, 162, 43, 0, 43, 6, },
|
||||
{ 0, 0, 0, 0, 102, 102, 0, 25, 25, }
|
||||
{ 0, 0, 0, 0, 102, 102, 0, 25, 25, }
|
||||
},
|
||||
{
|
||||
{ 0, 0, 0, 64, 64, 0, 64, 64, 0, },
|
||||
{ 0, 0, 0, 25, 102, 0, 25, 102, 0, },
|
||||
{ 0, 0, 0, 0, 128, 0, 0, 128, 0, },
|
||||
{ 0, 0, 0, 0, 102, 25, 0, 102, 25, },
|
||||
{ 0, 0, 0, 0, 64, 64, 0, 64, 64, }
|
||||
}
|
||||
{ 0, 0, 0, 0, 64, 64, 0, 64, 64, }
|
||||
}
|
||||
};
|
||||
|
||||
#endif /* __GIMP_PAINT_CORE_KERNELS_H__ */
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
/* The GIMP -- an image manipulation program
|
||||
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
||||
*
|
||||
* kernel_gen -- Copyright (C) 2000 Sven Neumann <sven@gimp.org>
|
||||
* kernel_gen -- Copyright (C) 2000 Sven Neumann <sven@gimp.org>
|
||||
* Simple hack to create subsampling kernels for the brushes
|
||||
* as used in app/paint_core.c.
|
||||
* If you want to play with it, change some of the #defines at the
|
||||
* top and copy the output to apps/tools/paint_core_kernels.h.
|
||||
*
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
|
@ -21,8 +21,10 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include <math.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
|
||||
#define STEPS 64
|
||||
|
@ -57,7 +59,7 @@ create_kernel (double x,
|
|||
for (i = 0; i < STEPS * KERNEL_WIDTH; i++)
|
||||
{
|
||||
dist_x = x - (((double)i + 0.5) / (double)STEPS);
|
||||
|
||||
|
||||
/* I've tried to use a gauss function here instead of a
|
||||
threshold, but the result was not that impressive. */
|
||||
w = (SQR (dist_x) + SQR (dist_y)) < THRESHOLD ? 1.0 : 0.0;
|
||||
|
@ -74,10 +76,10 @@ create_kernel (double x,
|
|||
w = 256.0 * (value[i][j] / sum);
|
||||
printf (" %3d,", (int)w);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
int
|
||||
main (int argc,
|
||||
char **argv)
|
||||
{
|
||||
|
@ -98,12 +100,12 @@ main (int argc,
|
|||
printf ("/* Brush pixel subsampling kernels */\n");
|
||||
printf ("static const int subsample[%d][%d][%d] =\n{\n",
|
||||
SUBSAMPLE + 1, SUBSAMPLE + 1, KERNEL_WIDTH * KERNEL_HEIGHT);
|
||||
|
||||
|
||||
for (j = 0; j <= SUBSAMPLE; j++)
|
||||
{
|
||||
y = (double)j / (double)(SUBSAMPLE);
|
||||
|
||||
printf (" {\n");
|
||||
|
||||
printf (" {\n");
|
||||
|
||||
for (i = 0; i <= SUBSAMPLE; i++)
|
||||
{
|
||||
|
@ -111,21 +113,15 @@ main (int argc,
|
|||
|
||||
printf (" {");
|
||||
create_kernel (x, y);
|
||||
printf (" }%c\n", i < SUBSAMPLE ? ',' : ' ');
|
||||
printf (" }%s", i < SUBSAMPLE ? ",\n" : "\n");
|
||||
}
|
||||
|
||||
printf (" }%c\n", j < SUBSAMPLE ? ',' : ' ');
|
||||
printf (" }%s", j < SUBSAMPLE ? ",\n" : "\n");
|
||||
}
|
||||
|
||||
printf ("};\n\n");
|
||||
|
||||
printf ("#endif /* __GIMP_PAINT_CORE_KERNELS_H__\n");
|
||||
printf ("#endif /* __GIMP_PAINT_CORE_KERNELS_H__ */\n");
|
||||
|
||||
exit (0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue