IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Opened 21 years ago

Closed 21 years ago

Last modified 21 years ago

#537 closed defect (fixed)

psPixelGet error return

Reported by: David.Robbins@… 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 Paul Price, 21 years ago

Resolution: fixed
Status: newclosed

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}.

comment:2 by David.Robbins@…, 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.