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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? jquant1.c

?? WinCE開發技巧與實例的配套源碼
?? C
?? 第 1 頁 / 共 3 頁
字號:
	     cquantize->Ncolors[1], cquantize->Ncolors[2]);
  else
    TRACEMS1(cinfo, 1, JTRC_QUANT_NCOLORS, total_colors);

  /* Allocate and fill in the colormap. */
  /* The colors are ordered in the map in standard row-major order, */
  /* i.e. rightmost (highest-indexed) color changes most rapidly. */

  colormap = (*cinfo->mem->alloc_sarray)
    ((j_common_ptr) cinfo, JPOOL_IMAGE,
     (JDIMENSION) total_colors, (JDIMENSION) cinfo->out_color_components);

  /* blksize is number of adjacent repeated entries for a component */
  /* blkdist is distance between groups of identical entries for a component */
  blkdist = total_colors;

  for (i = 0; i < cinfo->out_color_components; i++) {
    /* fill in colormap entries for i'th color component */
    nci = cquantize->Ncolors[i]; /* # of distinct values for this color */
    blksize = blkdist / nci;
    for (j = 0; j < nci; j++) {
      /* Compute j'th output value (out of nci) for component */
      val = output_value(cinfo, i, j, nci-1);
      /* Fill in all colormap entries that have this value of this component */
      for (ptr = j * blksize; ptr < total_colors; ptr += blkdist) {
	/* fill in blksize entries beginning at ptr */
	for (k = 0; k < blksize; k++)
	  colormap[i][ptr+k] = (JSAMPLE) val;
      }
    }
    blkdist = blksize;		/* blksize of this color is blkdist of next */
  }

  /* Save the colormap in private storage,
   * where it will survive color quantization mode changes.
   */
  cquantize->sv_colormap = colormap;
  cquantize->sv_actual = total_colors;
}


/*
 * Create the color index table.
 */

LOCAL(void)
create_colorindex (j_decompress_ptr cinfo)
{
  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
  JSAMPROW indexptr;
  int i,j,k, nci, blksize, val, pad;

  /* For ordered dither, we pad the color index tables by MAXJSAMPLE in
   * each direction (input index values can be -MAXJSAMPLE .. 2*MAXJSAMPLE).
   * This is not necessary in the other dithering modes.  However, we
   * flag whether it was done in case user changes dithering mode.
   */
  if (cinfo->dither_mode == JDITHER_ORDERED) {
    pad = MAXJSAMPLE*2;
    cquantize->is_padded = TRUE;
  } else {
    pad = 0;
    cquantize->is_padded = FALSE;
  }

  cquantize->colorindex = (*cinfo->mem->alloc_sarray)
    ((j_common_ptr) cinfo, JPOOL_IMAGE,
     (JDIMENSION) (MAXJSAMPLE+1 + pad),
     (JDIMENSION) cinfo->out_color_components);

  /* blksize is number of adjacent repeated entries for a component */
  blksize = cquantize->sv_actual;

  for (i = 0; i < cinfo->out_color_components; i++) {
    /* fill in colorindex entries for i'th color component */
    nci = cquantize->Ncolors[i]; /* # of distinct values for this color */
    blksize = blksize / nci;

    /* adjust colorindex pointers to provide padding at negative indexes. */
    if (pad)
      cquantize->colorindex[i] += MAXJSAMPLE;

    /* in loop, val = index of current output value, */
    /* and k = largest j that maps to current val */
    indexptr = cquantize->colorindex[i];
    val = 0;
    k = largest_input_value(cinfo, i, 0, nci-1);
    for (j = 0; j <= MAXJSAMPLE; j++) {
      while (j > k)		/* advance val if past boundary */
	k = largest_input_value(cinfo, i, ++val, nci-1);
      /* premultiply so that no multiplication needed in main processing */
      indexptr[j] = (JSAMPLE) (val * blksize);
    }
    /* Pad at both ends if necessary */
    if (pad)
      for (j = 1; j <= MAXJSAMPLE; j++) {
	indexptr[-j] = indexptr[0];
	indexptr[MAXJSAMPLE+j] = indexptr[MAXJSAMPLE];
      }
  }
}


/*
 * Create an ordered-dither array for a component having ncolors
 * distinct output values.
 */

LOCAL(ODITHER_MATRIX_PTR)
make_odither_array (j_decompress_ptr cinfo, int ncolors)
{
  ODITHER_MATRIX_PTR odither;
  int j,k;
  INT32 num,den;

  odither = (ODITHER_MATRIX_PTR)
    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
				SIZEOF(ODITHER_MATRIX));
  /* The inter-value distance for this color is MAXJSAMPLE/(ncolors-1).
   * Hence the dither value for the matrix cell with fill order f
   * (f=0..N-1) should be (N-1-2*f)/(2*N) * MAXJSAMPLE/(ncolors-1).
   * On 16-bit-int machine, be careful to avoid overflow.
   */
  den = 2 * ODITHER_CELLS * ((INT32) (ncolors - 1));
  for (j = 0; j < ODITHER_SIZE; j++) {
    for (k = 0; k < ODITHER_SIZE; k++) {
      num = ((INT32) (ODITHER_CELLS-1 - 2*((int)base_dither_matrix[j][k])))
	    * MAXJSAMPLE;
      /* Ensure round towards zero despite C's lack of consistency
       * about rounding negative values in integer division...
       */
      odither[j][k] = (int) (num<0 ? -((-num)/den) : num/den);
    }
  }
  return odither;
}


/*
 * Create the ordered-dither tables.
 * Components having the same number of representative colors may 
 * share a dither table.
 */

LOCAL(void)
create_odither_tables (j_decompress_ptr cinfo)
{
  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
  ODITHER_MATRIX_PTR odither;
  int i, j, nci;

  for (i = 0; i < cinfo->out_color_components; i++) {
    nci = cquantize->Ncolors[i]; /* # of distinct values for this color */
    odither = NULL;		/* search for matching prior component */
    for (j = 0; j < i; j++) {
      if (nci == cquantize->Ncolors[j]) {
	odither = cquantize->odither[j];
	break;
      }
    }
    if (odither == NULL)	/* need a new table? */
      odither = make_odither_array(cinfo, nci);
    cquantize->odither[i] = odither;
  }
}


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

METHODDEF(void)
color_quantize (j_decompress_ptr cinfo, JSAMPARRAY input_buf,
		JSAMPARRAY output_buf, int num_rows)
/* General case, no dithering */
{
  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
  JSAMPARRAY colorindex = cquantize->colorindex;
  register int pixcode, ci;
  register JSAMPROW ptrin, ptrout;
  int row;
  JDIMENSION col;
  JDIMENSION width = cinfo->output_width;
  register int nc = cinfo->out_color_components;

  for (row = 0; row < num_rows; row++) {
    ptrin = input_buf[row];
    ptrout = output_buf[row];
    for (col = width; col > 0; col--) {
      pixcode = 0;
      for (ci = 0; ci < nc; ci++) {
	pixcode += GETJSAMPLE(colorindex[ci][GETJSAMPLE(*ptrin++)]);
      }
      *ptrout++ = (JSAMPLE) pixcode;
    }
  }
}


METHODDEF(void)
color_quantize3 (j_decompress_ptr cinfo, JSAMPARRAY input_buf,
		 JSAMPARRAY output_buf, int num_rows)
/* Fast path for out_color_components==3, no dithering */
{
  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
  register int pixcode;
  register JSAMPROW ptrin, ptrout;
  JSAMPROW colorindex0 = cquantize->colorindex[0];
  JSAMPROW colorindex1 = cquantize->colorindex[1];
  JSAMPROW colorindex2 = cquantize->colorindex[2];
  int row;
  JDIMENSION col;
  JDIMENSION width = cinfo->output_width;

  for (row = 0; row < num_rows; row++) {
    ptrin = input_buf[row];
    ptrout = output_buf[row];
    for (col = width; col > 0; col--) {
      pixcode  = GETJSAMPLE(colorindex0[GETJSAMPLE(*ptrin++)]);
      pixcode += GETJSAMPLE(colorindex1[GETJSAMPLE(*ptrin++)]);
      pixcode += GETJSAMPLE(colorindex2[GETJSAMPLE(*ptrin++)]);
      *ptrout++ = (JSAMPLE) pixcode;
    }
  }
}


METHODDEF(void)
quantize_ord_dither (j_decompress_ptr cinfo, JSAMPARRAY input_buf,
		     JSAMPARRAY output_buf, int num_rows)
/* General case, with ordered dithering */
{
  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
  register JSAMPROW input_ptr;
  register JSAMPROW output_ptr;
  JSAMPROW colorindex_ci;
  int * dither;			/* points to active row of dither matrix */
  int row_index, col_index;	/* current indexes into dither matrix */
  int nc = cinfo->out_color_components;
  int ci;
  int row;
  JDIMENSION col;
  JDIMENSION width = cinfo->output_width;

  for (row = 0; row < num_rows; row++) {
    /* Initialize output values to 0 so can process components separately */
    jzero_far((void FAR *) output_buf[row],
	      (size_t) (width * SIZEOF(JSAMPLE)));
    row_index = cquantize->row_index;
    for (ci = 0; ci < nc; ci++) {
      input_ptr = input_buf[row] + ci;
      output_ptr = output_buf[row];
      colorindex_ci = cquantize->colorindex[ci];
      dither = cquantize->odither[ci][row_index];
      col_index = 0;

      for (col = width; col > 0; col--) {
	/* Form pixel value + dither, range-limit to 0..MAXJSAMPLE,
	 * select output value, accumulate into output code for this pixel.
	 * Range-limiting need not be done explicitly, as we have extended
	 * the colorindex table to produce the right answers for out-of-range
	 * inputs.  The maximum dither is +- MAXJSAMPLE; this sets the
	 * required amount of padding.
	 */
	*output_ptr += colorindex_ci[GETJSAMPLE(*input_ptr)+dither[col_index]];
	input_ptr += nc;
	output_ptr++;
	col_index = (col_index + 1) & ODITHER_MASK;
      }
    }
    /* Advance row index for next row */
    row_index = (row_index + 1) & ODITHER_MASK;
    cquantize->row_index = row_index;
  }
}


METHODDEF(void)
quantize3_ord_dither (j_decompress_ptr cinfo, JSAMPARRAY input_buf,
		      JSAMPARRAY output_buf, int num_rows)
