#include <maglo.h> int MAGReaderNextPixel(MagReader *rd, unsigned char *buf);
The MAGReaderNextPixel() function copies next MAG pixel from MagReader rd to buf if one is available.
A MAG pixel consists of 2 or 4 screen pixels, which can be queried to the library with MAGpixelWidth() function. The buf should be 2 or 4 bytes long depending on the width of MAG pixel of the image.
After successful completion, the buf contains palette indexes for each of two or four screen pixels. The mapping between palette index and actual color can be queried through MAGpalette() function.
If the image width is not multiple of 2 or 4, dummy screen pixels are padded at the end of each row.
On successful completion MAGReaderNextPixel function returns MAGERR_NOERROR. Otherwise one of following error codes is returned: