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

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

?? rdtarga.c

?? JPEG source code converts the image into compressed format
?? C
?? 第 1 頁 / 共 2 頁
字號:
  }
  return 1;
}

/*
 * Targa also defines a 32-bit pixel format with order B,G,R,A.
 * We presently ignore the attribute byte, so the code for reading
 * these pixels is identical to the 24-bit routine above.
 * This works because the actual pixel length is only known to read_pixel.
 */

#define get_32bit_row  get_24bit_row


/*
 * This method is for re-reading the input data in standard top-down
 * row order.  The entire image has already been read into whole_image
 * with proper conversion of pixel format, but it's in a funny row order.
 */

METHODDEF(JDIMENSION)
get_memory_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)
{
  tga_source_ptr source = (tga_source_ptr) sinfo;
  JDIMENSION source_row;

  /* Compute row of source that maps to current_row of normal order */
  /* For now, assume image is bottom-up and not interlaced. */
  /* NEEDS WORK to support interlaced images! */
  source_row = cinfo->image_height - source->current_row - 1;

  /* Fetch that row from virtual array */
  source->pub.buffer = (*cinfo->mem->access_virt_sarray)
    ((j_common_ptr) cinfo, source->whole_image,
     source_row, (JDIMENSION) 1, FALSE);

  source->current_row++;
  return 1;
}


/*
 * This method loads the image into whole_image during the first call on
 * get_pixel_rows.  The get_pixel_rows pointer is then adjusted to call
 * get_memory_row on subsequent calls.
 */

METHODDEF(JDIMENSION)
preload_image (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)
{
  tga_source_ptr source = (tga_source_ptr) sinfo;
  JDIMENSION row;
  cd_progress_ptr progress = (cd_progress_ptr) cinfo->progress;

  /* Read the data into a virtual array in input-file row order. */
  for (row = 0; row < cinfo->image_height; row++) {
    if (progress != NULL) {
      progress->pub.pass_counter = (long) row;
      progress->pub.pass_limit = (long) cinfo->image_height;
      (*progress->pub.progress_monitor) ((j_common_ptr) cinfo);
    }
    source->pub.buffer = (*cinfo->mem->access_virt_sarray)
      ((j_common_ptr) cinfo, source->whole_image, row, (JDIMENSION) 1, TRUE);
    (*source->get_pixel_rows) (cinfo, sinfo);
  }
  if (progress != NULL)
    progress->completed_extra_passes++;

  /* Set up to read from the virtual array in unscrambled order */
  source->pub.get_pixel_rows = get_memory_row;
  source->current_row = 0;
  /* And read the first row */
  return get_memory_row(cinfo, sinfo);
}


/*
 * Read the file header; return image size and component count.
 */

