static int l_scan_image(lua_State * L) { image *a, **aa; if (lua_gettop(L) != 1) luaL_error(L, "img.scan needs exactly 1 argument"); if (lua_istable(L, 1)) (void) l_new_image(L); aa = (image **) luaL_checkudata(L, 1, TYPE_IMG); a = *aa; check_o_mode(static_pdf, "img.scan", 1 << OMODE_PDF, false); read_scale_img(a); return 1; }
static int l_scan_image(lua_State * L) { image *a, **aa; if (lua_gettop(L) != 1) luaL_error(L, "img.scan() needs exactly 1 argument"); if (lua_istable(L, 1)) (void) l_new_image(L); /* image --- if everything worked well */ aa = (image **) luaL_checkudata(L, 1, TYPE_IMG); /* image */ a = *aa; check_o_mode(static_pdf, "img.scan()", 1 << OMODE_PDF, false); /* flush_str(last_tex_string); *//* ?? */ read_scale_img(a); return 1; /* image */ }
static void setup_image(PDF pdf, image * a, wrtype_e writetype) { image_dict *ad; if (a == NULL) luaL_error(Luas, "no valid image passed"); /* todo, also check in caller */ ad = img_dict(a); check_o_mode(pdf, wrtype_s[writetype], 1 << OMODE_PDF, false); read_scale_img(a); if (img_objnum(ad) == 0) { /* latest needed just before out_img() */ pdf->ximage_count++; img_objnum(ad) = pdf_create_obj(pdf, obj_type_ximage, pdf->ximage_count); img_index(ad) = pdf->ximage_count; idict_to_array(ad); /* from now on ad is read-only */ obj_data_ptr(pdf, pdf->obj_ptr) = img_index(ad); } }
static void setup_image(PDF pdf, image * a, wrtype_e writetype) { image_dict *ad; assert(a != NULL); ad = img_dict(a); check_o_mode(pdf, wrtype_s[writetype], 1 << OMODE_PDF, false); /* flush_str(last_tex_string); *//* ?? */ read_scale_img(a); if (img_objnum(ad) == 0) { /* latest needed just before out_img() */ pdf->ximage_count++; img_objnum(ad) = pdf_create_obj(pdf, obj_type_ximage, pdf->ximage_count); img_index(ad) = pdf->ximage_count; idict_to_array(ad); /* now ad is read-only */ obj_data_ptr(pdf, pdf->obj_ptr) = img_index(ad); } }