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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? rdcolmap.c

?? JPEG source code converts the image into compressed format
?? C
字號(hào):
/*
 * 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 */

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲成人在线网站| 欧美xxxxxxxxx| 国内久久精品视频| 亚洲婷婷在线视频| 欧美va日韩va| 91影视在线播放| 精品中文字幕一区二区小辣椒| ●精品国产综合乱码久久久久| 欧美一区二区三区影视| caoporn国产精品| 久久精品国产免费| 亚洲影视在线播放| 国产精品天干天干在线综合| 日韩欧美综合一区| 日本乱人伦aⅴ精品| 国产·精品毛片| 九九国产精品视频| 日本三级亚洲精品| 亚洲一区二区中文在线| 国产欧美日韩亚州综合| 欧美一级欧美三级在线观看| 91福利国产精品| 91亚洲精品久久久蜜桃网站| 国产成人精品亚洲午夜麻豆| 久久成人羞羞网站| 日本一不卡视频| 亚洲主播在线观看| 亚洲综合成人在线视频| 亚洲欧美激情小说另类| 国产女人水真多18毛片18精品视频 | 欧美人xxxx| 在线精品视频一区二区| 91亚洲资源网| 色综合久久久久| 99久久久久免费精品国产 | 日韩精品91亚洲二区在线观看 | 国产乱码一区二区三区| 免费精品视频最新在线| 日本不卡一区二区| 秋霞av亚洲一区二区三| 日韩国产成人精品| 久久国产综合精品| 久久精品国产秦先生| 经典三级视频一区| 国产一区二区三区av电影| 极品少妇xxxx精品少妇| 国产综合一区二区| 国产美女精品人人做人人爽| 国产不卡一区视频| av在线不卡网| 91精品91久久久中77777| 欧美亚洲一区三区| 在线成人av网站| 欧美高清精品3d| 日韩视频一区在线观看| 久久久影视传媒| 国产精品高潮久久久久无| 亚洲欧美另类久久久精品| 亚洲成人免费电影| 日韩av中文在线观看| 久久99蜜桃精品| 国产福利一区二区三区| youjizz国产精品| 在线精品视频小说1| 欧美一级专区免费大片| 国产亚洲精品中文字幕| ㊣最新国产の精品bt伙计久久| 亚洲永久免费av| 九九在线精品视频| 成人精品高清在线| 欧美日韩极品在线观看一区| 久久综合五月天婷婷伊人| ●精品国产综合乱码久久久久| 亚洲成av人片在线观看无码| 久久99精品视频| 一本色道久久综合精品竹菊| 91麻豆精品91久久久久同性| 久久精品亚洲一区二区三区浴池| 中文字幕一区二区三区不卡在线| 亚洲一区二区三区爽爽爽爽爽| 久久国内精品自在自线400部| 成人动漫一区二区在线| 91精品国产综合久久久久久| 国产女同互慰高潮91漫画| 午夜婷婷国产麻豆精品| 国产精品自拍毛片| 欧美三区在线观看| 中文字幕日韩一区| 青娱乐精品视频| 日本高清不卡在线观看| www一区二区| 亚洲国产精品一区二区www在线| 国产麻豆一精品一av一免费| 欧美午夜片在线看| 国产精品传媒在线| 久久66热re国产| 一本色道久久综合亚洲aⅴ蜜桃 | 91精品国产一区二区三区蜜臀| 国产日韩欧美精品一区| 天堂成人国产精品一区| 99视频精品在线| 久久青草国产手机看片福利盒子 | 色哟哟日韩精品| 国产亚洲精品aa| 毛片一区二区三区| 欧美视频日韩视频在线观看| 国产精品午夜电影| 久久精品国产精品亚洲综合| 欧美日韩免费高清一区色橹橹 | 奇米影视在线99精品| 一本到高清视频免费精品| 久久精品一区八戒影视| 六月丁香婷婷久久| 欧美日韩视频专区在线播放| 亚洲图片你懂的| 国产精品一区二区果冻传媒| 51精品秘密在线观看| 一区二区三国产精华液| www.av亚洲| 国产欧美日韩不卡免费| 精品中文字幕一区二区小辣椒| 欧美精品日韩一本| 亚洲午夜av在线| 日本韩国一区二区| 日韩美女视频一区| www.日韩在线| 成人免费一区二区三区在线观看| 国产69精品久久久久毛片| 国产日产欧美精品一区二区三区| 国产乱码精品一区二区三区五月婷| 欧美一区二区三区在线视频| 日韩中文字幕麻豆| 欧美一区二区三区四区在线观看| 午夜电影网一区| 欧美精品123区| 日本视频在线一区| 精品三级在线看| 精品一区二区成人精品| 精品国产精品一区二区夜夜嗨| 捆绑紧缚一区二区三区视频| 欧美大片一区二区三区| 久久成人免费网站| 欧美精品一区二区三区蜜桃| 久久99热狠狠色一区二区| 久久久久久久久99精品| 粉嫩av一区二区三区粉嫩| 欧美韩国日本不卡| 大桥未久av一区二区三区中文| 国产精品久久免费看| 91在线视频在线| 亚洲资源中文字幕| 日韩视频在线永久播放| 久久99日本精品| 国产精品网站在线观看| 欧美亚州韩日在线看免费版国语版| 亚洲成人精品在线观看| 日韩免费观看高清完整版在线观看| 精品系列免费在线观看| 国产天堂亚洲国产碰碰| 91免费国产在线| 午夜久久久影院| 久久人人97超碰com| 色综合咪咪久久| 日韩和的一区二区| 久久久精品免费网站| 91麻豆.com| 免费观看在线色综合| 国产女人18水真多18精品一级做| 91欧美一区二区| 美国欧美日韩国产在线播放| 欧美极品aⅴ影院| 欧亚一区二区三区| 久久97超碰色| 亚洲精品免费视频| 日韩精品一区二区三区蜜臀 | 99久久精品国产麻豆演员表| 亚洲二区在线观看| 久久久久久久久久电影| 欧美亚洲国产怡红院影院| 国产在线视频一区二区| 一区二区在线免费| 精品国产一区二区三区久久影院 | 97精品电影院| 日韩va亚洲va欧美va久久| 久久久国产精品麻豆| 日本国产一区二区| 狠狠色狠狠色综合系列| 国产精品久久久久久久久免费丝袜| 欧美日韩高清在线播放| 成人黄色av电影| 亚洲福利电影网| 亚洲图片你懂的| 久久久久久久久久久99999| 日本黄色一区二区| 成人毛片视频在线观看| 国产无一区二区| 日韩欧美激情一区| 欧美艳星brazzers| 国产不卡视频在线观看| 七七婷婷婷婷精品国产|