If you have used vtkImageActor or vtkImageMapper + vtkActor2D to display an image in VTK renderer window, you can change the value of ColorLevel of vtkImageMapper to adjust the exposure to get a better effect.

    vtkSmartPointer<vtkPNGReader> reader = vtkSmartPointer<vtkPNGReader>::New(); 
    reader->SetFileName( m_ButtonTexturePaths );
    reader->Update();

    vtkSmartPointer<vtkImageMapper> mapper = vtkSmartPointer<vtkImageMapper>::New(); 
    mapper->SetInputData( reader->GetOutput() );
    mapper->Update();
    mapper->GetInputAlgorithm()->UpdateInformation();
    mapper->SetColorWindow( 256 );
    mapper->SetColorLevel( 168 ); //128  //168 get lower exposure 

    m_Buttons[buttonType] = vtkSmartPointer<vtkActor2D>::New();
    m_Buttons[buttonType]->SetMapper( mapper );

As the ColorLevel value increases, the exposure decreases while the ColorWindow value remains constant.

Categories: VTK

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Inline Feedbacks
View all comments

XOR Strings
: Input your strings, the tool can encrypt and decrypt them.

X
0
Would love your thoughts, please comment.x
()
x