ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/src/util/rmatrix.c
(Generate patch)

Comparing src/util/rmatrix.c (file contents):
Revision 2.101 by greg, Mon Aug 11 22:31:33 2025 UTC vs.
Revision 2.102 by greg, Thu Oct 30 16:47:54 2025 UTC

# Line 278 | Line 278 | rmx_load_rgbe(rmx_dtype *drp, const RMATRIX *rm, FILE
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  
# Line 299 | Line 318 | rmx_load_spec(rmx_dtype *drp, const RMATRIX *rm, FILE
318          }
319          return(1);
320   }
321 + #endif
322  
323   /* Read matrix header from input stream (cannot be XML) */
324   int
# Line 518 | Line 538 | rmx_write_rgbe(const rmx_dtype *dp, int ncomp, int len
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  
# Line 535 | Line 571 | rmx_write_spec(const rmx_dtype *dp, int ncomp, int len
571          }
572          return(fwritescolrs(scan, ncomp, len, fp) >= 0);
573   }
574 + #endif
575  
576   /* Check if CIE XYZ primaries were specified */
577   static int

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)