Advertisement
Guest User

Untitled

a guest
Jan 25th, 2020
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. void MainWindow::on_horizontalSlider_valueChanged(int value)
  2. {
  3.  
  4. unsigned char *wsk;
  5. unsigned char *obrazek1;
  6. unsigned char *obrazek2;
  7.  
  8. double wartosc = value/100.0;
  9.  
  10. for(int i=0; i<height; i++)
  11. {
  12. wsk = img->scanLine(i);
  13. obrazek1 = obrazek[0].scanLine(i);
  14. obrazek2 = obrazek[1].scanLine(i);
  15. for(int j=0; j<width; j++)
  16. {
  17.  
  18. wsk[4*j] = int(wartosc * obrazek2[4*j] + (1 -wartosc) * obrazek1[4*j]);
  19. wsk[4*j+1] = int(wartosc * obrazek2[4*j+1] + (1 -wartosc) * obrazek1[4*j+1]);
  20. wsk[4*j+2] = int(wartosc * obrazek2[4*j+2] + (1 -wartosc) * obrazek1[4*j+2]);
  21.  
  22. }
  23.  
  24. }
  25. update();
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement