Search Results
Search type | Search syntax |
---|---|
Tags | [tag] |
Exact | "words here" |
Author |
user:1234 user:me (yours) |
Score |
score:3 (3+) score:0 (none) |
Answers |
answers:3 (3+) answers:0 (none) isaccepted:yes hasaccepted:no inquestion:1234 |
Views | views:250 |
Code | code:"if (foo != bar)" |
Sections |
title:apples body:"apples oranges" |
URL | url:"*.example.com" |
Saves | in:saves |
Status |
closed:yes duplicate:no migrated:no wiki:no |
Types |
is:question is:answer |
Exclude |
-[tag] -apples |
For more details on advanced search visit our help page |
resize.c, one of the assignments in Problem Set 4, will require you to scale a bitmap image by a certain factor (making it 2, 3, or n times as large).
1
vote
Accepted
Pset4 - Problem in Resize, pixels are offset
If you resize that by 2, (see where this is going?) a scanline will be 6px or 18 bytes, which requires 2 bytes of padding. …
1
vote
PSET 4 Resize image shrunk
Zamyla gives psuedocode for two methods to resize vertically in the walkthrough (starting around 8:30). This code looks more like the "recopy" method. …
1
vote
Stuck at resize.c for days. Following the rewrite method
I see a problem here:
for (int l = 0, k = j * times; k < times; k++, l++){
Arr[k] = triple;
}
The intention is to put times copies of triple into Arr. Let's say you are …
1
vote
Resize - Looking for tips / hints on what I'm doing wrong
Here's the psuedo code from the walkthrough:
psuedocode: "recopy" method
for each row
for n-1 times
write pixels, padding to outfile
send …
1
vote
Accepted
Pset4 resize, jumbled output
Problem 1: fseek(inptr, (54+ bi.biWidth * sizeof(RGBTRIPLE) + paddingoriginal)*i, SEEK_SET);
54 is for all intents and purposes, a constant.
Problem 2: It is writing out the headers of the original i …
0
votes
Accepted
Wrong colors in resized file
There's a problem here: line[j + l] = triple;.
Using an infile width of 3 and a factor of 3: When j is 0, this will populate indexes 0,1,2. When j is 1: indexes 1,2,3. When j is 2: indexes 2,3,4.
B …
0
votes
Accepted
PSET4: Resize not duplicating rows
From the walkthrough:
psuedocode: "recopy" method
for each row
for n-1 times
write pixels, padding to outfile
send infile cursor back[1]
…
1
vote
Accepted
cs50 pset4 resize returning distorted image
There's a problem here long var = new_bi.biWidth * sizeof(RGBTRIPLE);. This will "rewind" the input file pointer too far.
1
vote
Accepted
Pset4: Valgrind memory issue?
There is a unix shell command called resize. It looks like you invoked that with your valgrind command, something like valgrind resize 2 small.bmp bigger.bmp instead of valgrind ./resize ..... …
1
vote
biHeight strange value pset4
fffffff4 in hexadecimal equals.......4294967284 in decimal
0
votes
Accepted
PSET4 'resize' Padding is wrong
One problem in the k loop: It is adding padding each time it duplicates a triple instead of one time when it is done with the line.
If you 2x small.bmp it will:
read a triple, write two triples, writ …
0
votes
Accepted
Pset4 Resize - Invalid or Unsupported Image Format
FILE header comes before INFO header. Make sure you output (fwrite) them in the correct order.
1
vote
Accepted
Problems with vertical resize Pset4
fseek does not require an unsigned long, the signature is
int fseek(FILE *stream, long offset, int whence);
The runtime error stems from this calculation -((bi.biWidth * sizeof(RGBTRIPLE))-1). size …
1
vote
Accepted
I can't seem to figure out what is wrong with my code. Please help!
The headers of the new image have biSizeImage and bfSize values of the original.
1
vote
Resize.c is not copying pixels correctly
A quick way to format code properly: select the code and click the {} in the format bar, to-da. This can be done on initial post or you can edit the question and fix the format.
Here is the pseudo co …