METHODDEF(void)
start_input_tga (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)
{
  tga_source_ptr source = (tga_source_ptr) sinfo;
  U_CHAR targaheader[18];
  int idlen, cmaptype, subtype, flags, interlace_type, components;
  unsigned int width, height, maplen;
  boolean is_bottom_up;

#define GET_2B(offset)	((unsigned int) UCH(targaheader[offset]) + \
			 (((unsigned int) UCH(targaheader[offset+1])) << 8))

  if (! ReadOK(source->pub.input_file, targaheader, 18))
    ERREXIT(cinfo, JERR_INPUT_EOF);

  /* Pretend "15-bit" pixels are 16-bit --- we ignore attribute bit anyway */
  if (targaheader[16] == 15)
    targaheader[16] = 16;

  idlen = UCH(targaheader[0]);
  cmaptype = UCH(targaheader[1]);
  subtype = UCH(targaheader[2]);
  maplen = GET_2B(5);
  width = GET_2B(12);
  height = GET_2B(14);
  source->pixel_size = UCH(targaheader[16]) >> 3;
  flags = UCH(targaheader[17]);	/* Image Descriptor byte */

  is_bottom_up = ((flags & 0x20) == 0);	/* bit 5 set => top-down */
  interlace_type = flags >> 6;	/* bits 6/7 are interlace code */

  if (cmaptype > 1 ||		/* cmaptype must be 0 or 1 */
      source->pixel_size < 1 || source->pixel_size > 4 ||
      (UCH(targaheader[16]) & 7) != 0 || /* bits/pixel must be multiple of 8 */
      interlace_type != 0)	/* currently don't allow interlaced image */
    ERREXIT(cinfo, JERR_TGA_BADPARMS);
  
  if (subtype > 8) {
    /* It's an RLE-coded file */
    source->read_pixel = read_rle_pixel;
    source->block_count = source->dup_pixel_count = 0;
    subtype -= 8;
  } else {
    /* Non-RLE file */
    source->read_pixel = read_non_rle_pixel;
  }

  /* Now should have subtype 1, 2, or 3 */
  components = 3;		/* until proven different */
  cinfo->in_color_space = JCS_RGB;

  switch (subtype) {
  case 1:			/* Colormapped image */
    if (source->pixel_size == 1 && cmaptype == 1)
      source->get_pixel_rows = get_8bit_row;
    else
      ERREXIT(cinfo, JERR_TGA_BADPARMS);
    TRACEMS2(cinfo, 1, JTRC_TGA_MAPPED, width, height);
    break;
  case 2:			/* RGB image */
    switch (source->pixel_size) {
    case 2:
      source->get_pixel_rows = get_16bit_row;
      break;
    case 3:
      source->get_pixel_rows = get_24bit_row;
      break;
    case 4:
      source->get_pixel_rows = get_32bit_row;
      break;
    default:
      ERREXIT(cinfo, JERR_TGA_BADPARMS);
      break;
    }
    TRACEMS2(cinfo, 1, JTRC_TGA, width, height);
    break;
  case 3:			/* Grayscale image */
    components = 1;
    cinfo->in_color_space = JCS_GRAYSCALE;
    if (source->pixel_size == 1)
      source->get_pixel_rows = get_8bit_gray_row;
    else
      ERREXIT(cinfo, JERR_TGA_BADPARMS);
    TRACEMS2(cinfo, 1, JTRC_TGA_GRAY, width, height);
    break;
  default:
    ERREXIT(cinfo, JERR_TGA_BADPARMS);
    break;
  }

  if (is_bottom_up) {
    /* Create a virtual array to buffer the upside-down image. */
    source->whole_image = (*cinfo->mem->request_virt_sarray)
      ((j_common_ptr) cinfo, JPOOL_IMAGE, FALSE,
       (JDIMENSION) width * components, (JDIMENSION) height, (JDIMENSION) 1);
    if (cinfo->progress != NULL) {
      cd_progress_ptr progress = (cd_progress_ptr) cinfo->progress;
      progress->total_extra_passes++; /* count file input as separate pass */
    }
    /* source->pub.buffer will point to the virtual array. */
    source->pub.buffer_height = 1; /* in case anyone looks at it */
    source->pub.get_pixel_rows = preload_image;
  } else {
    /* Don't need a virtual array, but do need a one-row input buffer. */
    source->whole_image = NULL;
    source->pub.buffer = (*cinfo->mem->alloc_sarray)
      ((j_common_ptr) cinfo, JPOOL_IMAGE,
       (JDIMENSION) width * components, (JDIMENSION) 1);
    source->pub.buffer_height = 1;
    source->pub.get_pixel_rows = source->get_pixel_rows;
  }
  
  while (idlen--)		/* Throw away ID field */
    (void) read_byte(source);

  if (maplen > 0) {
    if (maplen > 256 || GET_2B(3) != 0)
      ERREXIT(cinfo, JERR_TGA_BADCMAP);
    /* Allocate space to store the colormap */
    source->colormap = (*cinfo->mem->alloc_sarray)
      ((j_common_ptr) cinfo, JPOOL_IMAGE, (JDIMENSION) maplen, (JDIMENSION) 3);
    /* and read it from the file */
    read_colormap(source, (int) maplen, UCH(targaheader[7]));
  } else {
    if (cmaptype)		/* but you promised a cmap! */
      ERREXIT(cinfo, JERR_TGA_BADPARMS);
    source->colormap = NULL;
  }

  cinfo->input_components = components;
  cinfo->data_precision = 8;
  cinfo->image_width = width;
  cinfo->image_height = height;
}


