pike.git / src / modules / Image / layers.c

version» Context lines:

pike.git/src/modules/Image/layers.c:1:   /*   **! module Image   **! note - **! $Id: layers.c,v 1.73 2001/07/27 15:20:45 nilsson Exp $ + **! $Id: layers.c,v 1.74 2001/09/24 11:35:00 grubba Exp $   **! class Layer   **! see also: layers   **!      **!   **!   **! appendix Image.Layer modes   **!   **! <dl compact>   **! <dt><i>The variables in the expression:</i></dt>
pike.git/src/modules/Image/layers.c:210:   **! return 0;   **! }   **!   **! </execute>   */      #include "global.h"      #include <math.h> /* floor */    - RCSID("$Id: layers.c,v 1.73 2001/07/27 15:20:45 nilsson Exp $"); + RCSID("$Id: layers.c,v 1.74 2001/09/24 11:35:00 grubba Exp $");      #include "image_machine.h"      #include "stralloc.h"   #include "pike_macros.h"   #include "object.h"   #include "constants.h"   #include "interpret.h"   #include "svalue.h"   #include "array.h"
pike.git/src/modules/Image/layers.c:769:   }         static INLINE void hls_to_rgb(double h,double l,double s,rgb_group *rgb)   {    double m1, m2;       if (s == 0)    {   /* achromatic case */ -  rgb->r = l; -  rgb->g = l; -  rgb->b = l; +  rgb->r = (COLORTYPE)l; +  rgb->g = (COLORTYPE)l; +  rgb->b = (COLORTYPE)l;    }    else    {    if (l < 128)    m2 = (l * (255 + s)) / 65025.0;    else    m2 = (l + s - (l * s) / 255.0) / 255.0;       m1 = (l / 127.5) - m2;   
pike.git/src/modules/Image/layers.c:2401:   #endif    return;    }       if (ly->alpha_value==1.0)    if (!l)    if (ly->fill.r!=0 ||    ly->fill.g!=0 ||    ly->fill.b!=0)    { -  rgb_group fill=ly->fill; +     while (len--)    {    d->r=MINIMUM(s->r+la->r,COLORMAX);    d->g=MINIMUM(s->g+la->g,COLORMAX);    d->b=MINIMUM(s->b+la->b,COLORMAX);    da->r=MINIMUM(sa->r+la->r,COLORMAX);    da->g=MINIMUM(sa->g+la->g,COLORMAX);    da->b=MINIMUM(sa->b+la->b,COLORMAX);    da++; sa++; la++; d++; s++;    }
pike.git/src/modules/Image/layers.c:2628:    s+=SNUMPIXS; d+=SNUMPIXS;    sa+=SNUMPIXS;da+=SNUMPIXS;    if (l) l+=SNUMPIXS;    len-=SNUMPIXS;    }    if (len)    (ly->row_func)(s,l?l:ly->sfill,d,sa,NULL,da,len,ly->alpha_value);    }    else    { -  int i; -  +    /* fprintf(stderr,"ly=%p len=%d\n",ly,len); */       while (len>SNUMPIXS)    {    (ly->row_func)(s,l?l:ly->sfill,d,sa,la?la:ly->sfill_alpha,da,    SNUMPIXS,ly->alpha_value);    s+=SNUMPIXS; d+=SNUMPIXS;    sa+=SNUMPIXS; da+=SNUMPIXS;    if (l) l+=SNUMPIXS;    if (la) la+=SNUMPIXS;
pike.git/src/modules/Image/layers.c:2824:   #endif    z=0;    }       /* loop over the rest of the layers, except the last */    for (; z<layers-1; z++)    if (!layer[z]->really_optimize_alpha ||    (layer[z]->yoffs<=y+dest->yoffs &&    y+dest->yoffs<layer[z]->yoffs+layer[z]->ysize))    { -  rgb_group *tmp; -  +    /* if (!layer[z]->really_optimize_alpha) */   /* fprintf(stderr,"huh %d\n",z); */   /* if (!(layer[z]->yoffs>=y+dest->yoffs && */   /* y+dest->yoffs<layer[z]->yoffs+layer[z]->ysize)) */   /* fprintf(stderr,"hmm %d %d<=%d<%d\n", */   /* z, */   /* layer[z]->yoffs, */   /* y+dest->yoffs, */   /* layer[z]->yoffs+layer[z]->ysize); */   
pike.git/src/modules/Image/layers.c:3268:    default:    push_int(0);    return;    }   }      /******************************************************/      void init_image_layers(void)   { -  char buf[100]; -  char buf2[sizeof(INT32)]; +     int i;       for (i=0; i<LAYER_MODES; i++)    layer_mode[i].ps=make_shared_string(layer_mode[i].name);       /* layer object */       ADD_STORAGE(struct layer);    set_init_callback(init_layer);    set_exit_callback(exit_layer);