/*----------------------------------------------------------------------------*/ void save_xbm( const claw::graphic::image& img, const std::string& filename ) { claw::math::coordinate_2d<int> hot(10, 10); std::cout << "no hot" << std::endl; save_xbm( img, filename, "cold", NULL ); std::cout << "hot" << std::endl; save_xbm( img, filename, "hot", &hot ); }
/*----------------------------------------------------------------------------*/ void save( const claw::graphic::image& img, const std::string& filename ) { std::cout << "== Saving pcx files ==" << std::endl; save_pcx( img, filename ); std::cout << "== Saving jpg files ==" << std::endl; save_jpeg( img, filename ); std::cout << "== Saving png files ==" << std::endl; save_png( img, filename ); std::cout << "== Saving bitmap files ==" << std::endl; save_bitmap( img, filename ); std::cout << "== Saving targa files ==" << std::endl; save_targa( img, filename ); std::cout << "== Saving xbm files ==" << std::endl; save_xbm( img, filename ); }
void image_xbm_encode( INT32 args ) { struct image *img = NULL; struct pike_string *name = NULL, *buf; if (!args) Pike_error("Image.XBM.encode: too few arguments\n"); if (Pike_sp[-args].type!=PIKE_T_OBJECT || !(img=(struct image*) get_storage(Pike_sp[-args].u.object,image_program))) Pike_error("Image.XBM.encode: illegal argument 1\n"); if (!img->img) Pike_error("Image.XBM.encode: no image\n"); if (args>1) { if (Pike_sp[1-args].type!=PIKE_T_MAPPING) Pike_error("Image.XBM.encode: illegal argument 2\n"); push_svalue(Pike_sp+1-args); ref_push_string(param_name); f_index(2); if(Pike_sp[-1].type == PIKE_T_STRING) { if(Pike_sp[-1].u.string->size_shift) Pike_error("The name of the image must be a normal non-wide string (sorry, not my fault)\n"); name = Pike_sp[-1].u.string; } pop_stack(); } buf = save_xbm( img, name ); pop_n_elems(args); push_string( buf ); }