/*
 * Finish up at the end of the file.
 */

METHODDEF(void)
finish_input_tga (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)
{
  /* no work */
}


/*
 * The module selection routine for Targa format input.
 */

GLOBAL(cjpeg_source_ptr)
jinit_read_targa (j_compress_ptr cinfo)
{
  tga_source_ptr source;

  /* Create module interface object */
  source = (tga_source_ptr)
      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
				  SIZEOF(tga_source_struct));
  source->cinfo = cinfo;	/* make back link for subroutines */
  /* Fill in method ptrs, except get_pixel_rows which start_input sets */
  source->pub.start_input = start_input_tga;
  source->pub.finish_input = finish_input_tga;

  return (cjpeg_source_ptr) source;
}

#endif /* TARGA_SUPPORTED */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美老女人第四色| 亚洲欧美日韩一区| 91麻豆精品国产自产在线观看一区 | 水蜜桃久久夜色精品一区的特点| 香港成人在线视频| 国产精品正在播放| 91色porny在线视频| 欧美精品日日鲁夜夜添| 日日夜夜一区二区| 欧美一区二区三区爱爱| 亚洲人成网站精品片在线观看| 99国产精品99久久久久久| 日韩视频国产视频| 一区二区三区美女| 成人免费黄色在线| 日韩欧美国产一区在线观看| 亚洲午夜免费福利视频| 色综合久久天天| 欧美一级欧美三级| 国产美女一区二区三区| 欧美日韩精品一区二区在线播放 | 欧美精品xxxxbbbb| 美美哒免费高清在线观看视频一区二区 | 国产精品嫩草影院av蜜臀| 日本视频一区二区三区| 欧洲视频一区二区| 中文字幕在线不卡一区| 国产美女久久久久| 亚洲欧美一区二区三区国产精品| 欧美日韩一区二区三区高清| 亚洲一区二区三区国产| 色域天天综合网| 人妖欧美一区二区| 91精品免费在线观看| 国产精品1区二区.| 亚洲香蕉伊在人在线观| 26uuu另类欧美| 精品一区二区三区在线播放| 欧美无人高清视频在线观看| 亚洲无线码一区二区三区| 欧美一区二区三区免费| 成人晚上爱看视频| 蜜桃精品视频在线| 亚洲中国最大av网站| 久久精品免费在线观看| 精品一区二区在线免费观看| 亚洲三级视频在线观看| 欧美日韩免费一区二区三区| 国产成人丝袜美腿| 国产精品久久久久国产精品日日| 成人精品视频一区二区三区尤物| 日韩二区三区在线观看| 亚洲欧美成aⅴ人在线观看| 久久久久久久久99精品| 岛国精品在线观看| 久久国产精品99久久人人澡| 久久精品亚洲精品国产欧美| 欧美久久久久久久久久| 色综合久久综合网97色综合| 国产高清无密码一区二区三区| 日日夜夜免费精品| 亚洲图片欧美视频| 亚洲色图制服诱惑 | 欧美激情一区二区三区| 成人国产精品免费网站| 亚洲少妇30p| 国产精品你懂的| 国产欧美va欧美不卡在线| 99精品视频在线播放观看| 国产乱码精品一区二区三 | 国产偷v国产偷v亚洲高清| 日韩欧美一级二级三级| 日韩欧美精品在线| 精品日韩欧美在线| 99国产精品久久| aaa欧美日韩| 麻豆91在线播放免费| 图片区小说区国产精品视频| 欧美激情在线看| 久久久久久97三级| 日本一区二区三区四区| 国产网红主播福利一区二区| 亚洲国产精品激情在线观看| 国产日韩欧美高清在线| 国产精品午夜免费| 亚洲欧洲另类国产综合| 国产精品国产自产拍在线| 中文字幕一区二区三| 亚洲精品视频观看| 久久夜色精品国产噜噜av| 久久久五月婷婷| 久久亚洲综合色| 亚洲图片你懂的| 亚洲精品高清在线| 亚洲国产一区二区a毛片| 日韩综合在线视频| 久久91精品久久久久久秒播| 国产一区二区免费视频| 成人免费观看av| 欧美在线看片a免费观看| 欧美日韩国产精品自在自线| 精品久久国产字幕高潮| 久久精品免视看| 亚洲精品老司机| 日韩在线一区二区| 国产酒店精品激情| 99国产精品99久久久久久| 欧美挠脚心视频网站| 精品av久久707| 91精品国产综合久久蜜臀| 日韩免费福利电影在线观看| 国产欧美日韩激情| 亚洲电影你懂得| 国产成人精品一区二区三区四区 | 亚洲婷婷在线视频| 亚洲国产一区二区视频| 精品一区二区三区日韩| 不卡的av中国片| 欧美日韩国产美女| 国产欧美一区二区三区在线看蜜臀| 亚洲人被黑人高潮完整版| 秋霞电影网一区二区| 成人97人人超碰人人99| 69堂亚洲精品首页| 亚洲视频免费在线| 中文字幕制服丝袜一区二区三区| 亚洲天堂免费在线观看视频| 天天色综合天天| 国产剧情av麻豆香蕉精品| 欧美日韩一区不卡| 中文在线资源观看网站视频免费不卡| 香蕉久久一区二区不卡无毒影院| 国产成都精品91一区二区三 | 亚洲一区二区三区免费视频| 国产在线国偷精品产拍免费yy| 91视频在线观看| 久久精品在线免费观看| 亚洲图片欧美一区| 99国产精品久久久久久久久久久| 久久伊人中文字幕| 日韩精品五月天| 91福利小视频| 欧美午夜片在线看| 中文字幕电影一区| 免费观看一级特黄欧美大片| 在线中文字幕一区| 国产精品久久久久久亚洲毛片 | 91麻豆免费在线观看| 精品久久久久久久久久久院品网| 亚洲成av人片在线| 91黄色免费网站| 国产精品理论在线观看| 国产又粗又猛又爽又黄91精品| 91麻豆精品国产综合久久久久久| 一级做a爱片久久| 91亚洲国产成人精品一区二三| 亚洲精品一区二区三区影院 | 国产精品福利影院| 国产麻豆精品久久一二三| 日韩视频免费观看高清完整版在线观看 | 亚洲国产精品t66y| 国产一区二区在线免费观看| 欧美成va人片在线观看| 奇米精品一区二区三区四区| 7777精品伊人久久久大香线蕉经典版下载| 一区二区三区在线视频播放| 一本久道久久综合中文字幕| 1024精品合集| 91在线国产福利| 依依成人精品视频| 色噜噜久久综合| 亚洲国产综合在线| 9191精品国产综合久久久久久| 三级一区在线视频先锋| 日韩一区二区视频| 黑人巨大精品欧美黑白配亚洲| 99麻豆久久久国产精品免费| 中文字幕一区二区三| 99久久99久久精品免费观看| 亚洲精品大片www| 欧美日韩国产高清一区二区| 日韩影视精彩在线| 日韩一本二本av| 国产尤物一区二区在线| 国产精品久久久久久久第一福利| 色综合天天综合色综合av| 欧美成人a∨高清免费观看| 国产精品自在欧美一区| 中文字幕va一区二区三区| 一本大道久久精品懂色aⅴ| 亚洲亚洲精品在线观看| 日韩一级片在线观看| 国产98色在线|日韩| 亚洲女同一区二区| 欧美一区二区三区免费大片| 国产成人精品在线看| 一区二区三区四区蜜桃| 日韩一区二区三免费高清| 国产91精品露脸国语对白| 亚洲免费av在线|