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

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

?? example.pas

?? DELPHI版的JPEG文件解碼源程序
?? PAS
?? 第 1 頁 / 共 2 頁
字號:
{ ERROR HANDLING:

  The JPEG library's standard error handler (jerror.c) is divided into
  several "methods" which you can override individually.  This lets you
  adjust the behavior without duplicating a lot of code, which you might
  have to update with each future release.

  Our example here shows how to override the "error_exit" method so that
  control is returned to the library's caller when a fatal error occurs,
  rather than calling exit() as the standard error_exit method does.

  We use C's setjmp/longjmp facility to return control.  This means that the
  routine which calls the JPEG library must first execute a setjmp() call to
  establish the return point.  We want the replacement error_exit to do a
  longjmp().  But we need to make the setjmp buffer accessible to the
  error_exit routine.  To do this, we make a private extension of the
  standard JPEG error handler object.  (If we were using C++, we'd say we
  were making a subclass of the regular error handler.) }

{$IFDEF TEST ---------------------------------------------------------------}

{extern}
type
  jmp_buf = pointer;

  { This routine does the output }
  procedure put_scanline_someplace(buffer : JSAMPROW; row_stride : int);
     forward;

  { define an error recovery point. Return 0 when OK }
  function setjmp(setjmp_buffer : jmp_buf) : int;
     forward;

  { Return control to the setjmp point }
  procedure longjmp(setjmp_buffer : jmp_buf; flag : int);
     forward;

{$ENDIF --------------------------------------------------------------------}


