[vtkusers] Inclusiveness of Rasterization

Bryan Cool bryan at radialogica.com
Wed Jul 2 15:18:14 EDT 2014


Hi everyone,

I noticed that vtkImageStencilRaster has code like the following in
InsertLine and FillStencilData, for both the x and y directions:

if (x1 >= xmin)
     {
     r1 = vtkMath::Floor(x1) + 1;
     }
if (x2 < xmax)
     {
     r2 = vtkMath::Floor(x2);
     }

Correct me if I'm wrong, but it looks like the lower side is exclusive,
while the upper end is inclusive.  The upshot of this is that the only way
to stencil the first pixel is to have a line intersect the row on the
negative side of the first pixel (in the extents).  On the other hand, to
stencil the last pixel a line only need intersect anywhere past the
second-to-last pixel (in the extents).

Assuming that's true, it seems a bit asymmetric.  Is there any way to have
exclusive behavior on both ends?

Thanks,
Bryan



More information about the vtkusers mailing list