/[gzz]/gzz/gfx/libfisheye/Fisheye.hxx
ViewVC logotype

Diff of /gzz/gfx/libfisheye/Fisheye.hxx

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.4 by tjl, Tue Oct 1 10:14:47 2002 UTC revision 1.5 by tjl, Tue Oct 1 10:33:13 2002 UTC
# Line 46  namespace Fisheye { Line 46  namespace Fisheye {
46              if(z <= 0) return 1; // Fail gracefully              if(z <= 0) return 1; // Fail gracefully
47              if (r2 > 0) {              if (r2 > 0) {
48                  float r_orig = sqrt(r2);                  float r_orig = sqrt(r2);
49                  float ylow = r_orig;                  float ylow = r_orig - z * M_PI / 2;
50                  float yhigh = r_orig + z * M_PI / 2;                  float yhigh = r_orig;
51                  // Then, loop a little bit // XXX Improve                  // Then, loop a little bit // XXX Improve
52                  for(int i=0; i<15; i++) {                  for(int i=0; i<18; i++) {
53                      float y = 0.5*(ylow+yhigh);                      float y = 0.5*(ylow+yhigh);
54                      float c = y * func(y);                      float c = y * func(y);
55                      if(c < r_orig) {                      if(c < r_orig) {
# Line 58  namespace Fisheye { Line 58  namespace Fisheye {
58                          yhigh = y;                          yhigh = y;
59                      }                      }
60                      DBG(dbg) <<                      DBG(dbg) <<
61                              "r_orig: " << r_orig <<                              " r_orig: " << r_orig <<
62                              "ylow: " << ylow <<                              " ylow: " << ylow <<
63                              "yhigh: " << yhigh <<                              " yhigh: " << yhigh <<
64                              "c: " << c << "\n";                              " c: " << c << "\n";
65                  }                  }
66                  return 0.5*(ylow+yhigh) / r_orig;                  return 0.5*(ylow+yhigh) / r_orig;
67              }              }

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26