21 void ImageViewOldGL::paintGL()
23 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
24 glDrawPixels(image_view.
image.width(), image_view.
image.height(), GL_RGB, GL_UNSIGNED_BYTE, image_view.
image.bits());
25 QList<DrawItem*>::iterator iter = image_view.
items.begin();
26 for(;iter != image_view.
items.end();++iter)
29 if((*iter)->onOpenGL())
30 (*iter)->renderOnGl(*
this,image_view.
source,image_view.
target);
36 if(!display_width || !display_height)
38 display_width = width();
39 display_height = height();
45 if (image_view.
image.width() && image_view.
image.height())
47 x = ((float)display_width)/ image_view.
image.width();
48 y = ((float)display_height)/ image_view.
image.height();
57 y_offset = -0.5f*(display_height-x*image_view.
image.height());
62 x_offset = 0.5f*(display_width-y*image_view.
image.width());
67 glMatrixMode(GL_PROJECTION);
69 glOrtho(0, display_width, 0, display_height, 0, 1);
70 glMatrixMode(GL_MODELVIEW);
72 glViewport(0,0, display_width, display_height);
73 glRasterPos2i(x_offset,display_height+y_offset);
79 void ImageViewOldGL::resizeGL(
int w,
int h)
virtual ~ImageViewOldGL()
ImageViewOldGL(ImageViewOld &parent)
void setGLViewPoint(int display_width=0, int display_height=0)