[vtkusers] vtkImageMapper error

Neil Killeen Neil.Killeen at atnf.csiro.au
Sun Apr 6 23:44:00 EDT 2003


John

On Sat, 5 Apr 2003, John Biddiscombe wrote:

> Yes. There's a bug in the render to rectangle code.
>
> What's happening is that the render to rectangle is scaling the image
> correctly, but unbeknown to it, the image mapper base class has "cropped"
> the extents of the visible image before the rectangle scaling is applied.
> Hence it gets the scaling wrong and as the screen size drops below the image
> size an error is apparent. It doesn't happen when the screen size is bigger
> than the image because no cropping occurs.
>
> A fix you can use temporarily is to
>       mapper->SetRenderToRectangle(1);
>       mapper->SetUseCustomExtents(1);
>       int ex[4] = { 0, dims[0]-1, 0, dims[1]-1 };
>       mapper->SetCustomDisplayExtents(ex);
> now we've fixed the extents that are displayed to the limits of the image
> and nomatter what happens, the correct pixels are being used, and the
> scaling is preserved.
>
> it may take me a while to fix this bug, so perhaps a short term solution is
> to alter the docs to tell the user to use custom extents (which is what I
> always do and why I've never noticed the bug)
>
> Thanks for pointing it out
>
> JB
>

Under Linux indeed this changed the behaviour to something
more sensible.

Under Solaris I still get a Bus Error, even with this new code.
Do you have the opportunity to try it under Solaris ?


thanks
Neil




More information about the vtkusers mailing list