re_readimagefile()

extern ReImageHandle XXX_API re_readimagefile
  (ReFileHandle rfh, long image_number, ReImage *image);
      

Parameter:

rfh
of an image file, opened with re_openimagefile().
image_number
Number of the image to be read (first image has number 0).
image
Pointer of a structure ReImage.

Return value:

Handle of the allocated memory, NULL in case of error.

Comment:

The function reads the image given by image_number from the image file given by file_handle allocates sufficient memory, and fills in the ReImage data structure image accordingly. This image can directly be processed by rec_do(), rel_do(), or rep_do(). In case of error the NULL pointer will be returned, the error text can be retrieved with re_GetErrorText(). In case of success a handle of the allocated memory will be returned. This memory can be freed by a call to re_freeimage() with the given handle. The image numbers of the file start with 0. After reading an image from the file, re_endofimagefile() can be used to check if the end of the file has been reached. In case of empty image files or empty images (height*width==0) the functions re_readimagefile() and re_readimage() don't throw an error any more. They simply return with NULL.

Reference: