Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void MainWindow::on_horizontalSlider_valueChanged(int value)
- {
- unsigned char *wsk;
- unsigned char *obrazek1;
- unsigned char *obrazek2;
- double wartosc = value/100.0;
- for(int i=0; i<height; i++)
- {
- wsk = img->scanLine(i);
- obrazek1 = obrazek[0].scanLine(i);
- obrazek2 = obrazek[1].scanLine(i);
- for(int j=0; j<width; j++)
- {
- wsk[4*j] = int(wartosc * obrazek2[4*j] + (1 -wartosc) * obrazek1[4*j]);
- wsk[4*j+1] = int(wartosc * obrazek2[4*j+1] + (1 -wartosc) * obrazek1[4*j+1]);
- wsk[4*j+2] = int(wartosc * obrazek2[4*j+2] + (1 -wartosc) * obrazek1[4*j+2]);
- }
- }
- update();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement