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

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

?? rdbmp.pas

?? DELPHI版的JPEG文件解碼源程序
?? PAS
?? 第 1 頁 / 共 2 頁
字號:
Unit RdBmp;

{ rdbmp.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 contains routines to read input images in Microsoft "BMP"
  format (MS Windows 3.x, OS/2 1.x, and OS/2 2.x flavors).
  Currently, only 8-bit and 24-bit images are supported, not 1-bit or
  4-bit (feeding such low-depth images into JPEG would be silly anyway).
  Also, we don't support RLE-compressed files.

  These routines may need modification for non-Unix environments or
  specialized applications.  As they stand, they assume input from
  an ordinary stdio stream.  They further assume that reading begins
  at the start of the file; start_input may need work if the
  user interface has already read some data (e.g., to determine that
  the file is indeed BMP format).

  This code contributed by James Arthur Boucher. }

interface

{$I jconfig.inc}

uses
  jmorecfg,
  jpeglib,
  jinclude,
  jdeferr,
  jerror,
  cdjpeg;		{ Common decls for cjpeg/djpeg applications }

{ The module selection routine for BMP format input. }

{GLOBAL}
function jinit_read_bmp (cinfo : j_compress_ptr) : cjpeg_source_ptr;

implementation

{ Macros to deal with unsigned chars as efficiently as compiler allows }

{$define HAVE_UNSIGNED_CHAR}
{$ifdef HAVE_UNSIGNED_CHAR}
type
  U_CHAR =  byte;
  UCH = int;
{$else} { !HAVE_UNSIGNED_CHAR }
  {$ifdef CHAR_IS_UNSIGNED}
  type
    U_CHAR = char;
    UCH = int;
  {$else}
  type
    U_CHAR = char;
    UCH = int(x) and $FF
  {$endif}
{$endif} { HAVE_UNSIGNED_CHAR }


{ Private version of data source object }

type
  bmp_source_ptr = ^bmp_source_struct;
  bmp_source_struct = record
    pub : cjpeg_source_struct; { public fields }

    cinfo : j_compress_ptr;		{ back link saves passing separate parm }

    colormap : JSAMPARRAY;		{ BMP colormap (converted to my format) }

    whole_image : jvirt_sarray_ptr;	{ Needed to reverse row order }
    source_row : JDIMENSION;	{ Current source row number }
    row_width : JDIMENSION;		{ Physical width of scanlines in file }

    bits_per_pixel : int;		{ remembers 8- or 24-bit format }
  end; { bmp_source_struct }


{LOCAL}
function read_byte (sinfo : bmp_source_ptr) : int;
{ Read next byte from BMP file }
var
  {register} infile : FILEptr;
  {register} c : byte;
begin
  infile := sinfo^.pub.input_file;
  if JFREAD(infile, @c, 1) <> size_t(1) then
    ERREXIT(j_common_ptr(sinfo^.cinfo), JERR_INPUT_EOF);
  read_byte  := c;
end;


{LOCAL}
procedure read_colormap (sinfo : bmp_source_ptr;
                         cmaplen : int;
                         mapentrysize : int);
{ Read the colormap from a BMP file }
var
  i : int;
begin
  case (mapentrysize) of
  3:{ BGR format (occurs in OS/2 files) }
    for i := 0 to pred(cmaplen) do
    begin
      sinfo^.colormap^[2]^[i] := JSAMPLE (read_byte(sinfo));
      sinfo^.colormap^[1]^[i] := JSAMPLE (read_byte(sinfo));
      sinfo^.colormap^[0]^[i] := JSAMPLE (read_byte(sinfo));
    end;
  4:{ BGR0 format (occurs in MS Windows files) }
    for i := 0 to pred(cmaplen) do
    begin
      sinfo^.colormap^[2]^[i] := JSAMPLE (read_byte(sinfo));
      sinfo^.colormap^[1]^[i] := JSAMPLE (read_byte(sinfo));
      sinfo^.colormap^[0]^[i] := JSAMPLE (read_byte(sinfo));
      {void} read_byte(sinfo);
    end;
  else
    ERREXIT(j_common_ptr(sinfo^.cinfo), JERR_BMP_BADCMAP);
  end;
end;


{ Read one row of pixels.
  The image has been read into the whole_image array, but is otherwise
  unprocessed.  We must read it out in top-to-bottom row order, and if
  it is an 8-bit image, we must expand colormapped pixels to 24bit format. }

{METHODDEF}
function  get_8bit_row (cinfo : j_compress_ptr;
                        sinfo : cjpeg_source_ptr) : JDIMENSION; far;
{ This version is for reading 8-bit colormap indexes }
var
  source : bmp_source_ptr;
  {register} colormap : JSAMPARRAY;
  image_ptr : JSAMPARRAY;
  {register} t : int;
  {register} inptr, outptr : JSAMPLE_PTR;
  {register} col : JDIMENSION;
begin
  source := bmp_source_ptr (sinfo);
  colormap := source^.colormap;
  { Fetch next row from virtual array }
  Dec(source^.source_row);
  image_ptr := cinfo^.mem^.access_virt_sarray(
     j_common_ptr (cinfo), source^.whole_image,
     source^.source_row, JDIMENSION (1), FALSE);

  { Expand the colormap indexes to real data }
  inptr := JSAMPLE_PTR(image_ptr^[0]);
  outptr := JSAMPLE_PTR(source^.pub.buffer^[0]);
  for col := pred(cinfo^.image_width) downto 0 do
  begin
    t := GETJSAMPLE(inptr^);
    Inc(inptr);
    outptr^ := colormap^[0]^[t];       { can omit GETJSAMPLE() safely }
    Inc(outptr);
    outptr^ := colormap^[1]^[t];
    Inc(outptr);
    outptr^ := colormap^[2]^[t];
    Inc(outptr);
  end;

  get_8bit_row  := 1;
end;


{METHODDEF}
function get_24bit_row (cinfo : j_compress_ptr;
                        sinfo : cjpeg_source_ptr) : JDIMENSION; far;
{ This version is for reading 24-bit pixels }
var
  source : bmp_source_ptr;
  image_ptr : JSAMPARRAY;
  {register} inptr : JSAMPLE_PTR;
  {register} outptr : JSAMPROW;
  {register} col : JDIMENSION;