/* Fast path for out_color_components==3, with ordered dithering */
{
  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
  register int pixcode;
  register JSAMPROW input_ptr;
  register JSAMPROW output_ptr;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
天天操天天干天天综合网| 国产欧美一区视频| 亚洲18女电影在线观看| 欧美浪妇xxxx高跟鞋交| 亚洲国产精品嫩草影院| 欧美欧美午夜aⅴ在线观看| 日韩福利电影在线| 26uuu国产日韩综合| 懂色av一区二区三区蜜臀 | 国产麻豆视频精品| 久久久午夜精品| 99国产精品久久久久| 亚洲在线一区二区三区| 欧美一区二区三区视频在线| 国产一区二区福利视频| 中文字幕在线不卡一区二区三区| 在线观看视频一区二区| 久久er精品视频| 中文字幕日韩一区| 欧美日韩高清一区二区三区| 经典三级视频一区| 1024国产精品| 欧美一区二区精品在线| 成人精品国产福利| 日韩二区在线观看| 国产精品嫩草久久久久| 欧美丰满嫩嫩电影| 东方欧美亚洲色图在线| 图片区日韩欧美亚洲| 国产精品免费人成网站| 欧美日韩国产综合视频在线观看 | 日韩综合一区二区| 久久蜜桃av一区精品变态类天堂 | 国产一区二区在线视频| 亚洲欧美一区二区久久| 亚洲精品一区二区三区影院 | 欧美一区二区三区在线观看 | 在线免费av一区| 韩国理伦片一区二区三区在线播放| 国产精品乱人伦一区二区| 69久久99精品久久久久婷婷| 99视频超级精品| 精品亚洲免费视频| 午夜视频久久久久久| 国产精品免费看片| 久久久噜噜噜久噜久久综合| 7777精品久久久大香线蕉| 99re免费视频精品全部| 国产在线不卡一卡二卡三卡四卡| 亚洲成精国产精品女| 国产精品麻豆视频| 亚洲精品一区二区三区精华液| 精品视频在线免费| 波多野结衣91| 国产69精品久久久久毛片| 蜜桃视频一区二区三区在线观看| 亚洲第一福利一区| 玉米视频成人免费看| 国产精品污www在线观看| 欧美不卡一区二区| 欧美一区二区美女| 7777精品伊人久久久大香线蕉完整版 | 91在线观看污| 高清国产午夜精品久久久久久| 免费观看一级欧美片| 午夜国产精品一区| 亚洲高清免费一级二级三级| 亚洲欧美激情小说另类| 国产精品久久久久久亚洲毛片| 国产日产精品一区| 久久久精品综合| 久久久高清一区二区三区| 精品国产99国产精品| 日韩一级二级三级| 日韩午夜精品视频| 欧美哺乳videos| 日韩女优电影在线观看| 日韩欧美成人一区| 精品成人佐山爱一区二区| 精品国产乱码久久久久久老虎| 久久亚洲捆绑美女| 国产亚洲欧美色| 国产精品色呦呦| 最近日韩中文字幕| 亚洲一区日韩精品中文字幕| 亚洲国产视频一区| 日韩精品一区第一页| 玖玖九九国产精品| 国产毛片一区二区| 91小视频免费看| 欧美日韩不卡视频| 欧美成人官网二区| 国产精品久久久久久一区二区三区 | 欧美一区二区黄| 日韩你懂的在线观看| 欧美成人女星排行榜| 欧美国产日本视频| 一区二区三区四区蜜桃| 视频一区视频二区中文字幕| 蜜乳av一区二区三区| 国产福利一区二区| 色噜噜狠狠色综合中国| 欧美精品丝袜久久久中文字幕| 精品乱人伦一区二区三区| 久久久国产精品午夜一区ai换脸| 亚洲人成小说网站色在线| 日韩电影网1区2区| 国产suv精品一区二区6| 欧美撒尿777hd撒尿| 日韩欧美资源站| 亚洲欧洲性图库| 日韩av一级电影| 国产成人亚洲精品青草天美| 91九色02白丝porn| 精品日产卡一卡二卡麻豆| 亚洲人成小说网站色在线| 蜜臀av在线播放一区二区三区| 国产裸体歌舞团一区二区| 91久久精品一区二区三区| 精品sm在线观看| 亚洲国产精品一区二区尤物区| 精品亚洲国产成人av制服丝袜| 色香色香欲天天天影视综合网| 日韩欧美区一区二| 一区二区三区日韩欧美| 极品少妇xxxx偷拍精品少妇| 色偷偷久久人人79超碰人人澡| 日韩欧美电影在线| 亚洲一区二区三区视频在线播放| 国产九色精品成人porny| 欧美日韩一区二区三区免费看| 国产性色一区二区| 日本亚洲视频在线| 一本到不卡免费一区二区| 久久夜色精品国产噜噜av| 亚洲3atv精品一区二区三区| av一本久道久久综合久久鬼色| 欧美一区午夜视频在线观看| 亚洲码国产岛国毛片在线| 国模冰冰炮一区二区| 欧美久久久久久蜜桃| 亚洲人成伊人成综合网小说| 国产高清精品网站| 欧美一二三区在线| 五月天亚洲精品| 在线视频国产一区| 亚洲私人黄色宅男| 成人综合日日夜夜| 久久蜜桃av一区二区天堂 | va亚洲va日韩不卡在线观看| 日韩视频免费观看高清完整版| 亚洲国产成人va在线观看天堂| av综合在线播放| 国产精品色噜噜| 国产成人av自拍| 久久久777精品电影网影网| 免费看日韩a级影片| 在线播放亚洲一区| 丝袜美腿亚洲色图| 91精品国产综合久久精品app| 亚洲午夜激情网页| 欧美日韩精品一区二区三区| 亚洲成va人在线观看| 欧美日韩亚洲综合在线 欧美亚洲特黄一级| 亚洲欧美一区二区三区孕妇| av中文字幕一区| 亚洲精品免费视频| 欧洲视频一区二区| 亚洲资源中文字幕| 欧美日韩国产一级| 日韩高清一级片| 欧美va亚洲va国产综合| 久久99国内精品| 久久久噜噜噜久噜久久综合| 国产成人av影院| **欧美大码日韩| 欧美日韩国产首页在线观看| 日日摸夜夜添夜夜添亚洲女人| 日韩一区和二区| 国产精品羞羞答答xxdd| 中文在线免费一区三区高中清不卡| 成人性色生活片| 亚洲伦理在线精品| 欧美日韩国产欧美日美国产精品| 五月天亚洲精品| 久久久激情视频| 色婷婷av一区二区三区软件| 亚洲电影一级黄| 亚洲精品一线二线三线| 91在线视频观看| 香蕉加勒比综合久久| 欧美成人精品3d动漫h| 成人黄色免费短视频| 亚洲国产精品一区二区久久恐怖片| 欧美疯狂性受xxxxx喷水图片| 国产精品一区一区| 一区二区成人在线| 精品日韩一区二区三区| 91丨九色porny丨蝌蚪| 热久久免费视频|