• Home
  • Raw
  • Download

Lines Matching refs:achv

24 static f_pixel averagepixels (unsigned int clrs, const hist_item achv[],
49 box_variance (const hist_item achv[], const struct box *box) in box_variance() argument
55 f_pixel px = achv[box->ind + i].acolor; in box_variance()
56 double weight = achv[box->ind + i].adjusted_weight; in box_variance()
69 box_max_error (const hist_item achv[], const struct box *box) in box_max_error() argument
76 const double diff = colordifference (mean, achv[box->ind + i].acolor); in box_max_error()
201 static f_pixel get_median (const struct box *b, hist_item achv[]);
220 prepare_sort (struct box *b, hist_item achv[]) in prepare_sort() argument
236 const float *chans = (const float *) &achv[b->ind + i].acolor; in prepare_sort()
239 achv[b->ind + i].tmp.sort_value = in prepare_sort()
247 const f_pixel median = get_median (b, achv); in prepare_sort()
252 totalvar += (achv[j].color_weight = color_weight (median, achv[j])); in prepare_sort()
259 get_median (const struct box *b, hist_item achv[]) in get_median() argument
263 hist_item_sort_range (&(achv[b->ind]), b->colors, median_start); in get_median()
266 return achv[b->ind + median_start].acolor; in get_median()
270 return averagepixels (2, &achv[b->ind + median_start], 1.0, (f_pixel) { in get_median()
319 unsigned int boxes, hist_item * achv);
320 static void adjust_histogram (hist_item * achv, const colormap * map,
324 box_error (const struct box *box, const hist_item achv[]) in box_error() argument
333 achv[box->ind + i].acolor) * achv[box->ind + i].perceptual_weight; in box_error()
360 bv[i].total_error = box_error (&bv[i], hist->achv); in total_box_error_below_target()
380 hist_item *achv = hist->achv; in mediancut() local
392 averagepixels (bv[0].colors, &achv[bv[0].ind], min_opaque_val, (f_pixel) { in mediancut()
394 bv[0].variance = box_variance (achv, &bv[0]); in mediancut()
395 bv[0].max_error = box_max_error (achv, &bv[0]); in mediancut()
399 bv[0].sum += achv[i].adjusted_weight; in mediancut()
420 set_colormap_from_boxes (representative_subset, bv, boxes, achv); in mediancut()
442 halfvar = prepare_sort (&bv[bi], achv); in mediancut()
446 break_p = hist_item_sort_halfvar (&achv[indx], clrs, &lowervar, halfvar); in mediancut()
447 break_at = MIN (clrs - 1, break_p - &achv[indx] + 1); in mediancut()
455 lowersum += achv[indx + i].adjusted_weight; in mediancut()
461 averagepixels (bv[bi].colors, &achv[bv[bi].ind], min_opaque_val, in mediancut()
464 bv[bi].variance = box_variance (achv, &bv[bi]); in mediancut()
465 bv[bi].max_error = box_max_error (achv, &bv[bi]); in mediancut()
470 averagepixels (bv[boxes].colors, &achv[bv[boxes].ind], min_opaque_val, in mediancut()
473 bv[boxes].variance = box_variance (achv, &bv[boxes]); in mediancut()
474 bv[boxes].max_error = box_max_error (achv, &bv[boxes]); in mediancut()
484 set_colormap_from_boxes (map, bv, boxes, achv); in mediancut()
487 adjust_histogram (achv, map, bv, boxes); in mediancut()
494 hist_item * achv) in set_colormap_from_boxes() argument
510 map->palette[bi].popularity += achv[i].perceptual_weight; in set_colormap_from_boxes()
517 adjust_histogram (hist_item * achv, const colormap * map, const struct box *bv, in adjust_histogram() argument
522 achv[i].adjusted_weight *= in adjust_histogram()
524 achv[i].acolor) / 4.0); in adjust_histogram()
525 achv[i].tmp.likely_colormap_index = bi; in adjust_histogram()
531 averagepixels (unsigned int clrs, const hist_item achv[], in averagepixels() argument
539 const f_pixel px = achv[i].acolor; in averagepixels()
540 new_a += px.a * achv[i].adjusted_weight; in averagepixels()
541 sum += achv[i].adjusted_weight; in averagepixels()
559 f_pixel px = achv[i].acolor; in averagepixels()
571 weight *= achv[i].adjusted_weight; in averagepixels()