Arjen Markus <[EMAIL PROTECTED]> writes:

> Hello,
>
> Stefan Menzel reported a bug (plplot-Bugs-1973336) regarding plotting
> a single pixel. This is a special case in plpoin (where the value of
> the argument code is -1).
>
> The wingcc driver does not plot anything, whereas the GD driver does
> (at least for PNG).
>
> Given the implementation (as a line drawn from the point to itself)
> and the comment in the header that this may not work for smart enough
> drivers/devices, I wonder how we can solve this:
>
> - The wingcc driver has a separate function to draw a single pixel. We
> could change the driver to use that function to draw such a degenerate
> line. Then the effect would be limited to the wingcc driver, thus
> solving Stefan's immediate problem.  Each device for which this is an
> issue would have to be adapted.
>
> - We can change the plpoin() function or better: the underlying line
> drawing function grline() to to invoke the correct drawing function if
> the line is degenerate. This is (a lot?) more work, as currently the
> devices are not required to have a separate pixel drawing function
> (there is no provision in the dispatch table for this).
>
> Should we go for the first or the second solution?
>

In the new win driver, the line function looks for the degenerate case
where the start and end point are the same and uses the 


For example

  // If the beginning and end are the same
  if ( xpixb == xpixe && ypixb == ypixe ) {
    // Draw a pixel
    rc = SetPixel(dev->current_dc, xpixb, ypixb, dev->pen_color);
  } else {
    // Otherwise draw a line
    rc = MoveToEx(dev->current_dc, xpixb, ypixb,NULL);
    if(rc) rc = LineTo(dev->current_dc, xpixe, ypixe);
  }

There is a similar logic for X11 using XDrawPoint and XDrawLine.
I think this change should be made even if a single point drawing
function is implemented.

The plpoin does not draw a single pixel point per se.  The intent of the
function is to draw a point on the graph (which can multiple pixels).
Unless there is a reason to create an API call that draws a single
pixel, then I advocate we leave the dispatch table alone.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel

Reply via email to