{"id":242119,"date":"2014-11-01T14:02:03","date_gmt":"2014-11-01T10:02:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=242119"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=242119","title":{"rendered":"<span class=\"post_title\">Delphi: \u0411\u044b\u0441\u0442\u0440\u043e\u0435 (\u0434\u0435)\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 JPEG \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e libjpeg-turbo<\/span>"},"content":{"rendered":"<div class=\"content html_format\">     \t\u041a\u0430\u043a-\u0442\u043e \u0440\u0430\u0437, \u043f\u0440\u043e\u0444\u0438\u043b\u0438\u0440\u0443\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0434\u043b\u044f \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u044f \u0437\u0430 \u0440\u0430\u0431\u043e\u0447\u0438\u043c \u0441\u0442\u043e\u043b\u043e\u043c, \u043c\u043d\u043e\u0439 \u0431\u044b\u043b\u043e \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u043e \u0447\u0442\u043e \u043a\u0443\u0447\u0430 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u0438 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\/\u0434\u0435\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 JPEG. \u0418\u0437\u0443\u0447\u0438\u0432 \u043f\u043e \u0443\u0441\u043a\u043e\u0440\u0435\u043d\u0438\u044e \u044d\u0442\u043e\u0439 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u044b \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f, \u0431\u044b\u043b\u043e \u0440\u0435\u0448\u0435\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c libjpeg-turbo.<\/p>\n<p>  \u041f\u043e\u0434 \u043a\u0430\u0442\u043e\u043c \u043c\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u043d\u0430 Delphi \u0438 \u043e\u043f\u0438\u0441\u0430\u043d\u044b \u043f\u043e\u0434\u0432\u043e\u0434\u043d\u044b\u0435 \u043a\u0430\u043c\u043d\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438<\/p>\n<p>  <a name=\"habracut\"><\/a>  <\/p>\n<h4>\u0414\u043b\u044f \u0447\u0435\u0433\u043e \u0432\u0441\u0435 \u044d\u0442\u043e \u043d\u0443\u0436\u043d\u043e?<\/h4>\n<p>  \u0421\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c jpeg.pas \u2014 \u044d\u0442\u043e \u0432\u0440\u0430\u043f\u043f\u0435\u0440 \u043d\u0430\u0434 libjpeg. libjpeg-turbo \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u043b\u0441\u044f \u0447\u0442\u043e \u0431\u044b \u0431\u044b\u043b\u043e \u043b\u0435\u0433\u043a\u043e \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u0438\u043c libjpeg, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0443 \u043d\u0435\u0433\u043e \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0435 API, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043e\u0433\u0440\u043e\u043c\u043d\u044b\u0439 \u0432\u044b\u0438\u0433\u0440\u044b\u0448 \u0432 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438. <\/p>\n<p>  \u041f\u043e <a href=\"http:\/\/www.libjpeg-turbo.org\/About\/Performance\">\u0441\u0441\u044b\u043b\u043a\u0435<\/a> \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 libjpeg vs libjpeg-turbo vs intel-ipp. \u0412 \u0434\u0432\u0443\u0445 \u0441\u043b\u043e\u0432\u0430\u0445 \u044d\u0442\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0432 3 \u0440\u0430\u0437\u0430 \u0431\u044b\u0441\u0442\u0440\u0435\u0435 \u0447\u0435\u043c libjpeg, \u0438 \u0442\u0430\u043a\u0430\u044f \u0436\u0435 \u043f\u043e \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u043a\u0430\u043a Intel IPP \u043d\u043e \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u0430\u044f.<\/p>\n<h4>\u041f\u0440\u043e\u0435\u043a\u0442 delphi-jpeg-turbo<\/h4>\n<p>  \u041f\u0435\u0440\u0435\u0434 \u0438\u0437\u043e\u0431\u0440\u0435\u0442\u0435\u043d\u0438\u0435\u043c \u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434\u0430 \u044f \u043f\u0440\u043e\u0448\u0435\u0440\u0441\u0442\u0438\u043b \u0433\u0443\u0433\u043b \u0438 \u043d\u0430\u0442\u043a\u043d\u0443\u043b\u0441\u044f \u043d\u0430 \u043f\u0440\u043e\u0435\u043a\u0442 <a href=\"https:\/\/code.google.com\/p\/delphi-libjpeg-turbo\/\">delphi-jpeg-turbo<\/a>. \u041f\u0440\u043e\u0435\u043a\u0442 \u0431\u0435\u0437\u0443\u0441\u043b\u043e\u0432\u043d\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0439, \u043d\u043e \u043a\u0430\u043a \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0435\u0433\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043c\u043d\u0435 \u043d\u0435 \u043f\u043e\u0434\u043e\u0448\u043b\u0430:  <\/p>\n<ul>\n<li>\u0420\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d \u0432 \u0432\u0438\u0434\u0435 \u043d\u0430\u0441\u043b\u0435\u0434\u043d\u0438\u043a\u0430 \u043e\u0442 TBitmap, \u044f \u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e TFastDib \u0434\u043b\u044f \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u0439 \u043c\u043d\u043e\u0433\u043e\u043f\u043e\u0442\u043e\u0447\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b;<\/li>\n<li>\u0423\u0441\u0442\u0430\u0440\u0435\u0432\u0448\u0438\u0435 \u0445\u0435\u0434\u0435\u0440\u044b, \u0430\u0432\u0442\u043e\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0434\u0435\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0432 RGB \u0444\u043e\u0440\u043c\u0430\u0442, \u0430 \u043f\u043e\u0442\u043e\u043c \u043f\u043e\u043f\u0438\u043a\u0441\u0435\u043b\u044c\u043d\u043e \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0438\u0442 \u0435\u0433\u043e \u0432 \u0442\u0440\u0435\u0431\u0443\u0435\u043c\u044b\u0439 Windows GDI GBR \u0444\u043e\u0440\u043c\u0430\u0442. \u042d\u0442\u043e \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 \u043a\u0443\u0447\u0443 \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u0445\u043e\u0442\u044f libjpeg-turbo \u0443\u043c\u0435\u0435\u0442 \u0434\u0435\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0440\u0430\u0437\u0443 \u0432 GBR<\/li>\n<li>\u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0438\u0437 \u043f\u0430\u043c\u044f\u0442\u0438: libjpeg-turbo \u0438\u043c\u0435\u0435\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 jpeg_mem_src \u0438 jpeg_mem_dest, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u0441\u0440\u0430\u0437\u0443 \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u0442\u044c\/\u0434\u0435\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u0437 \u0431\u0443\u0444\u0435\u0440\u0430 \u043d\u0435 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u044f \u043a\u0443\u0447\u0443 \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u0447\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430;<\/li>\n<\/ul>\n<p>  \u041f\u0440\u043e\u0435\u043a\u0442 \u043d\u0435 \u043f\u043e\u0434\u043e\u0448\u0435\u043b, \u0430 \u0432\u043e\u0442 \u0445\u0435\u0434\u0435\u0440\u044b \u043a\u0430\u043a \u043e\u0441\u043d\u043e\u0432\u0430 \u0434\u043b\u044f \u0441\u0432\u043e\u0435\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043e\u043a\u0430\u0437\u0430\u043b\u0438\u0441\u044c \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u043c\u0438.  <\/p>\n<h4>\u0427\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c<\/h4>\n<p>  \u0420\u0430\u0441\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c API libjpeg-turbo \u044f \u043d\u0435 \u0431\u0443\u0434\u0443, \u0442\u0430\u043a \u043a\u0430\u043a \u0441\u0430\u043c \u0441 \u043d\u0438\u043c \u0433\u043b\u0443\u0431\u043e\u043a\u043e \u043d\u0435 \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u043b\u0441\u044f \u0438, \u043f\u043e\u0441\u043b\u0435 \u0443\u0432\u0438\u0434\u0435\u043d\u043d\u043e\u0433\u043e, \u043d\u0430\u0434\u0435\u044e\u0441\u044c, \u0447\u0442\u043e \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0434\u0430\u043b\u044c\u0448\u0435 \u0432 \u044d\u0442\u043e\u043c \u043a\u043e\u043f\u0430\u0442\u044c\u0441\u044f. \u0421\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u0438\u0437\u0443\u0447\u0438\u0442\u044c API \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u043c\u043e\u0433\u043b\u0438 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438 \u043f\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c\u043e\u0433\u043e \u0441 Delphi \u043c\u043e\u0434\u0443\u043b\u044f Jpeg.pas, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 libjpeg \u0441 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u044b\u043c api. \u0415\u0441\u043b\u0438 \u0432 \u043c\u043e\u0435\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0447\u0442\u043e \u043d\u0435 \u0442\u0430\u043a \u043f\u0440\u043e\u0441\u044c\u0431\u0430 \u043f\u043e\u043f\u0440\u0430\u0432\u0438\u0442\u044c) <\/p>\n<p>  \u0418\u0442\u0430\u043a, \u0432\u043e\u0442 \u0447\u0442\u043e \u0443 \u043c\u0435\u043d\u044f \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c:  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">suJpegTurboUnit.pas<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"delphi\">unit suJpegTurboUnit;   interface   uses   Windows, SysUtils,     FastDIB;   type   \/\/\u041e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u043a\u043e\u0433\u0434\u0430 \u043f\u043e\u043b\u0443\u0447\u0435\u043d \u0431\u0443\u0444\u0435\u0440 \u0441 JPEG \u0444\u0430\u0439\u043b\u043e\u043c   TOnEncodedJpegBuffer = reference to procedure(ABuffer: Pointer; ABufferSize: LongWord);     \/\/\u0414\u0435\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 JPEG \u0444\u0430\u0439\u043b\u0430 \u0438\u0437 \u0431\u0443\u0444\u0435\u0440\u0430   function DecodeJpegTurbo(ABuffer: Pointer; ABufferLen: Integer; HQ: Boolean = True): TFastDIB;     \/\/\u041a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 JPEG   procedure EncodeJpegTurbo(Source: TFastDIB; Quality: Integer; OnEncodedBuffer: TOnEncodedJpegBuffer);   implementation   uses   suJpegTurboHeadersUnit,   suJpegTurboMemDestUnit;   var   _LibInitialized: LongBool = False;   \/\/\u041e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043a\u0440\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043e\u0448\u0438\u0431\u043a\u0438 procedure ErrorExit(cinfo: j_common_ptr); cdecl; var   Msg: AnsiString; begin   \/\/\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0442\u0435\u043a\u0441\u0442 \u043e\u0448\u0438\u0431\u043a\u0438   SetLength(Msg, JMSG_LENGTH_MAX);   cinfo^.err^.format_message(cinfo, PAnsiChar(Msg));     \/\/\u0427\u0442\u043e \u0431\u044b \u043e\u0431\u0440\u0435\u0437\u0430\u0442\u044c \u043c\u0443\u0441\u043e\u0440 \u043f\u043e\u0441\u043b\u0435 #0 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u043c Msg \u043a\u0430\u043a PAnsiChar   raise Exception.CreateFmt('JPEG error #%d (%s)',     [cinfo^.err^.msg_code, PAnsiChar(Msg)]); end;   \/\/\u041e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0432\u044b\u0432\u043e\u0434\u0430 \u0442\u0435\u043a\u0441\u0442\u0430 \u043e\u0448\u0438\u0431\u043a\u0438 \u043d\u0430 \u044d\u043a\u0440\u0430\u043d procedure OutputMessage(cinfo: j_common_ptr); cdecl; begin end;   \/\/\u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 LibJpeg-Turbo procedure InitLib; begin   if _LibInitialized then     Exit;     \/\/\u041f\u0440\u043e\u0431\u0443\u0435\u043c \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c   if not init_libJPEG then     raise Exception.Create('initialization of libJPEG failed.');     \/\/\u0417\u0430\u043f\u0438\u0448\u0435\u043c \u0444\u043b\u0430\u0433 \u0447\u0442\u043e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0430   if InterlockedCompareExchange(Integer(_LibInitialized), Integer(True), Integer(False)) = Integer(True) then     \/\/\u0415\u0441\u043b\u0438 \u0442\u0430\u043c \u0443\u0436\u0435 \u0437\u0430\u043f\u0438\u0441\u0430\u043d \u044d\u0442\u043e\u0442 \u0444\u043b\u0430\u0433, \u0437\u043d\u0430\u0447\u0438\u0442 \u0434\u0440\u0443\u0433\u043e\u0439 \u043f\u043e\u0442\u043e\u043a \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043b \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443     \/\/\u0432\u044b\u0433\u0440\u0443\u0437\u0438\u043c \u0441\u0432\u043e\u0439 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440     quit_libJPEG; end;   \/\/\u0414\u0435\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 function DecodeJpegTurbo(ABuffer: pointer; ABufferLen: Integer; HQ: Boolean): TFastDIB; var   Loop: Integer;   JpegErr: jpeg_error_mgr;   Jpeg: jpeg_decompress_struct; begin   \/\/\u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438   InitLib;     FillChar(Jpeg, SizeOf(Jpeg), 0);   FillChar(JpegErr, SizeOf(JpegErr), 0);     \/\/\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0434\u0435\u043a\u043e\u043c\u043f\u0440\u0435\u0441\u0441\u043e\u0440\u0430   jpeg_create_decompress(@Jpeg);   try     \/\/\u041d\u0430\u0437\u043d\u0430\u0447\u0438\u043c \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u044b\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043e\u0448\u0438\u0431\u043e\u043a     Jpeg.err := jpeg_std_error(@JpegErr);       \/\/\u041f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043c \u043c\u0435\u0442\u043e\u0434\u044b \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u043e\u0433\u043e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430. \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e, \u043f\u0440\u0438 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u043e\u0432\u0435\u043d\u0438\u0438     \/\/\u043b\u044e\u0431\u043e\u0439 \u043e\u0448\u0438\u0431\u043a\u0438 \u0432 LibJPEG \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0437\u0430\u043a\u0440\u044b\u0442\u0438\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0438 \u0432\u044b\u0432\u043e\u0434 \u043e\u0448\u0438\u0431\u043a\u0438 \u0432 MessageBox     JpegErr.error_exit := ErrorExit;     JpegErr.output_message := OutputMessage;       jpeg_mem_src(@Jpeg, ABuffer, ABufferLen);       \/\/\u041f\u0440\u043e\u0447\u0438\u0442\u0430\u0435\u043c \u0445\u0435\u0434\u0435\u0440\u044b, \u0434\u0430\u0431\u044b \u0437\u043d\u0430\u0442\u044c \u0432\u044b\u0441\u043e\u0442\u0443 \u0438 \u0448\u0438\u0440\u0438\u043d\u0443 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438     jpeg_read_header(@jpeg, False);       \/\/\u041d\u0430 \u0432\u044b\u0445\u043e\u0434\u0435 \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u043f\u0438\u043a\u0441\u0435\u043b\u0438 BGR     jpeg.out_color_space := JCS_EXT_BGR;       \/\/\u041d\u0430\u0441\u0442\u0440\u043e\u0438\u043c \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 - 1:1     jpeg.scale_num := 1;     jpeg.scale_denom := 1;       \/\/\u0421\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0438\u043b\u0438 \u0445\u043e\u0440\u043e\u0448\u0435\u0435 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e     If HQ then     begin       jpeg.do_block_smoothing := 1;       jpeg.do_fancy_upsampling := 1;       jpeg.dct_method := JDCT_ISLOW     end     else     begin       jpeg.do_block_smoothing := 0;       jpeg.do_fancy_upsampling := 0;       jpeg.dct_method := JDCT_IFAST;     end;       \/\/\u0414\u0435\u043a\u043e\u0434\u0438\u0440\u0443\u0435\u043c \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435     jpeg_start_decompress(@Jpeg);     try       Result := TFastDIB.Create(jpeg.output_width, jpeg.output_height, 24);       try         \/\/\u0427\u0438\u0442\u0430\u0435\u043c \u0441\u0442\u0440\u043e\u043a\u0438         for Loop := 0 to jpeg.output_height - 1 do           jpeg_read_scanlines(@jpeg, @Result.Scanlines[Result.Height - 1 - Loop], 1);       except         FreeAndNil(Result);         raise;       end;     finally       \/\/\u0417\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u0435\u043c \u0434\u0435\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435       jpeg_finish_decompress(@Jpeg);     end;   finally     \/\/\u0423\u043d\u0438\u0447\u0442\u043e\u0436\u0430\u0435\u043c \u043d\u0435\u043d\u0443\u0436\u043d\u044b\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b     jpeg_destroy_decompress(@Jpeg);   end; end;     \/\/\u041a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f procedure EncodeJpegTurbo(Source: TFastDIB; Quality: Integer; OnEncodedBuffer: TOnEncodedJpegBuffer); var   ScanLine: JSAMPROW;   CompressedBuff: Pointer;   CompressedSize: LongWord;   JpegErr: jpeg_error_mgr;   Jpeg: jpeg_compress_struct; begin   \/\/\u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438   InitLib;     FillChar(Jpeg, SizeOf(Jpeg), 0);   FillChar(JpegErr, SizeOf(JpegErr), 0);     \/\/\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u043a\u043e\u043c\u043f\u0440\u0435\u0441\u0441\u043e\u0440\u0430   jpeg_create_compress(@Jpeg);   try     \/\/\u041d\u0430\u0437\u043d\u0430\u0447\u0438\u043c \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u044b\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043e\u0448\u0438\u0431\u043e\u043a     Jpeg.err := jpeg_std_error(@JpegErr);       \/\/\u041f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043c \u043c\u0435\u0442\u043e\u0434\u044b \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u043e\u0433\u043e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430. \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e, \u043f\u0440\u0438 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u043e\u0432\u0435\u043d\u0438\u0438     \/\/\u043b\u044e\u0431\u043e\u0439 \u043e\u0448\u0438\u0431\u043a\u0438 \u0432 LibJPEG \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0437\u0430\u043a\u0440\u044b\u0442\u0438\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0438 \u0432\u044b\u0432\u043e\u0434 \u043e\u0448\u0438\u0431\u043a\u0438 \u0432 MessageBox     JpegErr.error_exit := ErrorExit;     JpegErr.output_message := OutputMessage;       CompressedSize := 0;     CompressedBuff := nil;       \/\/\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0441\u0432\u043e\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e jpeg_mem_dest \u0438\u0437-\u0437\u0430 \u0443\u0442\u0435\u0447\u0435\u043a \u043f\u0430\u043c\u044f\u0442\u0438 \u0432 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439.     suJpegTurboMemDestUnit.jpeg_mem_dest(@Jpeg, @CompressedBuff, @CompressedSize);     try       jpeg.image_width := Source.Width;       jpeg.image_height := Source.Height;       jpeg.input_components := Source.Info.Header.BitCount div 8;       jpeg.in_color_space := JCS_EXT_BGR;         \/\/Setting defaults       jpeg_set_defaults(@Jpeg);         \/\/\u041a\u0430\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0436\u0430\u0442\u0438\u044f       jpeg_set_quality(@Jpeg, Quality, True);         \/\/\u0414\u0435\u043a\u043e\u0434\u0438\u0440\u0443\u0435\u043c \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435       jpeg_start_compress(@Jpeg, True);       try         while Jpeg.next_scanline &lt; Jpeg.image_height do         begin           ScanLine := JSAMPROW(Source.Scanlines[Jpeg.image_height - Jpeg.next_scanline - 1]);           jpeg_write_scanlines(@Jpeg, @ScanLine, 1);         end;       finally         \/\/\u0417\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u0435\u043c \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435         jpeg_finish_compress(@Jpeg);       end;         \/\/\u041f\u0435\u0440\u0435\u0434\u0430\u0435\u043c \u0431\u0443\u0444\u0435\u0440 \u0432\u044b\u0437\u044b\u0432\u0430\u044e\u0449\u0435\u0439 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0435       if Assigned(OnEncodedBuffer) then         OnEncodedBuffer(CompressedBuff, CompressedSize);     finally       \/\/\u041e\u0441\u0432\u043e\u0431\u043e\u0434\u0438\u043c \u043f\u0430\u043c\u044f\u0442\u044c       FreeMemory(CompressedBuff);     end;   finally     \/\/\u0423\u043d\u0438\u0447\u0442\u043e\u0436\u0430\u0435\u043c \u043d\u0435\u043d\u0443\u0436\u043d\u044b\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b     jpeg_destroy_compress(@Jpeg);   end; end;   initialization   finalization   \/\/\u0412\u044b\u0433\u0440\u0443\u0436\u0430\u0435\u043c \u0435\u0441\u043b\u0438 \u0431\u044b\u043b\u0430 \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u0430   if _LibInitialized then     quit_libJPEG; end. <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  \u0412\u043e \u0432\u0440\u0435\u043c\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u0430 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0441 \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439 jpeg_mem_dest, \u043a\u0430\u043a \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u043e\u043d\u0430 \u0432\u043d\u0443\u0442\u0440\u0438 \u0441\u0435\u0431\u044f \u0432\u044b\u0434\u0435\u043b\u044f\u0435\u0442 \u043f\u0430\u043c\u044f\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0430\u043b\u043b\u043e\u043a\u0430\u0442\u043e\u0440\u0430 \u043f\u0430\u043c\u044f\u0442\u0438 \u0438\u0437 msvcrt.dll, \u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043f\u0430\u043c\u044f\u0442\u044c \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u043e\u0441\u0432\u043e\u0431\u043e\u0436\u0434\u0430\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0437\u0435\u0440\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438\u0437 \u0442\u043e\u0439 \u0436\u0435 msvcrt.dll.<\/p>\n<p>  \u042d\u0442\u043e\u0442 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u043c\u043d\u0435 \u043d\u0435 \u043f\u043e\u0434\u043e\u0448\u0435\u043b \u043f\u043e \u0442\u043e\u0439 \u043f\u0440\u0438\u0447\u0438\u043d\u0435, \u0447\u0442\u043e \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e jpegturbo \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 msvcrt \u0441\u043b\u0438\u043d\u043a\u043e\u0432\u0430\u043d \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0438 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043e\u0441\u0432\u043e\u0431\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u043f\u0430\u043c\u044f\u0442\u0438 \u043d\u0435 \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u0442\u0441\u044f. \u041f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0432\u043e\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e jpeg_mem_dest \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 delphi \u0430\u043b\u043b\u043e\u043a\u0430\u0442\u043e\u0440 \u043f\u0430\u043c\u044f\u0442\u0438:   <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">suJpegTurboMemDestUnit.pas<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"delphi\">{   \u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0430\u043d\u0430\u043b\u043e\u0433\u0430 jpeg_mem_dest \u0438\u0437 JpegTurbo.     \u0422\u0430\u043a \u043a\u0430\u043a \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043f\u043e\u0441\u043b\u0435 \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043e\u0441\u0432\u043e\u0431\u043e\u0434\u0438\u0442\u044c   \u043f\u0430\u043c\u044f\u0442\u044c RTL \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439 Free (\u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043d\u0435 \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u0442\u0441\u044f), \u043a \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0443 \u043d\u0430\u0441 \u043d\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u0430,   \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0430\u043d\u0430\u043b\u043e\u0433, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b\u0434\u0435\u043b\u044f\u0435\u0442\/\u043e\u0441\u0432\u043e\u0431\u043e\u0436\u0434\u0430\u0435\u0442 \u043f\u0430\u043c\u044f\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e   GetMemory\/FreeMemory.     \u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0432\u0435\u043d\u043d\u043e, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f jpeg_mem_dest \u0438\u0437 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f \u043e\u0441\u0432\u043e\u0431\u043e\u0436\u0434\u0430\u0442\u044c \u043f\u0430\u043c\u044f\u0442\u044c \u0441   \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u043e\u0439 \u043d\u0443\u0436\u043d\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 FreeMemory.     \u041a\u043e\u0434 \u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d \u043d\u0430 Delphi \u0438\u0437 jdatadst.c } unit suJpegTurboMemDestUnit;   interface   uses   suJpegTurboHeadersUnit;     procedure jpeg_mem_dest(cinfo: j_compress_ptr; outbuffer: PPointer; outsize: PLongWord);   implementation   const   OUTPUT_BUF_SIZE  = 4096; \/\/choose an efficiently fwrite'able size   type   my_mem_destination_mgr = record     pub: jpeg_destination_mgr;  \/\/public fields     outbuffer: PPointer; \/\/target buffer     outsize: PLongWord;     newbuffer: Pointer;   \/\/newly allocated buffer     buffer: JOCTET_ptr; \/\/start of buffer     bufsize: LongWord;   end;   my_mem_dest_ptr = ^my_mem_destination_mgr;   \/\/Initialize destination --- called by jpeg_start_compress \/\/before any data is actually written. procedure init_mem_destination(cinfo: j_compress_ptr); cdecl; begin   \/\/no work necessary here end;   {  Empty the output buffer --- called whenever buffer fills up.    In typical applications, this should write the entire output buffer  (ignoring the current state of next_output_byte & free_in_buffer),  reset the pointer & count to the start of the buffer, and return TRUE  indicating that the buffer has been dumped.    In applications that need to be able to suspend compression due to output  overrun, a FALSE return indicates that the buffer cannot be emptied now.  In this situation, the compressor will return to its caller (possibly with  an indication that it has not accepted all the supplied scanlines).  The  application should resume compression after it has made more room in the  output buffer.  Note that there are substantial restrictions on the use of  suspension --- see the documentation.    When suspending, the compressor will back up to a convenient restart point  (typically the start of the current MCU). next_output_byte & free_in_buffer  indicate where the restart point will be if the current call returns FALSE.  Data beyond this point will be regenerated after resumption, so do not  write it out when emptying the buffer externally. } function empty_mem_output_buffer(cinfo: j_compress_ptr): Boolean; cdecl; var   nextsize: LongWord;   dest: my_mem_dest_ptr;   nextbuffer: JOCTET_ptr; begin   dest := my_mem_dest_ptr(cinfo^.dest);     \/\/Try to allocate new buffer with double size   nextsize := dest^.bufsize * 2;   nextbuffer := GetMemory(nextsize);     if nextbuffer = nil then     ERREXIT1(j_common_ptr(cinfo), JERR_OUT_OF_MEMORY, 10);     Move(dest^.buffer^, nextbuffer^, dest^.bufsize);     if dest^.newbuffer &lt;&gt; nil then     FreeMemory(dest^.newbuffer);     dest^.newbuffer := nextbuffer;     dest^.pub.next_output_byte := JOCTET_ptr(PByte(nextbuffer) + dest^.bufsize);   dest^.pub.free_in_buffer := dest^.bufsize;     dest^.buffer := nextbuffer;   dest^.bufsize := nextsize;     Result := True; end;   procedure term_mem_destination(cinfo: j_compress_ptr); cdecl; var   dest: my_mem_dest_ptr; begin   dest := my_mem_dest_ptr(cinfo^.dest);   dest^.outbuffer^ := dest^.buffer;   dest^.outsize^ := dest^.bufsize - dest^.pub.free_in_buffer; end;   {   Prepare for output to a memory buffer.   The caller may supply an own initial buffer with appropriate size.   Otherwise, or when the actual data output exceeds the given size,   the library adapts the buffer size as necessary.   The standard library functions GetMemory\/FreeMemory are used for allocating   larger memory, so the buffer is available to the application after   finishing compression, and then the application is responsible for   freeing the requested memory. } procedure jpeg_mem_dest(cinfo: j_compress_ptr; outbuffer: PPointer; outsize: PLongWord); var   dest: my_mem_dest_ptr; begin   if (outbuffer = nil) or (outsize = nil) then     ERREXIT(j_common_ptr(cinfo), JERR_BUFFER_SIZE);     if (cinfo^.dest = nil) then \/\/first time for this JPEG object?     cinfo^.dest := cinfo^.mem.alloc_small(j_common_ptr(cinfo), JPOOL_PERMANENT,       SizeOf(my_mem_destination_mgr));     dest := my_mem_dest_ptr(cinfo^.dest);   dest^.pub.init_destination := init_mem_destination;   dest^.pub.empty_output_buffer := empty_mem_output_buffer;   dest^.pub.term_destination := term_mem_destination;   dest^.outbuffer := outbuffer;   dest^.outsize := outsize;   dest^.newbuffer := nil;     if (outbuffer^ = nil) or (outsize^ = 0) then   begin     \/\/Allocate initial buffer     outbuffer^ := GetMemory(OUTPUT_BUF_SIZE);       dest^.newbuffer := outbuffer^;       if dest^.newbuffer = nil then       ERREXIT1(j_common_ptr(cinfo), JERR_OUT_OF_MEMORY, 10);       outsize^ := OUTPUT_BUF_SIZE;   end;     dest^.buffer := outbuffer^;   dest^.pub.next_output_byte := dest^.buffer;     dest^.bufsize := outsize^;   dest^.pub.free_in_buffer := dest^.bufsize; end;   end.<\/code><\/pre>\n<\/div>\n<\/div>\n<p>  \u041d\u0443 \u0438 \u0445\u0435\u0434\u0435\u0440\u044b, \u043e\u043d\u0438 \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u0432 \u043c\u043e\u0434\u0443\u043b\u0435 suJpegTurboHeadersUnit.pas, \u044d\u0442\u043e \u0445\u0435\u0434\u0435\u0440\u044b \u0432\u0437\u044f\u0442\u044b\u0435 \u0438\u0437 delphi-jpeg-turbo \u0441 \u043f\u0430\u0440\u043e\u0439 \u0434\u043e\u0440\u0430\u0431\u043e\u0442\u043e\u043a:  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">suJpegTurboHeadersUnit.pas<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"delphi\">{ Known color spaces. }  J_COLOR_SPACE = (    JCS_UNKNOWN, { error\/unspecified }   JCS_GRAYSCALE,  \/\/* monochrome *\/   JCS_RGB,  \/\/* red\/green\/blue as specified by the RGB_RED, RGB_GREEN,       \/\/RGB_BLUE, and RGB_PIXELSIZE macros *\/   JCS_YCbCr,  \/\/* Y\/Cb\/Cr (also known as YUV) *\/   JCS_CMYK,  \/\/* C\/M\/Y\/K *\/   JCS_YCCK,  \/\/* Y\/Cb\/Cr\/K *\/   JCS_EXT_RGB,  \/\/* red\/green\/blue *\/   JCS_EXT_RGBX,  \/\/* red\/green\/blue\/x *\/   JCS_EXT_BGR,  \/\/* blue\/green\/red *\/   JCS_EXT_BGRX,  \/\/* blue\/green\/red\/x *\/   JCS_EXT_XBGR,  \/\/* x\/blue\/green\/red *\/   JCS_EXT_XRGB,  \/\/* x\/red\/green\/blue *\/ \/\/  When out_color_space it set to JCS_EXT_RGBX, JCS_EXT_BGRX, \/\/    JCS_EXT_XBGR, or JCS_EXT_XRGB during decompression, the X byte is \/\/    undefined, and in order to ensure the best performance, \/\/    libjpeg-turbo can set that byte to whatever value it wishes.  Use \/\/    the following colorspace constants to ensure that the X byte is set \/\/    to 0xFF, so that it can be interpreted as an opaque alpha \/\/    channel.   JCS_EXT_RGBA,  \/\/\/* red\/green\/blue\/alpha *\/   JCS_EXT_BGRA,  \/\/* blue\/green\/red\/alpha *\/   JCS_EXT_ABGR,  \/\/* alpha\/blue\/green\/red *\/   JCS_EXT_ARGB  \/\/* alpha\/red\/green\/blue *\/    );   ...    { Standard data source and destination managers: stdio streams. }  { Caller is responsible for opening the file before and closing after. }  \/\/ jpeg_stdio_dest: procedure(cinfo: j_compress_ptr; FILE * outfile); cdecl;  \/\/ jpeg_stdio_src: procedure(cinfo: j_decompress_ptr; FILE * infile); cdecl;    jpeg_mem_src: procedure(cinfo: j_decompress_ptr; inbuffer: Pointer; insize: LongWord); cdecl;  jpeg_mem_dest: procedure(cinfo: j_decompress_ptr; outbuffer: Pointer; outsize: PLongWord); cdecl;   ... Function init_libJPEG(): boolean; ...      @jpeg_mem_src := GetProcAddress(libJPEG_Handle, 'jpeg_mem_src');      @jpeg_mem_dest := GetProcAddress(libJPEG_Handle, 'jpeg_mem_dest');   ...  {$DEFINE JPEG_LIB_VERSION = 62} \/\/Version 6b type  J_MESSAGE_CODE = (    JMSG_NOMESSAGE,    {$IF Declared(JPEG_LIB_VERSION) and (JPEG_LIB_VERSION &lt; 70)}    JERR_ARITH_NOTIMPL,    {$IFEND}    JERR_BAD_ALIGN_TYPE,    JERR_BAD_ALLOC_CHUNK,    JERR_BAD_BUFFER_MODE,    JERR_BAD_COMPONENT_ID,    {$IF Declared(JPEG_LIB_VERSION) and (JPEG_LIB_VERSION &gt;= 70)}    JERR_BAD_CROP_SPEC,    {$IFEND}    JERR_BAD_DCT_COEF,    JERR_BAD_DCTSIZE,    {$IF Declared(JPEG_LIB_VERSION) and (JPEG_LIB_VERSION &gt;= 70)}    JERR_BAD_DROP_SAMPLING,    {$IFEND}    JERR_BAD_HUFF_TABLE,    JERR_BAD_IN_COLORSPACE,    JERR_BAD_J_COLORSPACE,    JERR_BAD_LENGTH,    JERR_BAD_LIB_VERSION,    JERR_BAD_MCU_SIZE,    JERR_BAD_POOL_ID,    JERR_BAD_PRECISION,    JERR_BAD_PROGRESSION,    JERR_BAD_PROG_SCRIPT,    JERR_BAD_SAMPLING,    JERR_BAD_SCAN_SCRIPT,    JERR_BAD_STATE,    JERR_BAD_STRUCT_SIZE,    JERR_BAD_VIRTUAL_ACCESS,    JERR_BUFFER_SIZE,    JERR_CANT_SUSPEND,    JERR_CCIR601_NOTIMPL,    JERR_COMPONENT_COUNT,    JERR_CONVERSION_NOTIMPL,    JERR_DAC_INDEX,    JERR_DAC_VALUE,    JERR_DHT_INDEX,    JERR_DQT_INDEX,    JERR_EMPTY_IMAGE,    JERR_EMS_READ,    JERR_EMS_WRITE,    JERR_EOI_EXPECTED,    JERR_FILE_READ,    JERR_FILE_WRITE,    JERR_FRACT_SAMPLE_NOTIMPL,    JERR_HUFF_CLEN_OVERFLOW,    JERR_HUFF_MISSING_CODE,    JERR_IMAGE_TOO_BIG,    JERR_INPUT_EMPTY,    JERR_INPUT_EOF,    JERR_MISMATCHED_QUANT_TABLE,    JERR_MISSING_DATA,    JERR_MODE_CHANGE,    JERR_NOTIMPL,    JERR_NOT_COMPILED,    {$IF Declared(JPEG_LIB_VERSION) and (JPEG_LIB_VERSION &gt;= 70)}    JERR_NO_ARITH_TABLE,    {$IFEND}    JERR_NO_BACKING_STORE,    JERR_NO_HUFF_TABLE,    JERR_NO_IMAGE,    JERR_NO_QUANT_TABLE,    JERR_NO_SOI,    JERR_OUT_OF_MEMORY,    JERR_QUANT_COMPONENTS,    JERR_QUANT_FEW_COLORS,    JERR_QUANT_MANY_COLORS,    JERR_SOF_DUPLICATE,    JERR_SOF_NO_SOS,    JERR_SOF_UNSUPPORTED,    JERR_SOI_DUPLICATE,    JERR_SOS_NO_SOF,    JERR_TFILE_CREATE,    JERR_TFILE_READ,    JERR_TFILE_SEEK,    JERR_TFILE_WRITE,    JERR_TOO_LITTLE_DATA,    JERR_UNKNOWN_MARKER,    JERR_VIRTUAL_BUG,    JERR_WIDTH_OVERFLOW,    JERR_XMS_READ,    JERR_XMS_WRITE  );   procedure ERREXIT(cinfo: j_common_ptr; code: J_MESSAGE_CODE); procedure ERREXIT1(cinfo: j_common_ptr; code: J_MESSAGE_CODE; p1: Integer);   ...   \/\/\u041c\u0430\u043a\u0440\u043e\u0441 \u0438\u0437 jerror.h \/\/Fatal errors (print message and exit) procedure ERREXIT(cinfo: j_common_ptr; code: J_MESSAGE_CODE); begin  cinfo^.err^.msg_code := Ord(code);  cinfo^.err^.error_exit(j_common_ptr(cinfo)); end;   procedure ERREXIT1(cinfo: j_common_ptr; code: J_MESSAGE_CODE; p1: Integer); begin  cinfo^.err^.msg_code := Ord(code);  cinfo^.err^.msg_parm.i[0] := p1;  cinfo^.err^.error_exit(j_common_ptr(cinfo)); end; <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  \u041f\u0438\u0441\u0430\u043b\u043e\u0441\u044c \u0438 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043b\u043e\u0441\u044c \u043d\u0430 Delphi 2010. <br \/>  \u0412\u0441\u0435 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438 \u043c\u043e\u0436\u043d\u043e \u0441\u043a\u0430\u0447\u0430\u0442\u044c \u043f\u043e <a href=\"https:\/\/sites.google.com\/site\/victorfedorenkov\/suJpegTurbo.zip\">\u0441\u0441\u044b\u043b\u043a\u0435<\/a>      \t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/242119\/\"> http:\/\/habrahabr.ru\/post\/242119\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">     \t\u041a\u0430\u043a-\u0442\u043e \u0440\u0430\u0437, \u043f\u0440\u043e\u0444\u0438\u043b\u0438\u0440\u0443\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0434\u043b\u044f \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u044f \u0437\u0430 \u0440\u0430\u0431\u043e\u0447\u0438\u043c \u0441\u0442\u043e\u043b\u043e\u043c, \u043c\u043d\u043e\u0439 \u0431\u044b\u043b\u043e \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u043e \u0447\u0442\u043e \u043a\u0443\u0447\u0430 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u0438 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\/\u0434\u0435\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 JPEG. \u0418\u0437\u0443\u0447\u0438\u0432 \u043f\u043e \u0443\u0441\u043a\u043e\u0440\u0435\u043d\u0438\u044e \u044d\u0442\u043e\u0439 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u044b \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f, \u0431\u044b\u043b\u043e \u0440\u0435\u0448\u0435\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c libjpeg-turbo.<\/p>\n<p>  \u041f\u043e\u0434 \u043a\u0430\u0442\u043e\u043c \u043c\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u043d\u0430 Delphi \u0438 \u043e\u043f\u0438\u0441\u0430\u043d\u044b \u043f\u043e\u0434\u0432\u043e\u0434\u043d\u044b\u0435 \u043a\u0430\u043c\u043d\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-242119","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/242119","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=242119"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/242119\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=242119"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=242119"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=242119"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}