POV-Ray : Newsgroups : povray.general : Trouble with +ER1 with Pov-Ray 3.5a Server Time
6 Nov 2024 10:23:12 EST (-0500)
  Trouble with +ER1 with Pov-Ray 3.5a (Message 1 to 2 of 2)  
From: William F  Pokorny
Subject: Trouble with +ER1 with Pov-Ray 3.5a
Date: 3 Sep 2002 16:02:21
Message: <3D75154C.9DCE81AF@attglobal.net>
The following 3.5 code in povmsrec.cpp does not allow the command line
option of (+ER) to be 1, but rather forces the value, indirectly, to be
the last row in the image.  Basically it seems to be impossible to
render the top row of an image by itself.  Could someone please verify
that it happens for you too?  Thanks.

Here is the code which I think is the culprit and my suggested change:

   if(POVMSUtil_GetFloat(msg, kPOVAttrib_EndRow, &f) == 0)
   {
      if(f > 0.0 && f <= 1.0)  /* Should be < 1.0 */
      {
         opts.Last_Line = -1;
         opts.Last_Line_Percent = f;
      }
      else
         opts.Last_Line = (int)f;
   }

I'd bet the bug crept in to allow for a 100% ending percentage, but just
not specifiying the ending percentage defaults to 100%.  Here is the
related documentation which is 'mostly clear' about how it should work.

=======================================================================
  End_Row=n
                  Set last row to n pixels
  End_Row=0.n
                  Set last row to n percent of height
  +ERn or +En
                  Same as End_Row=n
  +ER0.n or +E0.n
                  Same as End_Row=0.n

When doing test rendering it is often convenient to define a small,
rectangular sub-section of the whole screen so you can quickly check out
one area of the image.  The Start_Row, End_Row, Start_Column and
End_Column options allow you to define the subset area to be rendered.
The default values are the full size of the image from (1,1) which is
the upper left to (w,h) on the lower right where w and h are the Width=n
and Height=n values you have set.

Note:  if the number specified is greater than 1 then it is interpreted
as an absolute row or column number in pixels.  If it is a decimal value
between 0.0 and 1.0 then it is interpreted as a percent of the total
width or height of the image.

For example:  Start_Row=0.75 and Start_Column=0.75 starts on a row 75%
down from the top at a column 75% from the left.  Thus it renders only
the lower-right 25% of the image regardless of the specified width and
height.
======================================================================

I believe the change brings the code in line with the documented
behavior though I am also going to suggest the "Note" in the
documentation be changed to read "Note:  if the number specified is
greater than or equal to 1 then....."  It is currently self
inconsistent.

The change also makes the +SR/+ER flags consistent with the behavior of the
+SC/+EC flags.
Bill P.


Post a reply to this message

From: hughes b
Subject: Re: Trouble with +ER1 with Pov-Ray 3.5a
Date: 3 Sep 2002 17:58:48
Message: <3d753098$1@news.povray.org>
Yes, does. But there's a workaround by using a decimal number between 1 and
2, that might have been useful said in the documentation but also possibly
awkward.

Not knowing the source code you quoted, I don't know if you are suggesting
it only see a line number instead of 100% or not. Obviously you can't ask
for both from +er1 but if you can tell it 1.0 versus 1 then I could see how
it might be fixed by checking for a decimal value. Is that what you are
saying? Very true anyway, 1.0 ought to be 100% and 1 ought to be 1 line or
column. Only that it would likely mean extra code if it can be done, of
which I know nothing about.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.