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

Comparing ray/src/common/depthcodec.c (file contents):
Revision 2.5 by greg, Thu Nov 7 23:20:28 2019 UTC vs.
Revision 2.10 by greg, Thu Mar 5 17:43:22 2020 UTC

# Line 26 | Line 26 | depth2code(double d, double dref)
26          if (d > dref)
27                  return (int)(32768.001 - 32768.*dref/d) - 1;
28  
29 <        return (int)(32767.*d/dref - 32768.);
29 >        return (int)(32767.*d/dref - 32768.999);
30   }
31   #endif
32  
# Line 42 | Line 42 | code2depth(int c, double dref)
42          if (c >= 32767)
43                  return FHUGE;
44  
45 <        if (c >= 0)
45 >        if (c >= -1)
46                  return dref*32768./(32766.5 - c);
47  
48 <        return dref*(32767.5 + c)*(1./32767.);
48 >        return dref*(32768.5 + c)*(1./32767.);
49   }
50   #endif
51  
# Line 97 | Line 97 | headline(char *s, void *p)
97                          }
98                          return -1;
99                  }
100 <        } else if (isview(s))           /* get view params */
100 >                if (dcp->hdrflags & HF_ENCODE)
101 >                        return 0;       /* will add this later */
102 >        } else if (!strncmp(s, "SAMP360=", 8))
103 >                dcp->gotview--;
104 >        else if (isview(s))             /* get view params */
105                  dcp->gotview += (sscanview(&dcp->vw, s) > 0);
106          if (dcp->hdrflags & HF_HEADOUT)
107                  fputs(s, stdout);       /* copy to standard output */
# Line 117 | Line 121 | process_dc_header(DEPTHCODEC *dcp, int ac, char *av[])
121                  }
122                  return 0;
123          }
124 +        dcp->gotview *= (dcp->gotview > 0);
125          if (dcp->hdrflags & HF_HEADOUT) {       /* finish header */
126                  if (!(dcp->hdrflags & HF_HEADIN))
127                          newheader("RADIANCE", stdout);
# Line 314 | Line 319 | seek_dc_pix(DEPTHCODEC *dcp, int x, int y)
319                  return -1;
320          }
321          dcp->curpos = seekpos;
322 +        dcp->use_last = 0;
323          return 1;
324   }
325  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines