| 278 |
|
return(1); |
| 279 |
|
} |
| 280 |
|
|
| 281 |
+ |
#if DTrmx_native==DTfloat |
| 282 |
|
static int |
| 283 |
|
rmx_load_spec(rmx_dtype *drp, const RMATRIX *rm, FILE *fp) |
| 284 |
|
{ |
| 285 |
|
COLRV *scan; |
| 286 |
+ |
int j; |
| 287 |
+ |
|
| 288 |
+ |
if ((rm->ncomp < 3) | (rm->ncomp > MAXCOMP)) |
| 289 |
+ |
return(0); |
| 290 |
+ |
scan = (COLRV *)tempbuffer((rm->ncomp+1)*rm->ncols); |
| 291 |
+ |
if (!scan) |
| 292 |
+ |
return(0); |
| 293 |
+ |
if (freadscolrs(scan, rm->ncomp, rm->ncols, fp) < 0) |
| 294 |
+ |
return(0); |
| 295 |
+ |
for (j = 0; j < rm->ncols; j++, drp += rm->ncomp) |
| 296 |
+ |
scolr2scolor(drp, scan+j*(rm->ncomp+1), rm->ncomp); |
| 297 |
+ |
return(1); |
| 298 |
+ |
} |
| 299 |
+ |
#else |
| 300 |
+ |
static int |
| 301 |
+ |
rmx_load_spec(rmx_dtype *drp, const RMATRIX *rm, FILE *fp) |
| 302 |
+ |
{ |
| 303 |
+ |
COLRV *scan; |
| 304 |
|
COLORV scol[MAXCOMP]; |
| 305 |
|
int j, k; |
| 306 |
|
|
| 318 |
|
} |
| 319 |
|
return(1); |
| 320 |
|
} |
| 321 |
+ |
#endif |
| 322 |
|
|
| 323 |
|
/* Read matrix header from input stream (cannot be XML) */ |
| 324 |
|
int |
| 538 |
|
return(fwritecolrs(scan, len, fp) >= 0); |
| 539 |
|
} |
| 540 |
|
|
| 541 |
+ |
#if DTrmx_native==DTfloat |
| 542 |
|
static int |
| 543 |
|
rmx_write_spec(const rmx_dtype *dp, int ncomp, int len, FILE *fp) |
| 544 |
|
{ |
| 545 |
|
COLRV *scan; |
| 546 |
+ |
int j; |
| 547 |
+ |
|
| 548 |
+ |
if ((ncomp < 3) | (ncomp > MAXCOMP)) return(0); |
| 549 |
+ |
scan = (COLRV *)tempbuffer((ncomp+1)*len); |
| 550 |
+ |
if (!scan) return(0); |
| 551 |
+ |
for (j = 0; j < len; j++, dp += ncomp) |
| 552 |
+ |
scolor2scolr(scan+j*(ncomp+1), dp, ncomp); |
| 553 |
+ |
|
| 554 |
+ |
return(fwritescolrs(scan, ncomp, len, fp) >= 0); |
| 555 |
+ |
} |
| 556 |
+ |
#else |
| 557 |
+ |
static int |
| 558 |
+ |
rmx_write_spec(const rmx_dtype *dp, int ncomp, int len, FILE *fp) |
| 559 |
+ |
{ |
| 560 |
+ |
COLRV *scan; |
| 561 |
|
COLORV scol[MAXCOMP]; |
| 562 |
|
int j, k; |
| 563 |
|
|
| 571 |
|
} |
| 572 |
|
return(fwritescolrs(scan, ncomp, len, fp) >= 0); |
| 573 |
|
} |
| 574 |
+ |
#endif |
| 575 |
|
|
| 576 |
|
/* Check if CIE XYZ primaries were specified */ |
| 577 |
|
static int |