Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
0 votes
1 answer
118 views

pset 4, resize.c is not working

Here is the code for resize.c I am stuck for quite some time now and i am not able to figure out where i am wrong. please help. bi.biHeight = height*n; bi.biWidth = width*n; // determine new padding ...
0 votes
1 answer
422 views

determine padding for scanlines in copy.c

Line 65 in copy.c int padding = (4 - (bi.biWidth * sizeof(RGBTRIPLE)) % 4) % 4; Question is why do we need last modulo operator in bold? Even without it, it gives the right answer.
1 vote
1 answer
104 views

Pset 4 Resize makes a very colorful picture (not green!)--padding problem?

Well, it looks like I'm not the only one having issues with padding (I suspect that's my problem). Specifically, if I test my version of resize with an enlargement factor of 2 (using small.bmp as ...
3 votes
1 answer
1k views

PSET 4: Why is padding required?

I am currently going through the PSET 4 sheet and have just read up to the part where it is being explained that if the number of bytes in each scan line is not a multiple of 4 then it is padded out. ...
1 vote
1 answer
935 views

what is wrong with my resize?

My resize program isn't working. I have narrowed it down to the padding, but cannot find what is incorrect. It resizes images that don't need padding perfectly (multiples of 4), and the header ...
1 vote
0 answers
209 views

pset5: Resize does not consistently work

I am having a problem with resize. I can resize smiley.bmp perfectly at X1, X2, and X10, but not for factors between 2 and 10--I just get an abstract blob of colors. I assume this has something to do ...