|
From: Daniel J S. <dan...@ie...> - 2015-04-20 07:00:44
|
On 04/20/2015 12:02 AM, sfeam wrote: > On Sunday, 19 April 2015 11:51:22 PM Daniel J Sebald wrote: >> Forgot one: >> >> imageNaN.dem >> Treatment of missing/undefined/NaN/Inf data: Qt and x11 plots look >> similar except for first column. >> Qt: (top to bottom) black, yellow, white, blue, white, blue >> x11: (top to bottom) black, yellow, black, blue, black, blue >> image from non-matrix data: The x11 plot has a black pixel left, >> second from top so the text "NaN should appear as background" is not >> visible. >> negative values mapped to log-scale colorbar: Same sort of thing for >> x11, the "Negative values become NaN..." is not visible. > > Right. That's the point of having the demos - they serve as unit tests > for the various code features. In this case it shows that the x11 terminal > does not handle NaN in image data optimally. That's at least partly because > the x11 terminal doesn't handle transparency, so there is not the option > of mapping NaN to "all-transparent". > > The PostScript terminal exhibits the same deficiency. > In both cases the terminal is just showing it's age. > The newer options (qt/cairo) are more capable. > > Ethan Are we talking 100% transparent "pixel"? Or partially transparent? I've not worked with any of the Qt QGraphicsItem classes, but I'm wondering if this QGraphicsPixmapItem class is handling images as a collective of pixels, as opposed to an image of data that is sent to a driver. That might explain the slowness of the Qt terminal. Qt is much slower than x11 when working with the image data--a factor of five or more. In other words, the QGraphicsItem class might be similar to the failsafe mode of x11, as far as its operation is concerned--I'm assuming failsafe is where an image is created by drawing squares on the canvas. For that example, if I turn on failsafe mode, i.e., plot $DATA with image failsafe that example with "NaN should appear as background" and "Negative values become NaN with a log-scale color mapping" looks similar in x11 and Qt terminals. In fact, shrinking down the image I can see in both cases that "NaN should appear as background" is actually in front of the pixmap while "Negative values become NaN with a log-scale color mapping". I'm fine with the demo, but now that I understand it I don't see the terminal type as being highly responsible for the feature. (Partial transparency is a different issue. That's something more significant. Could probably do alpha-blending in X11, but I don't think anyone wants to tackle that.) The "failsafe" option is somewhat vague. Given what I suspect about the image being actually drawn with individual rectangles (something that "image" defaults to when cast into a 3D non-perpendicular view), it might have been nicer to force this mode with a different type, say "pixmap" as opposed to "image". I'm not too quick to dismiss x11 terminal. Yes, I know maintenance is an issue, and alpha blending is missing, antialiasing for nice lines is missing, etc. But it wouldn't surprise me if ultimately Qt terminal (i.e., QGraphicsItem) is using X11 in some form. Dan |