pike.git / src / modules / Image / encodings / tim.c

version» Context lines:

pike.git/src/modules/Image/encodings/tim.c:10:   #include <ctype.h>      #include "object.h"   #include "interpret.h"   #include "svalue.h"   #include "mapping.h"   #include "pike_error.h"   #include "operators.h"   #include "builtin_functions.h"   #include "module_support.h" + #include "pike_types.h"         #include "image.h"      #include "encodings.h"            extern struct program *image_program;   
pike.git/src/modules/Image/encodings/tim.c:166:      void img_tim_decode(INT32 args, int header_only)   {    struct pike_string *str;    unsigned char *s, *clut;    int n=0, hasalpha=0, bitpp=0, bsize=0;    ptrdiff_t len;    INT32 attr;    unsigned int h=0, w=0;    -  get_all_args("Image.TIM._decode", args, "%S", &str); +  get_all_args(NULL, args, "%S", &str);    clut=s=(unsigned char *)str->str;    clut+=20;    len = str->len;    pop_n_elems(args-1);       if(len < 12 || (s[0] != 0x10 || s[2] != 0 || s[3] != 0))    Pike_error("not a TIM texture\n");    else if(s[2] != 0)    Pike_error("unknown version of TIM texture\n");       s += 4; len -= 4;    -  push_text("type"); -  push_text("image/x-tim"); +  ref_push_string(literal_type_string); +  push_static_text("image/x-tim");    n++;       attr = s[0]|(s[1]<<8)|(s[2]<<16)|(s[3]<<24);    if(attr&0xfffffff0)    Pike_error("unknown flags in TIM texture\n");       s += 4; len -= 4;    -  push_text("attr"); +  push_static_text("attr");    push_int(attr);    n++;       if(attr&FLAG_CLUT) {    bsize = s[0]|(s[1]<<8)|(s[2]<<16)|(s[3]<<24);   #ifdef TIM_DEBUG    printf("bsize: %d\n", bsize);   #endif    s += bsize; len -= bsize;    }
pike.git/src/modules/Image/encodings/tim.c:257:    break;    case MODE_MIXED:   #ifdef TIM_DEBUG    printf("Mixed\n");   #endif    Pike_error("mixed TIMs not supported\n");    default:    Pike_error("unknown TIM format\n");    }    -  push_text("xsize"); +  push_static_text("xsize");    push_int(w);    n++; -  push_text("ysize"); +  push_static_text("ysize");    push_int(h);    n++;      #ifdef TIM_DEBUG    printf("w: %d, h: %d\n", w, h);   #endif       if(!header_only) {    struct object *o;    struct image *img;       if(len < (INT32)(bitpp*(h*w)/8))    Pike_error("short pixel data\n");    -  push_text("image"); +  push_static_text("image");    push_int(w);    push_int(h);    o=clone_object(image_program,2); -  img=(struct image*)get_storage(o,image_program); +  img=get_storage(o,image_program);    push_object(o);    n++;       tim_decode_rect(attr, s, img->img, clut, h, w);       if(hasalpha) { -  push_text("alpha"); +  push_static_text("alpha");    push_int(w);    push_int(h);    o=clone_object(image_program,2); -  img=(struct image*)get_storage(o,image_program); +  img=get_storage(o,image_program);    push_object(o);    n++;       tim_decode_alpha_rect(attr, s, img->img, clut, h, w);    }    }       f_aggregate_mapping(2*n);       stack_swap();
pike.git/src/modules/Image/encodings/tim.c:328:   void image_tim_f_decode_header(INT32 args)   {    img_tim_decode(args,1);   }      void image_tim_f__decode(INT32 args)   {    img_tim_decode(args,0);   }    - void init_image_tim() + void init_image_tim(void)   {    ADD_FUNCTION( "decode", image_tim_f_decode, tFunc(tStr,tObj), 0);    ADD_FUNCTION( "decode_alpha", image_tim_f_decode_alpha, tFunc(tStr,tObj), 0);    ADD_FUNCTION( "_decode", image_tim_f__decode, tFunc(tStr,tMapping), 0);    ADD_FUNCTION( "decode_header", image_tim_f_decode_header, tFunc(tStr,tMapping), 0);   }    - void exit_image_tim() + void exit_image_tim(void)   {   }