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

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

?? rdswitch.c

?? JPEG source code converts the image into compressed format
?? C
字號:
/*
 * rdswitch.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 routines to process some of cjpeg's more complicated
 * command-line switches.  Switches processed here are:
 *	-qtables file		Read quantization tables from text file
 *	-scans file		Read scan script from text file
 *	-qslots N[,N,...]	Set component quantization table selectors
 *	-sample HxV[,HxV,...]	Set component sampling factors
 */

#include "cdjpeg.h"		/* Common decls for cjpeg/djpeg applications */
#include <ctype.h>		/* to declare isdigit(), isspace() */


LOCAL(int)
text_getc (FILE * file)
/* Read next char, skipping over any comments (# to end of line) */
/* A comment/newline sequence is returned as a newline */
{
  register int ch;
  
  ch = getc(file);
  if (ch == '#') {
    do {
      ch = getc(file);
    } while (ch != '\n' && ch != EOF);
  }
  return ch;
}


LOCAL(boolean)
read_text_integer (FILE * file, long * result, int * termchar)
/* Read an unsigned decimal integer from a file, store it in result */
/* Reads one trailing character after the integer; returns it in termchar */
{
  register int ch;
  register long val;
  
  /* Skip any leading whitespace, detect EOF */
  do {
    ch = text_getc(file);
    if (ch == EOF) {
      *termchar = ch;
      return FALSE;
    }
  } while (isspace(ch));
  
  if (! isdigit(ch)) {
    *termchar = ch;
    return FALSE;
  }

  val = ch - '0';
  while ((ch = text_getc(file)) != EOF) {
    if (! isdigit(ch))
      break;
    val *= 10;
    val += ch - '0';
  }
  *result = val;
  *termchar = ch;
  return TRUE;
}


GLOBAL(boolean)
read_quant_tables (j_compress_ptr cinfo, char * filename,
		   int scale_factor, boolean force_baseline)
/* Read a set of quantization tables from the specified file.
 * The file is plain ASCII text: decimal numbers with whitespace between.
 * Comments preceded by '#' may be included in the file.
 * There may be one to NUM_QUANT_TBLS tables in the file, each of 64 values.
 * The tables are implicitly numbered 0,1,etc.
 * NOTE: does not affect the qslots mapping, which will default to selecting
 * table 0 for luminance (or primary) components, 1 for chrominance components.
 * You must use -qslots if you want a different component->table mapping.
 */
{
  FILE * fp;
  int tblno, i, termchar;
  long val;
  unsigned int table[DCTSIZE2];

  if ((fp = fopen(filename, "r")) == NULL) {
    fprintf(stderr, "Can't open table file %s\n", filename);
    return FALSE;
  }
  tblno = 0;

  while (read_text_integer(fp, &val, &termchar)) { /* read 1st element of table */
    if (tblno >= NUM_QUANT_TBLS) {
      fprintf(stderr, "Too many tables in file %s\n", filename);
      fclose(fp);
      return FALSE;
    }
    table[0] = (unsigned int) val;
    for (i = 1; i < DCTSIZE2; i++) {
      if (! read_text_integer(fp, &val, &termchar)) {
	fprintf(stderr, "Invalid table data in file %s\n", filename);
	fclose(fp);
	return FALSE;
      }
      table[i] = (unsigned int) val;
    }
    jpeg_add_quant_table(cinfo, tblno, table, scale_factor, force_baseline);
    tblno++;
  }

  if (termchar != EOF) {
    fprintf(stderr, "Non-numeric data in file %s\n", filename);
    fclose(fp);
    return FALSE;
  }

  fclose(fp);
  return TRUE;
}


#ifdef C_MULTISCAN_FILES_SUPPORTED

LOCAL(boolean)
read_scan_integer (FILE * file, long * result, int * termchar)
/* Variant of read_text_integer that always looks for a non-space termchar;
 * this simplifies parsing of punctuation in scan scripts.
 */
{
  register int ch;

  if (! read_text_integer(file, result, termchar))
    return FALSE;
  ch = *termchar;
  while (ch != EOF && isspace(ch))
    ch = text_getc(file);
  if (isdigit(ch)) {		/* oops, put it back */
    if (ungetc(ch, file) == EOF)
      return FALSE;
    ch = ' ';
  } else {
    /* Any separators other than ';' and ':' are ignored;
     * this allows user to insert commas, etc, if desired.
     */
    if (ch != EOF && ch != ';' && ch != ':')
      ch = ' ';
  }
  *termchar = ch;
  return TRUE;
}


