Improved 'New' and 'Open' interfaces. ('Open' dialog no longer includes
Starter images; 'New' now brings up a selection dialog showing 'Starter' images and color choices.) New images can be given solid background colors (which the 'Eraser' tool erases to). Improved --usage output. Added support for "--papersize help" to list papersizes available via libpaper. Some Magic tools that apply an affect once per click-and-drag no longer recalculate the effect on pixels that have already been affected (until mouse button is released and clicked again).
This commit is contained in:
parent
cd17a10a32
commit
6e827f67fe
9 changed files with 1280 additions and 296 deletions
|
|
@ -75,19 +75,22 @@ void do_tint(void * ptr, int which, SDL_Surface * canvas, SDL_Surface * last,
|
|||
{
|
||||
if (api->in_circle(xx - x, yy - y, 16))
|
||||
{
|
||||
/* Get original pixel: */
|
||||
if (!api->touched(xx, yy))
|
||||
{
|
||||
/* Get original pixel: */
|
||||
|
||||
SDL_GetRGB(api->getpixel(last, xx, yy), last->format, &r, &g, &b);
|
||||
SDL_GetRGB(api->getpixel(last, xx, yy), last->format, &r, &g, &b);
|
||||
|
||||
old = api->sRGB_to_linear(r) * 0.2126 +
|
||||
api->sRGB_to_linear(g) * 0.7152 +
|
||||
api->sRGB_to_linear(b) * 0.0722;
|
||||
old = api->sRGB_to_linear(r) * 0.2126 +
|
||||
api->sRGB_to_linear(g) * 0.7152 +
|
||||
api->sRGB_to_linear(b) * 0.0722;
|
||||
|
||||
api->putpixel(canvas, xx, yy,
|
||||
api->putpixel(canvas, xx, yy,
|
||||
SDL_MapRGB(canvas->format,
|
||||
api->linear_to_sRGB(rd * old),
|
||||
api->linear_to_sRGB(gd * old),
|
||||
api->linear_to_sRGB(bd * old)));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue