Update of the Xinput airbrush, fixed some bugs. It's a bit closer to a

Sun Nov 14 21:37:51 CET 1999 Olof S Kylander <olof@gimp.org>

        Update of the Xinput airbrush, fixed some bugs.
        It's a bit closer to a real tool now ;-).
This commit is contained in:
CET 1999 Olof S Kylander 1999-11-14 20:49:14 +00:00 committed by Olof S Kylander/GIMP
parent 4fd0770bdb
commit df8598df2f
7 changed files with 1239 additions and 326 deletions

View file

@ -1,3 +1,28 @@
Sun Nov 14 21:37:51 CET 1999 Olof S Kylander <olof@gimp.org>
Update of the Xinput airbrush, fixed some bugs.
It's a bit closer to a real tool now ;-).
Test it out but be aware that you have to have at least
a tablet with tilt support. Preferibly you should have
a Wacom Airbrush and a patched version of GTK.
Well it still has preformance problems with big brushes
i.e big virtual height and big tilt.
All sensitives are not yet implemented, but it starts
to work like a real airbrush. It's as hard to
master as the real thing (beside that your ink will
not streem).
PS: There is a lot of printf and experimental code
in the tool at the moment please don't remove it.
* app/airbrush_blob.c
* app/airbrush_blob.h
* app/xinput_airbrush.c
Sun Nov 14 16:38:21 GMT 1999 Adam D. Moss <adam@gimp.org>
* plug-ins/common/psd.c: Patch from Andy Hefner

View file

