pike.git / src / modules / Image / match.h

version» Context lines:

pike.git/src/modules/Image/match.h:1:   /*   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information.   */      /*   This file is incuded in search.c with the following defines set:      NAME The name of the match function. This is undef:ed at end of this file - INAME The name of the match c-function. This is nudef:ed at end of this file + INAME The name of the match c-function. This is undef:ed at end of this file   PIXEL_VALUE_DISTANCE The inner loop code for each pixel.    undef:ed at end of this file   NEEDLEAVRCODE If this is set, needle_average is calculated.    Not undef:ed at end   NORMCODE code used for normalizing in the haystack. Not undef:ed at end   SCALE_MODIFY(x) This modifies the output in each pixel       */      
pike.git/src/modules/Image/match.h:33:    type==3 : (int|float scale, needle, haystack_avoid, int foo)    type==4 : (int|float scale, needle,    haystack_cert, needle_cert,    haystack_avoid, int foo) */       int xs,ys, y, x; /* for this & img */    int nxs,nys, ny, nx; /* for neddle */    int foo=0;    double scale = 1.0;    int needle_average=0; -  int needle_size=0; +  int needle_size=1;       if (!THIS->img) { Pike_error("no image\n"); return; }    this=THIS;    haystacki=this->img;    haystack=this;    if (!args) { Pike_error("Missing arguments to image->"NAME"\n"); return; }    else if (args<2) { Pike_error("Too few arguments to image->"NAME"\n"); return; }    else    {    if (TYPEOF(sp[-args]) == T_INT)
pike.git/src/modules/Image/match.h:140:    nys=needle->ysize;    xs=this->xsize;    ys=this->ysize-nys;       /* This sets needle_average to something nice :-) */    /* match and match_phase don't use this */   #ifdef NEEDLEAVRCODE    needle_size=nxs*nys;    for(x=0; x<needle_size; x++)    needle_average+=needlei[x].r+needlei[x].g+needlei[x].b; +  if (!needle_size) needle_size = 1;    needle_average=(int)(((float)needle_average)/(3*needle_size));      #define NORMCODE for(ny=0; ny<nys; ny++) \    for(nx=0; nx<nxs; nx++) \    { \    int j=i+ny*xs+nx; \    tempavr+=haystacki[j].r+haystacki[j].g+ \    haystacki[j].b; \    }   #else