Subject: | redefine setpixel()'s return value |
Date: | Tue, 6 Aug 2013 23:41:17 +1000 |
To: | bug-Imager [...] rt.cpan.org |
From: | tonyc [...] cpan.org |
Currently setpixel() returns an empty list when:
- there's a parameter error (missing co-ordinates, bad colour value, etc)
- the caller uses the single pixel interface and that pixel is outside
the image.
but when asked to a single pixel using the multi-pixel interface it
returns a list of ( 0 ).
To make the behaviour more sensible, so caller errors can be
distinguished from outside-the-image, setpixel should:
- return an empty list on a parameter error
- return the number of pixels drawn for either call mechanism
- if the number of pixels draw is 0, return "0 but true".
Tony