gzz-commits
[Top][All Lists]
Advanced

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

[Gzz-commits] gzz ./TODO gfx/demo/xupdf.py gfx/librenderables...


From: Tuomas J. Lukka
Subject: [Gzz-commits] gzz ./TODO gfx/demo/xupdf.py gfx/librenderables...
Date: Fri, 27 Sep 2002 15:34:48 -0400

CVSROOT:        /cvsroot/gzz
Module name:    gzz
Changes by:     Tuomas J. Lukka <address@hidden>        02/09/27 15:34:48

Modified files:
        .              : TODO 
        gfx/demo       : xupdf.py 
        gfx/librenderables: renderables.py 
        gfx/libutil    : effects.py 

Log message:
        Change the parameters of irregularquad to match paperquad. xupdf looks 
very nice now, although it's not useful the way it is. Still, the 
irregularframe graphics WORKS.

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/TODO.diff?tr1=1.164&tr2=1.165&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/demo/xupdf.py.diff?tr1=1.27&tr2=1.28&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/librenderables/renderables.py.diff?tr1=1.73&tr2=1.74&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/libutil/effects.py.diff?tr1=1.8&tr2=1.9&r1=text&r2=text

Patches:
Index: gzz/TODO
diff -c gzz/TODO:1.164 gzz/TODO:1.165
*** gzz/TODO:1.164      Fri Sep 27 12:06:32 2002
--- gzz/TODO    Fri Sep 27 15:34:48 2002
***************
*** 40,52 ****
      benja:
        - help fixing rungl - now the necessary infos are
          passed along and text shows up in the cells but 
!         a bit wrong.
        - think with Tjl about the edit bindings for xupdf demo
        - check with Tjl that saving works
        + ZZ vanishingview cell size for pagespans and linebroken
          paragraphs, as well as libpaper backgrounds
      humppake:
!       - clean up Paper VP interface:
            - vertex => vertexVP(), and also explanation
              for outside how to avoid it, i.e. use 
              vertex position and texcoords, since
--- 40,52 ----
      benja:
        - help fixing rungl - now the necessary infos are
          passed along and text shows up in the cells but 
!         a bit wrong (sorry about the kludges --Tjl).
        - think with Tjl about the edit bindings for xupdf demo
        - check with Tjl that saving works
        + ZZ vanishingview cell size for pagespans and linebroken
          paragraphs, as well as libpaper backgrounds
      humppake:
!       - clean up Paper VP interface [jvk will explain]:
            - vertex => vertexVP(), and also explanation
              for outside how to avoid it, i.e. use 
              vertex position and texcoords, since
***************
*** 60,73 ****
          of it.
          Check by setting polygonmode to lines in xupdf
          (by a key) and seeing that the non-distorted 
!         polygons are diced less.
      tjl:
        - distorted multi-page PDF view with xu links
!           - make it work again, distorted paper, irregular quad.
            - text
            - entry / link making bindings
            - saving
!           - larger startup structure
            - clean up the xupdf.py file
            - buoy edges, distorted (dep. on *1)
        - script the demo, determine in detail all features
--- 60,74 ----
          of it.
          Check by setting polygonmode to lines in xupdf
          (by a key) and seeing that the non-distorted 
!         polygons are diced less. Actually, better make
!         a new demo just of this fact.
      tjl:
        - distorted multi-page PDF view with xu links
!           - make it work again
            - text
            - entry / link making bindings
            - saving
!           - larger structure
            - clean up the xupdf.py file
            - buoy edges, distorted (dep. on *1)
        - script the demo, determine in detail all features
Index: gzz/gfx/demo/xupdf.py
diff -c gzz/gfx/demo/xupdf.py:1.27 gzz/gfx/demo/xupdf.py:1.28
*** gzz/gfx/demo/xupdf.py:1.27  Fri Sep 27 14:52:26 2002
--- gzz/gfx/demo/xupdf.py       Fri Sep 27 15:34:48 2002
***************
*** 128,135 ****
        self.cell = cell
        self.content = space.cellTexter.getEnfilade(cell, None)
        self.pap = getPDFPapers(self.content)
