Advertisement
Guest User

Untitled

a guest
Dec 13th, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. int C,M,Y,K;
  2.  
  3. for(int i=1; i<width/2; i++){
  4. for(int j=1; j<height/2; j++){
  5. SDL_Color color = getPixel(i, j);
  6. // Lewy górny, konwersja na CMYK
  7. C = 255 - color.r;
  8. M = 255 - color.g;
  9. Y = 255 - color.b;
  10. K = min(min(C,M),Y);
  11. C = C-K;
  12. M = M-K;
  13. Y = Y-K;
  14. setPixel(i, j, C, M, Y);
  15. // Prawy górny, składowa C
  16. setPixel(i+width/2, j, C, 0, 0);
  17. // Lewy dolny, składowa M
  18. setPixel(i, j+height/2, 0, M, 0 );
  19. // Prawy dolny, składowa Y
  20. setPixel(i+width/2, j+height/2, 0,0,Y);
  21. }
  22. }
  23.  
  24. SDL_Flip(screen);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement