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

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

?? jccolor.c

?? About JPEG, executable on Visual C++
?? C
?? 第 1 頁 / 共 2 頁
字號:
////////////////////////////////////////////////////////////////////////
//
//	Note : this file is included as part of the Smaller Animals Software
//	JpegFile package. Though this file has not been modified from it's 
//	original IJG 6a form, it is not the responsibility on the Independent
//	JPEG Group to answer questions regarding this code.
//	
//	Any questions you have about this code should be addressed to :
//
//	CHRISDL@PAGESZ.NET	- the distributor of this package.
//
//	Remember, by including this code in the JpegFile package, Smaller 
//	Animals Software assumes all responsibilities for answering questions
//	about it. If we (SA Software) can't answer your questions ourselves, we 
//	will direct you to people who can.
//
//	Thanks, CDL.
//
////////////////////////////////////////////////////////////////////////
/*
 * jccolor.c
 *
 * Copyright (C) 1991-1996, Thomas G. Lane.
 * This file is part of the Independent JPEG Group's software.
 * For conditions of distribution and use, see the accompanying README file.
 *
 * This file contains input colorspace conversion routines.
 */

#define JPEG_INTERNALS
#include "jinclude.h"
#include "jpeglib.h"


/* Private subobject */

typedef struct {
  struct jpeg_color_converter pub; /* public fields */

  /* Private state for RGB->YCC conversion */
  INT32 * rgb_ycc_tab;		/* => table for RGB to YCbCr conversion */
} my_color_converter;

typedef my_color_converter * my_cconvert_ptr;


/**************** RGB -> YCbCr conversion: most common case **************/

/*
 * YCbCr is defined per CCIR 601-1, except that Cb and Cr are
 * normalized to the range 0..MAXJSAMPLE rather than -0.5 .. 0.5.
 * The conversion equations to be implemented are therefore
 *	Y  =  0.29900 * R + 0.58700 * G + 0.11400 * B
 *	Cb = -0.16874 * R - 0.33126 * G + 0.50000 * B  + CENTERJSAMPLE
 *	Cr =  0.50000 * R - 0.41869 * G - 0.08131 * B  + CENTERJSAMPLE
 * (These numbers are derived from TIFF 6.0 section 21, dated 3-June-92.)
 * Note: older versions of the IJG code used a zero offset of MAXJSAMPLE/2,
 * rather than CENTERJSAMPLE, for Cb and Cr.  This gave equal positive and
 * negative swings for Cb/Cr, but meant that grayscale values (Cb=Cr=0)
 * were not represented exactly.  Now we sacrifice exact representation of
 * maximum red and maximum blue in order to get exact grayscales.
 *
 * To avoid floating-point arithmetic, we represent the fractional constants
 * as integers scaled up by 2^16 (about 4 digits precision); we have to divide
 * the products by 2^16, with appropriate rounding, to get the correct answer.
 *
 * For even more speed, we avoid doing any multiplications in the inner loop
 * by precalculating the constants times R,G,B for all possible values.
 * For 8-bit JSAMPLEs this is very reasonable (only 256 entries per table);
 * for 12-bit samples it is still acceptable.  It's not very reasonable for
 * 16-bit samples, but if you want lossless storage you shouldn't be changing
 * colorspace anyway.
 * The CENTERJSAMPLE offsets and the rounding fudge-factor of 0.5 are included
 * in the tables to save adding them separately in the inner loop.
 */

#define SCALEBITS	16	/* speediest right-shift on some machines */
#define CBCR_OFFSET	((INT32) CENTERJSAMPLE << SCALEBITS)
#define ONE_HALF	((INT32) 1 << (SCALEBITS-1))
#define FIX(x)		((INT32) ((x) * (1L<<SCALEBITS) + 0.5))

/* We allocate one big table and divide it up into eight parts, instead of
 * doing eight alloc_small requests.  This lets us use a single table base
 * address, which can be held in a register in the inner loops on many
 * machines (more than can hold all eight addresses, anyway).
 */

#define R_Y_OFF		0			/* offset to R => Y section */
#define G_Y_OFF		(1*(MAXJSAMPLE+1))	/* offset to G => Y section */
#define B_Y_OFF		(2*(MAXJSAMPLE+1))	/* etc. */
#define R_CB_OFF	(3*(MAXJSAMPLE+1))
#define G_CB_OFF	(4*(MAXJSAMPLE+1))
#define B_CB_OFF	(5*(MAXJSAMPLE+1))
#define R_CR_OFF	B_CB_OFF		/* B=>Cb, R=>Cr are the same */
#define G_CR_OFF	(6*(MAXJSAMPLE+1))
#define B_CR_OFF	(7*(MAXJSAMPLE+1))
#define TABLE_SIZE	(8*(MAXJSAMPLE+1))


/*
 * Initialize for RGB->YCC colorspace conversion.
 */

METHODDEF(void)
rgb_ycc_start (j_compress_ptr cinfo)
{
  my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;
  INT32 * rgb_ycc_tab;
  INT32 i;

  /* Allocate and fill in the conversion tables. */
  cconvert->rgb_ycc_tab = rgb_ycc_tab = (INT32 *)
    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
				(TABLE_SIZE * SIZEOF(INT32)));

  for (i = 0; i <= MAXJSAMPLE; i++) {
    rgb_ycc_tab[i+R_Y_OFF] = FIX(0.29900) * i;
    rgb_ycc_tab[i+G_Y_OFF] = FIX(0.58700) * i;
    rgb_ycc_tab[i+B_Y_OFF] = FIX(0.11400) * i     + ONE_HALF;
    rgb_ycc_tab[i+R_CB_OFF] = (-FIX(0.16874)) * i;
    rgb_ycc_tab[i+G_CB_OFF] = (-FIX(0.33126)) * i;
    /* We use a rounding fudge-factor of 0.5-epsilon for Cb and Cr.
     * This ensures that the maximum output will round to MAXJSAMPLE
     * not MAXJSAMPLE+1, and thus that we don't have to range-limit.
     */
    rgb_ycc_tab[i+B_CB_OFF] = FIX(0.50000) * i    + CBCR_OFFSET + ONE_HALF-1;
/*  B=>Cb and R=>Cr tables are the same
    rgb_ycc_tab[i+R_CR_OFF] = FIX(0.50000) * i    + CBCR_OFFSET + ONE_HALF-1;
*/
    rgb_ycc_tab[i+G_CR_OFF] = (-FIX(0.41869)) * i;
    rgb_ycc_tab[i+B_CR_OFF] = (-FIX(0.08131)) * i;
  }
}


/*
 * Convert some rows of samples to the JPEG colorspace.
 *
 * Note that we change from the application's interleaved-pixel format
 * to our internal noninterleaved, one-plane-per-component format.
 * The input buffer is therefore three times as wide as the output buffer.
 *
 * A starting row offset is provided only for the output buffer.  The caller
 * can easily adjust the passed input_buf value to accommodate any row
 * offset required on that side.
 */

METHODDEF(void)
rgb_ycc_convert (j_compress_ptr cinfo,
		 JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
		 JDIMENSION output_row, int num_rows)
{
  my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;
  register int r, g, b;
  register INT32 * ctab = cconvert->rgb_ycc_tab;
  register JSAMPROW inptr;
  register JSAMPROW outptr0, outptr1, outptr2;
  register JDIMENSION col;
  JDIMENSION num_cols = cinfo->image_width;

  while (--num_rows >= 0) {
    inptr = *input_buf++;
    outptr0 = output_buf[0][output_row];
    outptr1 = output_buf[1][output_row];
    outptr2 = output_buf[2][output_row];
    output_row++;
    for (col = 0; col < num_cols; col++) {
      r = GETJSAMPLE(inptr[RGB_RED]);
      g = GETJSAMPLE(inptr[RGB_GREEN]);
      b = GETJSAMPLE(inptr[RGB_BLUE]);
      inptr += RGB_PIXELSIZE;
      /* If the inputs are 0..MAXJSAMPLE, the outputs of these equations
       * must be too; we do not need an explicit range-limiting operation.
       * Hence the value being shifted is never negative, and we don't
       * need the general RIGHT_SHIFT macro.
       */
      /* Y */
      outptr0[col] = (JSAMPLE)
		((ctab[r+R_Y_OFF] + ctab[g+G_Y_OFF] + ctab[b+B_Y_OFF])
		 >> SCALEBITS);
      /* Cb */
      outptr1[col] = (JSAMPLE)
		((ctab[r+R_CB_OFF] + ctab[g+G_CB_OFF] + ctab[b+B_CB_OFF])
		 >> SCALEBITS);
      /* Cr */
      outptr2[col] = (JSAMPLE)
		((ctab[r+R_CR_OFF] + ctab[g+G_CR_OFF] + ctab[b+B_CR_OFF])
		 >> SCALEBITS);
    }
  }
}


/**************** Cases other than RGB -> YCbCr **************/


/*
 * Convert some rows of samples to the JPEG colorspace.
 * This version handles RGB->grayscale conversion, which is the same
 * as the RGB->Y portion of RGB->YCbCr.
 * We assume rgb_ycc_start has been called (we only use the Y tables).
 */

METHODDEF(void)
rgb_gray_convert (j_compress_ptr cinfo,
		  JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
		  JDIMENSION output_row, int num_rows)
{
  my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;
  register int r, g, b;
  register INT32 * ctab = cconvert->rgb_ycc_tab;
  register JSAMPROW inptr;
  register JSAMPROW outptr;
  register JDIMENSION col;
  JDIMENSION num_cols = cinfo->image_width;

  while (--num_rows >= 0) {
    inptr = *input_buf++;
    outptr = output_buf[0][output_row];
    output_row++;
    for (col = 0; col < num_cols; col++) {
      r = GETJSAMPLE(inptr[RGB_RED]);
      g = GETJSAMPLE(inptr[RGB_GREEN]);
      b = GETJSAMPLE(inptr[RGB_BLUE]);
      inptr += RGB_PIXELSIZE;
      /* Y */
      outptr[col] = (JSAMPLE)
		((ctab[r+R_Y_OFF] + ctab[g+G_Y_OFF] + ctab[b+B_Y_OFF])
		 >> SCALEBITS);
    }
  }
}


/*
 * Convert some rows of samples to the JPEG colorspace.
 * This version handles Adobe-style CMYK->YCCK conversion,
 * where we convert R=1-C, G=1-M, and B=1-Y to YCbCr using the same
 * conversion as above, while passing K (black) unchanged.
 * We assume rgb_ycc_start has been called.

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
午夜免费欧美电影| 亚洲国产va精品久久久不卡综合| 成人黄色电影在线| 国产精品久久久久久久久免费相片 | 制服丝袜亚洲色图| 狠狠色狠狠色综合| 亚洲欧洲日韩一区二区三区| 欧美美女黄视频| 国产精品99久久不卡二区| 一区二区三区四区激情| 欧美r级电影在线观看| 97久久人人超碰| 免费成人小视频| 亚洲视频狠狠干| 欧美变态口味重另类| 99re热这里只有精品免费视频| 五月天中文字幕一区二区| 国产女人18水真多18精品一级做| 欧美亚洲愉拍一区二区| 久久99日本精品| 亚洲视频在线观看一区| 欧美成人精精品一区二区频| 色综合天天综合在线视频| 久久不见久久见中文字幕免费| 亚洲欧美激情小说另类| 亚洲超丰满肉感bbw| 中文字幕精品一区二区精品绿巨人| 欧美日韩免费不卡视频一区二区三区| 成人小视频在线| 奇米色一区二区三区四区| 亚洲欧美色一区| 国产欧美va欧美不卡在线| 正在播放一区二区| 91麻豆国产在线观看| 国产又粗又猛又爽又黄91精品| 亚洲欧美成人一区二区三区| 久久女同精品一区二区| 3751色影院一区二区三区| 色妹子一区二区| 成人小视频在线| 国产一区二区视频在线播放| 久久久久综合网| 欧美福利视频导航| 一本一道综合狠狠老| 国产91富婆露脸刺激对白| 美女脱光内衣内裤视频久久网站| 亚洲一区在线视频| 亚洲视频一区在线观看| 中文字幕制服丝袜一区二区三区| 精品sm在线观看| 欧美放荡的少妇| 92国产精品观看| 国产成人在线视频免费播放| 久久成人免费日本黄色| 久久精品国产精品亚洲精品| 日韩成人免费电影| 爽爽淫人综合网网站| 亚洲v中文字幕| 亚洲国产欧美在线| 亚洲一二三四在线| 亚洲人成在线观看一区二区| 综合在线观看色| 日韩一区二区三区视频在线观看| 欧美精品第一页| 日韩一级在线观看| 久久久久久久久99精品| 久久久亚洲精品石原莉奈| 久久只精品国产| 中文av一区二区| 亚洲欧美另类久久久精品 | 精品91自产拍在线观看一区| 久久亚洲综合色| 久久精品一区二区| 中文字幕第一页久久| 椎名由奈av一区二区三区| 亚洲免费高清视频在线| 亚洲国产aⅴ成人精品无吗| 午夜精品成人在线视频| 久久疯狂做爰流白浆xx| 国产成人免费在线视频| 91视频一区二区三区| 欧美日韩亚洲综合| 日韩午夜精品视频| 亚洲国产成人私人影院tom| 亚洲欧洲日韩av| 婷婷夜色潮精品综合在线| 免费成人在线观看视频| 国产成人精品一区二区三区四区 | 日韩和欧美一区二区| 久久国产精品免费| 99久久久久免费精品国产 | 国产一区二区在线观看视频| av不卡一区二区三区| 欧美精品一二三四| 国产午夜精品美女毛片视频| 一区二区三区视频在线看| 蜜芽一区二区三区| 韩国av一区二区| 麻豆91精品91久久久的内涵| 成人精品免费视频| 色婷婷综合久久久久中文| 69堂精品视频| 中文字幕亚洲综合久久菠萝蜜| 一级中文字幕一区二区| 久久99热狠狠色一区二区| 99re成人精品视频| 精品久久人人做人人爱| 亚洲特黄一级片| 久久99精品久久久久久国产越南 | 日韩三级.com| 亚洲欧洲一区二区三区| 美腿丝袜亚洲综合| 97精品视频在线观看自产线路二| 欧美日韩成人综合在线一区二区| 91麻豆精品国产| 亚洲欧美自拍偷拍| 九九**精品视频免费播放| 欧美色精品在线视频| 欧美国产成人在线| 亚洲欧美日韩国产中文在线| 精品一区二区综合| 色域天天综合网| 国产亚洲婷婷免费| 免费欧美高清视频| 欧美性三三影院| 自拍偷在线精品自拍偷无码专区| 国产一区二区三区最好精华液| 欧美日本在线看| 伊人开心综合网| av电影天堂一区二区在线| 久久精品日韩一区二区三区| 调教+趴+乳夹+国产+精品| 色综合久久久久网| 国产精品美女久久久久久久久| 久久91精品国产91久久小草| 欧美高清性hdvideosex| 一区二区激情视频| 99久久久久久| 国产精品欧美一级免费| 懂色一区二区三区免费观看| 精品久久国产字幕高潮| 美国av一区二区| 日韩欧美中文字幕一区| 五月综合激情网| 欧美性受xxxx| 亚洲免费电影在线| 99精品国产99久久久久久白柏| 国产视频在线观看一区二区三区 | 99在线精品一区二区三区| 国产日产欧美一区二区视频| 国产一区二区三区蝌蚪| 精品少妇一区二区三区免费观看| 日韩激情一区二区| 日韩三级电影网址| 久久精品久久久精品美女| 欧美一区二区三区在线观看视频| 亚洲国产精品精华液网站| 欧美日本一区二区| 免费观看91视频大全| 欧美成人性战久久| 国产精品资源在线| 国产日韩欧美不卡| 99精品在线免费| 一区二区三区中文字幕| 久久女同精品一区二区| 久久99精品久久久久婷婷| 久久久久国产精品麻豆ai换脸 | 99精品国产91久久久久久| 亚洲码国产岛国毛片在线| 91在线国产福利| 亚洲一区二区欧美日韩| 欧洲日韩一区二区三区| 美女性感视频久久| 国产精品每日更新在线播放网址| 欧美性videosxxxxx| 精品在线观看免费| 中文字幕日韩精品一区| 国产激情91久久精品导航| 国产精品无码永久免费888| 色婷婷综合久久久中文一区二区| 日韩中文字幕一区二区三区| 久久精品视频一区| 欧美性三三影院| 国产精华液一区二区三区| 亚洲午夜视频在线观看| 久久久久九九视频| 欧美吞精做爰啪啪高潮| 国产精品1区2区| 亚洲成人一区二区在线观看| 国产亚洲精品资源在线26u| 欧美曰成人黄网| 国产盗摄女厕一区二区三区| 亚洲国产精品一区二区久久| 国产午夜精品久久久久久免费视 | 亚洲精品乱码久久久久久日本蜜臀| 欧美一区二区精品久久911| 成人av在线资源| 久久国产精品99久久久久久老狼| 一区二区高清在线| 国产精品久久久一区麻豆最新章节|