Roxen.git / server / modules / graphics / graphic_text.pike

version» Context lines:

Roxen.git/server/modules/graphics/graphic_text.pike:1: - string cvs_version="$Id: graphic_text.pike,v 1.11 1996/12/10 03:07:30 per Exp $"; + string cvs_version="$Id: graphic_text.pike,v 1.12 1996/12/10 03:39:46 per Exp $";   #include <module.h>   inherit "module";   inherit "roxenlib";         array register_module()   {    return ({ MODULE_LOCATION | MODULE_PARSER,    "Graphics text",    "Makes a few new tags:<p>"
Roxen.git/server/modules/graphics/graphic_text.pike:149:    res = map_array(allocate(size), lambda(int s, int size){    return allocate(size); }, size);       for(i=0; i<size; i++)    for(j=0; j<size; j++)    res[i][j] = (int)MAX((float)size/2.0-sqrt((size/2-i)*(size/2-i) + (size/2-j)*(size/2-j)),0);    return matrixes[size] = res;   }       + object last_image; + string last_image_name;   object (Image) load_image(string f)   { -  +  if(last_image_name==f) return last_image;    object file = File();    string data;    object img = Image(); -  perror("Loading "+f+"\n"); -  if(!file->open(f,"r")) -  { -  perror("Failed to open file ("+f+").\n"); -  return 0; -  } +  +  if(!file->open(f,"r")) return 0;    if(!(data=file->read(0x7fffffff))) return 0; -  if(img->frompnm(data)) return img; -  if(img->fromgif(data)) return img; -  perror("Failed to parse file.\n"); -  return 0; +  if(!img->frompnm(data) && !img->fromgif(data)) return 0; +  +  last_image_name=f; +  last_image=img; + //call_out(lambda(){last_image=last_image_name=0;}, 10); +  return img->copy();;   }      object (Image) blur(object (Image) img, int amnt)   {    for(int i=0; i<amnt; i++)    img = img->apply_matrix( make_matrix((int)sqrt(img->ysize()+10)));    return img;   }      constant white = ({ 255,255,255 });