[vtk-developers] 2D DrawImage() API

Eric E. Monson emonson at cs.duke.edu
Mon Jun 7 15:03:30 EDT 2010


Hey,

I'm working on some customizations of the Charts, and it requires drawing images with the 2D API. The problem I'm running into is that with DrawImage() in its various forms there is no easy way to scale the image for display, and it limits the usability quite a bit (e.g. if I have image data that have very large or small extents I have to resample the image before drawing it to make it a reasonable size for viewing).

Do you think it would be possible to change the vtkOpenGLContextDevice2D::DrawImage() to include a floating point scaling factor? (Or, I guess, some sort of width, height pixel dimensions for the display size, if you prefer, but I personally like keeping the original aspect ratio.) From what I can see, this would require small changes in:

vtkContext2D.cxx
vtkContext2D.h
vtkContextDevice2D.h
vtkImageItem.cxx
vtkOpenGLContextDevice2D.cxx
vtkOpenGLContextDevice2D.h

There isn't a lot in the public repository that uses image drawing, but I don't know how much you guys are doing with it behind the scenes, so I don't know how much of a pain it would be to change the API now.

Let me know what you think. I could supply a patch after I experiment a bit more if you think it's reasonable to make this kind of change.

Thanks,
-Eric

------------------------------------------------------
Eric E Monson
Duke Visualization Technology Group





More information about the vtk-developers mailing list