gzz-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gzz-commits] gzz/gfx/libtexture irregu.texture


From: Janne V. Kujala
Subject: [Gzz-commits] gzz/gfx/libtexture irregu.texture
Date: Mon, 21 Oct 2002 03:33:48 -0400

CVSROOT:        /cvsroot/gzz
Module name:    gzz
Changes by:     Janne V. Kujala <address@hidden>        02/10/21 03:33:48

Modified files:
        gfx/libtexture : irregu.texture 

Log message:
        cleanup

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/libtexture/irregu.texture.diff?tr1=1.2&tr2=1.3&r1=text&r2=text

Patches:
Index: gzz/gfx/libtexture/irregu.texture
diff -c gzz/gfx/libtexture/irregu.texture:1.2 
gzz/gfx/libtexture/irregu.texture:1.3
*** gzz/gfx/libtexture/irregu.texture:1.2       Mon Oct 21 03:07:15 2002
--- gzz/gfx/libtexture/irregu.texture   Mon Oct 21 03:33:48 2002
***************
*** 50,56 ****
      ind = 3;
      for (j = 0, y = 0; j < height; j++, y += ystep) { 
        for (i = 0, x = 0; i < width; i++, x += xstep) {
!           data[ind] = func(x,y);
            ind += 4;
        }       
      }
--- 50,59 ----
      ind = 3;
      for (j = 0, y = 0; j < height; j++, y += ystep) { 
        for (i = 0, x = 0; i < width; i++, x += xstep) {
!           data[ind] = func(x,y) * scale + bias;
! 
!           // Add outer edge to quantized inner edge
!           data[ind] = floor(data[ind] * 255.0 + 0.5) / 255.0;
            ind += 4;
        }       
      }
***************
*** 63,76 ****
        for (j = 0, y = 0; j < height; j++, y += ystep) {       
            for (i = 0, x = 0; i < width; i++, x += xstep) {
  
!               float scale = 1.0 / (width * ripple_scale);
                
                float maxh = -1E+10;
                for (float r = -radius; r <= radius; r += eps) {
                    float h = filter(data + 3, width, height, components, 
                                     i + dx * r, j + dy * r);
  
!                   h += sqrt(radius * radius - r * r) * scale;
                    //h += radius * scale;
                    if (h > maxh) maxh = h;
                }
--- 66,79 ----
        for (j = 0, y = 0; j < height; j++, y += ystep) {       
            for (i = 0, x = 0; i < width; i++, x += xstep) {
  
!               float m = scale / (width * ripple_scale);
                
                float maxh = -1E+10;
                for (float r = -radius; r <= radius; r += eps) {
                    float h = filter(data + 3, width, height, components, 
                                     i + dx * r, j + dy * r);
  
!                   h += sqrt(radius * radius - r * r) * m;
                    //h += radius * scale;
                    if (h > maxh) maxh = h;
                }
***************
*** 82,95 ****
  
      }
  
!     for(int i = 0; i<width*height*components; i++) {
!       data[i] *= scale;
!       data[i] += bias;
!     }
! 
! #if 0    
      for(int i = 0; i<width*components; i += 4) {
!       fprintf(stderr, "%.2f %.2f %.2f %.2f\n",
                data[i+0],
                data[i+1],
                data[i+2],
--- 85,93 ----
  
      }
  
! #if 0
      for(int i = 0; i<width*components; i += 4) {
!       fprintf(stderr, "%.3f %.3f %.3f %.3f\n",
                data[i+0],
                data[i+1],
                data[i+2],




reply via email to

[Prev in Thread] Current Thread [Next in Thread]