Hot answers tagged

1 vote
Accepted

Pset3-resize explaination

Basically you need to modify the headers so they are the right size but not all the information contained in the headers needs to change. Than you need to iterate over the printing of the pictures so ...
user avatar
  • 418
1 vote
Accepted

How does RGBTRIPLE differentiate between the 3 bytes it reads from input file and assign them to rgbt blue, green and red?

When a struct is stored in memory, the data for each struct element is stored in sequence. That means that when a struct's data is read, the data is simply read into each element in the same order ...
user avatar
  • 64.1k
1 vote

Pset 4: Resize (more) -- check50 all correct except one

Because 1/f when f = 3 is not exactly 1/3 but 0.33333.. with a lot of digits. So the loop iterate for some times, the offset accumulate making the variable newHeightIndex behave not as we want. For ...
user avatar
  • 11
1 vote
Accepted

How to resize vertically for pset4?

There are a few issues I see in your code. You define your file headers, but you don't read them or set pointers to them, which means you can't track them. You need padding n times for each pixel. ...
user avatar
1 vote
Accepted

Issues with padding - why am I getting a black image for every outfile?

You should run the staff's version for a couple of files and different values of resize and then run peek on those files to see which are the headers that actually change. Also, take a closer look ...
user avatar
  • 1,677
1 vote
Accepted

Pset4: Resize: Unsupported image format

There are a number of errors in the code that need to be resolved and other issues that haven't even been coded for. There are fields in the headers that haven't been updated. The padding for the ...
user avatar
  • 64.1k
1 vote
Accepted

PSET4 Resize: image resizes but fails check50 (PADDING or HEADER???)

You'll see what your problem is if you do this: Think about it for a while and come back here again if this doesn't make it click for you... and I can add other tips.
user avatar
1 vote
Accepted

pset4 resize premature end of file encountered

I think maybe the relationship between biSize, biSizeImage, and bfSize is not reflected properly in the code. Here's reference from MSDN: bfSize: The size, in bytes, of the bitmap file. ~ MSDN ...
user avatar
1 vote
Accepted

Pset4 Resize: Incorrect scaling of image

There are a number of problems. First, you haven't calculated the padding for the output file. The padding for the input and output files are not necessarily the same. You have to calculate the ...
user avatar
  • 64.1k
1 vote
Accepted

Resize problem in pset4

Because the width of your image has to be a multiple of 4, in fact the next multiple of 4 of your width. Since the width is 3, the next multiple of 4 is 4. So you have to add one pixel of padding. And ...
user avatar
  • 7,326

Only top scored, non community-wiki answers of a minimum length are eligible