Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int C,M,Y,K;
- for(int i=1; i<width/2; i++){
- for(int j=1; j<height/2; j++){
- SDL_Color color = getPixel(i, j);
- // Lewy górny, konwersja na CMYK
- C = 255 - color.r;
- M = 255 - color.g;
- Y = 255 - color.b;
- K = min(min(C,M),Y);
- C = C-K;
- M = M-K;
- Y = Y-K;
- setPixel(i, j, C, M, Y);
- // Prawy górny, składowa C
- setPixel(i+width/2, j, C, 0, 0);
- // Lewy dolny, składowa M
- setPixel(i, j+height/2, 0, M, 0 );
- // Prawy dolny, składowa Y
- setPixel(i+width/2, j+height/2, 0,0,Y);
- }
- }
- SDL_Flip(screen);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement