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

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

?? rdcolmap.c

?? 一款最完整的工業組態軟源代碼
?? C
字號:
/*
 * rdcolmap.c
 *
 * Copyright (C) 1994-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 implements djpeg's "-map file" switch.  It reads a source image
 * and constructs a colormap to be supplied to the JPEG decompressor.
 *
 * Currently, these file formats are supported for the map file:
 *   GIF: the contents of the GIF's global colormap are used.
 *   PPM (either text or raw flavor): the entire file is read and
 *      each unique pixel value is entered in the map.
 * Note that reading a large PPM file will be horrendously slow.
 * Typically, a PPM-format map file should contain just one pixel
 * of each desired color.  Such a file can be extracted from an
 * ordinary image PPM file with ppmtomap(1).
 *
 * Rescaling a PPM that has a maxval unequal to MAXJSAMPLE is not
 * currently implemented.
 */

#include "cdjpeg.h"		/* Common decls for cjpeg/djpeg applications */

#ifdef QUANT_2PASS_SUPPORTED	/* otherwise can't quantize to supplied map */

/* Portions of this code are based on the PBMPLUS library, which is:
**
** Copyright (C) 1988 by Jef Poskanzer.
**
** Permission to use, copy, modify, and distribute this software and its
** documentation for any purpose and without fee is hereby granted, provided
** that the above copyright notice appear in all copies and that both that
** copyright notice and this permission notice appear in supporting
** documentation.  This software is provided "as is" without express or
** implied warranty.
*/


/*
 * Add a (potentially) new color to the color map.
 */

LOCAL(void)
add_map_entry (j_decompress_ptr cinfo, int R, int G, int B)
{
  JSAMPROW colormap0 = cinfo->colormap[0];
  JSAMPROW colormap1 = cinfo->colormap[1];
  JSAMPROW colormap2 = cinfo->colormap[2];
  int ncolors = cinfo->actual_number_of_colors;
  int index;

  /* Check for duplicate color. */
  for (index = 0; index < ncolors; index++) {
    if (GETJSAMPLE(colormap0[index]) == R &&
	GETJSAMPLE(colormap1[index]) == G &&
	GETJSAMPLE(colormap2[index]) == B)
      return;			/* color is already in map */
  }

  /* Check for map overflow. */
  if (ncolors >= (MAXJSAMPLE+1))
    ERREXIT1(cinfo, JERR_QUANT_MANY_COLORS, (MAXJSAMPLE+1));

  /* OK, add color to map. */
  colormap0[ncolors] = (JSAMPLE) R;
  colormap1[ncolors] = (JSAMPLE) G;
  colormap2[ncolors] = (JSAMPLE) B;
  cinfo->actual_number_of_colors++;
}


/*
 * Extract color map from a GIF file.
 */

LOCAL(void)
read_gif_map (j_decompress_ptr cinfo, FILE * infile)
{
  int header[13];
  int i, colormaplen;
  int R, G, B;

  /* Initial 'G' has already been read by read_color_map */
  /* Read the rest of the GIF header and logical screen descriptor */
  for (i = 1; i < 13; i++) {
    if ((header[i] = getc(infile)) == EOF)
      ERREXIT(cinfo, JERR_BAD_CMAP_FILE);
  }

  /* Verify GIF Header */
  if (header[1] != 'I' || header[2] != 'F')
    ERREXIT(cinfo, JERR_BAD_CMAP_FILE);

  /* There must be a global color map. */
  if ((header[10] & 0x80) == 0)
    ERREXIT(cinfo, JERR_BAD_CMAP_FILE);

  /* OK, fetch it. */
  colormaplen = 2 << (header[10] & 0x07);

  for (i = 0; i < colormaplen; i++) {
    R = getc(infile);
    G = getc(infile);
    B = getc(infile);
    if (R == EOF || G == EOF || B == EOF)
      ERREXIT(cinfo, JERR_BAD_CMAP_FILE);
    add_map_entry(cinfo,
		  R << (BITS_IN_JSAMPLE-8),
		  G << (BITS_IN_JSAMPLE-8),
		  B << (BITS_IN_JSAMPLE-8));
  }
}


/* Support routines for reading PPM */


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


LOCAL(unsigned int)
read_pbm_integer (j_decompress_ptr cinfo, FILE * infile)
/* Read an unsigned decimal integer from the PPM file */
/* Swallows one trailing character after the integer */
/* Note that on a 16-bit-int machine, only values up to 64k can be read. */
/* This should not be a problem in practice. */
{
  register int ch;
  register unsigned int val;
  
  /* Skip any leading whitespace */
  do {
    ch = pbm_getc(infile);
    if (ch == EOF)
      ERREXIT(cinfo, JERR_BAD_CMAP_FILE);
  } while (ch == ' ' || ch == '\t' || ch == '\n' || ch == '\r');
  
  if (ch < '0' || ch > '9')
    ERREXIT(cinfo, JERR_BAD_CMAP_FILE);
  
  val = ch - '0';
  while ((ch = pbm_getc(infile)) >= '0' && ch <= '9') {
    val *= 10;
    val += ch - '0';
  }
  return val;
}


