00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044 #include "gradients.h"
00045 #include "hoverpoints.h"
00046
00047 #include <QtOpenGL>
00048
00049 #include <GL/gl.h>
00050 #include <GL/glu.h>
00051 #include <GL/glut.h>
00052
00053
00054 #define tfcheckImageWidth 256
00055 #define tfcheckImageHeight 256
00056 static GLubyte tfcheckImage[tfcheckImageHeight][tfcheckImageWidth][4];
00057
00058
00059
00060 #ifdef GL_VERSION_1_1
00061 static GLuint tftexName;
00062 #endif
00063
00064 #include <iostream>
00065
00066 void tfmakeCheckImage(void)
00067 {
00068 int i, j, c;
00069
00070 for (i = 0; i < tfcheckImageHeight; i++) {
00071 for (j = 0; j < tfcheckImageWidth; j++) {
00072 c = ((((i&0x8)==0)^((j&0x8))==0))*255;
00073
00074
00075
00076 tfcheckImage[i][j][0] = (GLubyte) c;
00077 tfcheckImage[i][j][1] = (GLubyte) c;
00078 tfcheckImage[i][j][2] = (GLubyte) c;
00079 tfcheckImage[i][j][3] = (GLubyte) 255;
00080
00081 }
00082 }
00083 }
00084
00085 ShadeWidget::ShadeWidget(ShadeType type, QWidget *parent)
00086 : QWidget(parent), m_shade_type(type), m_alpha_gradient(QLinearGradient(0, 0, 0, 0))
00087 {
00088
00089
00090 if (m_shade_type == ARGBShade) {
00091 QPixmap pm(20, 20);
00092 QPainter pmp(&pm);
00093 pmp.fillRect(0, 0, 10, 10, Qt::lightGray);
00094 pmp.fillRect(10, 10, 10, 10, Qt::lightGray);
00095 pmp.fillRect(0, 10, 10, 10, Qt::darkGray);
00096 pmp.fillRect(10, 0, 10, 10, Qt::darkGray);
00097 pmp.end();
00098 QPalette pal = palette();
00099 pal.setBrush(backgroundRole(), QBrush(pm));
00100 setAutoFillBackground(true);
00101 setPalette(pal);
00102
00103 } else {
00104 setAttribute(Qt::WA_NoBackground);
00105
00106 }
00107
00108 QPolygonF points;
00109 points << QPointF(0, sizeHint().height())
00110 << QPointF(sizeHint().width(), 0);
00111
00112 m_hoverPoints = new HoverPoints(this, HoverPoints::CircleShape);
00113
00114 m_hoverPoints->setPoints(points);
00115 m_hoverPoints->setPointLock(0, HoverPoints::LockToLeft);
00116 m_hoverPoints->setPointLock(1, HoverPoints::LockToRight);
00117 m_hoverPoints->setSortType(HoverPoints::XSort);
00118
00119
00120 setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
00121
00122 connect(m_hoverPoints, SIGNAL(pointsChanged(const QPolygonF &)), this, SIGNAL(colorsChanged()));
00123 }
00124
00125
00126 QPolygonF ShadeWidget::points() const
00127 {
00128 return m_hoverPoints->points();
00129 }
00130
00131
00132 uint ShadeWidget::colorAt(int x)
00133 {
00134 generateShade();
00135
00136 QPolygonF pts = m_hoverPoints->points();
00137 for (int i=1; i < pts.size(); ++i) {
00138 qreal candidate_left_x = pts.at(i-1).x();
00139 qreal candidate_left_y = pts.at(i-1).y();
00140 qreal candidate_right_x = pts.at(i).x();
00141 qreal candidate_right_y = pts.at(i).y();
00142 qreal lx1,lx2,ly1,ly2,ll;
00143 if ( candidate_left_x<= x && candidate_right_x >= x) {
00144 QLineF l(pts.at(i-1), pts.at(i));
00145
00146 ll = l.length();
00147
00148 l.setLength(l.length() * ((x - l.x1()) / l.dx()));
00149
00150 ll = l.length();
00151 lx1 = l.x1();
00152 lx2 = l.x2();
00153 ly1 = l.y1();
00154 ly2 = l.y2();
00155
00156 int widget_width = m_shade.width();
00157 int widget_height = m_shade.height();
00158
00159 qreal min_px = qMin(l.x2(), qreal(m_shade.width() - 1));
00160 qreal min_py = qMin(l.y2(), qreal(m_shade.height() - 1));
00161
00162 int px = qRound(min_px);
00163 int py = qRound(min_py);
00164
00165 QRgb p1 = m_shade.pixel(px,py);
00166 int pred = qRed(p1);
00167 int pgreen = qGreen(p1);
00168 int pblue = qBlue(p1);
00169 int palpha = qAlpha(p1);
00170
00171 return p1;
00172 }
00173 }
00174 return 0;
00175 }
00176
00177
00178 void ShadeWidget::setGradientStops(const QGradientStops &stops)
00179 {
00180 if (m_shade_type == ARGBShade) {
00181 m_alpha_gradient = QLinearGradient(0, 0, width()-1, 0);
00182
00183 for (int i=0; i<stops.size(); ++i) {
00184 QColor c = stops.at(i).second;
00185 m_alpha_gradient.setColorAt(stops.at(i).first, QColor(c.red(), c.green(), c.blue()));
00186 }
00187
00188 m_shade = QImage();
00189 generateShade();
00190 update();
00191 }
00192 }
00193
00194
00195 void ShadeWidget::paintEvent(QPaintEvent *)
00196 {
00197 generateShade();
00198
00199 QPainter p(this);
00200 p.drawImage(0, 0, m_shade);
00201
00202
00203
00204 }
00205
00206
00207 void ShadeWidget::generateShade()
00208 {
00209 if (m_shade.isNull() || m_shade.size() != size()) {
00210
00211 if (m_shade_type == ARGBShade) {
00212 m_shade = QImage(size(), QImage::Format_ARGB32_Premultiplied);
00213 m_shade.fill(0);
00214
00215 QPainter p(&m_shade);
00216 p.fillRect(rect(), m_alpha_gradient);
00217
00218 p.setCompositionMode(QPainter::CompositionMode_DestinationIn);
00219
00220 QLinearGradient fade(0, 0, 0, height()-1);
00221 fade.setColorAt(0, QColor(0, 0, 0, 255));
00222 fade.setColorAt(1, QColor(0, 0, 0, 0));
00223 p.fillRect(rect(), fade);
00224 m_shade.save("argbashade.png");
00225
00226
00227
00228
00229
00230
00231
00232
00233
00234
00235
00236 } else {
00237 m_shade = QImage(size(), QImage::Format_RGB32);
00238 QLinearGradient shade(0, 0, 0, height()-1);
00239 shade.setColorAt(1, Qt::black);
00240
00241 if (m_shade_type == RedShade)
00242 shade.setColorAt(0, Qt::red);
00243 else if (m_shade_type == GreenShade)
00244 shade.setColorAt(0, Qt::green);
00245 else
00246 shade.setColorAt(0, Qt::blue);
00247
00248 QPainter p(&m_shade);
00249 p.fillRect(rect(), shade);
00250 }
00251 }
00252
00253
00254 }
00255
00256
00257 GradientEditor::GradientEditor(QWidget *parent)
00258 : QWidget(parent)
00259 {
00260 QVBoxLayout *vbox = new QVBoxLayout(this);
00261 vbox->setSpacing(1);
00262 vbox->setMargin(1);
00263
00264 m_red_shade = new ShadeWidget(ShadeWidget::RedShade, this);
00265 m_green_shade = new ShadeWidget(ShadeWidget::GreenShade, this);
00266 m_blue_shade = new ShadeWidget(ShadeWidget::BlueShade, this);
00267 m_alpha_shade = new ShadeWidget(ShadeWidget::ARGBShade, this);
00268
00269 vbox->addWidget(m_red_shade);
00270 vbox->addWidget(m_green_shade);
00271 vbox->addWidget(m_blue_shade);
00272 vbox->addWidget(m_alpha_shade);
00273
00274 connect(m_red_shade, SIGNAL(colorsChanged()), this, SLOT(pointsUpdated()));
00275 connect(m_green_shade, SIGNAL(colorsChanged()), this, SLOT(pointsUpdated()));
00276 connect(m_blue_shade, SIGNAL(colorsChanged()), this, SLOT(pointsUpdated()));
00277 connect(m_alpha_shade, SIGNAL(colorsChanged()), this, SLOT(pointsUpdated()));
00278 }
00279
00280
00281 inline static bool x_less_than(const QPointF &p1, const QPointF &p2)
00282 {
00283 return p1.x() < p2.x();
00284 }
00285
00286
00287 void GradientEditor::pointsUpdated()
00288 {
00289 double w = m_alpha_shade->width();
00290
00291 QGradientStops stops;
00292
00293 QPolygonF points;
00294
00295 points += m_red_shade->points();
00296 points += m_green_shade->points();
00297 points += m_blue_shade->points();
00298 points += m_alpha_shade->points();
00299
00300 qSort(points.begin(), points.end(), x_less_than);
00301
00302 for (int i=0; i<points.size(); ++i) {
00303 double x = int(points.at(i).x());
00304 if (i < points.size() - 1 && x == points.at(i+1).x())
00305 continue;
00306 QColor color((0x00ff0000 & m_red_shade->colorAt(int(x))) >> 16,
00307 (0x0000ff00 & m_green_shade->colorAt(int(x))) >> 8,
00308 (0x000000ff & m_blue_shade->colorAt(int(x))),
00309 (0xff000000 & m_alpha_shade->colorAt(int(x))) >> 24);
00310
00311
00312 int r1 = (0x00ff0000 & m_red_shade->colorAt(int(x))) >> 16;
00313 int g1 = (0x0000ff00 & m_green_shade->colorAt(int(x))) >> 8;
00314 int b1 = (0x000000ff & m_blue_shade->colorAt(int(x)));
00315 int a1 = (0xff000000 & m_alpha_shade->colorAt(int(x)) >> 24);
00316
00317 if (x / w > 1)
00318 return;
00319
00320 stops << QGradientStop(x / w, color);
00321 }
00322
00323 m_alpha_shade->setGradientStops(stops);
00324
00325 emit gradientStopsChanged(stops);
00326 }
00327
00328
00329 static void set_shade_points(const QPolygonF &points, ShadeWidget *shade)
00330 {
00331 shade->hoverPoints()->setPoints(points);
00332 shade->hoverPoints()->setPointLock(0, HoverPoints::LockToLeft);
00333 shade->hoverPoints()->setPointLock(points.size() - 1, HoverPoints::LockToRight);
00334 shade->update();
00335 }
00336
00337 void GradientEditor::setGradientStops(const QGradientStops &stops)
00338 {
00339 QPolygonF pts_red, pts_green, pts_blue, pts_alpha;
00340
00341 double h_red = m_red_shade->height();
00342 double h_green = m_green_shade->height();
00343 double h_blue = m_blue_shade->height();
00344 double h_alpha = m_alpha_shade->height();
00345
00346 double w_red = m_red_shade->width();
00347 double w_green = m_green_shade->width();
00348 double w_blue = m_blue_shade->width();
00349 double w_alpha = m_alpha_shade->width();
00350
00351
00352 for (int i=0; i<stops.size(); ++i) {
00353 double pos = stops.at(i).first;
00354 QRgb color = stops.at(i).second.rgba();
00355
00356 qreal red_x = pos * w_red;
00357 qreal red_y = h_red - qRed(color) * h_red / 255;
00358
00359 qreal green_x = pos * w_green;
00360 qreal green_y = h_green - qGreen(color) * h_green / 255;
00361
00362 qreal blue_x = pos * w_blue;
00363 qreal blue_y = h_blue - qBlue(color) * h_blue / 255;
00364
00365 qreal alpha_x = pos * w_alpha;
00366 qreal alpha_y = h_alpha - qAlpha(color) * h_alpha / 255;
00367
00368 pts_red << QPointF(red_x, red_y);
00369 pts_green << QPointF(green_x, green_y);
00370 pts_blue << QPointF(blue_x, blue_y);
00371 pts_alpha << QPointF(alpha_x, alpha_y);
00372 }
00373
00374 set_shade_points(pts_red, m_red_shade);
00375 set_shade_points(pts_green, m_green_shade);
00376 set_shade_points(pts_blue, m_blue_shade);
00377 set_shade_points(pts_alpha, m_alpha_shade);
00378
00379 emit gradientStopsChanged(stops);
00380
00381 }
00382
00383 GradientWidget::GradientWidget(QWidget *parent)
00384 : QWidget(parent)
00385 {
00386
00387
00388
00389
00390
00391
00392
00393
00394
00395
00396
00397
00398
00399
00400
00401
00402
00403
00404
00405
00406
00407
00408
00409
00410
00411
00412
00413
00414
00415
00416
00417
00418
00419
00420
00421
00422
00423
00424
00425
00426
00427
00428
00429
00430
00431
00432
00433
00434
00435
00436
00437
00438
00439
00440
00441
00442
00443
00444
00445
00446
00447
00448
00449
00450
00451
00452
00453
00454
00455
00456
00457
00458
00459
00460
00461
00462
00463
00464
00465 QGroupBox *mainGroup = new QGroupBox(this);
00466 mainGroup->setTitle("Color editor");
00467
00468 QVBoxLayout *mainLayout = new QVBoxLayout(mainGroup);
00469
00470 m_editor = new GradientEditor(mainGroup);
00471 mainLayout->addWidget(m_editor);
00472
00473 tf_widget = new tfGLWidget(mainGroup);
00474 mainLayout->addWidget(tf_widget);
00475
00476 QGroupBox *defaultsGroup = new QGroupBox(mainGroup);
00477 defaultsGroup->setTitle("Pre-defined functions");
00478
00479 mainLayout->addWidget(defaultsGroup);
00480
00481 QVBoxLayout *defaultsGroupLayout = new QVBoxLayout(defaultsGroup);
00482
00483 m_linearButton = new QPushButton("Linear");
00484 defaultsGroupLayout->addWidget(m_linearButton);
00485
00486 m_zerosButton = new QPushButton("Zeros");
00487 defaultsGroupLayout->addWidget(m_zerosButton);
00488
00489 m_blackButton = new QPushButton("Black");
00490 defaultsGroupLayout->addWidget(m_blackButton);
00491
00492 m_whiteButton = new QPushButton("White");
00493 defaultsGroupLayout->addWidget(m_whiteButton);
00494
00495 m_redButton = new QPushButton("Red");
00496 defaultsGroupLayout->addWidget(m_redButton);
00497
00498 m_greenButton = new QPushButton("Green");
00499 defaultsGroupLayout->addWidget(m_greenButton);
00500
00501 m_blueButton = new QPushButton("Blue");
00502 defaultsGroupLayout->addWidget(m_blueButton);
00503
00504 m_rainbowButton = new QPushButton("Rainbow");
00505 defaultsGroupLayout->addWidget(m_rainbowButton);
00506
00507
00508
00509
00510
00511
00512
00513
00514
00515
00516
00517
00518
00519
00520
00521
00522
00523
00524
00525
00526
00527
00528 connect(m_editor, SIGNAL(gradientStopsChanged(const QGradientStops &)), this, SLOT(rendertf(const QGradientStops &)));
00529
00530
00531 connect(this, SIGNAL(tfready(QImage &)), tf_widget, SLOT(setTFImage(QImage &)));
00532
00533
00534 connect(m_zerosButton, SIGNAL(clicked()), this, SLOT(setDefault1()));
00535 connect(m_blackButton, SIGNAL(clicked()), this, SLOT(setDefault2()));
00536 connect(m_linearButton, SIGNAL(clicked()), this, SLOT(setDefault3()));
00537 connect(m_redButton, SIGNAL(clicked()), this, SLOT(setDefault4()));
00538 connect(m_greenButton, SIGNAL(clicked()), this, SLOT(setDefault5()));
00539 connect(m_blueButton, SIGNAL(clicked()), this, SLOT(setDefault6()));
00540 connect(m_rainbowButton, SIGNAL(clicked()), this, SLOT(setDefault7()));
00541 connect(m_whiteButton, SIGNAL(clicked()), this, SLOT(setDefault8()));
00542
00543
00544
00545
00546
00547
00548
00549
00550
00551
00552
00553
00554
00555
00556
00557
00558
00559
00560
00561
00562
00563
00564
00565
00566
00567
00568
00569
00570
00571
00572 QTimer::singleShot(50, this, SLOT(setDefault3()));
00573 }
00574
00575 void GradientWidget::setTransferFunction(QImage &tf_img)
00576 {
00577 m_transfer_function = tf_img;
00578 emit tfready(m_transfer_function);
00579 }
00580
00581 void GradientWidget::setGradientStops(const QGradientStops &stops)
00582 {
00583 m_stops.clear();
00584 m_editor->setGradientStops(stops);
00585 update();
00586 }
00587
00588 void GradientWidget::setDefault(int config)
00589 {
00590 QGradientStops stops;
00591 QPolygonF points;
00592 switch (config) {
00593
00594 case 1:
00595 stops << QGradientStop(0.00, QColor::fromRgba(0x00000000));
00596 stops << QGradientStop(1.00, QColor::fromRgba(0x00000000));
00597 break;
00598
00599 case 2:
00600 stops << QGradientStop(0.00, QColor::fromRgba(0xff000000));
00601 stops << QGradientStop(1.00, QColor::fromRgba(0xff000000));
00602 break;
00603
00604 case 3:
00605 stops << QGradientStop(0.00, QColor::fromRgba(0x00000000));
00606 stops << QGradientStop(1.00, QColor::fromRgba(0xffffffff));
00607 break;
00608
00609 case 4:
00610 stops << QGradientStop(0.00, QColor::fromRgba(0x00ff0000));
00611 stops << QGradientStop(1.00, QColor::fromRgba(0x00ff0000));
00612 break;
00613
00614 case 5:
00615 stops << QGradientStop(0.00, QColor::fromRgba(0x0000ff00));
00616 stops << QGradientStop(1.00, QColor::fromRgba(0x0000ff00));
00617 break;
00618
00619 case 6:
00620 stops << QGradientStop(0.00, QColor::fromRgba(0x000000ff));
00621 stops << QGradientStop(1.00, QColor::fromRgba(0x000000ff));
00622 break;
00623
00624 case 7:
00625 stops << QGradientStop(0.00, QColor::fromRgba(0xffff0000));
00626 stops << QGradientStop(0.50, QColor::fromRgba(0xff00ff00));
00627 stops << QGradientStop(1.00, QColor::fromRgba(0xff0000ff));
00628
00629
00630 break;
00631
00632 case 8:
00633 stops << QGradientStop(0.00, QColor::fromRgba(0xffffffff));
00634 stops << QGradientStop(1.00, QColor::fromRgba(0xffffffff));
00635 break;
00636 default:
00637 qWarning("bad default: %d\n", config);
00638 break;
00639 }
00640
00641
00642
00643
00644
00645
00646
00647
00648
00649 m_editor->setGradientStops(stops);
00650
00651
00652 }
00653
00654
00655 void GradientWidget::rendertf(const QGradientStops &stops)
00656 {
00657 m_stops = stops;
00658
00659 QImage tf_img = QImage(256, 256, QImage::Format_ARGB32_Premultiplied);
00660 tf_img.fill(0);
00661
00662 QLinearGradient lg = QLinearGradient(0, 0, 255, 0);
00663
00664 for (int i=0; i<stops.size(); ++i) {
00665 QColor c = stops.at(i).second;
00666 lg.setColorAt(stops.at(i).first, QColor(c.red(), c.green(), c.blue()));
00667 }
00668
00669 QPainter p(&tf_img);
00670
00671 p.fillRect(rect(), lg);
00672
00673 QGradient fade;
00674
00675 p.setCompositionMode(QPainter::CompositionMode_DestinationIn);
00676 fade = QLinearGradient(0, 0, 255, 0);
00677
00678 for (int i=0; i<m_stops.size(); ++i)
00679 {
00680 fade.setColorAt(m_stops.at(i).first, m_stops.at(i).second);
00681 }
00682
00683
00684 p.setBrush(fade);
00685 p.drawRect(rect());
00686
00687
00688
00689
00690
00691
00692
00693
00694
00695
00696
00697
00698
00699
00700
00701
00702
00703
00704
00705
00706 tf_img.save("tf.png");
00707
00708
00709
00710
00711 m_transfer_function = tf_img;
00712 emit tfready(m_transfer_function);
00713
00714
00715 update();
00716 }
00717
00718
00719 GradientRenderer::GradientRenderer(QWidget *parent) : QGLWidget(parent)
00720
00721 {
00722
00723
00724
00725
00726
00727
00728
00729
00730
00731
00732
00733
00734
00735
00736
00737
00738 setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
00739 }
00740
00741 void GradientRenderer::setGradientStops(const QGradientStops &stops)
00742 {
00743 m_stops = stops;
00744 update();
00745 }
00746 void GradientRenderer::initializeGL()
00747 {
00748
00749
00750 qglClearColor(QColor::fromRgb(255,255,255));
00751 glShadeModel (GL_FLAT);
00752 glutInitDisplayMode(GLUT_RGBA | GLUT_DOUBLE);
00753 glutInitDisplayMode(GLUT_RGBA);
00754 gluOrtho2D(0.0, 256.0, 0.0, 512.0);
00755 }
00756
00757 void GradientRenderer::paintGL()
00758 {
00759 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
00760
00761 glLoadIdentity();
00762
00763 glTranslated(0.0, 0.0, 0.0);
00764
00765
00766 QPointF v00 = QPointF(10.0, 0.0);
00767 QPointF v01 = QPointF(200.0, 128.0);
00768 QPointF v02 = QPointF(100.0, 256.0);
00769 QPointF v03 = QPointF(20.0, 384.0);
00770 QPointF v04 = QPointF(140.0, 512.0);
00771 QColor line_color0 = QColor(255,0,0,255);
00772
00773
00774 QList<QPointF> vertices0;
00775 vertices0.append(v00);
00776 vertices0.append(v01);
00777 vertices0.append(v02);
00778 vertices0.append(v03);
00779 vertices0.append(v04);
00780
00781
00782 QPointF v10 = QPointF(100.0, 0.0);
00783 QPointF v11 = QPointF(150.0, 128.0);
00784 QPointF v12 = QPointF(200.0, 256.0);
00785 QPointF v13 = QPointF(126.0, 384.0);
00786 QPointF v14 = QPointF(10.0, 512.0);
00787 QColor line_color1 = QColor(0,0,255,255);
00788
00789
00790 QList<QPointF> vertices1;
00791 vertices1.append(v10);
00792 vertices1.append(v11);
00793 vertices1.append(v12);
00794 vertices1.append(v13);
00795 vertices1.append(v14);
00796
00797
00798
00799 typedef QPair<QList<QPointF>,QColor> ParralelCoordinatesLine;
00800 typedef QList<ParralelCoordinatesLine> ParallelCoordinatesLinesList;
00801
00802 ParallelCoordinatesLinesList pc_lines_list;
00803 pc_lines_list.append(qMakePair(vertices0,line_color0));
00804 pc_lines_list.append(qMakePair(vertices1,line_color1));
00805
00806 QListIterator<ParralelCoordinatesLine> pc_lineslist_i(pc_lines_list);
00807 ParralelCoordinatesLine pc_line;
00808 QList<QPointF> pc_line_vertices;
00809 QColor pc_line_color;
00810 while(pc_lineslist_i.hasNext())
00811 {
00812 pc_line = pc_lineslist_i.next();
00813 pc_line_vertices = pc_line.first;
00814 pc_line_color = pc_line.second;
00815
00816
00817 glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
00818
00819
00820 qglColor(pc_line_color);
00821
00822
00823 glBegin(GL_POLYGON);
00824 QListIterator<QPointF> i(pc_line_vertices);
00825 QPointF poly_vertex;
00826 while (i.hasNext())
00827 {
00828 poly_vertex = (QPointF)i.next();
00829
00830
00831 if(i.hasNext())
00832 glEdgeFlag(GL_TRUE);
00833 else
00834 glEdgeFlag(GL_FALSE);
00835
00836 glVertex2f(poly_vertex.x(),poly_vertex.y());
00837 }
00838
00839
00840
00841
00842
00843
00844
00845
00846
00847
00848
00849
00850 glEnd();
00851 }
00852
00853
00854
00855
00856
00857
00858
00859
00860
00861
00862
00863
00864
00865
00866
00867
00868
00869
00870
00871
00872
00873
00874
00875
00876
00877
00878
00879 glFlush ();
00880
00881 }
00882
00883 void GradientRenderer::resizeGL(int width, int height)
00884 {
00885 int side = qMin(width, height);
00886
00887 glViewport (0, 0, (GLsizei) width, (GLsizei) height);
00888 glMatrixMode (GL_PROJECTION);
00889 glLoadIdentity ();
00890 }
00891
00892 void GradientRenderer::mousePressEvent(QMouseEvent *event)
00893 {
00894 }
00895
00896 void GradientRenderer::mouseMoveEvent(QMouseEvent *event)
00897 {
00898 }
00899
00900
00901
00902
00903
00904
00905
00906
00907
00908
00909
00910
00911
00912
00913
00914
00915
00916
00917
00918
00919
00920
00921
00922
00923
00924
00925
00926
00927
00928
00929
00930
00931
00932
00933
00934
00935
00936
00937
00938
00939
00940
00941