亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? jquant2.c

?? JPEG source code converts the image into compressed format
?? C
?? 第 1 頁(yè) / 共 4 頁(yè)
字號(hào):
  if (c0max > c0min)
    for (c0 = c0min; c0 <= c0max; c0++)
      for (c1 = c1min; c1 <= c1max; c1++) {
	histp = & histogram[c0][c1][c2min];
	for (c2 = c2min; c2 <= c2max; c2++)
	  if (*histp++ != 0) {
	    boxp->c0min = c0min = c0;
	    goto have_c0min;
	  }
      }
 have_c0min:
  if (c0max > c0min)
    for (c0 = c0max; c0 >= c0min; c0--)
      for (c1 = c1min; c1 <= c1max; c1++) {
	histp = & histogram[c0][c1][c2min];
	for (c2 = c2min; c2 <= c2max; c2++)
	  if (*histp++ != 0) {
	    boxp->c0max = c0max = c0;
	    goto have_c0max;
	  }
      }
 have_c0max:
  if (c1max > c1min)
    for (c1 = c1min; c1 <= c1max; c1++)
      for (c0 = c0min; c0 <= c0max; c0++) {
	histp = & histogram[c0][c1][c2min];
	for (c2 = c2min; c2 <= c2max; c2++)
	  if (*histp++ != 0) {
	    boxp->c1min = c1min = c1;
	    goto have_c1min;
	  }
      }
 have_c1min:
  if (c1max > c1min)
    for (c1 = c1max; c1 >= c1min; c1--)
      for (c0 = c0min; c0 <= c0max; c0++) {
	histp = & histogram[c0][c1][c2min];
	for (c2 = c2min; c2 <= c2max; c2++)
	  if (*histp++ != 0) {
	    boxp->c1max = c1max = c1;
	    goto have_c1max;
	  }
      }
 have_c1max:
  if (c2max > c2min)
    for (c2 = c2min; c2 <= c2max; c2++)
      for (c0 = c0min; c0 <= c0max; c0++) {
	histp = & histogram[c0][c1min][c2];
	for (c1 = c1min; c1 <= c1max; c1++, histp += HIST_C2_ELEMS)
	  if (*histp != 0) {
	    boxp->c2min = c2min = c2;
	    goto have_c2min;
	  }
      }
 have_c2min:
  if (c2max > c2min)
    for (c2 = c2max; c2 >= c2min; c2--)
      for (c0 = c0min; c0 <= c0max; c0++) {
	histp = & histogram[c0][c1min][c2];
	for (c1 = c1min; c1 <= c1max; c1++, histp += HIST_C2_ELEMS)
	  if (*histp != 0) {
	    boxp->c2max = c2max = c2;
	    goto have_c2max;
	  }
      }
 have_c2max:

  /* Update box volume.
   * We use 2-norm rather than real volume here; this biases the method
   * against making long narrow boxes, and it has the side benefit that
   * a box is splittable iff norm > 0.
   * Since the differences are expressed in histogram-cell units,
   * we have to shift back to JSAMPLE units to get consistent distances;
   * after which, we scale according to the selected distance scale factors.
   */
  dist0 = ((c0max - c0min) << C0_SHIFT) * C0_SCALE;
  dist1 = ((c1max - c1min) << C1_SHIFT) * C1_SCALE;
  dist2 = ((c2max - c2min) << C2_SHIFT) * C2_SCALE;
  boxp->volume = dist0*dist0 + dist1*dist1 + dist2*dist2;
  
  /* Now scan remaining volume of box and compute population */
  ccount = 0;
  for (c0 = c0min; c0 <= c0max; c0++)
    for (c1 = c1min; c1 <= c1max; c1++) {
      histp = & histogram[c0][c1][c2min];
      for (c2 = c2min; c2 <= c2max; c2++, histp++)
	if (*histp != 0) {
	  ccount++;
	}
    }
  boxp->colorcount = ccount;
}


LOCAL(int)
median_cut (j_decompress_ptr cinfo, boxptr boxlist, int numboxes,
	    int desired_colors)
