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

version» Context lines:

pike.git/src/modules/Image/layers.c:158:   LMFUNC(lm_less_or_equal);   LMFUNC(lm_more_or_equal);      LMFUNC(lm_logic_equal);   LMFUNC(lm_logic_not_equal);   LMFUNC(lm_logic_strict_less);   LMFUNC(lm_logic_strict_more);   LMFUNC(lm_logic_strict_less_or_equal);   LMFUNC(lm_logic_strict_more_or_equal);    - static void lm_spec_burn_alpha(struct layer *ly, -  rgb_group *l, rgb_group *la, -  rgb_group *s, rgb_group *sa, -  rgb_group *d, rgb_group *da, -  int len); + static void lm_spec_burn_alpha_row_func(rgb_group *s, rgb_group *l, +  rgb_group *d, rgb_group *sa, +  rgb_group *la, rgb_group *da, +  int len, double alpha);      struct layer_mode_desc   {    char *name;    lm_row_func *func;    int optimize_alpha; /* alpha 0 -> skip layer */    struct pike_string *ps;    char *desc;   } layer_mode[]=   {
pike.git/src/modules/Image/layers.c:284:    {"behind", lm_behind, 1, NULL,    "D=(S*aS+L*(1-aS)*aL) / (aS+(1-aS)*aL), aD=(aS+(1-aS)*aL); "    "simply swap S and L"},    {"erase", lm_erase, 1, NULL,    "D=S, aD=aS*(1-aL)"},       {"screen", lm_screen, 1, NULL,    "1-(1-S)*(1-L) applied with alpha, aD=aS"},    {"overlay", lm_overlay, 1, NULL,    "(1-(1-a)*(1-b)-a*b)*a+a*b applied with alpha, aD=aS"}, -  {"burn_alpha", (lm_row_func*)lm_spec_burn_alpha, 1, NULL, +  {"burn_alpha", (lm_row_func*)lm_spec_burn_alpha_row_func, 1, NULL,    "aD=aL+aS applied with alpha, D=L+S;"    " experimental, may change or be removed"},       {"equal", lm_equal, 0, NULL,    "each channel D=max if L==S, 0 otherwise, apply with alpha"},    {"not_equal", lm_not_equal, 0, NULL,    "each channel D=max if L!=S, 0 otherwise, apply with alpha"},    {"less", lm_less, 0, NULL,    "each channel D=max if L<S, 0 otherwise, apply with alpha"},    {"more", lm_more, 0, NULL,
pike.git/src/modules/Image/layers.c:2337:    while (len--)    {    da->r=CCUT(sa->r*(int)(COLORMAX-alpha*la->r));    da->g=CCUT(sa->g*(int)(COLORMAX-alpha*la->g));    da->b=CCUT(sa->b*(int)(COLORMAX-alpha*la->b));       la++; sa++; da++;    }   }    + /* This function is just a place holder and should not be called. +  * Instead, lm_spec_burn_alpha() is called in case row_func points to +  * this. */ + static void lm_spec_burn_alpha_row_func(rgb_group *UNUSED(s), +  rgb_group *UNUSED(l), +  rgb_group *UNUSED(d), +  rgb_group *UNUSED(sa), +  rgb_group *UNUSED(la), +  rgb_group *UNUSED(da), +  int UNUSED(len), double UNUSED(alpha)) + { +  Pike_fatal("lm_spec_burn_alpha_row_func() called.\n"); + } +    static void lm_spec_burn_alpha(struct layer *ly,    rgb_group *l, rgb_group *la,    rgb_group *s, rgb_group *sa,    rgb_group *d, rgb_group *da,    int len)      {    /* special optimized */    if (!la)    {
pike.git/src/modules/Image/layers.c:2547:    rgb_group *la,    rgb_group *s,    rgb_group *sa,    rgb_group *d,    rgb_group *da,    int len)   {    if (len<0) Pike_error("internal error: stroke len < 0\n");    if (!ly->row_func) Pike_error("internal error: row_func=NULL\n");    -  if (ly->row_func==(lm_row_func*)lm_spec_burn_alpha) +  if (ly->row_func==(lm_row_func*)lm_spec_burn_alpha_row_func)    {    lm_spec_burn_alpha(ly,l,la,s,sa,d,da,len);    return;    }       if (l)    {    (ly->row_func)(s,l,d,sa,la,da,len,ly->alpha_value);    return;    }