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

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

?? wrrle.c

?? JPEG source code converts the image into compressed format
?? C
字號:
/*
 * wrrle.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 write output images in RLE format.
 * The Utah Raster Toolkit library is required (version 3.1 or later).
 *
 * These routines may need modification for non-Unix environments or
 * specialized applications.  As they stand, they assume output to
 * an ordinary stdio stream.
 *
 * Based on code contributed by Mike Lijewski,
 * with updates from Robert Hutchinson.
 */

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

#ifdef RLE_SUPPORTED

/* rle.h is provided by the Utah Raster Toolkit. */

#include <rle.h>

/*
 * We assume that JSAMPLE has the same representation as rle_pixel,
 * to wit, "unsigned char".  Hence we can't cope with 12- or 16-bit samples.
 */

#if BITS_IN_JSAMPLE != 8
  Sorry, this code only copes with 8-bit JSAMPLEs. /* deliberate syntax err */
#endif


/*
 * Since RLE stores scanlines bottom-to-top, we have to invert the image
 * from JPEG's top-to-bottom order.  To do this, we save the outgoing data
 * in a virtual array during put_pixel_row calls, then actually emit the
 * RLE file during finish_output.
 */


/*
 * For now, if we emit an RLE color map then it is always 256 entries long,
 * though not all of the entries need be used.
 */

#define CMAPBITS	8
#define CMAPLENGTH	(1<<(CMAPBITS))

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

  jvirt_sarray_ptr image;	/* virtual array to store the output image */
  rle_map *colormap;	 	/* RLE-style color map, or NULL if none */
  rle_pixel **rle_row;		/* To pass rows to rle_putrow() */

} rle_dest_struct;

typedef rle_dest_struct * rle_dest_ptr;

/* Forward declarations */
METHODDEF(void) rle_put_pixel_rows
    JPP((j_decompress_ptr cinfo, djpeg_dest_ptr dinfo,
	 JDIMENSION rows_supplied));


/*
 * Write the file header.
 *
 * In this module it's easier to wait till finish_output to write anything.
 */

METHODDEF(void)
start_output_rle (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo)
{
  rle_dest_ptr dest = (rle_dest_ptr) dinfo;
  size_t cmapsize;
  int i, ci;
#ifdef PROGRESS_REPORT
  cd_progress_ptr progress = (cd_progress_ptr) cinfo->progress;
#endif

  /*
   * Make sure the image can be stored in RLE format.
   *
   * - RLE stores image dimensions as *signed* 16 bit integers.  JPEG
   *   uses unsigned, so we have to check the width.
   *
   * - Colorspace is expected to be grayscale or RGB.
   *
   * - The number of channels (components) is expected to be 1 (grayscale/
   *   pseudocolor) or 3 (truecolor/directcolor).
   *   (could be 2 or 4 if using an alpha channel, but we aren't)
   */

  if (cinfo->output_width > 32767 || cinfo->output_height > 32767)
    ERREXIT2(cinfo, JERR_RLE_DIMENSIONS, cinfo->output_width, 
	     cinfo->output_height);

  if (cinfo->out_color_space != JCS_GRAYSCALE &&
      cinfo->out_color_space != JCS_RGB)
    ERREXIT(cinfo, JERR_RLE_COLORSPACE);

  if (cinfo->output_components != 1 && cinfo->output_components != 3)
    ERREXIT1(cinfo, JERR_RLE_TOOMANYCHANNELS, cinfo->num_components);

  /* Convert colormap, if any, to RLE format. */

  dest->colormap = NULL;

  if (cinfo->quantize_colors) {
    /* Allocate storage for RLE-style cmap, zero any extra entries */
    cmapsize = cinfo->out_color_components * CMAPLENGTH * SIZEOF(rle_map);
    dest->colormap = (rle_map *) (*cinfo->mem->alloc_small)
      ((j_common_ptr) cinfo, JPOOL_IMAGE, cmapsize);
    MEMZERO(dest->colormap, cmapsize);

    /* Save away data in RLE format --- note 8-bit left shift! */
    /* Shifting would need adjustment for JSAMPLEs wider than 8 bits. */
    for (ci = 0; ci < cinfo->out_color_components; ci++) {
      for (i = 0; i < cinfo->actual_number_of_colors; i++) {
        dest->colormap[ci * CMAPLENGTH + i] =
          GETJSAMPLE(cinfo->colormap[ci][i]) << 8;
      }
    }
  }

  /* Set the output buffer to the first row */
  dest->pub.buffer = (*cinfo->mem->access_virt_sarray)
    ((j_common_ptr) cinfo, dest->image, (JDIMENSION) 0, (JDIMENSION) 1, TRUE);
  dest->pub.buffer_height = 1;

  dest->pub.put_pixel_rows = rle_put_pixel_rows;

#ifdef PROGRESS_REPORT
  if (progress != NULL) {
    progress->total_extra_passes++;  /* count file writing as separate pass */
  }
#endif
}


/*
 * Write some pixel data.
 *
 * This routine just saves the data away in a virtual array.
 */

METHODDEF(void)
rle_put_pixel_rows (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo,
		    JDIMENSION rows_supplied)
{
  rle_dest_ptr dest = (rle_dest_ptr) dinfo;

  if (cinfo->output_scanline < cinfo->output_height) {
    dest->pub.buffer = (*cinfo->mem->access_virt_sarray)
      ((j_common_ptr) cinfo, dest->image,
       cinfo->output_scanline, (JDIMENSION) 1, TRUE);
  }
}

/*
 * Finish up at the end of the file.
 *
 * Here is where we really output the RLE file.
 */

METHODDEF(void)
finish_output_rle (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo)
{
  rle_dest_ptr dest = (rle_dest_ptr) dinfo;
  rle_hdr header;		/* Output file information */
  rle_pixel **rle_row, *red, *green, *blue;
  JSAMPROW output_row;
  char cmapcomment[80];
  int row, col;
  int ci;
#ifdef PROGRESS_REPORT
  cd_progress_ptr progress = (cd_progress_ptr) cinfo->progress;
#endif

  /* Initialize the header info */
  header = *rle_hdr_init(NULL);
  header.rle_file = dest->pub.output_file;
  header.xmin     = 0;
  header.xmax     = cinfo->output_width  - 1;
  header.ymin     = 0;
  header.ymax     = cinfo->output_height - 1;
  header.alpha    = 0;
  header.ncolors  = cinfo->output_components;
  for (ci = 0; ci < cinfo->output_components; ci++) {
    RLE_SET_BIT(header, ci);
  }
  if (cinfo->quantize_colors) {
    header.ncmap   = cinfo->out_color_components;
    header.cmaplen = CMAPBITS;
    header.cmap    = dest->colormap;
    /* Add a comment to the output image with the true colormap length. */
    sprintf(cmapcomment, "color_map_length=%d", cinfo->actual_number_of_colors);
    rle_putcom(cmapcomment, &header);
  }

  /* Emit the RLE header and color map (if any) */
  rle_put_setup(&header);

  /* Now output the RLE data from our virtual array.
   * We assume here that (a) rle_pixel is represented the same as JSAMPLE,
   * and (b) we are not on a machine where FAR pointers differ from regular.
   */

#ifdef PROGRESS_REPORT
  if (progress != NULL) {
    progress->pub.pass_limit = cinfo->output_height;
    progress->pub.pass_counter = 0;
    (*progress->pub.progress_monitor) ((j_common_ptr) cinfo);
  }
#endif

  if (cinfo->output_components == 1) {
    for (row = cinfo->output_height-1; row >= 0; row--) {
      rle_row = (rle_pixel **) (*cinfo->mem->access_virt_sarray)
        ((j_common_ptr) cinfo, dest->image,
	 (JDIMENSION) row, (JDIMENSION) 1, FALSE);
      rle_putrow(rle_row, (int) cinfo->output_width, &header);
#ifdef PROGRESS_REPORT
      if (progress != NULL) {
        progress->pub.pass_counter++;
        (*progress->pub.progress_monitor) ((j_common_ptr) cinfo);
      }
#endif
    }
  } else {
    for (row = cinfo->output_height-1; row >= 0; row--) {
      rle_row = (rle_pixel **) dest->rle_row;
      output_row = * (*cinfo->mem->access_virt_sarray)
        ((j_common_ptr) cinfo, dest->image,
	 (JDIMENSION) row, (JDIMENSION) 1, FALSE);
      red = rle_row[0];
      green = rle_row[1];
      blue = rle_row[2];
      for (col = cinfo->output_width; col > 0; col--) {
        *red++ = GETJSAMPLE(*output_row++);
        *green++ = GETJSAMPLE(*output_row++);
        *blue++ = GETJSAMPLE(*output_row++);
      }
      rle_putrow(rle_row, (int) cinfo->output_width, &header);
#ifdef PROGRESS_REPORT
      if (progress != NULL) {
        progress->pub.pass_counter++;
        (*progress->pub.progress_monitor) ((j_common_ptr) cinfo);
      }
#endif
    }
  }

#ifdef PROGRESS_REPORT
  if (progress != NULL)
    progress->completed_extra_passes++;
#endif

  /* Emit file trailer */
  rle_puteof(&header);
  fflush(dest->pub.output_file);
  if (ferror(dest->pub.output_file))
    ERREXIT(cinfo, JERR_FILE_WRITE);
}


