Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.postscript > #959

Re: How can I stretch a Postscript image, vertically only??

Newsgroups comp.lang.postscript
Date 2012-09-13 21:34 -0700
References (1 earlier) <9n0vt8Fpp4U1@mid.individual.net> <bb086a9a-f4b7-43d3-9f1b-ba9691542b65@k28g2000yqn.googlegroups.com> <5f5084db-e002-401d-8a8d-072e0592db75@q17g2000yqh.googlegroups.com> <1f50f327-f97f-496f-971b-c1d2996b41e1@r5g2000yqc.googlegroups.com> <9n2n0jF1f1U1@mid.individual.net>
Message-ID <e7dc0339-bd5f-4bfa-a25c-caacf7fd4b31@googlegroups.com> (permalink)
Subject Re: How can I stretch a Postscript image, vertically only??
From luser- -droog <mijoryx@yahoo.com>

Show all headers | View raw


On Tuesday, January 10, 2012 5:50:38 AM UTC-6, Helge Blischke wrote:
> luser- -droog wrote:
> 
> 
> 
> > On Jan 9, 3:27 pm, luser- -droog <mijo...@yahoo.com> wrote:
> 
> >> On Jan 9, 2:44 pm, Ramon F Herrera <ra...@conexus.net> wrote:
> 
> >>
> 
> >>
> 
> >>
> 
> >> > On Jan 9, 2:10 pm, Helge Blischke <h.blisc...@acm.org> wrote:
> 
> >>
> 
> >> > > Ramon F Herrera wrote:
> 
> >>
> 
> >> > > > See my thread "Need minimum/tutorial Postscript code".
> 
> >>
> 
> >> > > > In essence, I need to multiply the vertical dimensions by a factor
> 
> >> > > > of 3.
> 
> >>
> 
> >> > > > TIA,
> 
> >>
> 
> >> > > > -Ramon
> 
> >>
> 
> >> > > What about
> 
> >> > >
> 
> >> > > 1 3 scale
> 
> >> > >
> 
> >> > > ?
> 
> >> > >
> 
> >> > > Helge
> 
> >>
> 
> >> > Thanks Helge!
> 
> >>
> 
> >> > I tried it, but it doesn't work. It scales the traces, making the
> 
> >> > horizontal lines thicker:
> 
> >>
> 
> >> That's not fatal! You just need to *un*scale before you `stroke`.
> 
> >>
> 
> >> matrix currentmatrix  % get a copy of the 'current' matrix
> 
> >> 1 3 scale
> 
> >> %create path (moveto's and lineto's)
> 
> >> setmatrix  % reinstall the saved matrix
> 
> >> stroke  % draw the lines with the "normal" pen-shape.
> 
> >>
> 
> >> In a pinch, you can use
> 
> >> matrix defaultmatrix setmatrix
> 
> >> to reset the pen-shape. But this is a bad habit; it destroys
> 
> >> modularity; and it's illegal in EPS. Because you can't *embed*
> 
> >> the program fragment anymore.
> 
> "illegal" is a hard statement. The core of the restrictions the PLRM states 
> 
> on EPS files is that an EPS must not generate any unwanted side effects that 
> 
> may have influence of the environment that includes the EPS. But if you use 
> 
> e.g. setmatrix as shown above it is perfectly legal.
> 
> 
> 

Finally looked this one up.
PLRM 2ed, Appendix I Guidelines for Specific Operators
===
setmatrix
Should be used with a matrix that was previously obtained
using the currentmatrix operator or its equivalent. It can
be used for drawing objects such as ovals:

   matrix currentmatrix
   rx ry scale
   0 0 1 0 360 arc
   setmatrix
   stroke
This example ensures that the oval is drawn with an even 
stroke. However, do not use this operator to perform such 
operations as flipping the coordinate axes. Instead, use 
the concat operator and concatenate to the current 
transformation matrix. Ordinarily, Postscript programs
should modify the CTM (by using the translate, scale, rotate,
and concat operators rather than replacing it.
===

So `matrix defaultmatrix setmatrix` is definitely discouraged.
Doing this is not what one ordinarily should do.

Back to comp.lang.postscript | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

How can I stretch a Postscript image, vertically only?? Ramon F Herrera <ramon@conexus.net> - 2012-01-09 11:35 -0800
  Re: How can I stretch a Postscript image, vertically only?? Helge Blischke <h.blischke@acm.org> - 2012-01-09 21:10 +0100
    Re: How can I stretch a Postscript image, vertically only?? Ramon F Herrera <ramon@conexus.net> - 2012-01-09 12:44 -0800
      Re: How can I stretch a Postscript image, vertically only?? luser- -droog <mijoryx@yahoo.com> - 2012-01-09 13:27 -0800
        Re: How can I stretch a Postscript image, vertically only?? luser- -droog <mijoryx@yahoo.com> - 2012-01-10 00:25 -0800
          Re: How can I stretch a Postscript image, vertically only?? Helge Blischke <h.blischke@acm.org> - 2012-01-10 12:50 +0100
            Re: How can I stretch a Postscript image, vertically only?? luser- -droog <mijoryx@yahoo.com> - 2012-09-13 21:34 -0700
          Re: How can I stretch a Postscript image, vertically only?? helmwo@gmail.com - 2012-09-24 09:16 -0700
            Re: How can I stretch a Postscript image, vertically only?? "luser.droog" <luser.droog@gmail.com> - 2012-09-24 18:25 -0500
    Re: How can I stretch a Postscript image, vertically only?? Ramon F Herrera <ramon@conexus.net> - 2012-01-09 12:54 -0800

csiph-web