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.42 2000/02/08 03:38:56 per Exp $ + **! $Id: layers.c,v 1.43 2000/02/22 03:41:27 per Exp $   **! class Layer   **! see also: layers   **!      **!   **!   **! <add_appendix name="layers" title="Image.Layer modes">   **! <dl compact>   **! <dt><i>The variables in the expression:</i>   **! <dt>L<dd><i>The active layer</i>
pike.git/src/modules/Image/layers.c:208:   **! }   **!   **! </execute>   **! </add_appendix>   */      #include "global.h"      #include <math.h> /* floor */    - RCSID("$Id: layers.c,v 1.42 2000/02/08 03:38:56 per Exp $"); + RCSID("$Id: layers.c,v 1.43 2000/02/22 03:41:27 per 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:504:    CCUT((COLORMAX*(int)(aL))+(COLORMAX-(int)(aL))*(aS))   #define COMBINE_ALPHA_SUM_V(aS,aL,V) \    COMBINE_ALPHA_SUM(aS,(aL)*(V))      #define COMBINE_ALPHA(S,L,aS,aL) \    ( (COLORTYPE)((((S)*((int)(COLORMAX-(aL)))*(aS))+ \    ((L)*((int)(aL))*COLORMAX))/ \    (((COLORMAX*(int)(aL))+(COLORMAX-(int)(aL))*(aS))) ) )      #define COMBINE_ALPHA_V(S,L,aS,aL,V) \ -  COMBINE_ALPHA(S,(int)((L)*(V)),aS,aL) +  COMBINE_ALPHA((S),(L),(aS),((aL)*(V)))      #else   #ifdef COMBINE_METHOD_FLOAT      #define COMBINE_ALPHA(S,L,aS,aL) \    ( (COLORTYPE)( ( (S)*(1.0-C2F(aL))*C2F(aS) + (L)*C2F(aL) ) / \    ( (C2F(aL)+(1-C2F(aL))*C2F(aS))) ) )      #define COMBINE_ALPHA_V(S,L,aS,aL,V) \    COMBINE_ALPHA(S,(L)*(V),aS,aL)
pike.git/src/modules/Image/layers.c:1316:    {    MEMCPY(d,l,sizeof(rgb_group)*len);    smear_color(da,white,len);    }    else    {    while (len--)    {    if (la->r==0 && la->g==0 && la->b==0)    { - #if 0 -  int n=0; -  do -  { -  n++; la++; -  } -  while (len && len-- && la->r==0 && la->g==0 && la->b==0); -  if (n>1) -  { -  MEMCPY(d,s,n*sizeof(rgb_group)); -  MEMCPY(da,sa,n*sizeof(rgb_group)); -  l+=n; s+=n; sa+=n; d+=n; da+=n; -  } -  else -  *(d++)=*(s++),*(da++)=*(sa++),l++; -  continue; - #else +     *d=*s;    *da=*sa; - #endif +     }    else if (la->r==COLORMAX && la->g==COLORMAX && la->b==COLORMAX)    {    *d=*l;    *da=*la;    }    else if (l->r==COLORMAX && l->g==COLORMAX && l->b==COLORMAX)    {    ALPHA_ADD(s,&white,d,sa,la,da,r);    ALPHA_ADD(s,&white,d,sa,la,da,g);
pike.git/src/modules/Image/layers.c:1367:    }    else    {    if (!la) /* no layer alpha => alpha value opaque */    while (len--)    {    ALPHA_ADD_V_NOLA(s,l,d,sa,da,alpha,r);    ALPHA_ADD_V_NOLA(s,l,d,sa,da,alpha,g);    ALPHA_ADD_V_NOLA(s,l,d,sa,da,alpha,b);    -  l++; s++; la++; sa++; da++; d++; +  l++; s++; sa++; da++; d++;    }    else    while (len--)    {    ALPHA_ADD_V(s,l,d,sa,la,da,alpha,r);    ALPHA_ADD_V(s,l,d,sa,la,da,alpha,g);    ALPHA_ADD_V(s,l,d,sa,la,da,alpha,b);       l++; s++; la++; sa++; da++; d++;    }