/* Repeatedly select and split the largest box until we have enough boxes */
{
  int n,lb;
  int c0,c1,c2,cmax;
  register boxptr b1,b2;

  while (numboxes < desired_colors) {
    /* Select box to split.
     * Current algorithm: by population for first half, then by volume.
     */
    if (numboxes*2 <= desired_colors) {
      b1 = find_biggest_color_pop(boxlist, numboxes);
    } else {
      b1 = find_biggest_volume(boxlist, numboxes);
    }
    if (b1 == NULL)		/* no splittable boxes left! */
      break;
    b2 = &boxlist[numboxes];	/* where new box will go */
    /* Copy the color bounds to the new box. */
    b2->c0max = b1->c0max; b2->c1max = b1->c1max; b2->c2max = b1->c2max;
    b2->c0min = b1->c0min; b2->c1min = b1->c1min; b2->c2min = b1->c2min;
    /* Choose which axis to split the box on.
     * Current algorithm: longest scaled axis.
     * See notes in update_box about scaling distances.
     */
    c0 = ((b1->c0max - b1->c0min) << C0_SHIFT) * C0_SCALE;
    c1 = ((b1->c1max - b1->c1min) << C1_SHIFT) * C1_SCALE;
    c2 = ((b1->c2max - b1->c2min) << C2_SHIFT) * C2_SCALE;
    /* We want to break any ties in favor of green, then red, blue last.
     * This code does the right thing for R,G,B or B,G,R color orders only.
     */
#if RGB_RED == 0
    cmax = c1; n = 1;
    if (c0 > cmax) { cmax = c0; n = 0; }
    if (c2 > cmax) { n = 2; }
#else
    cmax = c1; n = 1;
    if (c2 > cmax) { cmax = c2; n = 2; }
    if (c0 > cmax) { n = 0; }
#endif
    /* Choose split point along selected axis, and update box bounds.
     * Current algorithm: split at halfway point.
     * (Since the box has been shrunk to minimum volume,
     * any split will produce two nonempty subboxes.)
     * Note that lb value is max for lower box, so must be < old max.
     */
    switch (n) {
    case 0:
      lb = (b1->c0max + b1->c0min) / 2;
      b1->c0max = lb;
      b2->c0min = lb+1;
      break;
    case 1:
      lb = (b1->c1max + b1->c1min) / 2;
      b1->c1max = lb;
      b2->c1min = lb+1;
      break;
    case 2:
      lb = (b1->c2max + b1->c2min) / 2;
      b1->c2max = lb;
      b2->c2min = lb+1;
      break;
    }
    /* Update stats for boxes */
    update_box(cinfo, b1);
    update_box(cinfo, b2);
    numboxes++;
  }
  return numboxes;
}


LOCAL(void)
compute_color (j_decompress_ptr cinfo, boxptr boxp, int icolor)
/* Compute representative color for a box, put it in colormap[icolor] */
{
  /* Current algorithm: mean weighted by pixels (not colors) */
  /* Note it is important to get the rounding correct! */
  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
  hist3d histogram = cquantize->histogram;
  histptr histp;
  int c0,c1,c2;
  int c0min,c0max,c1min,c1max,c2min,c2max;
  long count;
  long total = 0;
  long c0total = 0;
  long c1total = 0;
  long c2total = 0;
  
  c0min = boxp->c0min;  c0max = boxp->c0max;
  c1min = boxp->c1min;  c1max = boxp->c1max;
  c2min = boxp->c2min;  c2max = boxp->c2max;
  
  for (c0 = c0min; c0 <= c0max; c0++)
    for (c1 = c1min; c1 <= c1max; c1++) {
      histp = & histogram[c0][c1][c2min];
      for (c2 = c2min; c2 <= c2max; c2++) {
	if ((count = *histp++) != 0) {
	  total += count;
	  c0total += ((c0 << C0_SHIFT) + ((1<<C0_SHIFT)>>1)) * count;
	  c1total += ((c1 << C1_SHIFT) + ((1<<C1_SHIFT)>>1)) * count;
	  c2total += ((c2 << C2_SHIFT) + ((1<<C2_SHIFT)>>1)) * count;
	}
      }
    }
  
  cinfo->colormap[0][icolor] = (JSAMPLE) ((c0total + (total>>1)) / total);
  cinfo->colormap[1][icolor] = (JSAMPLE) ((c1total + (total>>1)) / total);
  cinfo->colormap[2][icolor] = (JSAMPLE) ((c2total + (total>>1)) / total);
}


LOCAL(void)
select_colors (j_decompress_ptr cinfo, int desired_colors)
/* Master routine for color selection */
{
  boxptr boxlist;
  int numboxes;
  int i;

  /* Allocate workspace for box list */
  boxlist = (boxptr) (*cinfo->mem->alloc_small)
    ((j_common_ptr) cinfo, JPOOL_IMAGE, desired_colors * SIZEOF(box));
  /* Initialize one box containing whole space */
  numboxes = 1;
  boxlist[0].c0min = 0;
  boxlist[0].c0max = MAXJSAMPLE >> C0_SHIFT;
  boxlist[0].c1min = 0;
  boxlist[0].c1max = MAXJSAMPLE >> C1_SHIFT;
  boxlist[0].c2min = 0;
  boxlist[0].c2max = MAXJSAMPLE >> C2_SHIFT;
  /* Shrink it to actually-used volume and set its statistics */
  update_box(cinfo, & boxlist[0]);
  /* Perform median-cut to produce final box list */
  numboxes = median_cut(cinfo, boxlist, numboxes, desired_colors);
  /* Compute the representative color for each box, fill colormap */
  for (i = 0; i < numboxes; i++)
    compute_color(cinfo, & boxlist[i], i);
  cinfo->actual_number_of_colors = numboxes;
  TRACEMS1(cinfo, 1, JTRC_QUANT_SELECTED, numboxes);
}


/*
 * These routines are concerned with the time-critical task of mapping input
 * colors to the nearest color in the selected colormap.
 *
 * We re-use the histogram space as an "inverse color map", essentially a
 * cache for the results of nearest-color searches.  All colors within a
 * histogram cell will be mapped to the same colormap entry, namely the one
 * closest to the cell's center.  This may not be quite the closest entry to
 * the actual input color, but it's almost as good.  A zero in the cache
 * indicates we haven't found the nearest color for that cell yet; the array
 * is cleared to zeroes before starting the mapping pass.  When we find the
 * nearest color for a cell, its colormap index plus one is recorded in the
 * cache for future use.  The pass2 scanning routines call fill_inverse_cmap
 * when they need to use an unfilled entry in the cache.
 *
 * Our method of efficiently finding nearest colors is based on the "locally
 * sorted search" idea described by Heckbert and on the incremental distance
 * calculation described by Spencer W. Thomas in chapter III.1 of Graphics
 * Gems II (James Arvo, ed.  Academic Press, 1991).  Thomas points out that
 * the distances from a given colormap entry to each cell of the histogram can
 * be computed quickly using an incremental method: the differences between
 * distances to adjacent cells themselves differ by a constant.  This allows a
 * fairly fast implementation of the "brute force" approach of computing the
 * distance from every colormap entry to every histogram cell.  Unfortunately,
 * it needs a work array to hold the best-distance-so-far for each histogram
 * cell (because the inner loop has to be over cells, not colormap entries).
 * The work array elements have to be INT32s, so the work array would need
 * 256Kb at our recommended precision.  This is not feasible in DOS machines.
 *
 * To get around these problems, we apply Thomas' method to compute the
 * nearest colors for only the cells within a small subbox of the histogram.
 * The work array need be only as big as the subbox, so the memory usage
 * problem is solved.  Furthermore, we need not fill subboxes that are never
 * referenced in pass2; many images use only part of the color gamut, so a
 * fair amount of work is saved.  An additional advantage of this
 * approach is that we can apply Heckbert's locality criterion to quickly
 * eliminate colormap entries that are far away from the subbox; typically
 * three-fourths of the colormap entries are rejected by Heckbert's criterion,
 * and we need not compute their distances to individual cells in the subbox.
 * The speed of this approach is heavily influenced by the subbox size: too
 * small means too much overhead, too big loses because Heckbert's criterion
 * can't eliminate as many colormap entries.  Empirically the best subbox
 * size seems to be about 1/512th of the histogram (1/8th in each direction).
 *
 * Thomas' article also describes a refined method which is asymptotically
 * faster than the brute-force method, but it is also far more complex and
 * cannot efficiently be applied to small subboxes.  It is therefore not
 * useful for programs intended to be portable to DOS machines.  On machines
 * with plenty of memory, filling the whole histogram in one shot with Thomas'
 * refined method might be faster than the present code --- but then again,
 * it might not be any faster, and it's certainly more complicated.
 */


/* log2(histogram cells in update box) for each axis; this can be adjusted */
#define BOX_C0_LOG  (HIST_C0_BITS-3)
#define BOX_C1_LOG  (HIST_C1_BITS-3)
#define BOX_C2_LOG  (HIST_C2_BITS-3)

#define BOX_C0_ELEMS  (1<<BOX_C0_LOG) /* # of hist cells in update box */
#define BOX_C1_ELEMS  (1<<BOX_C1_LOG)
#define BOX_C2_ELEMS  (1<<BOX_C2_LOG)

#define BOX_C0_SHIFT  (C0_SHIFT + BOX_C0_LOG)
#define BOX_C1_SHIFT  (C1_SHIFT + BOX_C1_LOG)
#define BOX_C2_SHIFT  (C2_SHIFT + BOX_C2_LOG)


/*
 * The next three routines implement inverse colormap filling.  They could
 * all be folded into one big routine, but splitting them up this way saves
 * some stack space (the mindist[] and bestdist[] arrays need not coexist)
 * and may allow some compilers to produce better code by registerizing more
 * inner-loop variables.
 */

LOCAL(int)
find_nearby_colors (j_decompress_ptr cinfo, int minc0, int minc1, int minc2,
		    JSAMPLE colorlist[])
/* Locate the colormap entries close enough to an update box to be candidates
 * for the nearest entry to some cell(s) in the update box.  The update box
 * is specified by the center coordinates of its first cell.  The number of
 * candidate colormap entries is returned, and their colormap indexes are
 * placed in colorlist[].
 * This routine uses Heckbert's "locally sorted search" criterion to select
 * the colors that need further consideration.
 */
{

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
2欧美一区二区三区在线观看视频 337p粉嫩大胆噜噜噜噜噜91av | 欧美在线播放高清精品| 色综合久久天天| 欧美日韩国产首页| 久久一夜天堂av一区二区三区| 亚洲精品一线二线三线无人区| 国产精品人妖ts系列视频| 亚洲精品高清在线| 久久er精品视频| 91色综合久久久久婷婷| 在线播放亚洲一区| 欧美韩国一区二区| 五月天一区二区三区| 国产综合一区二区| 色一区在线观看| 日韩美一区二区三区| 国产精品色一区二区三区| 亚洲成av人片| 成人免费av网站| 欧美精品1区2区3区| 久久影院电视剧免费观看| 一区二区三区**美女毛片| 久久精品国内一区二区三区| 91麻豆国产福利在线观看| 日韩欧美国产一区二区在线播放| 国产精品乱码一区二区三区软件| 五月婷婷色综合| 不卡一区二区中文字幕| 日韩三级在线免费观看| 1024成人网| 国产一区二区在线免费观看| 欧美日韩中文国产| 欧美激情一区三区| 久久精品国产网站| 欧美三级蜜桃2在线观看| 国产嫩草影院久久久久| 蜜臂av日日欢夜夜爽一区| 一本色道久久综合亚洲aⅴ蜜桃| 欧美一级视频精品观看| 一级日本不卡的影视| 成人综合婷婷国产精品久久蜜臀| 欧美一区二区黄色| 亚洲一区在线观看视频| 国产精品一级黄| 日韩欧美一二三区| 三级久久三级久久久| 欧洲人成人精品| 国产精品国产三级国产普通话99| 六月婷婷色综合| 欧美一区二区视频免费观看| 亚洲综合男人的天堂| 99久久免费视频.com| 国产拍揄自揄精品视频麻豆| 国内成人自拍视频| 日韩欧美一级二级三级久久久| 五月天国产精品| 欧美日本一道本| 亚洲电影你懂得| 91久久精品一区二区| 亚洲婷婷国产精品电影人久久| 国产精品中文欧美| 久久久久99精品国产片| 国产精品亚洲视频| 国产色91在线| 国产乱色国产精品免费视频| 精品区一区二区| 久久av资源网| 久久理论电影网| 国产精品一线二线三线精华| 26uuu国产电影一区二区| 国内精品国产成人国产三级粉色 | 久久99国产精品久久99| 欧美一区二区三区四区五区| 日韩精品福利网| 7777精品伊人久久久大香线蕉| 日韩精品视频网| 欧美一区二区三区视频在线| 老司机免费视频一区二区| 欧美tickling网站挠脚心| 国产精品一二三四区| 国产女人aaa级久久久级| bt欧美亚洲午夜电影天堂| 亚洲婷婷综合久久一本伊一区| 日本高清不卡视频| 亚洲高清视频中文字幕| 欧美一区二区三区视频| 国产在线视频一区二区| 欧美精彩视频一区二区三区| 北条麻妃一区二区三区| 亚洲欧美日韩综合aⅴ视频| 在线亚洲欧美专区二区| 日韩电影在线观看电影| 欧美xxxxx牲另类人与| 国产不卡视频一区二区三区| 亚洲图片欧美激情| 欧美精品国产精品| 精品亚洲porn| 亚洲视频中文字幕| 欧美精品v日韩精品v韩国精品v| 免费一级片91| 国产精品嫩草影院com| 在线亚洲免费视频| 紧缚奴在线一区二区三区| 国产精品久久久久久久久免费相片| 91同城在线观看| 日本美女一区二区| 国产偷国产偷精品高清尤物| 色综合天天综合网天天看片| 视频在线观看国产精品| 久久精品人人爽人人爽| 色婷婷综合中文久久一本| 天天做天天摸天天爽国产一区 | 日韩一区二区精品在线观看| 久久se精品一区精品二区| 精品国产凹凸成av人导航| 成人性生交大片免费看中文 | 欧美日韩国产综合视频在线观看 | 欧美日韩中文国产| 久久精品国产77777蜜臀| 国产精品不卡在线观看| 欧美日韩中文另类| 处破女av一区二区| 亚洲国产精品一区二区久久恐怖片 | 欧美高清视频一二三区| 热久久一区二区| 久久久精品免费免费| 欧美艳星brazzers| 精品系列免费在线观看| 亚洲男女一区二区三区| 欧美一级在线免费| 91香蕉国产在线观看软件| 天天免费综合色| 亚洲欧美日韩在线播放| 欧美大片日本大片免费观看| 不卡电影免费在线播放一区| 免费成人美女在线观看.| 国产精品国产三级国产aⅴ无密码| 欧美一区午夜精品| 成人黄页毛片网站| 另类小说视频一区二区| 亚洲一区二区视频在线| 久久综合九色综合97_久久久| 91麻豆swag| 国产综合色在线视频区| 日韩在线播放一区二区| 国产精品女人毛片| 久久夜色精品国产欧美乱极品| 在线视频一区二区免费| 成人性色生活片免费看爆迷你毛片| 日韩中文欧美在线| 亚洲日本一区二区| 国产欧美综合在线| 91精品欧美综合在线观看最新| 色综合久久久久综合体| 黑人精品欧美一区二区蜜桃 | 色欧美乱欧美15图片| 国产一区二区三区精品欧美日韩一区二区三区| 亚洲国产毛片aaaaa无费看| 日韩欧美专区在线| 欧美色视频一区| 色婷婷一区二区| 国产精品白丝jk白祙喷水网站| 免费黄网站欧美| 亚洲精品免费电影| 亚洲欧美在线视频| 日韩三级在线免费观看| 制服丝袜中文字幕一区| 欧美日韩美少妇| 色综合久久中文综合久久牛| 成人激情免费电影网址| 激情久久五月天| 国产在线不卡一区| 精品一区二区久久| 日日噜噜夜夜狠狠视频欧美人| 亚洲高清不卡在线| 依依成人精品视频| 亚洲免费在线视频一区 二区| 最好看的中文字幕久久| 欧美国产激情一区二区三区蜜月| 精品国产一区二区三区av性色| 欧美日韩精品福利| 91精品综合久久久久久| 欧美视频在线观看一区二区| 91久久精品一区二区三| 成人在线视频一区| aaa欧美色吧激情视频| 色中色一区二区| 99国产精品一区| 日本黄色一区二区| 色综合天天综合狠狠| 99re这里都是精品| 91影视在线播放| 91麻豆蜜桃一区二区三区| 91蝌蚪porny| 色综合久久88色综合天天6 | 亚洲男人天堂一区| 国产精品乱子久久久久| 国产精品久久久久久一区二区三区| 亚洲欧美激情小说另类| 综合欧美亚洲日本|