I got KAPPA installed and working on OS X today. Unfortunately bad pixels
aren't coming out correctly, and it has to do with endian-ness. Tim and I
figured out why, but we figured Norman could fix it for us (sorry
Norman!), since our fixes would be gross hacks.
The problem lies in libraries/prm/make-prm-par.c, specifically a
combination of the par_f() and tohex() functions. There's a line that
reads:
par_f(1, 'VAL__BADR", -FLT_MAX);
...that's correct, since -FLT_MAX is supposed to be the value for bad
pixels for reals, but in par_f() it converts this number into a hex for
better accuracy, and this conversion step is incorrect for whatever endian
PowerPC chips use. The hex conversion takes the first two bytes and uses
that as the number, but for PowerPC the last two bytes are the significant
ones.
This really shows up when comparing PRM_PAR and
libraries/hds/hds_machine.txt. PRM_PAR shows the bad value for reals to be
BFFFFBDC, whereas hds_machine.txt shows it (correctly) to be FF7FFFFF
(which is roughly -3.40e38).
In short, the tohex() function in libraries/prm/make-prm-par.c needs to be
modified to take different endian-ness into account.
I'm about to build CONVERT, but unfortunately once I have it built I won't
be able to actually let people use it because it links against the broken
PRM, so I'm going to have to rebuild it Monday. KAPPA looked nice, though.
:-)
Cheers,
Brad.
|