Remove quirc.row_average and associated code
quirc.row_average was used by the former threshold function and has become obsolete with the introduction of the Otsu threshold function.
This commit is contained in:
parent
97ffaabfb5
commit
96a5a380fb
2 changed files with 0 additions and 11 deletions
10
lib/quirc.c
10
lib/quirc.c
|
@ -41,7 +41,6 @@ void quirc_destroy(struct quirc *q)
|
|||
same size, so we need to be careful here to avoid a double free */
|
||||
if (sizeof(*q->image) != sizeof(*q->pixels))
|
||||
free(q->pixels);
|
||||
free(q->row_average);
|
||||
free(q);
|
||||
}
|
||||
|
||||
|
@ -49,7 +48,6 @@ int quirc_resize(struct quirc *q, int w, int h)
|
|||
{
|
||||
uint8_t *image = NULL;
|
||||
quirc_pixel_t *pixels = NULL;
|
||||
int *row_average = NULL;
|
||||
|
||||
/*
|
||||
* XXX: w and h should be size_t (or at least unsigned) as negatives
|
||||
|
@ -88,11 +86,6 @@ int quirc_resize(struct quirc *q, int w, int h)
|
|||
goto fail;
|
||||
}
|
||||
|
||||
/* alloc a new buffer for q->row_average */
|
||||
row_average = calloc(w, sizeof(int));
|
||||
if (!row_average)
|
||||
goto fail;
|
||||
|
||||
/* alloc succeeded, update `q` with the new size and buffers */
|
||||
q->w = w;
|
||||
q->h = h;
|
||||
|
@ -102,15 +95,12 @@ int quirc_resize(struct quirc *q, int w, int h)
|
|||
free(q->pixels);
|
||||
q->pixels = pixels;
|
||||
}
|
||||
free(q->row_average);
|
||||
q->row_average = row_average;
|
||||
|
||||
return 0;
|
||||
/* NOTREACHED */
|
||||
fail:
|
||||
free(image);
|
||||
free(pixels);
|
||||
free(row_average);
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
|
|
@ -77,7 +77,6 @@ struct quirc_grid {
|
|||
struct quirc {
|
||||
uint8_t *image;
|
||||
quirc_pixel_t *pixels;
|
||||
int *row_average; /* used by threshold() */
|
||||
int w;
|
||||
int h;
|
||||
|
||||
|
|
Loading…
Reference in a new issue