More accurate description of Blinds tool.

Added missing docs for some Magic tools.
Created a ROYGBIV variation of the Rainbow arc tool.
This commit is contained in:
William Kendrick 2009-09-01 01:30:58 +00:00
parent ec4a278ca0
commit 0f3d5fcfe4
8 changed files with 93 additions and 26 deletions

View file

@ -8,7 +8,7 @@ http://www.tuxpaint.org/
$Id$
2009.August.28 (0.9.22)
2009.August.31 (0.9.22)
* New Magic Tools:
----------------
* Blinds - Close window blinds over your picture.
@ -21,6 +21,9 @@ $Id$
By Adam 'foo-script' Rakowski <foo-script@o2.pl>
with modifications by Pere Pujal i Carabantes <pere@fornol.no-ip.org>
* ROYGBIV Rainbow - Draw a rainbow arc using solid colors of
Red, Orange, Yellow, Green, Blue, Indigo and Violet.
* Other Improvements:
-------------------
* Starter images can be in SVG format.

Binary file not shown.

After

Width:  |  Height:  |  Size: 183 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 330 B

View file

@ -4,6 +4,7 @@
</head>
<body bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#FF0000" alink="#FF00FF">
<h1 align="center">Tux Paint "Magic" Tool: List of Magic Tools</h1>
<li><a href="blinds.html">Blinds</a></li>
<li><a href="blocks.html">Blocks</a></li>
<li><a href="blur.html">Blur</a></li>
<li><a href="bricks.html">Bricks</a></li>
@ -31,6 +32,10 @@
<li><a href="lighten.html">Lighten</a></li>
<li><a href="metalpaint.html">Metal Paint</a></li>
<li><a href="mirror.html">Mirror</a></li>
<li><a href="mosaic.html">Mosaic</a></li>
<li><a href="hexagonmosaic.html">Hexagon Mosaic</a></li>
<li><a href="irregularmosaic.html">Irregular Mosaic</a></li>
<li><a href="squaremosaic.html">Square Mosaic</a></li>
<li><a href="negative.html">Negative</a></li>
<li><a href="noise.html">Noise</a></li>
<li><a href="perspective.html">Perspective</a></li>
@ -39,6 +44,7 @@
<li><a href="rain.html">Rain</a></li>
<li><a href="rainbow.html">Rainbow</a></li>
<li><a href="realrainbow.html">Real Rainbow</a></li>
<li><a href="roygbivrainbow.html">ROYGBIV Rainbow</a></li>
<li><a href="ripples.html">Ripples</a></li>
<li><a href="rosette.html">Rosette</a></li>
<li><a href="sharpen.html">Sharpen</a></li>

View file

@ -1,5 +1,6 @@
Tux Paint "Magic" Tool: List of Magic Tools
* Blinds
* Blocks
* Blur
* Bricks
@ -27,6 +28,10 @@
* Lighten
* Metal Paint
* Mirror
* Mosaic
* Hexagon Mosaic
* Irregular Mosaic
* Square Mosaic
* Negative
* Noise
* Perspective
@ -35,6 +40,7 @@
* Rain
* Rainbow
* Real Rainbow
* ROYGBIV Rainbow
* Ripples
* Rosette
* Sharpen

View file