GLOBAL(boolean)
read_scan_script (j_compress_ptr cinfo, char * filename)
/* Read a scan script from the specified text file.
 * Each entry in the file defines one scan to be emitted.
 * Entries are separated by semicolons ';'.
 * An entry contains one to four component indexes,
 * optionally followed by a colon ':' and four progressive-JPEG parameters.
 * The component indexes denote which component(s) are to be transmitted
 * in the current scan.  The first component has index 0.
 * Sequential JPEG is used if the progressive-JPEG parameters are omitted.
 * The file is free format text: any whitespace may appear between numbers
 * and the ':' and ';' punctuation marks.  Also, other punctuation (such
 * as commas or dashes) can be placed between numbers if desired.
 * Comments preceded by '#' may be included in the file.
 * Note: we do very little validity checking here;
 * jcmaster.c will validate the script parameters.
 */
{
  FILE * fp;
  int scanno, ncomps, termchar;
  long val;
  jpeg_scan_info * scanptr;
#define MAX_SCANS  100		/* quite arbitrary limit */
  jpeg_scan_info scans[MAX_SCANS];

  if ((fp = fopen(filename, "r")) == NULL) {
    fprintf(stderr, "Can't open scan definition file %s\n", filename);
    return FALSE;
  }
  scanptr = scans;
  scanno = 0;

  while (read_scan_integer(fp, &val, &termchar)) {
    if (scanno >= MAX_SCANS) {
      fprintf(stderr, "Too many scans defined in file %s\n", filename);
      fclose(fp);
      return FALSE;
    }
    scanptr->component_index[0] = (int) val;
    ncomps = 1;
    while (termchar == ' ') {
      if (ncomps >= MAX_COMPS_IN_SCAN) {
	fprintf(stderr, "Too many components in one scan in file %s\n",
		filename);
	fclose(fp);
	return FALSE;
      }
      if (! read_scan_integer(fp, &val, &termchar))
	goto bogus;
      scanptr->component_index[ncomps] = (int) val;
      ncomps++;
    }
    scanptr->comps_in_scan = ncomps;
    if (termchar == ':') {
      if (! read_scan_integer(fp, &val, &termchar) || termchar != ' ')
	goto bogus;
      scanptr->Ss = (int) val;
      if (! read_scan_integer(fp, &val, &termchar) || termchar != ' ')
	goto bogus;
      scanptr->Se = (int) val;
      if (! read_scan_integer(fp, &val, &termchar) || termchar != ' ')
	goto bogus;
      scanptr->Ah = (int) val;
      if (! read_scan_integer(fp, &val, &termchar))
	goto bogus;
      scanptr->Al = (int) val;
    } else {
      /* set non-progressive parameters */
      scanptr->Ss = 0;
      scanptr->Se = DCTSIZE2-1;
      scanptr->Ah = 0;
      scanptr->Al = 0;
    }
    if (termchar != ';' && termchar != EOF) {
bogus:
      fprintf(stderr, "Invalid scan entry format in file %s\n", filename);
      fclose(fp);
      return FALSE;
    }
    scanptr++, scanno++;
  }

  if (termchar != EOF) {
    fprintf(stderr, "Non-numeric data in file %s\n", filename);
    fclose(fp);
    return FALSE;
  }

  if (scanno > 0) {
    /* Stash completed scan list in cinfo structure.
     * NOTE: for cjpeg's use, JPOOL_IMAGE is the right lifetime for this data,
     * but if you want to compress multiple images you'd want JPOOL_PERMANENT.
     */
    scanptr = (jpeg_scan_info *)
      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
				  scanno * SIZEOF(jpeg_scan_info));
    MEMCOPY(scanptr, scans, scanno * SIZEOF(jpeg_scan_info));
    cinfo->scan_info = scanptr;
    cinfo->num_scans = scanno;
  }

  fclose(fp);
  return TRUE;
}

#endif /* C_MULTISCAN_FILES_SUPPORTED */