/*
 * Extract color map from a PPM file.
 */

LOCAL(void)
read_ppm_map (j_decompress_ptr cinfo, FILE * infile)
{
  int c;
  unsigned int w, h, maxval, row, col;
  int R, G, B;

  /* Initial 'P' has already been read by read_color_map */
  c = getc(infile);		/* save format discriminator for a sec */

  /* while we fetch the remaining header info */
  w = read_pbm_integer(cinfo, infile);
  h = read_pbm_integer(cinfo, infile);
  maxval = read_pbm_integer(cinfo, infile);

  if (w <= 0 || h <= 0 || maxval <= 0) /* error check */
    ERREXIT(cinfo, JERR_BAD_CMAP_FILE);

  /* For now, we don't support rescaling from an unusual maxval. */
  if (maxval != (unsigned int) MAXJSAMPLE)
    ERREXIT(cinfo, JERR_BAD_CMAP_FILE);

  switch (c) {
  case '3':			/* it's a text-format PPM file */
    for (row = 0; row < h; row++) {
      for (col = 0; col < w; col++) {
	R = read_pbm_integer(cinfo, infile);
	G = read_pbm_integer(cinfo, infile);
	B = read_pbm_integer(cinfo, infile);
	add_map_entry(cinfo, R, G, B);
      }
    }
    break;

  case '6':			/* it's a raw-format PPM file */
    for (row = 0; row < h; row++) {
      for (col = 0; col < w; col++) {
	R = getc(infile);
	G = getc(infile);
	B = getc(infile);
	if (R == EOF || G == EOF || B == EOF)
	  ERREXIT(cinfo, JERR_BAD_CMAP_FILE);
	add_map_entry(cinfo, R, G, B);
      }
    }
    break;

  default:
    ERREXIT(cinfo, JERR_BAD_CMAP_FILE);
    break;
  }
}


/*
 * Main entry point from djpeg.c.
 *  Input: opened input file (from file name argument on command line).
 *  Output: colormap and actual_number_of_colors fields are set in cinfo.
 */

GLOBAL(void)
read_color_map (j_decompress_ptr cinfo, FILE * infile)
{
  /* Allocate space for a color map of maximum supported size. */
  cinfo->colormap = (*cinfo->mem->alloc_sarray)
    ((j_common_ptr) cinfo, JPOOL_IMAGE,
     (JDIMENSION) (MAXJSAMPLE+1), (JDIMENSION) 3);
  cinfo->actual_number_of_colors = 0; /* initialize map to empty */

  /* Read first byte to determine file format */
  switch (getc(infile)) {
  case 'G':
    read_gif_map(cinfo, infile);
    break;
  case 'P':
    read_ppm_map(cinfo, infile);
    break;
  default:
    ERREXIT(cinfo, JERR_BAD_CMAP_FILE);
    break;
  }
}

