"xorpixel()" function added to Magic Tools API

This commit is contained in:
Bill Kendrick 2021-02-20 15:19:40 -08:00
parent d588e5d214
commit 7cd547e746
6 changed files with 103 additions and 62 deletions

View file

@ -12,7 +12,7 @@ alink="#FF00FF">
<p>Copyright 2007-2018 by various contributors; see AUTHORS.txt<br/>
<a href="http://www.tuxpaint.org/">http://www.tuxpaint.org/</a></p>
<p>July 5, 2007 - August 30, 2018</p>
<p>July 5, 2007 - February 20, 2021</p>
</center>
<hr size=2 noshade>
@ -497,6 +497,15 @@ plugin's functions.
surface.)<br>
<br>
<li><code><b>Uint32 xorpixel(SDL_Surface&nbsp;*&nbsp;surf,
int&nbsp;x, int&nbsp;y)</b></code><br>
Applies an XOR (exclusive-or) operation to the pixel at coordinates
(x,y) of the SDL_Surface. Applying an XOR again at the same position
will return the pixel to the original value. Useful for displaying
temporary 'rubberband' lines, outlines, and crosshairs, while
utilizing a Magic Tool.<br>
<br>
<li><code><b>SDL_Surface * scale(SDL_Surface&nbsp;*&nbsp;surf,
int&nbsp;w, int&nbsp;h, int&nbsp;keep_aspect)</b></code><br>
This accepts an existing SDL surface and creates a new one scaled to an