Initial feedback for std.experimental.image

ketmar via Digitalmars-d digitalmars-d at puremagic.com
Fri Jul 10 16:21:02 PDT 2015


On Thu, 09 Jul 2015 23:35:00 +0000, Vladimir Panteleev wrote:

> On Tuesday, 7 July 2015 at 03:39:00 UTC, Rikki Cattermole wrote:
>> I've been sold on the unsigned vs signed type issue for and only for
>> the x and y coordinates.
> 
> The first version of ae.utils.graphics had unsigned coordinates. As I
> found out, this was a mistake.
> 
> A rule of thumb I discovered is that any numbers you may want to
> subtract, you should use signed types. Otherwise, operations such as
> drawing an arc with its center point off-canvas (with negative
> coordinates) becomes unreasonably complicated.

giving that `int` and `uint` are freely interchangeable... `uint` is 
better, as it allows only one bound check in `if`, and without casts. ;-)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20150710/eb6ea8d6/attachment-0001.sig>


More information about the Digitalmars-d mailing list