| 574 |
|
return(0); |
| 575 |
|
if (rm->info) |
| 576 |
|
fputs(rm->info, fp); |
| 577 |
< |
if (dtype == DTfromHeader) |
| 577 |
> |
if (dtype == DTfromHeader) { |
| 578 |
|
dtype = rm->dtype; |
| 579 |
< |
else if (dtype == DTrgbe && (rm->dtype == DTxyze || |
| 579 |
> |
#if DTrmx_native==DTfloat |
| 580 |
> |
if (dtype == DTdouble) /* but stored as float? */ |
| 581 |
> |
dtype = DTfloat; |
| 582 |
> |
#endif |
| 583 |
> |
} else if (dtype == DTrgbe && (rm->dtype == DTxyze || |
| 584 |
|
findCIEprims(rm->info))) |
| 585 |
|
dtype = DTxyze; |
| 586 |
|
else if ((dtype == DTxyze) & (rm->dtype == DTrgbe)) |
| 790 |
|
dnew.ncomp = rm->ncomp; |
| 791 |
|
if (!rmx_prepare(&dnew)) |
| 792 |
|
return(0); |
| 793 |
< |
rmx_addinfo(&dnew, rm->info); |
| 793 |
> |
dnew.info = rm->info; rm->info = NULL; |
| 794 |
|
dnew.dtype = rm->dtype; |
| 795 |
|
copycolor(dnew.cexp, rm->cexp); |
| 796 |
|
memcpy(dnew.wlpart, rm->wlpart, sizeof(dnew.wlpart)); |
| 1036 |
|
case 1: |
| 1037 |
|
setcolor(cv, dp[0], dp[0], dp[0]); |
| 1038 |
|
break; |
| 1039 |
< |
default: { |
| 1039 |
> |
default: |
| 1040 |
> |
if (sizeof(COLORV) == sizeof(rmx_dtype)) { |
| 1041 |
> |
scolor2color(cv, (const COLORV *)dp, |
| 1042 |
> |
rm->ncomp, rm->wlpart); |
| 1043 |
> |
} else { |
| 1044 |
|
COLORV scol[MAXCOMP]; |
| 1045 |
< |
int k; |
| 1046 |
< |
for (k = rm->ncomp; k--; ) |
| 1039 |
< |
scol[k] = dp[k]; |
| 1045 |
> |
int k = rm->ncomp; |
| 1046 |
> |
while (k--) scol[k] = dp[k]; |
| 1047 |
|
scolor2color(cv, scol, rm->ncomp, rm->wlpart); |
| 1048 |
< |
} break; |
| 1048 |
> |
} |
| 1049 |
> |
break; |
| 1050 |
|
} |
| 1051 |
|
} |
| 1052 |
|
} |