slot for updating view with new image in complex zone evrey complited iteration
Definition at line 1081 of file aimainwindow.cpp. 01082 { 01083 try 01084 { 01085 QMutex mutex; 01086 mutex.lock(); 01087 { 01088 m_storage.replace( zone->getStartPoint(), zone->image() ); 01089 01090 static int count = 0; 01091 count++; 01092 if ( count == m_startedThreads && m_storage.size() > 0 ) 01093 { 01094 QImage tmp; 01095 //~ if screen is empty create a new empty image 01096 if( m_view->view()->emptyScreen() && m_config->getImageWidth() > 0 && m_config->getImageHeight() > 0 ) 01097 { 01098 tmp = QImage(m_config->getImageWidth(), m_config->getImageHeight(), QImage::Format_RGB32); 01099 tmp.fill(Qt::transparent); 01100 } 01101 else if( (m_config->getImageWidth() == 0 || m_config->getImageHeight() == 0) && m_storage.count() > 0 ) 01102 { 01103 tmp = QImage( m_storage[0].width(), m_storage[0].height(), QImage::Format_RGB32); 01104 tmp.fill(Qt::transparent); 01105 } 01106 else //~ get a current screen image for adding to it, a generated image =) 01107 { 01108 tmp = m_view->view()->image(); 01109 } 01110 01111 QPainter painter( &tmp ); 01112 for( int index = 0 ; index < m_storage.size() ; index++ ) 01113 { 01114 if( index == 0 ) 01115 { 01116 //# set to first thread a deferent compsition mode 01117 painter.setCompositionMode( m_firstCompositionModeIndex ); 01118 } 01119 else 01120 { 01121 painter.setCompositionMode( m_othersCompositionModeIndex ); 01122 } 01123 painter.drawImage(0,0, m_storage[ index ] ); 01124 } 01125 painter.end(); 01126 01127 m_view->view()->makeUpdate( tmp, false ); 01128 count = 0; 01129 } 01130 } 01131 mutex.unlock(); 01132 } 01133 catch(const std::exception & exception ) 01134 { 01135 QMessageBox::critical(this, tr("Critical Error!"), tr("Please report this problem to adrabi[at]gmail[dot]com =).")); 01136 } 01137 } |