#endif /* QUANT_2PASS_SUPPORTED */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
色拍拍在线精品视频8848| 国产亚洲一本大道中文在线| 亚洲男人天堂av| 精品视频免费在线| 午夜精品aaa| 久久久久久久久久久久电影 | 国产一区二区三区四区五区美女| 精品视频1区2区| 国产一区二区美女诱惑| 亚洲人成在线观看一区二区| 欧美在线观看禁18| 狠狠色狠狠色综合| 亚洲国产成人av网| 欧美高清在线一区| 欧美天堂一区二区三区| 国产.欧美.日韩| 日本美女视频一区二区| 国产精品视频线看| 欧美一区二区三区不卡| 97成人超碰视| 成人av在线电影| 久久国产麻豆精品| 午夜精品影院在线观看| 亚洲精品视频一区| 日本一区二区三区dvd视频在线| 色先锋资源久久综合| 毛片av一区二区| 日韩精品成人一区二区在线| 国产日产欧美精品一区二区三区| 成人网男人的天堂| 国产一区在线观看麻豆| 日韩精品一区第一页| 亚洲精品日韩一| 国产丝袜美腿一区二区三区| 欧美视频日韩视频在线观看| 99国产精品久久久久久久久久久| 美女精品自拍一二三四| 丝袜美腿亚洲色图| 久久亚洲私人国产精品va媚药| 欧美色网站导航| 色狠狠综合天天综合综合| 色综合视频在线观看| 成人性生交大合| 91丝袜高跟美女视频| 一本大道久久精品懂色aⅴ| 福利一区二区在线| 高清在线观看日韩| 成人涩涩免费视频| 欧美丝袜第三区| 成人一区二区三区视频| 99精品欧美一区二区三区综合在线| 黄页视频在线91| 国产曰批免费观看久久久| 国产成人av电影在线观看| av电影天堂一区二区在线| 色综合中文字幕| 91在线国产福利| 欧美三级视频在线| 精品视频在线免费看| 日韩精品自拍偷拍| 中文字幕色av一区二区三区| 亚洲欧美电影院| 精品一区免费av| 97久久超碰国产精品| 日韩一二在线观看| 久久久久久久久99精品| 久久久精品国产免大香伊| 亚洲精品国产a久久久久久| 久久99精品国产.久久久久久| www.日韩av| 欧美xxxxx裸体时装秀| 悠悠色在线精品| 国产成人在线视频网站| 91美女在线观看| 国产亲近乱来精品视频| 美女脱光内衣内裤视频久久影院| 99国产欧美久久久精品| 国产网站一区二区三区| 麻豆国产一区二区| 欧美喷潮久久久xxxxx| 国产精品狼人久久影院观看方式| 日韩av一级片| 宅男在线国产精品| 免费观看久久久4p| 欧美一二三四区在线| 丝袜美腿亚洲一区二区图片| 色av综合在线| 亚洲第一激情av| 在线精品视频一区二区三四| 亚洲女性喷水在线观看一区| 99久久精品国产一区| 亚洲视频网在线直播| 欧美日韩在线一区二区| 精品sm捆绑视频| 成人精品视频一区二区三区 | 久久国产精品99久久人人澡| 欧美午夜精品理论片a级按摩| 亚洲欧美视频在线观看视频| 欧美综合天天夜夜久久| 亚洲成人免费看| 中文字幕乱码久久午夜不卡 | 94-欧美-setu| 美女一区二区久久| 91 com成人网| 97成人超碰视| 国产成人免费高清| 日韩中文字幕区一区有砖一区| 日韩欧美成人一区二区| hitomi一区二区三区精品| 男男视频亚洲欧美| 国产精品成人免费精品自在线观看 | 国产一区999| 欧美色区777第一页| 欧美精品一区二区在线播放| 日本一区二区成人| 性久久久久久久久| 亚洲天堂网中文字| 久久久精品国产99久久精品芒果| 欧美日韩亚洲丝袜制服| 99国产精品久| 久久机这里只有精品| 天天综合天天做天天综合| 亚洲免费av高清| 中文字幕va一区二区三区| 久久久久久夜精品精品免费| 欧美一激情一区二区三区| 在线观看免费视频综合| 99久久国产免费看| 成人黄色免费短视频| 国产69精品久久99不卡| 天堂资源在线中文精品| 国产日韩欧美在线一区| 精品噜噜噜噜久久久久久久久试看 | 欧美日韩成人综合在线一区二区| 99久久精品免费| 成人av在线电影| 99精品视频中文字幕| 蜜乳av一区二区三区| 国产精品资源网站| 同产精品九九九| 午夜亚洲福利老司机| 风流少妇一区二区| 欧美视频你懂的| 精品久久久久久无| 麻豆精品一二三| 日韩视频在线观看一区二区| 国内精品第一页| 男男成人高潮片免费网站| 午夜精品一区在线观看| 一区二区三区av电影| 麻豆精品一区二区综合av| 亚洲乱码国产乱码精品精的特点| 久久66热re国产| 成人午夜精品在线| 日韩欧美的一区| 夜色激情一区二区| 日韩成人午夜电影| 奇米四色…亚洲| 国产成人精品在线看| 94-欧美-setu| 18成人在线观看| 久久99国内精品| 国产精品亚洲专一区二区三区 | 国产三区在线成人av| 精品久久久网站| 国产欧美久久久精品影院| 国产精品天天看| 久久综合久久综合亚洲| 国产色产综合产在线视频| 亚洲高清三级视频| 美国毛片一区二区三区| 欧美色窝79yyyycom| 国产精品动漫网站| 国产91在线观看丝袜| 久久精品综合网| 国产一区二区不卡| 日韩精品中文字幕一区二区三区 | 日本欧美久久久久免费播放网| 国内外成人在线视频| 91色在线porny| 国产偷国产偷亚洲高清人白洁| www.av精品| 久久不见久久见免费视频1| 久久99精品久久久| 丝袜美腿亚洲色图| 日韩中文字幕av电影| 一道本成人在线| 中文字幕在线一区| 国产精品66部| 精品国精品国产尤物美女| 午夜精彩视频在线观看不卡| 亚洲免费电影在线| 亚洲欧美综合另类在线卡通| 亚洲欧美成aⅴ人在线观看| 国产成人免费在线视频| xf在线a精品一区二区视频网站| 日本美女一区二区三区视频| 777xxx欧美| 蜜桃av噜噜一区| 精品国产一区二区精华|