亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
国v精品久久久网| 欧美成人精品二区三区99精品| 北条麻妃一区二区三区| 99久久国产综合精品麻豆| 欧美视频你懂的| 日本一区二区成人| 免费在线看成人av| 色8久久精品久久久久久蜜| 精品剧情在线观看| 亚洲五码中文字幕| 成人黄色电影在线 | 99久久精品费精品国产一区二区| 91久久免费观看| 日本一区二区三区国色天香 | 欧美三级中文字幕| 久久精品亚洲乱码伦伦中文| 亚洲成人午夜电影| 日本精品免费观看高清观看| 久久精品视频一区| 国模无码大尺度一区二区三区| 欧美日韩一区不卡| 一区二区日韩av| 99在线视频精品| 国产网站一区二区三区| 美女www一区二区| 欧美一区二区视频在线观看2020| 亚洲午夜免费电影| 在线视频一区二区免费| 一区免费观看视频| 91美女精品福利| 中文字幕在线观看一区| 大尺度一区二区| 国产精品嫩草影院av蜜臀| 国产精品伊人色| 日本一区二区在线不卡| 国产a精品视频| 国产喷白浆一区二区三区| 国产一区二区调教| 久久综合色鬼综合色| 激情综合色播五月| 久久久蜜桃精品| 国产风韵犹存在线视精品| 久久久精品国产免费观看同学| 国产风韵犹存在线视精品| 亚洲国产精品v| 99re66热这里只有精品3直播| 亚洲免费资源在线播放| 日本高清不卡aⅴ免费网站| 亚洲手机成人高清视频| 色网综合在线观看| 日日夜夜精品视频天天综合网| 欧美日韩视频一区二区| 免费国产亚洲视频| 久久久高清一区二区三区| 成人一级黄色片| 亚洲国产日韩在线一区模特 | 日韩中文字幕91| 日韩精品影音先锋| 国产成人av福利| 成人免费在线播放视频| 欧美伊人久久久久久久久影院| 日精品一区二区| 久久久精品国产免大香伊| 91麻豆福利精品推荐| 亚洲一区二区综合| 日韩免费一区二区| 波多野结衣亚洲| 日日摸夜夜添夜夜添国产精品| 久久婷婷一区二区三区| 色综合网站在线| 日韩不卡在线观看日韩不卡视频| 国产亚洲va综合人人澡精品| 在线免费观看视频一区| 麻豆国产精品一区二区三区| 中文在线资源观看网站视频免费不卡| 一本一本久久a久久精品综合麻豆| 午夜精品久久久久久久久久久| 国产午夜亚洲精品羞羞网站| 欧美天天综合网| 国产福利一区在线观看| 亚洲一区二区中文在线| 国产欧美日韩在线视频| 69堂成人精品免费视频| 99久久精品免费看| 看片网站欧美日韩| 亚洲一线二线三线久久久| 亚洲精品一区在线观看| 欧美日韩一级片在线观看| 不卡电影一区二区三区| 久久av中文字幕片| 亚洲国产美国国产综合一区二区| 久久精品一区二区三区不卡牛牛| 3d成人h动漫网站入口| 99re热这里只有精品视频| 国产精品一区免费视频| 免费av网站大全久久| 一区二区三区四区激情| 国产精品久久久久久一区二区三区| 欧美一区二区三区小说| 在线国产电影不卡| 99久久精品国产麻豆演员表| 国产一区二区三区四| 免费美女久久99| 青娱乐精品在线视频| 亚洲一区在线观看视频| 亚洲精品视频在线看| 国产欧美1区2区3区| 久久综合九色综合97婷婷女人 | 天堂影院一区二区| 亚洲男人都懂的| 亚洲欧美日韩中文字幕一区二区三区 | 懂色av一区二区在线播放| 免费三级欧美电影| 青草国产精品久久久久久| 亚洲一区二区三区免费视频| 亚洲精品视频在线观看网站| 亚洲欧美日韩一区二区三区在线观看| 国产精品人成在线观看免费| 国产拍欧美日韩视频二区 | 91精品一区二区三区在线观看| 色一情一乱一乱一91av| 色欲综合视频天天天| 色综合网站在线| 91黄色在线观看| 91成人在线免费观看| 在线观看日韩国产| 欧美日韩亚洲国产综合| 欧美熟乱第一页| 337p亚洲精品色噜噜狠狠| 91精品国产入口| 日韩一级视频免费观看在线| 欧美变态口味重另类| 久久久99精品免费观看不卡| 中文字幕高清一区| 亚洲少妇中出一区| 亚洲资源在线观看| 日韩av成人高清| 国产成人精品亚洲777人妖| 国产河南妇女毛片精品久久久| 国产不卡在线视频| 在线日韩av片| 欧美va亚洲va| 国产精品人成在线观看免费| 一区二区在线看| 久久精品999| 不卡的av电影| 宅男噜噜噜66一区二区66| 久久婷婷国产综合精品青草| 国产精品盗摄一区二区三区| 亚洲宅男天堂在线观看无病毒| 日本欧美一区二区三区乱码| 黄网站免费久久| 91麻豆123| 欧美肥妇bbw| 国产欧美一区视频| 亚洲图片自拍偷拍| 国产在线日韩欧美| 色婷婷国产精品| 精品福利一二区| 亚洲综合精品久久| 国产成人一区二区精品非洲| 欧美午夜电影在线播放| 精品久久人人做人人爱| 亚洲欧美国产三级| 韩国中文字幕2020精品| 日本大香伊一区二区三区| 精品国产免费视频| 亚洲h在线观看| 99re热这里只有精品视频| 日韩欧美不卡一区| 亚洲国产精品久久不卡毛片 | 免费观看91视频大全| 99久久综合国产精品| 欧美一区二区日韩一区二区| 亚洲美女屁股眼交3| 国产麻豆精品在线观看| 欧美性色欧美a在线播放| 中文字幕精品三区| 久久99国产精品久久99| 欧美日韩国产高清一区| 国产精品久久久久久久久晋中| 免费三级欧美电影| 欧美日韩在线三级| 亚洲视频免费在线| av一二三不卡影片| 国产欧美精品日韩区二区麻豆天美| 日本成人在线看| 欧美日韩国产成人在线免费| 亚洲精品伦理在线| 91在线视频播放| 国产精品私人自拍| 国产精品1区2区| 欧美成人精精品一区二区频| 五月天一区二区三区| 在线观看不卡视频| 亚洲精品久久久蜜桃| 成人精品在线视频观看| 国产欧美精品一区二区色综合 | 欧美激情综合五月色丁香| 精品综合免费视频观看|