1 /*=========================================================================
2 Program: vv http://www.creatis.insa-lyon.fr/rio/vv
5 - University of LYON http://www.universite-lyon.fr/
6 - Léon Bérard cancer center http://www.centreleonberard.fr
7 - CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr
9 This software is distributed WITHOUT ANY WARRANTY; without even
10 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11 PURPOSE. See the copyright notices for more information.
13 It is distributed under dual licence
15 - BSD See included LICENSE.txt file
16 - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
17 ===========================================================================**/
19 #include "vvBlendImageActor.h"
25 #include <vtkOpenGLRenderWindow.h>
26 #include <vtkOpenGLRenderer.h>
27 #include <vtkOpenGL.h>
28 #include <vtkObjectFactory.h>
30 vtkStandardNewMacro(vvBlendImageActor);
32 vvBlendImageActor::vvBlendImageActor()
36 vvBlendImageActor::~vvBlendImageActor()
40 // Actual actor render method.
41 void vvBlendImageActor::Render(vtkRenderer *ren)
43 //Change blending to maximum per component instead of weighted sum
44 vtkOpenGLRenderWindow *renwin = dynamic_cast<vtkOpenGLRenderWindow*>(ren->GetRenderWindow());
46 const char *extensions = renwin->ReportCapabilities();
49 VTK_IMAGE_ACTOR::Render(ren);
52 vtkOpenGLExtensionManager *extensions = renwin->GetExtensionManager();
53 if (extensions->ExtensionSupported("GL_EXT_blend_minmax")) {
54 extensions->LoadExtension("GL_EXT_blend_minmax");
55 vtkgl::BlendEquationEXT( vtkgl::MAX );
59 VTK_IMAGE_ACTOR::Render(ren);
61 //Move back blending to weighted sum
62 if (vtkgl::BlendEquationEXT!=0) {
63 vtkgl::BlendEquationEXT( vtkgl::FUNC_ADD );
68 void vvBlendImageActor::PrintSelf(ostream& os, vtkIndent indent)
70 this->Superclass::PrintSelf(os,indent);