Answer the question
In order to leave comments, you need to log in
What would such a C function look like in Java?
Hello. There is the following function in C:
void MergeBytes(PIXEL *pixel, unsigned char *p, int bytes)
{
pixel->r = p[2];
pixel->g = p[1];
pixel->b = p[0];
pixel->a = p[3];
}
MergeBytes(&(pixels[n]), p, bytes2read);
MergeBytes(&(pixels[n]), &(p[1]), bytes2read);
Answer the question
In order to leave comments, you need to log in
Understood. You need to write like this:
pixel->r = p[3];
pixel->g = p[2];
pixel->b = p[1];
pixel->a = p[4];
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question