Hello,
How can i allocate memory for the entire pixel array of a image read from disk?.
I need to allocate with calloc but I don't know all the structs and datatypes of magickwand,
Please give that 1 line of code to do what i need.
Thanks a lot!.
Ps: I am using imagemagick Q8 and C languague.
Allocate memory for pixel map of a image in C
Re: Allocate memory for pixel map of a image in C
Is this correct to edit the second pixel of the space allocated?
Code: Select all
MagickPixelPacket *pixels_map = (MagickPixelPacket *) malloc(sizeof(MagickPixelPacket) * image_width * image_height);
pixels_map[1].red = 255;
pixels_map[1].green 255;
pixels_map[1].blue = 255;