Ignore:
Timestamp:
Jan 3, 2005, 4:29:46 PM (15 years ago)
Author:
Sam Hocevar
Message:
  • renamed a few functions
File:
1 edited

Legend:

Unmodified
Added
Removed
  • pwntcha/trunk/src/slashdot.c

    r386 r387  
    3535
    3636/* Main function */
    37 char * slashdot_decode(char *image)
    38 {
    39     struct image *img, *tmp, *tmp2;
    40 
    41     img = load_image(image);
    42     if(img == NULL)
    43         return NULL;
     37char * decode_slashdot(struct image *img)
     38{
     39    struct image *tmp, *tmp2;
    4440
    4541    /* Slashdot captchas have 7 characters */
     
    4743
    4844    /* Clean image a bit */
    49     tmp = detect_lines(img);
    50     tmp = fill_holes(tmp);
     45    tmp = filter_detect_lines(img);
     46    tmp = filter_fill_holes(tmp);
    5147
    5248    /* Detect small objects to guess image orientation */
    53     tmp2 = median(tmp);
    54     tmp2 = equalize(tmp2);
     49    tmp2 = filter_median(tmp);
     50    tmp2 = filter_equalize(tmp2);
    5551    count_objects(tmp2);
    5652
    5753    /* Invert rotation and find glyphs */
    5854    tmp = rotate(tmp);
    59     tmp = median(tmp);
     55    tmp = filter_median(tmp);
    6056    tmp = find_glyphs(tmp);
    6157
     
    7268    int r, g, b;
    7369
    74     dst = new_image(img->width, img->height);
     70    dst = image_new(img->width, img->height);
    7571
    7672    for(y = 0; y < img->height; y++)
     
    9187                {
    9288                    gotblack = 1;
    93                     flood_fill(dst, x, y, 255 - objects, 0, 0);
     89                    filter_flood_fill(dst, x, y, 255 - objects, 0, 0);
    9490                    objects++;
    9591                }
     
    120116                first = i;
    121117            last = i;
    122             flood_fill(dst, objlist[i].xmin, objlist[i].ymin, 0, 0, 255);
     118            filter_flood_fill(dst, objlist[i].xmin, objlist[i].ymin, 0, 0, 255);
    123119        }
    124120    }
     
    154150    }
    155151
    156     dst = new_image(img->width * FACTOR, img->height * FACTOR);
     152    dst = image_new(img->width * FACTOR, img->height * FACTOR);
    157153
    158154    for(y = 0; y < img->height * FACTOR; y++)
     
    187183    int r, g, b;
    188184
    189     dst = new_image(img->width, img->height);
     185    dst = image_new(img->width, img->height);
    190186
    191187    for(y = 0; y < img->height; y++)
     
    222218    glyphs[22];
    223219    struct image *dst;
    224     struct image *font = load_image(FONTNAME);
     220    struct image *font = image_load(FONTNAME);
    225221    int x, y, i = 0;
    226222    int r, g, b;
     
    234230    }
    235231
    236     dst = new_image(img->width, img->height);
     232    dst = image_new(img->width, img->height);
    237233
    238234    for(y = 0; y < img->height; y++)
Note: See TracChangeset for help on using the changeset viewer.