Guest User

Untitled

a guest
May 26th, 2018
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. int tablica[image.width()][image.height()];
  2.  
  3. int xd,yd;
  4. cout<<endl<<"Enter x value of your seed";
  5. cin>>xd;
  6. cout<<"Enter y value of your seed ";
  7. cin>>yd;
  8. int sred=image(xd,yd,0);
  9.  
  10. float kolor;
  11. do
  12. {
  13. cout<<endl<<"In what color I should create region?"<<endl;
  14. cin>>kolor;
  15. }while(kolor>255&&kolor<0);
  16.  
  17. WHOLE_IMAGE_WITHOUT_BORDERS
  18. {
  19. if(image(x,y,z)<(sred+20) && image(x,y,z)>(sred-20))
  20. {tablica[x][y]=1;}
  21. }
  22. tablica[xd][yd]=2;
  23.  
  24.  
  25. for(int m;m<image.height();m++)
  26. {
  27.  
  28. for(int z=0;z<image.width();z++)
  29. {
  30.  
  31. for(int k=0;k<image.height();k++)
  32. {
  33. for(int i=-1;i<2;i++)for(int j=-1;j<2;j++)
  34. {
  35. if(tablica[k][z]==1){if(tablica[k+i][z+j]==2){tablica[k][z]=2;}}
  36. }
  37. }
  38. }}
  39. for(int x=0;x<image.width();x++)
  40. {
  41.  
  42. for(int y=0;y<image.height();y++)
  43. { for(int z=0;z<spectrum;z++){
  44. if(tablica[x][y]==2) {image(x,y,z)=kolor; visu(x,y,z)=60;}
  45. }}}
Add Comment
Please, Sign In to add comment