GLOBAL(boolean)
set_quant_slots (j_compress_ptr cinfo, char *arg)
/* Process a quantization-table-selectors parameter string, of the form
 *     N[,N,...]
 * If there are more components than parameters, the last value is replicated.
 */
{
  int val = 0;			/* default table # */
  int ci;
  char ch;

  for (ci = 0; ci < MAX_COMPONENTS; ci++) {
    if (*arg) {
      ch = ',';			/* if not set by sscanf, will be ',' */
      if (sscanf(arg, "%d%c", &val, &ch) < 1)
	return FALSE;
      if (ch != ',')		/* syntax check */
	return FALSE;
      if (val < 0 || val >= NUM_QUANT_TBLS) {
	fprintf(stderr, "JPEG quantization tables are numbered 0..%d\n",
		NUM_QUANT_TBLS-1);
	return FALSE;
      }
      cinfo->comp_info[ci].quant_tbl_no = val;
      while (*arg && *arg++ != ',') /* advance to next segment of arg string */
	;
    } else {
      /* reached end of parameter, set remaining components to last table */
      cinfo->comp_info[ci].quant_tbl_no = val;
    }
  }
  return TRUE;
}


GLOBAL(boolean)
set_sample_factors (j_compress_ptr cinfo, char *arg)
/* Process a sample-factors parameter string, of the form
 *     HxV[,HxV,...]
 * If there are more components than parameters, "1x1" is assumed for the rest.
 */
{
  int ci, val1, val2;
  char ch1, ch2;

  for (ci = 0; ci < MAX_COMPONENTS; ci++) {
    if (*arg) {
      ch2 = ',';		/* if not set by sscanf, will be ',' */
      if (sscanf(arg, "%d%c%d%c", &val1, &ch1, &val2, &ch2) < 3)
	return FALSE;
      if ((ch1 != 'x' && ch1 != 'X') || ch2 != ',') /* syntax check */
	return FALSE;
      if (val1 <= 0 || val1 > 4 || val2 <= 0 || val2 > 4) {
	fprintf(stderr, "JPEG sampling factors must be 1..4\n");
	return FALSE;
      }
      cinfo->comp_info[ci].h_samp_factor = val1;
      cinfo->comp_info[ci].v_samp_factor = val2;
      while (*arg && *arg++ != ',') /* advance to next segment of arg string */
	;
    } else {
      /* reached end of parameter, set remaining components to 1x1 sampling */
      cinfo->comp_info[ci].h_samp_factor = 1;
      cinfo->comp_info[ci].v_samp_factor = 1;
    }
  }
  return TRUE;
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲激情自拍偷拍| 国产清纯白嫩初高生在线观看91 | 成人一区在线看| 国产日韩欧美综合一区| 国产精品自产自拍| 日本一区二区三区国色天香| 成人午夜碰碰视频| 中文字幕一区av| 欧美在线观看一区二区| 亚洲成人综合在线| 日韩一区二区三区四区 | 国产一区二区精品在线观看| 久久久久97国产精华液好用吗| 国产成人精品亚洲777人妖| 国产精品免费看片| 欧美伊人久久大香线蕉综合69| 日韩制服丝袜av| 久久久久久久网| 91色在线porny| 免费一级欧美片在线观看| 久久久不卡网国产精品二区 | 91免费国产视频网站| 亚洲成人精品一区| 久久久久久久久久久黄色| 99久久国产免费看| 日本怡春院一区二区| 欧美激情一区二区三区四区| 欧美曰成人黄网| 国产激情一区二区三区四区 | 欧美视频在线一区二区三区| 另类的小说在线视频另类成人小视频在线| 久久精品一区二区三区av| 91久久精品一区二区三区| 久久精品国产久精国产爱| 综合av第一页| 精品国产免费一区二区三区香蕉| www.欧美.com| 韩国三级电影一区二区| 一区二区三区国产| 久久久久久久性| 欧美一级淫片007| 99精品视频中文字幕| 久久成人免费日本黄色| 亚洲成a人片综合在线| 欧美国产一区二区在线观看| 91精品国产麻豆| 色狠狠综合天天综合综合| 国产精品自拍av| 日本va欧美va精品发布| 一区二区三区欧美在线观看| 欧美国产一区在线| 久久久亚洲精华液精华液精华液| 欧美另类z0zxhd电影| 91麻豆.com| 成人蜜臀av电影| 国产精品一线二线三线精华| 日本视频免费一区| 亚洲一区二区三区四区五区黄| 日本一区二区视频在线观看| 久久看人人爽人人| 日韩一区二区在线观看视频| 欧美三级视频在线播放| av激情成人网| 高清不卡在线观看av| 激情综合亚洲精品| 久久国产生活片100| 日本怡春院一区二区| 婷婷久久综合九色综合伊人色| 亚洲老妇xxxxxx| 亚洲丝袜自拍清纯另类| 中文字幕乱码日本亚洲一区二区| 欧美精品一区二区三区久久久 | 日本麻豆一区二区三区视频| 亚洲国产综合91精品麻豆| 亚洲欧美国产三级| 亚洲天堂a在线| 亚洲天天做日日做天天谢日日欢| 国产精品视频yy9299一区| 国产欧美日韩视频一区二区| 久久综合久久综合久久| 久久久久综合网| 久久久久久久久免费| 日韩久久精品一区| 欧美大片免费久久精品三p| 91麻豆精品国产91久久久久久久久| 在线观看亚洲专区| 在线视频欧美区| 欧美日韩免费不卡视频一区二区三区 | 欧洲亚洲国产日韩| 日本韩国欧美在线| 欧美精品乱码久久久久久按摩| 欧美久久婷婷综合色| 欧美人妖巨大在线| 欧美草草影院在线视频| 久久久亚洲精华液精华液精华液| 中文字幕不卡在线观看| 最近日韩中文字幕| 亚洲成在线观看| 久久国产三级精品| 成人黄色一级视频| 欧洲一区在线观看| 欧美刺激脚交jootjob| 久久精品欧美日韩精品| 亚洲人成精品久久久久| 午夜不卡av免费| 国产一区二区毛片| 91丨九色丨蝌蚪丨老版| 欧美精品丝袜中出| 国产三级一区二区| 亚洲黄一区二区三区| 日韩国产欧美在线播放| 国产精品白丝jk黑袜喷水| av在线综合网| 日韩一区二区精品在线观看| 国产人伦精品一区二区| 一区二区三区**美女毛片| 美女一区二区久久| 成人精品免费网站| 3atv一区二区三区| 久久久久久久久99精品| 伊人一区二区三区| 国产一区二区三区黄视频| 一本大道综合伊人精品热热| 日韩精品专区在线| 亚洲综合久久久| 国产精品一二二区| 制服.丝袜.亚洲.另类.中文| 国产欧美精品日韩区二区麻豆天美| 亚洲综合色噜噜狠狠| 国产一区久久久| 91精品欧美福利在线观看| 国产精品国产三级国产aⅴ原创| 午夜精品久久久久久久99樱桃| 国产在线视视频有精品| 欧美日韩激情在线| 亚洲欧美在线aaa| 精品一区二区三区久久| 欧美手机在线视频| 亚洲三级免费电影| 国产剧情一区二区三区| 91麻豆精品国产自产在线| 国产精品成人免费在线| 激情丁香综合五月| 3d成人动漫网站| 亚洲国产日产av| 91视频免费播放| 中文字幕不卡三区| 激情成人午夜视频| 日韩精品最新网址| 日本不卡免费在线视频| 欧美中文字幕一区二区三区| 国产精品久久久久久久久久久免费看| 日本欧美在线观看| 在线电影国产精品| 亚洲成人福利片| 日韩欧美成人午夜| 婷婷久久综合九色综合绿巨人| 91麻豆免费在线观看| 国产精品灌醉下药二区| 国产91精品入口| 国产三级精品三级| 国产高清久久久久| 久久精品亚洲精品国产欧美kt∨| 免费在线观看一区| 日韩精品中文字幕在线不卡尤物| 亚洲福利视频一区二区| 欧美性色黄大片| 亚洲国产一二三| 色婷婷久久综合| 亚洲一区二区三区在线播放| 国产99一区视频免费| 亚洲综合清纯丝袜自拍| 日日欢夜夜爽一区| 99在线精品视频| 亚洲日穴在线视频| 91国偷自产一区二区开放时间| 18成人在线视频| 色狠狠综合天天综合综合| 亚洲五码中文字幕| 欧美福利电影网| 久久99精品国产.久久久久| 国产午夜亚洲精品不卡| 粉嫩av一区二区三区粉嫩| 国产精品对白交换视频| 一本色道亚洲精品aⅴ| 一区二区三区欧美激情| 欧美日韩精品欧美日韩精品| 日韩高清在线电影| 精品成人免费观看| 成+人+亚洲+综合天堂| 亚洲综合网站在线观看| 7777精品伊人久久久大香线蕉超级流畅| 天堂va蜜桃一区二区三区 | 中文一区在线播放| 欧美性生活久久| 久久aⅴ国产欧美74aaa| 国产欧美中文在线| 欧美午夜一区二区三区 | 国产一区视频导航| 国产精品乱人伦一区二区|