@ -1265,7 +1265,8 @@ create_air_line(AirBlob *airblob)
AirLine *airline;
/* Yes I know I can do a cal of number of lines, but it is for
/*
Yes I know I can do a cal of number of lines, but it is for
the moment much easier to just set a side mem for 16 lines
*/
@ -1279,6 +1280,28 @@ create_air_line(AirBlob *airblob)
direction = airblob->direction_abs;
/*
printf("Direction: %f\n", direction);
printf("Xcenter: %f\n",xcenter/SUBSAMPLE);
printf("Ycenter: %f\n",ycenter/SUBSAMPLE);
printf("MaCr.dist: %f\n",airblob->maincross_line.dist);
printf("MaCr.size: %f\n",airblob->maincross_line.size);
printf("MiCr.dist: %f\n",airblob->minorcross_line.dist);
printf("MiCr.size: %f\n",airblob->minorcross_line.size);
printf("Ma.size: %f\n",airblob->main_line.size);
printf("Mi.size: %f\n",airblob->minor_line.size);
*/
if (direction == M_PI_H || direction == M_PI)
{
direction = direction - 0.001;
}
if (direction == -M_PI_H || direction == -M_PI)
{
direction = direction + 0.001;
}
if(direction == 0.0)
{
@ -1323,6 +1346,7 @@ create_air_line(AirBlob *airblob)
airline->line[5].y = (ycenter + airblob->minorcross_line.size/2)/SUBSAMPLE;
airline->nlines = 6;
printf("Hmm bummer M_PI_H\n");
}
@ -1347,6 +1371,9 @@ create_air_line(AirBlob *airblob)
airline->nlines = 6;
printf("Hmm bummer M_PI\n");
}
else if(direction == -M_PI_H)
@ -1366,6 +1393,13 @@ create_air_line(AirBlob *airblob)
airline->line[4].y = (ycenter + airblob->maincross_line.size/2)/SUBSAMPLE;
airline->line[5].x = (xcenter - airblob->minorcross_line.dist)/SUBSAMPLE;
airline->line[5].y = (ycenter - airblob->minorcross_line.size/2)/SUBSAMPLE;
airline->nlines = 6;
printf("Hmm bummer -M_PI_H\n");
}
@ -1388,6 +1422,9 @@ create_air_line(AirBlob *airblob)
airline->line[5].y = (ycenter + airblob->minorcross_line.size/2)/SUBSAMPLE;
airline->nlines = 6;
printf("Hmm bummer -M_PI\n");
}
@ -1575,17 +1612,18 @@ create_air_line(AirBlob *airblob)
min_y = max_y = airline->ycenter;
/*
for (i=0; i < airline->nlines ; i++)
{
printf("x%d, value %d\n", i, airline->line[i].x);
printf("y%d, value %d\n", i, airline->line[i].y);
printf("x%d, value %d\n", i, airline->line[i].x);
printf("y%d, value %d\n", i, airline->line[i].y);
}
printf("The xcenter %d\n",airline->xcenter);
printf("The ycenter %d\n",airline->ycenter);
printf("The xcenter %d\n",airline->xcenter);
printf("The ycenter %d\n",airline->ycenter);
*/
for (i=0; i < airline->nlines ; i++)
{
min_x = MIN(airline->line[i].x, min_x);
@ -1794,26 +1832,6 @@ trans_air_blob(AirBlob *airblob_last, AirBlob *airblob_present, double dist, int
}
int
number_of_steps(int x0, int y0, int x1, int y1)
{
int dx, dy;
dx = abs(x0 - x1);
dy = abs(y0 - y1);
if (dy > dx)
{
return dy + 1;
}
else
{
return dx + 1;
}
}

View file

@ -138,7 +138,6 @@ struct _AirBrush {
AirBlob *create_air_blob (double xc, double yc, double xt, double yt, double xr, double yr, double xb, double yb, double xl, double yl, double direction_abs, double direction);
AirBlob *trans_air_blob(AirBlob *airblob_last, AirBlob *airblob_present, double dist, int xc, int yc);
AirLine *create_air_line(AirBlob *airblob);
int number_of_steps(int x0, int y0, int x1, int y1);

View file

@ -1265,7 +1265,8 @@ create_air_line(AirBlob *airblob)
AirLine *airline;
/* Yes I know I can do a cal of number of lines, but it is for
/*
Yes I know I can do a cal of number of lines, but it is for
the moment much easier to just set a side mem for 16 lines
*/
@ -1279,6 +1280,28 @@ create_air_line(AirBlob *airblob)
direction = airblob->direction_abs;
/*
printf("Direction: %f\n", direction);
printf("Xcenter: %f\n",xcenter/SUBSAMPLE);
printf("Ycenter: %f\n",ycenter/SUBSAMPLE);
printf("MaCr.dist: %f\n",airblob->maincross_line.dist);
printf("MaCr.size: %f\n",airblob->maincross_line.size);
printf("MiCr.dist: %f\n",airblob->minorcross_line.dist);
printf("MiCr.size: %f\n",airblob->minorcross_line.size);
printf("Ma.size: %f\n",airblob->main_line.size);
printf("Mi.size: %f\n",airblob->minor_line.size);
*/
if (direction == M_PI_H || direction == M_PI)
{
direction = direction - 0.001;
}
if (direction == -M_PI_H || direction == -M_PI)
{
direction = direction + 0.001;
}
if(direction == 0.0)
{
@ -1323,6 +1346,7 @@ create_air_line(AirBlob *airblob)
airline->line[5].y = (ycenter + airblob->minorcross_line.size/2)/SUBSAMPLE;
airline->nlines = 6;
printf("Hmm bummer M_PI_H\n");
}
@ -1347,6 +1371,9 @@ create_air_line(AirBlob *airblob)
airline->nlines = 6;
printf("Hmm bummer M_PI\n");
}
else if(direction == -M_PI_H)
@ -1366,6 +1393,13 @@ create_air_line(AirBlob *airblob)
airline->line[4].y = (ycenter + airblob->maincross_line.size/2)/SUBSAMPLE;
airline->line[5].x = (xcenter - airblob->minorcross_line.dist)/SUBSAMPLE;
airline->line[5].y = (ycenter - airblob->minorcross_line.size/2)/SUBSAMPLE;
airline->nlines = 6;
printf("Hmm bummer -M_PI_H\n");
}
@ -1388,6 +1422,9 @@ create_air_line(AirBlob *airblob)
airline->line[5].y = (ycenter + airblob->minorcross_line.size/2)/SUBSAMPLE;
airline->nlines = 6;
printf("Hmm bummer -M_PI\n");
}
@ -1575,17 +1612,18 @@ create_air_line(AirBlob *airblob)
min_y = max_y = airline->ycenter;
/*
for (i=0; i < airline->nlines ; i++)
{
printf("x%d, value %d\n", i, airline->line[i].x);
printf("y%d, value %d\n", i, airline->line[i].y);
printf("x%d, value %d\n", i, airline->line[i].x);
printf("y%d, value %d\n", i, airline->line[i].y);
}
printf("The xcenter %d\n",airline->xcenter);
printf("The ycenter %d\n",airline->ycenter);
printf("The xcenter %d\n",airline->xcenter);
printf("The ycenter %d\n",airline->ycenter);
*/
for (i=0; i < airline->nlines ; i++)
{
min_x = MIN(airline->line[i].x, min_x);
@ -1794,26 +1832,6 @@ trans_air_blob(AirBlob *airblob_last, AirBlob *airblob_present, double dist, int
}
int
number_of_steps(int x0, int y0, int x1, int y1)
{
int dx, dy;
dx = abs(x0 - x1);
dy = abs(y0 - y1);
if (dy > dx)
{
return dy + 1;
}
else
{
return dx + 1;
}
}

View file

@ -138,7 +138,6 @@ struct _AirBrush {
AirBlob *create_air_blob (double xc, double yc, double xt, double yt, double xr, double yr, double xb, double yb, double xl, double yl, double direction_abs, double direction);
AirBlob *trans_air_blob(AirBlob *airblob_last, AirBlob *airblob_present, double dist, int xc, int yc);
AirLine *create_air_line(AirBlob *airblob);
int number_of_steps(int x0, int y0, int x1, int y1);

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff