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

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

?? jquant2.c

?? 一款最完整的工業(yè)組態(tài)軟源代碼
?? C
?? 第 1 頁(yè) / 共 4 頁(yè)
字號(hào):
  int numcolors = cinfo->actual_number_of_colors;
  int maxc0, maxc1, maxc2;
  int centerc0, centerc1, centerc2;
  int i, x, ncolors;
  INT32 minmaxdist, min_dist, max_dist, tdist;
  INT32 mindist[MAXNUMCOLORS];	/* min distance to colormap entry i */

  /* Compute true coordinates of update box's upper corner and center.
   * Actually we compute the coordinates of the center of the upper-corner
   * histogram cell, which are the upper bounds of the volume we care about.
   * Note that since ">>" rounds down, the "center" values may be closer to
   * min than to max; hence comparisons to them must be "<=", not "<".
   */
  maxc0 = minc0 + ((1 << BOX_C0_SHIFT) - (1 << C0_SHIFT));
  centerc0 = (minc0 + maxc0) >> 1;
  maxc1 = minc1 + ((1 << BOX_C1_SHIFT) - (1 << C1_SHIFT));
  centerc1 = (minc1 + maxc1) >> 1;
  maxc2 = minc2 + ((1 << BOX_C2_SHIFT) - (1 << C2_SHIFT));
  centerc2 = (minc2 + maxc2) >> 1;

  /* For each color in colormap, find:
   *  1. its minimum squared-distance to any point in the update box
   *     (zero if color is within update box);
   *  2. its maximum squared-distance to any point in the update box.
   * Both of these can be found by considering only the corners of the box.
   * We save the minimum distance for each color in mindist[];
   * only the smallest maximum distance is of interest.
   */
  minmaxdist = 0x7FFFFFFFL;

  for (i = 0; i < numcolors; i++) {
    /* We compute the squared-c0-distance term, then add in the other two. */
    x = GETJSAMPLE(cinfo->colormap[0][i]);
    if (x < minc0) {
      tdist = (x - minc0) * C0_SCALE;
      min_dist = tdist*tdist;
      tdist = (x - maxc0) * C0_SCALE;
      max_dist = tdist*tdist;
    } else if (x > maxc0) {
      tdist = (x - maxc0) * C0_SCALE;
      min_dist = tdist*tdist;
      tdist = (x - minc0) * C0_SCALE;
      max_dist = tdist*tdist;
    } else {
      /* within cell range so no contribution to min_dist */
      min_dist = 0;
      if (x <= centerc0) {
	tdist = (x - maxc0) * C0_SCALE;
	max_dist = tdist*tdist;
      } else {
	tdist = (x - minc0) * C0_SCALE;
	max_dist = tdist*tdist;
      }
    }

    x = GETJSAMPLE(cinfo->colormap[1][i]);
    if (x < minc1) {
      tdist = (x - minc1) * C1_SCALE;
      min_dist += tdist*tdist;
      tdist = (x - maxc1) * C1_SCALE;
      max_dist += tdist*tdist;
    } else if (x > maxc1) {
      tdist = (x - maxc1) * C1_SCALE;
      min_dist += tdist*tdist;
      tdist = (x - minc1) * C1_SCALE;
      max_dist += tdist*tdist;
    } else {
      /* within cell range so no contribution to min_dist */
      if (x <= centerc1) {
	tdist = (x - maxc1) * C1_SCALE;
	max_dist += tdist*tdist;
      } else {
	tdist = (x - minc1) * C1_SCALE;
	max_dist += tdist*tdist;
      }
    }

    x = GETJSAMPLE(cinfo->colormap[2][i]);
    if (x < minc2) {
      tdist = (x - minc2) * C2_SCALE;
      min_dist += tdist*tdist;
      tdist = (x - maxc2) * C2_SCALE;
      max_dist += tdist*tdist;
    } else if (x > maxc2) {
      tdist = (x - maxc2) * C2_SCALE;
      min_dist += tdist*tdist;
      tdist = (x - minc2) * C2_SCALE;
      max_dist += tdist*tdist;
    } else {
      /* within cell range so no contribution to min_dist */
      if (x <= centerc2) {
	tdist = (x - maxc2) * C2_SCALE;
	max_dist += tdist*tdist;
      } else {
	tdist = (x - minc2) * C2_SCALE;
	max_dist += tdist*tdist;
      }
    }

    mindist[i] = min_dist;	/* save away the results */
    if (max_dist < minmaxdist)
      minmaxdist = max_dist;
  }

  /* Now we know that no cell in the update box is more than minmaxdist
   * away from some colormap entry.  Therefore, only colors that are
   * within minmaxdist of some part of the box need be considered.
   */
  ncolors = 0;
  for (i = 0; i < numcolors; i++) {
    if (mindist[i] <= minmaxdist)
      colorlist[ncolors++] = (JSAMPLE) i;
  }
  return ncolors;
}


LOCAL(void)
find_best_colors (j_decompress_ptr cinfo, int minc0, int minc1, int minc2,
		  int numcolors, JSAMPLE colorlist[], JSAMPLE bestcolor[])
/* Find the closest colormap entry for each cell in the update box,
 * given the list of candidate colors prepared by find_nearby_colors.
 * Return the indexes of the closest entries in the bestcolor[] array.
 * This routine uses Thomas' incremental distance calculation method to
 * find the distance from a colormap entry to successive cells in the box.
 */
{
  int ic0, ic1, ic2;
  int i, icolor;
  register INT32 * bptr;	/* pointer into bestdist[] array */
  JSAMPLE * cptr;		/* pointer into bestcolor[] array */
  INT32 dist0, dist1;		/* initial distance values */
  register INT32 dist2;		/* current distance in inner loop */
  INT32 xx0, xx1;		/* distance increments */
  register INT32 xx2;
  INT32 inc0, inc1, inc2;	/* initial values for increments */
  /* This array holds the distance to the nearest-so-far color for each cell */
  INT32 bestdist[BOX_C0_ELEMS * BOX_C1_ELEMS * BOX_C2_ELEMS];

  /* Initialize best-distance for each cell of the update box */
  bptr = bestdist;
  for (i = BOX_C0_ELEMS*BOX_C1_ELEMS*BOX_C2_ELEMS-1; i >= 0; i--)
    *bptr++ = 0x7FFFFFFFL;
  
  /* For each color selected by find_nearby_colors,
   * compute its distance to the center of each cell in the box.
   * If that's less than best-so-far, update best distance and color number.
   */
  
  /* Nominal steps between cell centers ("x" in Thomas article) */
#define STEP_C0  ((1 << C0_SHIFT) * C0_SCALE)
#define STEP_C1  ((1 << C1_SHIFT) * C1_SCALE)
#define STEP_C2  ((1 << C2_SHIFT) * C2_SCALE)
  
  for (i = 0; i < numcolors; i++) {
    icolor = GETJSAMPLE(colorlist[i]);
    /* Compute (square of) distance from minc0/c1/c2 to this color */
    inc0 = (minc0 - GETJSAMPLE(cinfo->colormap[0][icolor])) * C0_SCALE;
    dist0 = inc0*inc0;
    inc1 = (minc1 - GETJSAMPLE(cinfo->colormap[1][icolor])) * C1_SCALE;
    dist0 += inc1*inc1;
    inc2 = (minc2 - GETJSAMPLE(cinfo->colormap[2][icolor])) * C2_SCALE;
    dist0 += inc2*inc2;
    /* Form the initial difference increments */
    inc0 = inc0 * (2 * STEP_C0) + STEP_C0 * STEP_C0;
    inc1 = inc1 * (2 * STEP_C1) + STEP_C1 * STEP_C1;
    inc2 = inc2 * (2 * STEP_C2) + STEP_C2 * STEP_C2;
    /* Now loop over all cells in box, updating distance per Thomas method */
    bptr = bestdist;
    cptr = bestcolor;
    xx0 = inc0;
    for (ic0 = BOX_C0_ELEMS-1; ic0 >= 0; ic0--) {
      dist1 = dist0;
      xx1 = inc1;
      for (ic1 = BOX_C1_ELEMS-1; ic1 >= 0; ic1--) {
	dist2 = dist1;
	xx2 = inc2;
	for (ic2 = BOX_C2_ELEMS-1; ic2 >= 0; ic2--) {
	  if (dist2 < *bptr) {
	    *bptr = dist2;
	    *cptr = (JSAMPLE) icolor;
	  }
	  dist2 += xx2;
	  xx2 += 2 * STEP_C2 * STEP_C2;
	  bptr++;
	  cptr++;
	}
	dist1 += xx1;
	xx1 += 2 * STEP_C1 * STEP_C1;
      }
      dist0 += xx0;
      xx0 += 2 * STEP_C0 * STEP_C0;
    }
  }
}


LOCAL(void)
fill_inverse_cmap (j_decompress_ptr cinfo, int c0, int c1, int c2)
/* Fill the inverse-colormap entries in the update box that contains */
/* histogram cell c0/c1/c2.  (Only that one cell MUST be filled, but */
/* we can fill as many others as we wish.) */
{
  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
  hist3d histogram = cquantize->histogram;
  int minc0, minc1, minc2;	/* lower left corner of update box */
  int ic0, ic1, ic2;
  register JSAMPLE * cptr;	/* pointer into bestcolor[] array */
  register histptr cachep;	/* pointer into main cache array */
  /* This array lists the candidate colormap indexes. */
  JSAMPLE colorlist[MAXNUMCOLORS];
  int numcolors;		/* number of candidate colors */
  /* This array holds the actually closest colormap index for each cell. */
  JSAMPLE bestcolor[BOX_C0_ELEMS * BOX_C1_ELEMS * BOX_C2_ELEMS];

  /* Convert cell coordinates to update box ID */
  c0 >>= BOX_C0_LOG;
  c1 >>= BOX_C1_LOG;
  c2 >>= BOX_C2_LOG;

  /* Compute true coordinates of update box's origin corner.
   * Actually we compute the coordinates of the center of the corner
   * histogram cell, which are the lower bounds of the volume we care about.
   */
  minc0 = (c0 << BOX_C0_SHIFT) + ((1 << C0_SHIFT) >> 1);
  minc1 = (c1 << BOX_C1_SHIFT) + ((1 << C1_SHIFT) >> 1);
  minc2 = (c2 << BOX_C2_SHIFT) + ((1 << C2_SHIFT) >> 1);
  
  /* Determine which colormap entries are close enough to be candidates
   * for the nearest entry to some cell in the update box.
   */
  numcolors = find_nearby_colors(cinfo, minc0, minc1, minc2, colorlist);

  /* Determine the actually nearest colors. */
  find_best_colors(cinfo, minc0, minc1, minc2, numcolors, colorlist,
		   bestcolor);

  /* Save the best color numbers (plus 1) in the main cache array */
  c0 <<= BOX_C0_LOG;		/* convert ID back to base cell indexes */
  c1 <<= BOX_C1_LOG;
  c2 <<= BOX_C2_LOG;
  cptr = bestcolor;
  for (ic0 = 0; ic0 < BOX_C0_ELEMS; ic0++) {
    for (ic1 = 0; ic1 < BOX_C1_ELEMS; ic1++) {
      cachep = & histogram[c0+ic0][c1+ic1][c2];
      for (ic2 = 0; ic2 < BOX_C2_ELEMS; ic2++) {
	*cachep++ = (histcell) (GETJSAMPLE(*cptr++) + 1);
      }
    }
  }
}


/*
 * Map some rows of pixels to the output colormapped representation.
 */

METHODDEF(void)
pass2_no_dither (j_decompress_ptr cinfo,
		 JSAMPARRAY input_buf, JSAMPARRAY output_buf, int num_rows)
/* This version performs no dithering */
{
  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
  hist3d histogram = cquantize->histogram;
  register JSAMPROW inptr, outptr;
  register histptr cachep;
  register int c0, c1, c2;
  int row;
  JDIMENSION col;
  JDIMENSION width = cinfo->output_width;

  for (row = 0; row < num_rows; row++) {
    inptr = input_buf[row];
    outptr = output_buf[row];
    for (col = width; col > 0; col--) {
      /* get pixel value and index into the cache */
      c0 = GETJSAMPLE(*inptr++) >> C0_SHIFT;
      c1 = GETJSAMPLE(*inptr++) >> C1_SHIFT;
      c2 = GETJSAMPLE(*inptr++) >> C2_SHIFT;
      cachep = & histogram[c0][c1][c2];
      /* If we have not seen this color before, find nearest colormap entry */
      /* and update the cache */
      if (*cachep == 0)
	fill_inverse_cmap(cinfo, c0,c1,c2);
      /* Now emit the colormap index for this cell */
      *outptr++ = (JSAMPLE) (*cachep - 1);
    }
  }
}


METHODDEF(void)
pass2_fs_dither (j_decompress_ptr cinfo,
		 JSAMPARRAY input_buf, JSAMPARRAY output_buf, int num_rows)
/* This version performs Floyd-Steinberg dithering */
{
  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
  hist3d histogram = cquantize->histogram;
  register LOCFSERROR cur0, cur1, cur2;	/* current error or pixel value */
  LOCFSERROR belowerr0, belowerr1, belowerr2; /* error for pixel below cur */
  LOCFSERROR bpreverr0, bpreverr1, bpreverr2; /* error for below/prev col */
  register FSERRPTR errorptr;	/* => fserrors[] at column before current */
  JSAMPROW inptr;		/* => current input pixel */
  JSAMPROW outptr;		/* => current output pixel */
  histptr cachep;
  int dir;			/* +1 or -1 depending on direction */
  int dir3;			/* 3*dir, for advancing inptr & errorptr */
  int row;
  JDIMENSION col;
  JDIMENSION width = cinfo->output_width;
  JSAMPLE *range_limit = cinfo->sample_range_limit;
  int *error_limit = cquantize->error_limiter;
  JSAMPROW colormap0 = cinfo->colormap[0];
  JSAMPROW colormap1 = cinfo->colormap[1];
  JSAMPROW colormap2 = cinfo->colormap[2];
  SHIFT_TEMPS

  for (row = 0; row < num_rows; row++) {
    inptr = input_buf[row];
    outptr = output_buf[row];
    if (cquantize->on_odd_row) {
      /* work right to left in this row */
      inptr += (width-1) * 3;	/* so point to rightmost pixel */
      outptr += width-1;
      dir = -1;
      dir3 = -3;
      errorptr = cquantize->fserrors + (width+1)*3; /* => entry after last column */
      cquantize->on_odd_row = FALSE; /* flip for next time */

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久国产福利国产秒拍| 欧美日韩一区二区三区不卡| 久久99这里只有精品| 日韩成人一级大片| 偷拍日韩校园综合在线| 亚洲成在人线免费| 香蕉久久一区二区不卡无毒影院| 亚洲福利一区二区| 亚洲成人你懂的| 日韩激情一二三区| 蜜桃视频一区二区| 韩国三级在线一区| 国产精品99久久久久| 国产电影一区二区三区| 丁香激情综合国产| 99re免费视频精品全部| 在线精品视频免费观看| 欧美视频自拍偷拍| 91精品国产一区二区人妖| 日韩免费高清视频| 久久久精品一品道一区| 国产精品毛片久久久久久| 亚洲三级视频在线观看| 亚洲一区二区三区精品在线| 午夜精品久久久久久久99水蜜桃| 日韩精品电影在线观看| 国产一区二区免费在线| 99在线精品视频| 欧美午夜不卡在线观看免费| 91精品婷婷国产综合久久 | 欧美一区二区在线不卡| 日韩精品一区二区三区在线 | 欧美大度的电影原声| 欧美激情综合在线| 一区二区三区精品久久久| 天天综合色天天| 国内精品久久久久影院色| av中文字幕不卡| 欧美日韩国产电影| 久久午夜老司机| 亚洲精品久久久蜜桃| 免费欧美高清视频| 成人黄色免费短视频| 欧美日韩一区二区不卡| 久久久一区二区三区捆绑**| 亚洲人一二三区| 免费观看成人av| av激情综合网| 日韩亚洲欧美一区二区三区| 国产精品久久毛片| 免费高清视频精品| 91麻豆国产福利在线观看| 91精品黄色片免费大全| 国产精品二区一区二区aⅴ污介绍| 首页欧美精品中文字幕| 风间由美中文字幕在线看视频国产欧美| 99视频一区二区| 日韩欧美国产三级电影视频| 一区二区三区在线播放| 91老司机福利 在线| 777奇米成人网| 亚洲欧洲另类国产综合| 日韩成人精品在线观看| 9色porny自拍视频一区二区| 精品国产青草久久久久福利| 一区二区久久久久| 国产成人鲁色资源国产91色综| 91久久精品国产91性色tv| 久久精品人人做人人爽人人| 亚洲sss视频在线视频| 成人av在线资源网站| 精品乱人伦一区二区三区| 五月综合激情日本mⅴ| www.欧美日韩国产在线| 2023国产一二三区日本精品2022| 亚洲图片一区二区| 92国产精品观看| 国产农村妇女毛片精品久久麻豆 | 久久综合九色综合97婷婷女人 | 成人免费视频视频| 精品国产伦理网| 日韩av在线播放中文字幕| 成人午夜激情视频| 久久中文字幕电影| 麻豆成人久久精品二区三区小说| 欧洲一区在线电影| 亚洲视频在线一区观看| 国产精品资源网站| 精品成人a区在线观看| 免费日本视频一区| 6080国产精品一区二区| 亚洲最大成人网4388xx| 99视频精品在线| 久久久久成人黄色影片| 精品一区二区三区的国产在线播放| 欧美揉bbbbb揉bbbbb| 亚洲激情男女视频| 一本一道综合狠狠老| 国产一区二区三区黄视频| 337p粉嫩大胆噜噜噜噜噜91av| 日韩高清电影一区| 欧美久久久久久久久久| 亚洲bdsm女犯bdsm网站| 欧美午夜精品一区| 午夜精品久久久久久久久久久| 欧美日韩精品系列| 日本伊人精品一区二区三区观看方式| 在线免费观看日本欧美| 一区二区三区**美女毛片| 91久久免费观看| 亚洲高清中文字幕| 欧美四级电影在线观看| 日韩不卡一区二区| 日韩一区二区三区免费看| 精品制服美女久久| 日韩午夜三级在线| 国产在线国偷精品免费看| 久久久久久9999| 成人激情av网| 亚洲欧美色图小说| 欧美日韩aaa| 蜜臀av性久久久久蜜臀av麻豆| 日韩亚洲电影在线| 国产伦精品一区二区三区免费迷 | 成人激情动漫在线观看| 18涩涩午夜精品.www| 欧美亚洲动漫制服丝袜| 亚洲成av人片一区二区| 日韩精品一区在线| 成人h精品动漫一区二区三区| 亚洲视频每日更新| 精品视频在线免费观看| 麻豆91精品视频| 国产亚洲自拍一区| 一本色道久久综合狠狠躁的推荐 | 日韩vs国产vs欧美| 久久免费国产精品| 91视频在线看| 日本亚洲三级在线| 国产网红主播福利一区二区| 97久久精品人人澡人人爽| 午夜精品久久久| 久久免费国产精品| 欧美性猛片xxxx免费看久爱| 免费在线观看成人| 亚洲欧洲日韩在线| 911国产精品| 福利电影一区二区三区| 亚洲va欧美va人人爽午夜| 亚洲精品一区二区三区蜜桃下载| 99久久婷婷国产综合精品电影 | 99久久精品免费精品国产| 亚洲电影中文字幕在线观看| 久久综合一区二区| 色婷婷av一区| 国产麻豆精品95视频| 亚洲高清三级视频| 国产精品欧美经典| 5566中文字幕一区二区电影| av在线播放一区二区三区| 日本三级亚洲精品| 亚洲人成伊人成综合网小说| 日韩久久久久久| 在线免费一区三区| 国产精品一线二线三线精华| 亚洲午夜久久久久| 日本一区二区高清| 在线播放视频一区| 99久久99久久精品免费观看| 精品一区二区三区在线观看国产 | 99视频一区二区| 韩日av一区二区| 日韩电影在线免费看| 亚洲视频免费在线| 国产欧美日韩在线看| 日韩一级欧美一级| 欧洲另类一二三四区| 成人黄色电影在线| 国内不卡的二区三区中文字幕| 亚洲国产精品天堂| 17c精品麻豆一区二区免费| 久久九九国产精品| 精品国产免费人成在线观看| 91国偷自产一区二区开放时间 | 国产精品一二一区| 奇米精品一区二区三区四区| 伊人婷婷欧美激情| 综合精品久久久| 国产精品久久久久一区二区三区| 精品久久久久一区二区国产| 91精品国产入口| 欧美久久久久免费| 欧美日韩视频在线观看一区二区三区 | 精品国产乱码久久久久久闺蜜| 欧美精品自拍偷拍动漫精品| 欧美在线小视频| 色欲综合视频天天天| 91玉足脚交白嫩脚丫在线播放| 粉嫩蜜臀av国产精品网站| 国模无码大尺度一区二区三区|