0

In pset4 whodunit I start with a screen with too much red. Below I thought of two methods that could work. Will both methods work? Do I need to add more code to make it work? Where do I place this in whodunit.c ? I think I place it after line 80? If need be I can post the entire code of whodunit.

//line 80 
fwrite(&triple, sizeof(RGBTRIPLE), 1, outptr);

//remove red from each pixel

if (triple.rgbtred == 0xff)                
{
    triple.rgbtred = 0x00;
}

// change pure red to white

if (triple.rgbtred == 0xff) & (triple.rgbtBlue == 0x00) & (triple.rgbtGreen == 0x00)   
{                                    
    triple.rgbtBlue  =  0xff;                                                                                    
    triple.rgbtGreen = 0xff;                                                                                    
}
2
  • Well, that's kind of the whole idea of the pset. You need to try and clean up the image - at least enough to identify the buried image. Have you tried these methods yet? ;-) – Cliff B Dec 23 '17 at 6:04
  • Ya I managed to try it and get it working. – user20282 Jan 5 '18 at 6:13

You must log in to answer this question.

Browse other questions tagged .