octave-maintainers
[Top][All Lists]
Advanced

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

Re: opengl and images (was: Re: fltk backend fix & mouse wheel scroll fa


From: Shai Ayal
Subject: Re: opengl and images (was: Re: fltk backend fix & mouse wheel scroll factor)
Date: Thu, 1 Oct 2009 22:13:33 +0200

On Thu, Oct 1, 2009 at 9:21 PM, John W. Eaton <address@hidden> wrote:
> On  1-Oct-2009, Shai Ayal wrote:
>
> | On Mon, Sep 28, 2009 at 9:24 PM, John W. Eaton <address@hidden> wrote:
> | > If we just had images working, then the fltk backend might be able to
> | > run all the demos...
> |
> | I attach a changeset adding image rendering to the gl-renderer.
> | Currently only truecolor images are supported.
> | There is one major bug (which I know of ...) which is that the image
> | origin must be within the display area for it to be shown, so there
> | will be no zooming in on images just yet.
> | Note that images are purely 2D entities and are just "pasted" on the
> | window -- they will not undergo any transformation other than
> | stretching to fit the axes. I think this is the competition's behavior
> | as well, but I'm not sure.
>
> I applied the patch and made some other small changes.  Thanks.
>
> I also checked in this change
>
>  http://hg.savannah.gnu.org/hgweb/octave/rev/c338cb954e58
>
> so that in a plot like
>
>  image (rand (8, 10, 3))
>
> all the rectangles of color are the same size and are all inside the
> axes box.  This works now for both gnuplot and opengl.  However, the
> following does not work correctly for the opengl backend:
>
>  image (rand (8, 10, 3))
>  set (gca, 'xlim', [2, 4])
>
> I would expect something like the first image attached below
> (generated with the gnuplot backend), but I get the second.  Oddly,
> the axis is resized to fill the screen if the window is refreshed (by
> placing another window on top of it then uncovering it, for example).
> I'm not sure what the proper fix is.  Any clues?
I can confirm this behavior.
I know what causes the first problem, of the image disappearing.
OpenGL will only draw the image if the origin of the image is within
the window (viewport in OpenGL teminology). When you change the axis,
it moves the image origin out of the viewport.
I will try and fix this by drawing only the part of the image which is
inside the viewport if the origin is outside the viewport

I have no idea about the second problem -- the strange axes aspect
ration which is corrected by a screen redraw.

Shai

Shai



reply via email to

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