As above, I'm calculating some numbers, (inbetween 0 and 255) and I'm wanting to store them in a char array in C using their ASCII equivalents.
Is there a nice way of doing this?
int b = (int)(*pixelA.pixel_b * (1-w) * (1-h) + *pixelB.pixel_b * (w) * (1-h) + *pixelC.pixel_b * (1-w) * (h) + *pixelD.pixel_b * (w*h));
modified_Frame[k] = (char)b;
That's the kind of thing I'm aiming for, if the (char) meant it took the value of b, and wrote the ASCII equivalent into the array.
I tried using both pointers (hoping the C would just do it automatically) like so:
int *pb = &b;
modified_Frame[k] = *pb;
And using chars for b rather than an int, however it just seems to send block data back, so I'm guessing it doesn't work how I'm intending it to.
Any ideas would be greatly appreciated.
Aucun commentaire:
Enregistrer un commentaire