!       self.irregu = IrreguFrame(0.06, 2, 1.5, # XXX
!                       0.5)
      # Height = always 1.
      # Start = always (0,0)
      def placepapers(self, vs, 
--- 128,136 ----
        self.cell = cell
        self.content = space.cellTexter.getEnfilade(cell, None)
        self.pap = getPDFPapers(self.content)
!       self.irregu = IrreguFrame(0, 0, self.pap[0][1] / self.pap[0][2] * 
len(self.pap), 1,
!                       0.06, 0.5)
!       # self.irregu = IrreguFrame(-1, -1, 1, 1, 0.06, 0.5)
      # Height = always 1.
      # Start = always (0,0)
      def placepapers(self, vs, 
***************
*** 166,172 ****
                            pq = GLRen.createPaperQuad(
                                papers[i][0], *corners)
                            vs.map.put(pq, cs1, cs2)
!                   self.curx += 1.02 *  papers[i][1] * scale
  
        pp = PutPapers()
        if cliprect:
--- 167,173 ----
                            pq = GLRen.createPaperQuad(
                                papers[i][0], *corners)
                            vs.map.put(pq, cs1, cs2)
!                   self.curx += papers[i][1] * scale
  
        pp = PutPapers()
        if cliprect:
Index: gzz/gfx/librenderables/renderables.py
diff -c gzz/gfx/librenderables/renderables.py:1.73 
gzz/gfx/librenderables/renderables.py:1.74
*** gzz/gfx/librenderables/renderables.py:1.73  Fri Sep 27 14:22:59 2002
--- gzz/gfx/librenderables/renderables.py       Fri Sep 27 15:34:48 2002
***************
*** 556,576 ****
  
  # coords1: paper => window
  # coords2: tearaway => paper (assumed to be affine)
! # The paper is [-paperw,paperw]x[-paperh,paperh] in paper coordinates and
  # the tearaway part is [-1,1]x[-1,1] in tearaway coordinates.
  # border and ripple_period are relative to the ripple amplitude and period in
  # paper coordinates
  {
      "Type" : "2",
      "Name": "IrregularQuad",
!     "Data": "float border; float paperw, paperh, freq; int mode; CallGLCode 
setup;",
      "Params" : """
!           float border, float paperw, float paperh, float ripple_period, int 
mode, String setupcode
        """,
      "ParamCode" : """
              this->border = border;
-             this->paperw = paperw;
-             this->paperh = paperh;
              this->freq = 1.0 / ripple_period;
              this->mode = mode;
              setup = CallGLCode(string(setupcode.begin(), 
setupcode.end()).c_str());
--- 556,580 ----
  
  # coords1: paper => window
  # coords2: tearaway => paper (assumed to be affine)
! # The rectangular paper from which the tearaway is torn away
! # is [x0,y0]..[x1,y1] in paper coordinates (as in PaperQuad) and
  # the tearaway part is [-1,1]x[-1,1] in tearaway coordinates.
  # border and ripple_period are relative to the ripple amplitude and period in
  # paper coordinates
  {
      "Type" : "2",
      "Name": "IrregularQuad",
!     "Data": "float x0, y0, x1, y1; float border; float freq; int mode; 
CallGLCode setup;",
      "Params" : """
!           float x0, float y0, float x1, float y1,
!           float border, float ripple_period, int mode, String setupcode
        """,
      "ParamCode" : """
+           this->x0 = x0;
+           this->y0 = y0;
+           this->x1 = x1;
+           this->y1 = y1;
              this->border = border;
              this->freq = 1.0 / ripple_period;
              this->mode = mode;
              setup = CallGLCode(string(setupcode.begin(), 
setupcode.end()).c_str());
***************
*** 579,585 ****
              template <class Coords>
              inline void vert(Coords& coords1, Coords& coords2, ZPt q) {
                  ZPt p = coords2.transform(q);
!                 glMultiTexCoord2f(1, .25 / paperw * p.x + .5, .25 / paperh * 
p.y + .5);
                  coords1.vertex(p);
                DBG(dbg) << "Vert: " << q<<p<<coords1.transform(p) <<"\\n";
              }
--- 583,594 ----
              template <class Coords>
              inline void vert(Coords& coords1, Coords& coords2, ZPt q) {
                  ZPt p = coords2.transform(q);
!               float xrelp = (p.x - x0)/ (x1-x0);
!               float yrelp = (p.y - y0)/ (y1-y0);
!                 glMultiTexCoord2f(1, 
!                       .25 + .5 * xrelp,  // the center texels of 4x4 are 
colored
!                       .25 + .5 * yrelp
!               );
                  coords1.vertex(p);
                DBG(dbg) << "Vert: " << q<<p<<coords1.transform(p) <<"\\n";
              }
Index: gzz/gfx/libutil/effects.py
diff -c gzz/gfx/libutil/effects.py:1.8 gzz/gfx/libutil/effects.py:1.9
*** gzz/gfx/libutil/effects.py:1.8      Fri Sep 27 14:22:59 2002
--- gzz/gfx/libutil/effects.py  Fri Sep 27 15:34:48 2002
***************
*** 117,123 ****
  
      combiners = "Enable"
  
!     def __init__(self, border, w, h, ripple):
          print "Texture id:", self.tex.getTexId()
  
          code = """
--- 117,123 ----
  
      combiners = "Enable"
  
!     def __init__(self, x0, y0, x1, y1, border, ripple):
          print "Texture id:", self.tex.getTexId()
  
          code = """
***************
*** 164,169 ****
                self.combiners)
  
  
!       self.content = GLRen.createIrregularQuad(border, w, h, ripple, 0, code)
!       self.frame = GLRen.createIrregularQuad(border, w, h, ripple, 1, code)
  
--- 164,169 ----
                self.combiners)
  
  
!       self.content = GLRen.createIrregularQuad(x0, y0, x1, y1, border, 
ripple, 0, code)
!       self.frame = GLRen.createIrregularQuad(x0, y0, x1, y1, border, ripple, 
1, code)
  




reply via email to

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