--- In [email protected], "John Matthews" <jm5...@...> wrote: > > --- In [email protected], Jos Timanta Tarigan <jos_t_tarigan@> wrote: > > > > the problem is i want to merge two image and merging the value of each > > pixel. so basically pixel1 + pixel2 / 2.0; > > the problem is each of these pixels is char. how can I convert it to float > > and then convert it back to char again? > > Why do you need to convert to float? How about: > > char pixel1, pixel2, newPixel; > > newPixel = (pixel1 + pixel2) / 2; > Wouldn't you want to "or" them together? also instead of the "/2" use " >> 1" its faster with less overhead.
- [c-prog] char to float to char Jos Timanta Tarigan
- [c-prog] Re: char to float to char John Matthews
- [c-prog] Re: char to float to char John Matthews
- [c-prog] Re: char to float to char mikejd42
- [c-prog] Re: char to float to char John Matthews
- [c-prog] Re: char to float to char mikejd42
- [c-prog] Re: char to float to ch... John Matthews
- [c-prog] Re: char to float t... mikejd42
- [c-prog] Re: char to flo... John Matthews
- Re: [c-prog] Re: char to... Paul Herring
- Re: [c-prog] Re: char to float t... Paul Herring
- Re: [c-prog] Re: char to flo... Paul Herring
- [c-prog] Re: char to float t... mikejd42
- Re: [c-prog] Re: char to... Thomas Hruska
