#537 closed defect (fixed)
psPixelGet error return
| Reported by: | Owned by: | Paul Price | |
|---|---|---|---|
| Priority: | high | Milestone: | |
| Component: | PSLib SDRS | Version: | unspecified |
| Severity: | normal | Keywords: | |
| Cc: |
Description
psPixelsGet currently returns a psPixelCoord. It is unclear from the
documentation what this function should return on an error. For example, if
*pixels is NULL, what should we do? 0,0 and neg,neg are valid values so those
are out of the question. For ImageGet, VectorGet, the functions return complex
so we made these return NAN on error.
Change History (2)
comment:1 by , 21 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
comment:2 by , 21 years ago
sorry, i was just using some short-hand.
ie., instead of typing the whole psPixels *pixels, I referred to it as
*pixels. I can see why that was confusing.
thanks-
Note:
See TracTickets
for help on using tickets.

Firstly, *pixels cannot be NULL, because the types wouldn't match (psPixels vs
void*).
Secondly, if pixels (i.e., not dereferenced) is NULL, then this is most likely
due to a programmer error. So the function should generate an error, and return
values that flag the fact that there's an error. Returning NaN for the
components of the psPixelCoord would be a good choice.
Added to the SDRS:
In the event of an error, \code{psPixelsGet} shall return a \code{psPixelCoord}
with components set to \code{NaN}.