@ -5,7 +5,7 @@ individual HTML files for each of them, and an index.html that links to
them all. */
/* Bill Kendrick <bill@newbreedsoftware.com> */
/* 2009.08.10 */
/* 2009.08.31 */
/* Authors of the Magic tools: */
@ -50,7 +50,9 @@ $AUTHOR_PERE = "Pere Pujal i Carabantes|pere@fornol.no-ip.org";
$tools = array(
/* FIXME: Blinds */
array('name'=>'Blinds',
'desc'=>'Click towards the edge of your picture to pull window blinds over it. Move perpendicularly to open or close the blinds.',
'author'=>$AUTHOR_PERE),
array('name'=>'Blocks',
'desc'=>'This makes the picture blocky looking ("pixelated") wherever you drag the mouse.',
@ -170,10 +172,41 @@ $tools = array(
'author'=>$AUTHOR_KENDRICK,
'see'=>'Flip'),
/* FIXME: Mosaic */
/* FIXME: Mosaic hexagon */
/* FIXME: Mosaic irregular */
/* FIXME: Mosaic square */
array('name'=>'Mosaic',
'desc'=>'Adds a glass mosaic effect to your picture.',
'author'=>array($AUTHOR_ADAMR, $AUTHOR_PERE),
'see'=>array(
'Hexagon Mosaic',
'Irregular Mosaic',
'Square Mosaic',
)),
array('name'=>'Hexagon Mosaic',
'desc'=>'Converts parts of your picture into a mosaic of hexagon cells.',
'author'=>$AUTHOR_PERE,
'see'=>array(
'Irregular Mosaic',
'Square Mosaic',
'Mosaic',
)),
array('name'=>'Irregular Mosaic',
'desc'=>'Converts parts of your picture into a mosaic of irregularly-shaped cells.',
'author'=>$AUTHOR_PERE,
'see'=>array(
'Hexagon Mosaic',
'Square Mosaic',
'Mosaic',
)),
array('name'=>'Square Mosaic',
'desc'=>'Converts parts of your picture into a mosaic of square cells.',
'author'=>$AUTHOR_PERE,
'see'=>array(
'Hexagon Mosaic',
'Irregular Mosaic',
'Mosaic',
)),
array('name'=>'Negative',
'desc'=>'This inverts the colors wherever you drag the mouse. (e.g., white becomes black, and vice versa.)',
@ -209,6 +242,10 @@ $tools = array(
'desc'=>'Draw a transparent arc that looks like a real rainbow.',
'author'=>$AUTHOR_KENDRICK),
array('name'=>'ROYGBIV Rainbow',
'desc'=>'Draw a rainbow arc of red, orange, yellow, green, blue, indigo and violet.',
'author'=>$AUTHOR_KENDRICK),
array('name'=>'Ripples',
'desc'=>'Click in your picture to make water ripple distortions appear over it.',
'author'=>$AUTHOR_KENDRICK),

View file

@ -4,9 +4,9 @@
BLIND Magic Tools Plugin
Tux Paint - A simple drawing program for children.
Credits: Adam 'foo-script' Rakowski <foo-script@o2.pl>
By Pere Pujal Carabantes
Copyright (c) 2002-2008 by Bill Kendrick and others; see AUTHORS.txt
Copyright (c) 2002-2009 by Bill Kendrick and others; see AUTHORS.txt
bill@newbreedsoftware.com
http://www.tuxpaint.org/
@ -94,7 +94,7 @@ char * blind_get_name(magic_api * api, int which)
char * blind_get_description(magic_api * api, int which, int mode)
{
return strdup(gettext_noop("Click and drag to draw the blind, move left or right to open or close."));
return strdup(gettext_noop("Click towards the edge of your picture to pull window blinds over it. Move perpendicularly to open or close the blinds."));
}
int blind_requires_colors(magic_api * api, int which)

View file

@ -6,7 +6,7 @@
by Bill Kendrick <bill@newbreedsoftware.com>
Math assistence by Jeff Newmiller <jdnewmil@dcn.davis.ca.us>
2009.04.02 - 2009.06.06
2009.04.02 - 2009.08.31
FIXME:
* Color/alpha art needs improvement.
@ -23,11 +23,11 @@ FIXME:
Mix_Chunk * realrainbow_snd;
int realrainbow_x1, realrainbow_y1, realrainbow_x2, realrainbow_y2;
SDL_Rect realrainbow_rect;
SDL_Surface * realrainbow_colors;
SDL_Surface * realrainbow_colors[2];
Uint8 realrainbow_blendr, realrainbow_blendg, realrainbow_blendb, realrainbow_blenda;
void realrainbow_arc(magic_api * api, SDL_Surface * canvas, SDL_Surface * last,
void realrainbow_arc(magic_api * api, int which, SDL_Surface * canvas, SDL_Surface * last,
int x1, int y1, int x2, int y2,
int fulldraw, SDL_Rect * update_rect);
static void realrainbow_linecb(void * ptr, int which,
@ -45,8 +45,13 @@ int realrainbow_init(magic_api * api)
char fname[1024];
snprintf(fname, sizeof(fname), "%s/images/magic/realrainbow-colors.png", api->data_directory);
realrainbow_colors = IMG_Load(fname);
if (realrainbow_colors == NULL)
realrainbow_colors[0] = IMG_Load(fname);
if (realrainbow_colors[0] == NULL)
return(0);
snprintf(fname, sizeof(fname), "%s/images/magic/realrainbow-roygbiv-colors.png", api->data_directory);
realrainbow_colors[1] = IMG_Load(fname);
if (realrainbow_colors[1] == NULL)
return(0);
snprintf(fname, sizeof(fname), "%s/sounds/magic/realrainbow.ogg",
@ -58,22 +63,29 @@ int realrainbow_init(magic_api * api)
int realrainbow_get_tool_count(magic_api * api)
{
return(1);
return(2);
}
SDL_Surface * realrainbow_get_icon(magic_api * api, int which)
{
char fname[1024];
snprintf(fname, sizeof(fname), "%s/images/magic/realrainbow.png",
api->data_directory);
if (which == 0)
snprintf(fname, sizeof(fname), "%s/images/magic/realrainbow.png",
api->data_directory);
else
snprintf(fname, sizeof(fname), "%s/images/magic/realrainbow-roygbiv.png",
api->data_directory);
return(IMG_Load(fname));
}
char * realrainbow_get_name(magic_api * api, int which)
{
return(strdup(gettext_noop("Real Rainbow")));
if (which == 0)
return(strdup(gettext_noop("Real Rainbow")));
else
return(strdup(gettext_noop("ROYGBIV Rainbow")));
}
char * realrainbow_get_description(magic_api * api, int which, int mode)
@ -93,7 +105,10 @@ int realrainbow_requires_colors(magic_api * api, int which)
void realrainbow_shutdown(magic_api * api)
{
SDL_FreeSurface(realrainbow_colors);
if (realrainbow_colors[0] != NULL)
SDL_FreeSurface(realrainbow_colors[0]);
if (realrainbow_colors[1] != NULL)
SDL_FreeSurface(realrainbow_colors[1]);
if (realrainbow_snd != NULL)
Mix_FreeChunk(realrainbow_snd);
}
@ -129,7 +144,7 @@ void realrainbow_drag(magic_api * api, int which,
SDL_BlitSurface(last, &realrainbow_rect, canvas, &realrainbow_rect);
realrainbow_arc(api, canvas, last, realrainbow_x1, realrainbow_y1, realrainbow_x2, realrainbow_y2, 0, update_rect);
realrainbow_arc(api, which, canvas, last, realrainbow_x1, realrainbow_y1, realrainbow_x2, realrainbow_y2, 0, update_rect);
memcpy(&rect, &realrainbow_rect, sizeof(SDL_Rect));
memcpy(&realrainbow_rect, update_rect, sizeof(SDL_Rect));
@ -167,7 +182,7 @@ void realrainbow_release(magic_api * api, int which,
SDL_BlitSurface(last, &realrainbow_rect, canvas, &realrainbow_rect);
realrainbow_arc(api, canvas, last, realrainbow_x1, realrainbow_y1, realrainbow_x2, realrainbow_y2, 1, update_rect);
realrainbow_arc(api, which, canvas, last, realrainbow_x1, realrainbow_y1, realrainbow_x2, realrainbow_y2, 1, update_rect);
memcpy(&rect, &realrainbow_rect, sizeof(SDL_Rect));
memcpy(&realrainbow_rect, update_rect, sizeof(SDL_Rect));
@ -203,7 +218,7 @@ void realrainbow_switchout(magic_api * api, int which, int mode, SDL_Surface * c
}
void realrainbow_arc(magic_api * api, SDL_Surface * canvas, SDL_Surface * last, int x1, int y1, int x2, int y2, int fulldraw, SDL_Rect * update_rect)
void realrainbow_arc(magic_api * api, int which, SDL_Surface * canvas, SDL_Surface * last, int x1, int y1, int x2, int y2, int fulldraw, SDL_Rect * update_rect)
{
int lowx, lowy, hix, hiy, xm, ym, xc, yc, r, a1, atan2_a, atan2_b;
int a, oa, ox, oy, nx, ny, step, thick, rr, done;
@ -294,10 +309,10 @@ void realrainbow_arc(magic_api * api, SDL_Surface * canvas, SDL_Surface * last,
nx = (rr * cos(a * M_PI / 180.0)) + xc;
ny = (rr * sin(a * M_PI / 180.0)) + yc;
colorindex = realrainbow_colors->h - 1 - (((rr - r + (thick / 2)) * realrainbow_colors->h) / thick);
colorindex = realrainbow_colors[which]->h - 1 - (((rr - r + (thick / 2)) * realrainbow_colors[which]->h) / thick);
SDL_GetRGBA(api->getpixel(realrainbow_colors, 0, colorindex),
realrainbow_colors->format, &realrainbow_blendr, &realrainbow_blendg, &realrainbow_blendb, &realrainbow_blenda);
SDL_GetRGBA(api->getpixel(realrainbow_colors[which], 0, colorindex),
realrainbow_colors[which]->format, &realrainbow_blendr, &realrainbow_blendg, &realrainbow_blendb, &realrainbow_blenda);
if (!fulldraw)
realrainbow_blenda = 255;