/*
 * The module selection routine for RLE format output.
 */

GLOBAL(djpeg_dest_ptr)
jinit_write_rle (j_decompress_ptr cinfo)
{
  rle_dest_ptr dest;

  /* Create module interface object, fill in method pointers */
  dest = (rle_dest_ptr)
      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
                                  SIZEOF(rle_dest_struct));
  dest->pub.start_output = start_output_rle;
  dest->pub.finish_output = finish_output_rle;

  /* Calculate output image dimensions so we can allocate space */
  jpeg_calc_output_dimensions(cinfo);

  /* Allocate a work array for output to the RLE library. */
  dest->rle_row = (*cinfo->mem->alloc_sarray)
    ((j_common_ptr) cinfo, JPOOL_IMAGE,
     cinfo->output_width, (JDIMENSION) cinfo->output_components);

  /* Allocate a virtual array to hold the image. */
  dest->image = (*cinfo->mem->request_virt_sarray)
    ((j_common_ptr) cinfo, JPOOL_IMAGE, FALSE,
     (JDIMENSION) (cinfo->output_width * cinfo->output_components),
     cinfo->output_height, (JDIMENSION) 1);

  return (djpeg_dest_ptr) dest;
}

#endif /* RLE_SUPPORTED */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产偷国产偷精品高清尤物| 国产毛片精品国产一区二区三区| 91在线小视频| 综合精品久久久| 在线欧美小视频| 婷婷综合另类小说色区| 制服视频三区第一页精品| 日韩高清一区在线| 精品久久人人做人人爱| 福利一区福利二区| 亚洲免费av网站| 欧美日韩国产不卡| 精品一区二区综合| 国产精品毛片a∨一区二区三区| 色综合天天综合网国产成人综合天| 一区二区在线观看免费视频播放| 欧美日韩一级二级三级| 久久福利资源站| 国产精品国产自产拍高清av| 在线观看视频欧美| 精品一区二区影视| 亚洲少妇最新在线视频| 在线综合+亚洲+欧美中文字幕| 老色鬼精品视频在线观看播放| 日韩不卡一二三区| 国产亚洲综合av| 欧洲精品中文字幕| 国内精品久久久久影院一蜜桃| 国产精品久久久久精k8| 欧美剧情片在线观看| 国产综合色精品一区二区三区| 日韩毛片精品高清免费| 日韩女优av电影在线观看| 91在线你懂得| 精品综合免费视频观看| 亚洲精品日韩一| 久久综合成人精品亚洲另类欧美 | 日本午夜一区二区| 中文字幕第一页久久| 欧美精选一区二区| 成人网页在线观看| 奇米精品一区二区三区在线观看| 国产精品久久久久久久久图文区| 69成人精品免费视频| 成人av电影在线| 麻豆成人久久精品二区三区小说| 综合在线观看色| 久久精品亚洲麻豆av一区二区| 欧美日本一区二区三区四区| 成人蜜臀av电影| 美女视频免费一区| 亚洲亚洲精品在线观看| 亚洲少妇30p| 国产人伦精品一区二区| 欧美一级在线免费| 欧美亚洲另类激情小说| 成人高清av在线| 国产精品亚洲第一| 久久不见久久见中文字幕免费| 性做久久久久久免费观看欧美| 亚洲美女一区二区三区| 中文字幕一区不卡| 国产蜜臀av在线一区二区三区| 精品少妇一区二区三区免费观看 | 一区二区日韩av| 一色屋精品亚洲香蕉网站| 国产日韩欧美精品电影三级在线| 欧美电视剧在线看免费| 91精品国产美女浴室洗澡无遮挡| 欧美亚洲综合网| 在线精品视频小说1| 欧美午夜不卡在线观看免费| 91猫先生在线| 欧美亚洲一区二区在线| 在线观看视频一区二区| 欧美偷拍一区二区| 欧美日韩一区二区在线视频| 欧美调教femdomvk| 欧美日韩国产另类不卡| 亚洲男人天堂av网| 亚洲高清视频的网址| 亚洲高清在线视频| 五月天中文字幕一区二区| 亚洲成人资源网| 亚洲图片欧美一区| 2014亚洲片线观看视频免费| 日韩一区二区在线播放| 在线电影国产精品| 欧美精品在线一区二区三区| 高清不卡一区二区在线| 加勒比av一区二区| 国产一区二区中文字幕| 久草精品在线观看| 极品瑜伽女神91| 国产一区二区三区在线观看免费 | 欧美绝品在线观看成人午夜影视| 在线中文字幕一区| 欧美午夜在线一二页| 在线精品视频一区二区| 91丨九色丨蝌蚪丨老版| 91成人在线精品| 欧美军同video69gay| 在线91免费看| 欧美一区二区三区男人的天堂| 欧美美女喷水视频| 日韩一区二区三| 欧美三级电影精品| 精品国精品国产尤物美女| 亚洲精品一区二区三区精华液| 精品国产一区二区国模嫣然| 久久欧美中文字幕| 国产精品久久久久久久岛一牛影视 | 日韩理论电影院| 亚洲免费电影在线| 日韩二区在线观看| 国产一区二区三区在线观看精品| 国产麻豆成人传媒免费观看| 久久精品国产亚洲高清剧情介绍| 亚洲va欧美va人人爽午夜| 日韩不卡一二三区| 国产成a人亚洲精品| 在线精品视频免费观看| 91精品国产综合久久久久久久| 欧美精品一区二区三区一线天视频| 国产三级精品三级| 亚洲自拍另类综合| 韩国视频一区二区| 97久久久精品综合88久久| 777午夜精品免费视频| 国产视频一区在线观看| 国产欧美一区二区三区鸳鸯浴| 婷婷综合在线观看| 成人av第一页| 欧美性大战久久久久久久| 欧美日韩国产高清一区| 日本一区免费视频| 日韩高清欧美激情| av福利精品导航| 欧美一区二区三区爱爱| 国产精品色在线| 免费xxxx性欧美18vr| 不卡av在线网| 日韩视频永久免费| 亚洲精品伦理在线| 国产精品91xxx| 欧美精选在线播放| 亚洲婷婷综合色高清在线| 蜜臀av国产精品久久久久| 色哟哟在线观看一区二区三区| 国产视频亚洲色图| 麻豆精品视频在线观看视频| 91麻豆国产精品久久| 精品国产精品一区二区夜夜嗨| 亚洲精品视频在线| 激情综合亚洲精品| 久久夜色精品一区| 日韩中文字幕区一区有砖一区| 色综合一个色综合| 国产精品区一区二区三| 三级一区在线视频先锋 | 日韩亚洲欧美在线观看| 久久久久国产成人精品亚洲午夜| 美女脱光内衣内裤视频久久影院| 欧洲精品中文字幕| 中文字幕亚洲一区二区av在线| 国产在线精品一区二区不卡了 | 国产精品女人毛片| 激情六月婷婷久久| 日韩三级伦理片妻子的秘密按摩| 亚洲一区二区三区小说| 成人开心网精品视频| 国产精品入口麻豆原神| 国产精品中文欧美| 久久久久久免费网| 韩国成人在线视频| 精品国产露脸精彩对白| 狠狠色丁香婷婷综合| 欧美电影免费观看高清完整版在| 五月激情综合婷婷| 欧美日韩午夜影院| 性欧美疯狂xxxxbbbb| 在线免费亚洲电影| 亚洲精品国产成人久久av盗摄 | 国产精品毛片久久久久久| 国产91清纯白嫩初高中在线观看| 欧美成人高清电影在线| 久久9热精品视频| 欧美一区二区三区播放老司机| 国产自产视频一区二区三区| 久久人人97超碰com| 国产精品综合一区二区三区| 久久人人爽人人爽| 国产91高潮流白浆在线麻豆 | 中文字幕视频一区| 91浏览器在线视频| 夜夜揉揉日日人人青青一国产精品| 欧美亚洲丝袜传媒另类| 亚洲激情成人在线| 日韩欧美一区二区免费| 激情av综合网|