begin
  source := bmp_source_ptr (sinfo);
  { Fetch next row from virtual array }
  Dec(source^.source_row);
  image_ptr := cinfo^.mem^.access_virt_sarray (
     j_common_ptr (cinfo), source^.whole_image,
     source^.source_row, JDIMENSION (1), FALSE);

  { Transfer data.  Note source values are in BGR order
    (even though Microsoft's own documents say the opposite). }

  inptr := JSAMPLE_PTR(image_ptr^[0]);
  outptr := source^.pub.buffer^[0];
  for col := pred(cinfo^.image_width) downto 0 do
  begin
    outptr^[2] := inptr^;	{ can omit GETJSAMPLE() safely }
    Inc(inptr);
    outptr^[1] := inptr^;
    Inc(inptr);
    outptr^[0] := inptr^;
    Inc(inptr);
    Inc(JSAMPLE_PTR(outptr), 3);
  end;

  get_24bit_row := 1;
end;


{ 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_8bit_row or get_24bit_row on subsequent calls. }

{METHODDEF}
function preload_image (cinfo : j_compress_ptr;
                        sinfo : cjpeg_source_ptr) : JDIMENSION; far;
var
  source : bmp_source_ptr;
  {register} infile : FILEptr;
  {$IFDEF Original}
  {register} c : int;
  {$ENDIF}
  {register} out_ptr : JSAMPLE_PTR;
  image_ptr : JSAMPARRAY;
  row : JDIMENSION;
  {$IFDEF Original}
  col : JDIMENSION;
  {$ENDIF}
  progress : cd_progress_ptr;
begin
  source := bmp_source_ptr (sinfo);
  infile := source^.pub.input_file;
  progress := cd_progress_ptr (cinfo^.progress);

  { Read the data into a virtual array in input-file row order. }
  for row := 0 to pred(cinfo^.image_height) do
  begin
    if (progress <> NIL) then
    begin
      progress^.pub.pass_counter := long (row);
      progress^.pub.pass_limit := long (cinfo^.image_height);
      progress^.pub.progress_monitor (j_common_ptr (cinfo));
    end;
    image_ptr := cinfo^.mem^.access_virt_sarray (
       j_common_ptr (cinfo), source^.whole_image,
       row, JDIMENSION (1), TRUE);
    out_ptr := JSAMPLE_PTR(image_ptr^[0]);
    {$IFDEF Original}
    for col := pred(source^.row_width) downto 0 do
    begin
      { inline copy of read_byte() for speed }
      c := getc(infile);
      if (c = EOF) then
	ERREXIT(j_common_ptr(cinfo), JERR_INPUT_EOF);
      out_ptr^ := JSAMPLE (c);
      Inc(out_ptr);
    end;
    {$ELSE}
    if JFREAD(infile, out_ptr, source^.row_width) <>
      size_t(source^.row_width) then
	ERREXIT(j_common_ptr(cinfo), JERR_INPUT_EOF);
    {$ENDIF}
  end;
  if (progress <> NIL) then
    Inc(progress^.completed_extra_passes);

  { Set up to read from the virtual array in top-to-bottom order }
  case (source^.bits_per_pixel) of
   8: source^.pub.get_pixel_rows := get_8bit_row;
  24: source^.pub.get_pixel_rows := get_24bit_row;
  else
    ERREXIT(j_common_ptr(cinfo), JERR_BMP_BADDEPTH);
  end;
  source^.source_row := cinfo^.image_height;

  { And read the first row }
  preload_image := source^.pub.get_pixel_rows (cinfo, sinfo);

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品在线免费视频| 性感美女极品91精品| 欧美午夜在线观看| 五月天亚洲婷婷| 国产喂奶挤奶一区二区三区 | 裸体在线国模精品偷拍| 国产精品免费视频网站| 成人精品高清在线| 午夜一区二区三区在线观看| 国产亚洲一区字幕| 欧美色手机在线观看| 国产成人自拍在线| 亚洲成人av一区二区| 国产日韩欧美综合一区| 欧美日韩成人高清| 国产乱国产乱300精品| 亚洲国产视频a| 国产欧美精品一区二区色综合朱莉| 在线中文字幕不卡| 成人综合在线观看| 午夜日韩在线观看| 中文字幕在线一区| 精品国产亚洲在线| 欧美日韩亚洲国产综合| 91视频在线观看| 国产一区二区在线观看视频| 亚洲综合丁香婷婷六月香| 久久久午夜电影| 欧美一区二区三区婷婷月色| 成人动漫一区二区| 成人免费av网站| 高清av一区二区| 成人黄动漫网站免费app| 国产精品1024| 国产成人av一区二区三区在线| 久久成人免费网站| 国产九色精品成人porny| 韩国女主播成人在线| 久久狠狠亚洲综合| 激情五月激情综合网| 精品系列免费在线观看| 国产乱一区二区| 国产成人免费视频网站高清观看视频| 国产一区二区在线观看免费 | 欧美日韩另类一区| 欧美男人的天堂一二区| 7777精品伊人久久久大香线蕉超级流畅 | 日韩电影在线免费观看| 日本少妇一区二区| 免费成人美女在线观看.| 久久99精品久久久久久久久久久久| 久99久精品视频免费观看| 国产精品综合av一区二区国产馆| 国产成人亚洲精品狼色在线| 成人性视频免费网站| 色婷婷激情久久| 欧美裸体bbwbbwbbw| 精品福利一二区| 国产精品日韩精品欧美在线| 一区二区三区资源| 视频一区二区三区入口| 激情成人综合网| 成人av片在线观看| 欧美精品丝袜中出| 久久久久久久电影| 亚洲在线中文字幕| 精品在线免费观看| 色av一区二区| 日韩一区二区三区电影在线观看| 亚洲国产精品成人综合| 亚洲国产欧美在线| 寂寞少妇一区二区三区| 色素色在线综合| 日韩美女视频在线| 亚洲三级免费观看| 麻豆精品在线看| 97久久超碰国产精品电影| 91精品欧美福利在线观看| 欧美极品少妇xxxxⅹ高跟鞋| 一区二区三区日韩在线观看| 免费在线观看不卡| 91色九色蝌蚪| 精品久久五月天| 亚洲精品乱码久久久久久久久| 久久99精品久久久久久动态图| 99国产精品久久久久| 9191成人精品久久| 国产精品国产a级| 紧缚奴在线一区二区三区| 一本到高清视频免费精品| 欧美精品一区男女天堂| 亚洲午夜精品17c| 成人午夜免费电影| 欧美一区二区三区喷汁尤物| 亚洲色图丝袜美腿| 国产美女娇喘av呻吟久久| 欧美综合天天夜夜久久| 国产精品拍天天在线| 老司机精品视频一区二区三区| 91女厕偷拍女厕偷拍高清| 2020日本不卡一区二区视频| 亚洲1区2区3区视频| 日本韩国一区二区三区视频| 国产日韩欧美不卡在线| 久久aⅴ国产欧美74aaa| 国产精品另类一区| 免费成人性网站| 欧美日韩国产精选| 一区二区三区四区亚洲| 成人禁用看黄a在线| 精品美女在线播放| 蜜臀精品久久久久久蜜臀| 欧美亚一区二区| 亚洲男女一区二区三区| 成人99免费视频| 国产欧美日韩综合精品一区二区| 免费看黄色91| 日韩一区二区在线观看| 香蕉加勒比综合久久| 欧美日韩一级黄| 亚洲国产一区二区在线播放| 日本韩国欧美在线| 最新日韩av在线| 91在线观看视频| 亚洲人成在线观看一区二区| 91香蕉视频mp4| 日韩美女精品在线| 91网站视频在线观看| 亚洲色图欧美激情| 欧洲一区二区三区在线| 一区二区高清免费观看影视大全 | 青草国产精品久久久久久| 欧美日本韩国一区| 亚洲成人免费在线观看| 欧美图片一区二区三区| 亚洲高清一区二区三区| 9191久久久久久久久久久| 日本强好片久久久久久aaa| 7777精品伊人久久久大香线蕉 | 久久精品国产99久久6| 欧美人妖巨大在线| 免费的国产精品| 久久麻豆一区二区| 成人免费视频视频| 椎名由奈av一区二区三区| 一本色道久久综合亚洲91| 依依成人精品视频| 欧美精品在线视频| 极品少妇xxxx偷拍精品少妇| 国产农村妇女毛片精品久久麻豆| 99久免费精品视频在线观看| 亚洲免费在线看| 欧美一区在线视频| 国产剧情一区在线| 亚洲男女一区二区三区| 欧美久久一二区| 黄色成人免费在线| 日韩一区在线播放| 欧美日韩高清一区二区不卡| 久久se精品一区二区| 国产精品九色蝌蚪自拍| 欧美日韩成人在线| 国产精品996| 一区二区三区在线免费观看| 69久久夜色精品国产69蝌蚪网| 国产在线观看一区二区| 综合久久久久久久| 51午夜精品国产| 国产成人在线视频网址| 亚洲精品ww久久久久久p站| 日韩欧美综合在线| 97精品超碰一区二区三区| 午夜精品久久久久久久| 久久色.com| 欧美三区在线观看| 国产精品99久久久久久有的能看| 亚洲精选一二三| 欧美精品一区二区三区一线天视频 | 国产一区二区三区免费看 | 色综合视频一区二区三区高清| 日日摸夜夜添夜夜添亚洲女人| 国产日韩影视精品| 欧美日韩国产综合久久| 成人污视频在线观看| 日韩中文欧美在线| 亚洲欧美影音先锋| 精品99一区二区| 欧美精品一二三| 一本色道久久综合亚洲91| 国产在线精品免费| 日韩精品久久理论片| 中文字幕在线一区二区三区| 欧美成人官网二区| 欧美午夜视频网站| 94-欧美-setu| 国产suv一区二区三区88区| 日韩av一级电影| 亚洲综合久久久| 亚洲视频在线观看一区| 国产色产综合色产在线视频|