Bitmap blur problem [modified]
-
Thanks for the advice :D. But now, the output is just red and black lines :doh: Here's the updated code:
unsigned int yp=0, xp=0;
for(int y = 1; y < bmp.biHeight-1; y++){
for(int x = 1; x < bmp.biWidth-1; x++){
for(int i = 0; i < 9; i++){
{
get_pixel(x+xp,y+yp,blank[i],image);
if(xp<2)
xp++;
else{
xp = -1;
yp++;}
}
}
avg(blank, Merge, 9, Matrix);
set_pixel(x,y,Merge,image2);
clear_pixel(Merge);
yp=-1, xp=-1;}}
"Sir, I protest. I am NOT a merry man!"
Oh, one other question. You apparently assume that the pixels are RGB triples. You never check the bitmap info to make sure it matches. Were you told this is the structure of the image?
If you don't have the data, you're just another asshole with an opinion.
-
Oh, one other question. You apparently assume that the pixels are RGB triples. You never check the bitmap info to make sure it matches. Were you told this is the structure of the image?
If you don't have the data, you're just another asshole with an opinion.
Yeah, I spotted that, too. But, I assume it is, if it were 32 bit, he'd be complaining about pixels not processed, I reckon.
Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
-
Yeah, I spotted that, too. But, I assume it is, if it were 32 bit, he'd be complaining about pixels not processed, I reckon.
Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
I spotted the initialisation of xp and yp straight after posting. But it had no effect. :( I wasn't aware you could check if it was an RGBTRIPLE. Ignorance, I guess. How would I go about this? However, the other program I am using to create the random noise input image seems to work fine with the same values in the header BITMAPINFOHEADER and BITMAPFILEHEADERs. Oh, and, rather ironically, I used so many function calls to try and clean the for loops up. :^)
"Sir, I protest. I am NOT a merry man!"
-
I spotted the initialisation of xp and yp straight after posting. But it had no effect. :( I wasn't aware you could check if it was an RGBTRIPLE. Ignorance, I guess. How would I go about this? However, the other program I am using to create the random noise input image seems to work fine with the same values in the header BITMAPINFOHEADER and BITMAPFILEHEADERs. Oh, and, rather ironically, I used so many function calls to try and clean the for loops up. :^)
"Sir, I protest. I am NOT a merry man!"
-
Have you tried stepping through your code in the debugger to see if things actually work like you're expecting them to? I would have been doing that about 14 messages ago. :doh:
If you don't have the data, you're just another asshole with an opinion.
Hmm.... xp is set to 4294967295 and does not change with each loop... y, however, does as is wanted.
"Sir, I protest. I am NOT a merry man!"
-
Hmm.... xp is set to 4294967295 and does not change with each loop... y, however, does as is wanted.
"Sir, I protest. I am NOT a merry man!"
Okay, fixed that. Still get the same output, though.
"Sir, I protest. I am NOT a merry man!"
-
Yeah, I spotted that, too. But, I assume it is, if it were 32 bit, he'd be complaining about pixels not processed, I reckon.
Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
Hmm.... I tried recreating the file using the other program(which uses the same values in bmp and bfh) using the CREATE_NEW definition in the CreateFile() function. When I do this, the resulting image cannot be drawn by windows picture and fax viewer. This may be the problem...
"Sir, I protest. I am NOT a merry man!"
-
Hmm.... I tried recreating the file using the other program(which uses the same values in bmp and bfh) using the CREATE_NEW definition in the CreateFile() function. When I do this, the resulting image cannot be drawn by windows picture and fax viewer. This may be the problem...
"Sir, I protest. I am NOT a merry man!"
-
Hmm.... I tried recreating the file using the other program(which uses the same values in bmp and bfh) using the CREATE_NEW definition in the CreateFile() function. When I do this, the resulting image cannot be drawn by windows picture and fax viewer. This may be the problem...
"Sir, I protest. I am NOT a merry man!"
-
You've gone quiet. Did you ever get it to work? Inquiring minds want to know.
If you don't have the data, you're just another asshole with an opinion.
Unfortunately I haven't got it to work yet. I shall keep at it, however.
"Sir, I protest. I am NOT a merry man!"