fz_pixmap * fz_load_pnm(fz_context *ctx, unsigned char *p, size_t total) { fz_pixmap *img; struct info pnm = { 0 }; img = pnm_read_image(ctx, &pnm, p, total, 0); return img; }
void fz_load_pnm_info(fz_context *ctx, unsigned char *p, size_t total, int *wp, int *hp, int *xresp, int *yresp, fz_colorspace **cspacep) { struct info pnm = { 0 }; pnm_read_image(ctx, &pnm, p, total, 1); *cspacep = pnm.cs; *wp = pnm.width; *hp = pnm.height; *xresp = 72; *yresp = 72; }
inline void pnm_read_image(const std::string& filename,IMAGE& im) { pnm_read_image(filename.c_str(),im); }