{ Here's the extended error handler struct: }
type
  my_error_ptr = ^my_error_mgr;
  my_error_mgr = record
    pub : jpeg_error_mgr;	{ "public" fields }

    setjmp_buffer : jmp_buf;	{ for return to caller }
  end;


{ Here's the routine that will replace the standard error_exit method: }

{METHODDEF}
procedure my_error_exit (cinfo : j_common_ptr); far;
var
  myerr : my_error_ptr;
begin
  { cinfo^.err really points to a my_error_mgr struct, so coerce pointer }
  myerr := my_error_ptr (cinfo^.err);

  { Always display the message. }
  { We could postpone this until after returning, if we chose. }
  cinfo^.err^.output_message (cinfo);

  { Return control to the setjmp point }
  longjmp(myerr^.setjmp_buffer, 1);
end;


{ Sample routine for JPEG decompression.  We assume that the source file name
  is passed in.  We want to return 1 on success, 0 on error. }


{GLOBAL}
function read_JPEG_file (filename : string) : boolean;
var
  { This struct contains the JPEG decompression parameters and pointers to
    working space (which is allocated as needed by the JPEG library). }

  cinfo : jpeg_decompress_struct;
  { We use our private extension JPEG error handler.
    Note that this struct must live as long as the main JPEG parameter
    struct, to avoid dangling-pointer problems. }

  jerr  : my_error_mgr;
  { More stuff }
  infile : FILE;		{ source file }
  buffer : JSAMPARRAY;		{ Output row buffer }
  row_stride : int;		{ physical row width in output buffer }
begin

  { In this example we want to open the input file before doing anything else,
    so that the setjmp() error recovery below can assume the file is open.
    VERY IMPORTANT: use "b" option to fopen() if you are on a machine that
    requires it in order to read binary files. }

  Assign(infile, filename);
  {$I-}
  Reset(infile, 1);
  {$IFDEF IoCheck} {$I+} {$ENDIF}
  if (IOresult <> 0) then
  begin
    WriteLn(output, 'can''t open ', filename);
    read_JPEG_file := FALSE;
    exit;
  end;

  { Step 1: allocate and initialize JPEG decompression object }

  { We set up the normal JPEG error routines, then override error_exit. }
  cinfo.err := jpeg_std_error(jerr.pub);
  jerr.pub.error_exit := my_error_exit;
  jerr.pub.trace_level := 3;	{ I'm debbuging a lot (Nomssi) }
  { Establish the setjmp return context for my_error_exit to use. }
  if (setjmp(jerr.setjmp_buffer)<>0) then
  begin
    { If we get here, the JPEG code has signaled an error.
      We need to clean up the JPEG object, close the input file, and return. }
    { Nomssi: if we get here, we are in trouble, because e.g. cinfo.mem
              is not guaranted to be NIL }
    jpeg_destroy_decompress(@cinfo);
    system.close(infile);
    read_JPEG_file := FALSE;
    exit;
  end;

  { Now we can initialize the JPEG decompression object. }
  jpeg_create_decompress(@cinfo);

  { Step 2: specify data source (eg, a file) }

  jpeg_stdio_src(@cinfo, @infile);

  { Step 3: read file parameters with jpeg_read_header() }

  jpeg_read_header(@cinfo, TRUE);
  { We can ignore the return value from jpeg_read_header since
      (a) suspension is not possible with the stdio data source, and
      (b) we passed TRUE to reject a tables-only JPEG file as an error.
    See libjpeg.doc for more info. }

  { Step 4: set parameters for decompression }

  { the defaults are set by jpeg_read_header(),
    we could choose to do nothing here. }
  cinfo.scale_num := 1;
  cinfo.scale_denom := 1;	{ 1:1 scaling }
  cinfo.dct_method := JDCT_IFAST;
  cinfo.quantize_colors := TRUE;
  cinfo.two_pass_quantize := TRUE;
  cinfo.dither_mode := JDITHER_FS;  { Floyd-Steinberg error diffusion dither }

  { Step 5: Start decompressor }

  jpeg_start_decompress(@cinfo);
  { We can ignore the return value since suspension is not possible
    with the stdio data source. }

  { We may need to do some setup of our own at this point before reading
    the data.  After jpeg_start_decompress() we have the correct scaled
    output image dimensions available, as well as the output colormap
    if we asked for color quantization.
    In this example, we need to make an output work buffer of the right size. }

  { JSAMPLEs per row in output buffer }
  row_stride := cinfo.output_width * cinfo.output_components;
  { Make a one-row-high sample array that will go away when done with image }
  buffer := cinfo.mem^.alloc_sarray
		(j_common_ptr(@cinfo), JPOOL_IMAGE, row_stride, 1);

  { Step 6: while (scan lines remain to be read) }
  {           jpeg_read_scanlines(...); }

  { Here we use the library's state variable cinfo.output_scanline as the
    loop counter, so that we don't have to keep track ourselves. }

  while (cinfo.output_scanline < cinfo.output_height) do
  begin
    { jpeg_read_scanlines expects an array of pointers to scanlines.
      Here the array is only one element long, but you could ask for
      more than one scanline at a time if that's more convenient. }

    jpeg_read_scanlines(@cinfo, buffer, 1);
    { Assume put_scanline_someplace wants a pointer and sample count. }
    put_scanline_someplace(buffer^[0], row_stride);
  end;

  { Nomssi }
  save_color_map(@cinfo);

  { Step 7: Finish decompression }

  jpeg_finish_decompress(@cinfo);
  { We can ignore the return value since suspension is not possible
    with the stdio data source. }

  { Step 8: Release JPEG decompression object }

  { This is an important step since it will release a good deal of memory. }
  jpeg_destroy_decompress(@cinfo);

  { After finish_decompress, we can close the input file.
    Here we postpone it until after no more JPEG errors are possible,
    so as to simplify the setjmp error logic above.  (Actually, I don't
    think that jpeg_destroy can do an error exit, but why assume anything...) }
  system.close(infile);

  { At this point you may want to check to see whether any corrupt-data
    warnings occurred (test whether jerr.pub.num_warnings is nonzero). }

  { And we're done! }
  read_JPEG_file := TRUE;
end;


{ SOME FINE POINTS:

  In the above code, we ignored the return value of jpeg_read_scanlines,
  which is the number of scanlines actually read.  We could get away with
  this because we asked for only one line at a time and we weren't using
  a suspending data source.  See libjpeg.doc for more info.

  We cheated a bit by calling alloc_sarray() after jpeg_start_decompress();
  we should have done it beforehand to ensure that the space would be
  counted against the JPEG max_memory setting.  In some systems the above
  code would risk an out-of-memory error.  However, in general we don't
  know the output image dimensions before jpeg_start_decompress(), unless we
  call jpeg_calc_output_dimensions().  See libjpeg.doc for more about this.

  Scanlines are returned in the same order as they appear in the JPEG file,
  which is standardly top-to-bottom.  If you must emit data bottom-to-top,
  you can use one of the virtual arrays provided by the JPEG memory manager
  to invert the data.  See wrbmp.c for an example.

  As with compression, some operating modes may require temporary files.
  On some systems you may need to set up a signal handler to ensure that
  temporary files are deleted if the program is interrupted.  See libjpeg.doc. }

end.

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品久久久久久最新网址| 91精品国产综合久久福利| 国产做a爰片久久毛片| 免费成人在线观看视频| 奇米影视一区二区三区小说| 免费的成人av| 麻豆精品久久精品色综合| 捆绑紧缚一区二区三区视频| 麻豆91精品91久久久的内涵| 久久精品国产免费看久久精品| 精品一区二区三区在线观看国产| 免费成人av在线播放| 麻豆91免费看| 国产91综合一区在线观看| 成人爽a毛片一区二区免费| 成人av资源下载| 色婷婷精品久久二区二区蜜臀av| 欧美性感一类影片在线播放| 欧美人妖巨大在线| 久久影视一区二区| 亚洲精品少妇30p| 麻豆精品在线播放| 成人黄色国产精品网站大全在线免费观看| 成人午夜av电影| 欧美日韩国产美| 国产性做久久久久久| 亚洲精品大片www| 久久97超碰色| 色综合亚洲欧洲| 日韩美女视频一区二区在线观看| 国产日韩av一区| 亚洲va欧美va人人爽| 国产精品一品视频| 欧美性生交片4| 精品99999| 亚洲一区二区三区国产| 韩国女主播一区| 欧美色中文字幕| 国产亚洲一区字幕| 奇米四色…亚洲| 91免费在线视频观看| 日韩一区二区电影网| **网站欧美大片在线观看| 日本欧美久久久久免费播放网| 国产aⅴ综合色| 精品久久国产老人久久综合| 亚洲综合偷拍欧美一区色| 国产美女精品人人做人人爽| 91超碰这里只有精品国产| 国产精品免费av| 韩国精品主播一区二区在线观看| 日本高清不卡aⅴ免费网站| 精品国产乱码久久久久久久 | 91精品国产91久久久久久最新毛片 | 久久青草欧美一区二区三区| 亚洲成人动漫在线观看| 91在线播放网址| 国产精品国产自产拍高清av王其| 国模大尺度一区二区三区| 欧美喷水一区二区| 亚洲一区二区三区四区五区中文| 99久久精品免费看国产免费软件| 国产网站一区二区| 国产一区二区三区免费| 欧美一区在线视频| 日韩av不卡一区二区| 欧美日韩国产高清一区二区三区 | 亚洲日本护士毛茸茸| 国产成人综合视频| 精品乱人伦小说| 欧美aaaaaa午夜精品| 欧美一区二区三区不卡| 日本aⅴ亚洲精品中文乱码| 欧美酷刑日本凌虐凌虐| 午夜激情一区二区三区| 欧美日韩国产大片| 舔着乳尖日韩一区| 欧美丰满少妇xxxxx高潮对白 | 国产综合色在线视频区| 久久这里只有精品视频网| 国产精品一区二区91| 国产精品久久三| 色综合天天综合给合国产| 亚洲精品国产成人久久av盗摄 | 麻豆精品在线观看| 久久久亚洲精品石原莉奈| 国产99久久久精品| 亚洲男人的天堂网| 欧美日产国产精品| 精品亚洲国产成人av制服丝袜| 久久综合久久综合亚洲| 91黄色小视频| 视频一区二区三区在线| 欧美成人三级电影在线| 成人性生交大合| 一区二区三区.www| 日韩久久久精品| www.色精品| 蜜臀av在线播放一区二区三区| 久久综合狠狠综合| 91精品1区2区| 国产一区二三区好的| 亚洲欧美电影院| 日韩你懂的电影在线观看| 成人97人人超碰人人99| 婷婷综合五月天| 中文字幕免费不卡在线| 欧美三级日本三级少妇99| 国产一区二区在线免费观看| 亚洲欧美日韩一区二区三区在线观看| 欧美三级蜜桃2在线观看| 国产激情视频一区二区在线观看| 亚洲色图第一区| 日韩久久久精品| 欧美日韩在线播| 99国产一区二区三精品乱码| 日本视频中文字幕一区二区三区| 中文字幕不卡在线观看| 欧美一区三区四区| 91在线视频网址| 国产一区二区三区四区五区美女| 亚洲成a人片综合在线| 中文字幕一区二区三| 精品va天堂亚洲国产| 欧美午夜宅男影院| 国产91丝袜在线播放0| 免费久久精品视频| 一区二区三区四区不卡视频| 中文字幕国产一区二区| 精品噜噜噜噜久久久久久久久试看 | 久久成人久久爱| 日韩avvvv在线播放| 亚洲一区中文在线| 日韩毛片精品高清免费| 国产清纯白嫩初高生在线观看91 | 欧美美女黄视频| 在线视频欧美精品| 99久久久免费精品国产一区二区| 国产一区二区美女| 加勒比av一区二区| 久久精品国产亚洲a| 日本成人在线看| 亚洲福利一区二区| 一区二区三区在线观看国产| 国产精品麻豆欧美日韩ww| 久久久www成人免费无遮挡大片| 日韩三级在线观看| 91精品一区二区三区久久久久久| 欧美三级视频在线观看| 欧美日韩日日摸| 欧美视频精品在线观看| 欧美日韩一级视频| 91麻豆精品国产无毒不卡在线观看 | 99久久综合国产精品| 粉嫩高潮美女一区二区三区| 国产精品亚洲专一区二区三区| 精品在线你懂的| 国产乱码精品1区2区3区| 粉嫩嫩av羞羞动漫久久久| 99re在线精品| 欧美日韩一级视频| 日韩视频免费观看高清完整版 | 日韩精品在线看片z| 久久久久久影视| 中文字幕亚洲欧美在线不卡| 一区二区久久久久| 婷婷综合五月天| 国产一区二区0| 91色在线porny| 91麻豆精品久久久久蜜臀| 26uuu亚洲| 亚洲日本中文字幕区| 亚洲h在线观看| 久久精品免费观看| 99久久精品国产网站| 26uuu欧美| 国产精品看片你懂得| 亚洲日本在线a| 六月丁香婷婷色狠狠久久| 成人午夜精品在线| 欧美色老头old∨ideo| 26uuu亚洲| 亚洲自拍都市欧美小说| 久久精品久久精品| 91麻豆精东视频| 精品少妇一区二区三区在线视频| 国产欧美一区二区精品久导航| 依依成人精品视频| 国产曰批免费观看久久久| 欧美亚洲另类激情小说| 久久精品无码一区二区三区| 一区二区免费在线| 国产精品18久久久久久久久| 欧美在线免费视屏| 国产精品视频一区二区三区不卡| 五月开心婷婷久久| 91亚洲永久精品| 久久精品视频一区二区| 日韩不卡一二三区| 欧美亚洲国产一区二区三区|