| 3877 | } |
| 3878 | |
| 3879 | void |
| 3880 | ViewerGL::updateInfoWidgetColorPickerInternal(const QPointF & imgPos, |
| 3881 | const QPoint & widgetPos, |
| 3882 | int width, |
| 3883 | int height, |
| 3884 | const RectD & rod, // in canonical coordinates |
| 3885 | const RectD & dispW, // in canonical coordinates |
| 3886 | int texIndex) |
| 3887 | { |
| 3888 | if ( !_imp->viewerTab || !_imp->viewerTab->getGui() || _imp->viewerTab->getGui()->isGUIFrozen() ) { |
| 3889 | return; |
| 3890 | } |
| 3891 | |
| 3892 | const std::list<Histogram*>& histograms = _imp->viewerTab->getGui()->getHistograms(); |
| 3893 | |
| 3894 | if ( _imp->displayTextures[texIndex].isVisible && |
| 3895 | ( imgPos.x() >= rod.left() ) && |
| 3896 | ( imgPos.x() < rod.right() ) && |
| 3897 | ( imgPos.y() >= rod.bottom() ) && |
| 3898 | ( imgPos.y() < rod.top() ) && |
| 3899 | ( widgetPos.x() >= 0) && ( widgetPos.x() < width) && |
| 3900 | ( widgetPos.y() >= 0) && ( widgetPos.y() < height) ) { |
| 3901 | ///if the clip to project format is enabled, make sure it is in the project format too |
| 3902 | if ( isClippingImageToFormat() && |
| 3903 | ( ( imgPos.x() < dispW.left() ) || |
| 3904 | ( imgPos.x() >= dispW.right() ) || |
| 3905 | ( imgPos.y() < dispW.bottom() ) || |
| 3906 | ( imgPos.y() >= dispW.top() ) ) ) { |
| 3907 | if ( _imp->infoViewer[texIndex]->colorVisible() && _imp->pickerState == ePickerStateInactive) { |
| 3908 | _imp->infoViewer[texIndex]->hideColorInfo(); |
| 3909 | } |
| 3910 | for (std::list<Histogram*>::const_iterator it = histograms.begin(); it != histograms.end(); ++it) { |
| 3911 | if ( (*it)->getViewerTextureInputDisplayed() == texIndex ) { |
| 3912 | (*it)->hideViewerCursor(); |
| 3913 | } |
| 3914 | } |
| 3915 | if (texIndex == 0 && _imp->pickerState == ePickerStateInactive) { |
| 3916 | setParametricParamsPickerColor(OfxRGBAColourD(), false, false); |
| 3917 | } |
| 3918 | } else { |
| 3919 | if (_imp->pickerState == ePickerStateInactive) { |
| 3920 | //if ( !_imp->viewerTab->getInternalNode()->getRenderEngine()->hasThreadsWorking() ) { |
| 3921 | updateColorPicker( texIndex, widgetPos.x(), widgetPos.y() ); |
| 3922 | // } |
| 3923 | } else if ( ( _imp->pickerState == ePickerStatePoint) || ( _imp->pickerState == ePickerStateRectangle) ) { |
| 3924 | if ( !_imp->infoViewer[texIndex]->colorVisible() ) { |
| 3925 | _imp->infoViewer[texIndex]->showColorInfo(); |
| 3926 | } |
| 3927 | } else { |
| 3928 | ///unkwn state |
| 3929 | assert(false); |
| 3930 | } |
| 3931 | // Show the picker on parametric params without updating the color value |
| 3932 | if (texIndex == 0) { |
| 3933 | setParametricParamsPickerColor(OfxRGBAColourD(), false, true); |
| 3934 | } |
| 3935 | } |
| 3936 | } else { |
nothing calls this directly
no test coverage detected