Make(delphi) ver(4.04 build 185) Add(MainForm,2953706,126,133) { Position=1 link(onCreate,13071333:doSearch,[]) } Add(Button,3083885,287,378) { Left=10 Top=15 Width=80 Caption="PictureStream" link(onClick,1001299:doEvent1,[]) } Add(FileSearch,13071333,196,147) { SubDir=1 link(onSearch,14235328:doAdd,[]) link(onEndSearch,4909503:doData,[(282,160)(282,258)]) } Add(StrList,14235328,315,147) { Point(EndIdx) Point(doGetString) Point(onGetString) link(onGetString,11726403:doValue,[]) } Add(CounterEx,11074202,448,245) { Default=-1 Point(doMax) link(onNext,14004461:In,[]) } Add(DoData,4909503,336,252) { link(onEventData,11074202:doMax,[]) link(Data,14235328:EndIdx,[]) } Add(LineBreak,15126533,273,189) { link(Out,14235328:doGetString,[]) Primary=[14004461,217,56] } Add(Memory,11726403,420,154) { } Add(PictureStream,13190845,420,392) { link(onLoad,2288735:doWork2,[]) link(FileName,9954928:Var2,[]) } Add(Hub,1001299,336,378) { OutCount=4 link(onEvent1,1253832:doWork2,[]) link(onEvent2,15547226:doEvent1,[(375,391)(375,447)]) link(onEvent3,13190845:doLoad,[]) link(onEvent4,4280478:doEvent1,[(368,405)(368,468)]) } Add(Image,7305539,539,392) { Left=10 Top=40 Width=300 Height=225 } Add(Button,12152327,287,532) { Left=95 Top=15 Width=80 Caption="IJL" link(onClick,9422314:doEvent1,[]) } Add(Hub,9422314,336,532) { OutCount=4 link(onEvent1,1253832:doWork3,[(396,538)]) link(onEvent2,15547226:doEvent2,[(448,545)(448,454)]) link(onEvent3,5139779:doLoadJPG,[]) link(onEvent4,4280478:doEvent2,[(455,559)(455,475)]) } Add(HubEx,1253832,392,378) { Angle=3 link(onEvent,11074202:doNext,[(396,251)]) } Add(GetDataEx,9954928,420,357) { link(Data,11726403:Value,[]) } Add(HubEx,2288735,518,392) { link(onEvent,7305539:doLoad,[]) } Add(TimeCounter,13009724,595,441) { link(onStop,11903891:doText,[]) } Add(Label,11903891,644,448) { Left=180 Top=20 } Add(Hub,15547226,560,441) { InCount=2 OutCount=1 link(onEvent1,13009724:doStart,[]) } Add(Hub,4280478,560,462) { InCount=2 OutCount=1 link(onEvent1,13009724:doStop,[(584,468)(584,454)]) } Add(InlineCode,5139779,469,546) { @Hint=#26:IJL - модуль загрузки JPEG| WorkPoints=#9:doLoadJPG| EventPoints=#9:onLoadJPG| DataPoints=#13:dtStrFileName| Code=#15:unit HiAsmUnit;|8:{$Z+,A+}|0:|9:interface|0:|29:uses windows,kol,Share,Debug;|0:|24:const DLL = 'ijl15.dll';|0:|24:////Взято из IJL.pas////|4:type|18: PShort = ^Short;|29: IJL_INT64 = TLargeInteger;|30: IJL_UINT64 = TULargeInteger;|0:|1:{|17: Macros/Constants|1:}|0:|5:const|16: IJL_NONE = 0;|18: IJL_OTHER = 255;|55: JBUFSIZE = 4096; // Size of file I/O buffer (4K).|0:|76:////////////////////////////////////////////////////////////////////////////|28:// Name: IJLibVersion|2://|44:// Purpose: Stores library version info.|2://|11:// Context:|2://|10:// Fields:|21:// major -|21:// minor -|21:// build -|21:// Name -|21:// Version -|21:// InternalVersion -|21:// BuildDate -|21:// CallConv -|2://|76:////////////////////////////////////////////////////////////////////////////|4:type|33: PIJLibVersion = ^TIJLibVersion;|24: TIJLibVersion = record|30: Major : Integer;|30: Minor : Integer;|30: Build : Integer;|28: Name : PChar;|28: Version : PChar;|28: InternalVersion : PChar;|28: BuildDate : PChar;|28: CallConv : PChar;|6: end;|0:|76:////////////////////////////////////////////////////////////////////////////|24:// Name: IJL_RECT|2://|62:// Purpose: Keep coordinates for rectangle region of image|2://|35:// Context: Used to specify roi|2://|10:// Fields:|2://|76:////////////////////////////////////////////////////////////////////////////|25: PIJL_RECT = ^TIJL_RECT;|20: TIJL_RECT = record|21: Left : Longint;|21: Top : Longint;|21: Right : Longint;|21: Bottom : Longint;|6: end;|0:|76:////////////////////////////////////////////////////////////////////////////|26:// Name: IJL_HANDLE|2://|27:// Purpose: file handle|2://|31:// Context: used internally|2://|10:// Fields:|2://|76:////////////////////////////////////////////////////////////////////////////|24: TIJL_HANDLE = Pointer;|0:|1:{|23: Name: IJLIOTYPE|0:|70: Purpose: Possible types of data read/write/other operations to be|64: performed by the functions IJL_Read and IJL_Write.|0:|73: See the Developer's Guide for details on appropriate usage.|0:|8: Fields:|0:|58: IJL_JFILE_XXXXXXX Indicates JPEG data in a stdio file.|0:|67: IJL_JBUFF_XXXXXXX Indicates JPEG data in an addressable buffer.|1:}|5:const|17: IJL_SETUP = -1;|4:type|16: TIJLIOType = (|75: // Read JPEG parameters (i.e., height, width, channels, sampling, etc.)|30: // from a JPEG bit stream.|41: IJL_JFILE_READPARAMS, // = 0|41: IJL_JBUFF_READPARAMS, // = 1|0:|44: // Read a JPEG Interchange Format image.|41: IJL_JFILE_READWHOLEIMAGE, // = 2|41: IJL_JBUFF_READWHOLEIMAGE, // = 3|0:|66: // Read JPEG tables from a JPEG Abbreviated Format bit stream.|42: IJL_JFILE_READHEADER, // = 4,|42: IJL_JBUFF_READHEADER, // = 5,|0:|65: // Read image info from a JPEG Abbreviated Format bit stream.|41: IJL_JFILE_READENTROPY, // = 6|41: IJL_JBUFF_READENTROPY, // = 7|0:|39: // Write an entire JFIF bit stream.|41: IJL_JFILE_WRITEWHOLEIMAGE, // = 8|41: IJL_JBUFF_WRITEWHOLEIMAGE, // = 9|0:|50: // Write a JPEG Abbreviated Format bit stream.|41: IJL_JFILE_WRITEHEADER, // = 10|41: IJL_JBUFF_WRITEHEADER, // = 11|0:|64: // Write image info to a JPEG Abbreviated Format bit stream.|41: IJL_JFILE_WRITEENTROPY, // = 12|41: IJL_JBUFF_WRITEENTROPY, // = 13|0:|0:|31: // Scaled Decoding Options:|0:|45: // Reads a JPEG image scaled to 1/2 size.|41: IJL_JFILE_READONEHALF, // = 14|41: IJL_JBUFF_READONEHALF, // = 15|0:|45: // Reads a JPEG image scaled to 1/4 size.|41: IJL_JFILE_READONEQUARTER, // = 16|41: IJL_JBUFF_READONEQUARTER, // = 17|0:|45: // Reads a JPEG image scaled to 1/8 size.|41: IJL_JFILE_READONEEIGHTH, // = 18|41: IJL_JBUFF_READONEEIGHTH, // = 19|0:|58: // Reads an embedded thumbnail from a JFIF bit stream.|41: IJL_JFILE_READTHUMBNAIL, // = 20|41: IJL_JBUFF_READTHUMBNAIL // = 21|6: );|0:|76:////////////////////////////////////////////////////////////////////////////|25:// Name: IJL_COLOR|2://|45:// Purpose: Possible color space formats.|2://|62:// Note these formats do *not* necessarily denote|58:// the number of channels in the color space.|61:// There exists separate "channel" fields in the|64:// JPEG_CORE_PROPERTIES data structure specifically|60:// for indicating the number of channels in the|45:// JPEG and/or DIB color spaces.|2://|75:// See the Developer's Guide for details on appropriate usage.|2://|76:////////////////////////////////////////////////////////////////////////////|16: TIJL_COLOR = (|70: IJL_PAD1, // = 0 // Stub for Delphi, enum type start with 0|58: IJL_RGB, // = 1 // Red-Green-Blue color space.|70: IJL_BGR, // = 2 // Reversed channel ordering from IJL_RGB.|75: IJL_YCBCR, // = 3 // Luminance-Chrominance color space as defined|58: // by CCIR Recommendation 601.|53: IJL_G, // = 4 // Grayscale color space.|70: IJL_RGBA_FPX, // = 5 // FlashPix RGB 4 channel color space that|58: // has pre-multiplied opacity.|72: IJL_YCBCRA_FPX // = 6 // FlashPix YCbCr 4 channel color space that|58: // has pre-multiplied opacity.|77: //IJL_OTHER = 255 // Some other color space not defined by the IJL.|73: // (This means no color space conversion will|52: // be done by the IJL.)|6: );|0:|76:////////////////////////////////////////////////////////////////////////////|34:// Name: IJL_JPGSUBSAMPLING|2://|62:// Purpose: Possible subsampling formats used in the JPEG.|2://|75:// See the Developer's Guide for details on appropriate usage.|2://|76:////////////////////////////////////////////////////////////////////////////|25: TIJL_JPGSUBSAMPLING = (|72: IJL_PAD2, // = 0 // Stub for Delphi, enum type start with 0|63: IJL_411, // = 1, // Valid on a JPEG w/ 3 channels.|63: IJL_422, // = 2, // Valid on a JPEG w/ 3 channels.|63: IJL_4114, // = 3, // Valid on a JPEG w/ 4 channels.|63: IJL_4224 // = 4 // Valid on a JPEG w/ 4 channels.|6: );|0:|76:////////////////////////////////////////////////////////////////////////////|34:// Name: IJL_DIBSUBSAMPLING|2://|61:// Purpose: Possible subsampling formats used in the DIB.|2://|75:// See the Developer's Guide for details on appropriate usage.|2://|76:////////////////////////////////////////////////////////////////////////////|44: TIJL_DIBSUBSAMPLING = TIJL_JPGSUBSAMPLING;|0:|76:////////////////////////////////////////////////////////////////////////////|29:// Name: HUFFMAN_TABLE|2://|73:// Purpose: Stores Huffman table information in a fast-to-use format.|2://|71:// Context: Used by Huffman encoder/decoder to access Huffman table|67:// data. Raw Huffman tables are formatted to fit this|39:// structure prior to use.|2://|10:// Fields:|65:// huff_class 0 == DC Huffman or lossless table, 1 == AC table.|72:// ident Huffman table identifier, 0-3 valid (Extended Baseline).|58:// huffelem Huffman elements for codes <= 8 bits long;|72:// contains both zero run-length and symbol length in bits.|61:// huffval Huffman values for codes 9-16 bits in length.|50:// mincode Smallest Huffman code of length n.|49:// maxcode Largest Huffman code of length n.|70:// valptr Starting index into huffval[] for symbols of length k.|2://|76:////////////////////////////////////////////////////////////////////////////|35: PHUFFMAN_TABLE = ^THUFFMAN_TABLE;|25: THUFFMAN_TABLE = record|25: huff_class : Integer;|25: ident : Integer;|40: huffelem : array [0..255] of UINT;|41: huffval : array [0..255] of SHORT;|41: mincode : array [0..16] of SHORT;|41: maxcode : array [0..17] of SHORT;|41: valptr : array [0..16] of SHORT;|6: end;|0:|76:////////////////////////////////////////////////////////////////////////////|29:// Name: JPEGHuffTable|2://|61:// Purpose: Stores pointers to JPEG-binary spec compliant|42:// Huffman table information.|2://|70:// Context: Used by interface and table methods to specify encoder|57:// tables to generate and store JPEG images.|2://|10:// Fields:|71:// bits Points to number of codes of length i (<=16 supported).|56:// vals Value associated with each Huffman code.|45:// hclass 0 == DC table, 1 == AC table.|56:// ident Specifies the identifier for this table.|49:// 0-3 for extended JPEG compliance.|2://|76:////////////////////////////////////////////////////////////////////////////|35: PJPEGHuffTable = ^TJPEGHuffTable;|25: TJPEGHuffTable = record|20: bits : PUCHAR;|20: vals : PUCHAR;|19: hclass : UCHAR;|19: ident : UCHAR;|6: end;|0:|76:////////////////////////////////////////////////////////////////////////////|27:// Name: QUANT_TABLE|2://|58:// Purpose: Stores quantization table information in a|35:// fast-to-use format.|2://|64:// Context: Used by quantizer/dequantizer to store formatted|36:// quantization tables.|2://|10:// Fields:|54:// precision 0 => elements contains 8-bit elements,|55:// 1 => elements contains 16-bit elements.|39:// ident Table identifier (0-3).|73:// elements Pointer to 64 table elements + 16 extra elements to catch|67:// input data errors that may cause malfunction of the|32:// Huffman decoder.|68:// elarray Space for elements (see above) plus 8 bytes to align|39:// to a quadword boundary.|2://|76:////////////////////////////////////////////////////////////////////////////|31: PQUANT_TABLE = ^TQUANT_TABLE;|23: TQUANT_TABLE = record|24: precision : Integer;|24: ident : Integer;|23: elements : PSHORT;|39: elarray : array [0..83] of Short;|6: end;|0:|76:////////////////////////////////////////////////////////////////////////////|30:// Name: JPEGQuantTable|2://|61:// Purpose: Stores pointers to JPEG binary spec compliant|47:// quantization table information.|2://|70:// Context: Used by interface and table methods to specify encoder|57:// tables to generate and store JPEG images.|2://|10:// Fields:|71:// quantizer Zig-zag order elements specifying quantization factors.|52:// ident Specifies identifier for this table.|64:// 0-3 valid for Extended Baseline JPEG compliance.|2://|76:////////////////////////////////////////////////////////////////////////////|37: PJPEGQuantTable = ^TJPEGQuantTable;|26: TJPEGQuantTable = record|23: quantizer : PUCHAR;|22: ident : UCHAR;|6: end;|0:|76:////////////////////////////////////////////////////////////////////////////|31:// Name: FRAME_COMPONENT|2://|72:// Purpose: One frame-component structure is allocated per component|27:// in a frame.|2://|61:// Context: Used by Huffman decoder to manage components.|2://|10:// Fields:|67:// ident Component identifier. The tables use this ident to|63:// determine the correct table for each component.|65:// hsampling Horizontal subsampling factor for this component,|30:// 1-4 are legal.|63:// vsampling Vertical subsampling factor for this component,|30:// 1-4 are legal.|68:// quant_sel Quantization table selector. The quantization table|71:// used by this component is determined via this selector.|2://|76:////////////////////////////////////////////////////////////////////////////|39: PFRAME_COMPONENT = ^TFRAME_COMPONENT;|27: TFRAME_COMPONENT = record|24: ident : Integer;|24: hsampling : Integer;|24: vsampling : Integer;|24: quant_sel : Integer;|6: end;|0:|76:////////////////////////////////////////////////////////////////////////////|21:// Name: FRAME|2://|43:// Purpose: Stores frame-specific data.|2://|46:// Context: One Frame structure per image.|2://|10:// Fields:|45:// precision Sample precision in bits.|56:// width Width of the source image in pixels.|57:// height Height of the source image in pixels.|42:// MCUheight Height of a frame MCU.|41:// MCUwidth Width of a frame MCU.|75:// max_hsampling Max horiz sampling ratio of any component in the frame.|74:// max_vsampling Max vert sampling ratio of any component in the frame.|63:// ncomps Number of components/channels in the frame.|59:// horMCU Number of horizontal MCUs in the frame.|54:// totalMCU Total number of MCUs in the frame.|60:// comps Array of 'ncomps' component descriptors.|71:// restart_interv Indicates number of MCUs after which to restart the|39:// entropy parameters.|71:// SeenAllDCScans Used when decoding Multiscan images to determine if|63:// all channels of an image have been decoded.|40:// SeenAllACScans (See SeenAllDCScans)|2://|76:////////////////////////////////////////////////////////////////////////////|19: PFRAME = ^TFRAME;|17: TFRAME = record|29: precision : Integer;|29: width : Integer;|29: height : Integer;|29: MCUheight : Integer;|29: MCUwidth : Integer;|29: max_hsampling : Integer;|29: max_vsampling : Integer;|29: ncomps : Integer;|29: horMCU : Integer;|29: totalMCU : Longint;|38: comps : PFRAME_COMPONENT;|29: restart_interv : Integer;|29: SeenAllDCScans : Integer;|29: SeenAllACScans : Integer;|6: end;|0:|76:////////////////////////////////////////////////////////////////////////////|30:// Name: SCAN_COMPONENT|2://|71:// Purpose: One scan-component structure is allocated per component|40:// of each scan in a frame.|2://|74:// Context: Used by Huffman decoder to manage components within scans.|2://|10:// Fields:|69:// comp Component number, index to the comps member of FRAME.|43:// hsampling Horizontal sampling factor.|41:// vsampling Vertical sampling factor.|55:// dc_table DC Huffman table pointer for this scan.|55:// ac_table AC Huffman table pointer for this scan.|57:// quant_table Quantization table pointer for this scan.|2://|76:////////////////////////////////////////////////////////////////////////////|37: PSCAN_COMPONENT = ^TSCAN_COMPONENT;|26: TSCAN_COMPONENT = record|26: comp : Integer;|26: hsampling : Integer;|26: vsampling : Integer;|33: dc_table : PHUFFMAN_TABLE;|33: ac_table : PHUFFMAN_TABLE;|31: quant_table : PQUANT_TABLE;|6: end;|0:|76:////////////////////////////////////////////////////////////////////////////|20:// Name: SCAN|2://|68:// Purpose: One SCAN structure is allocated per scan in a frame.|2://|56:// Context: Used by Huffman decoder to manage scans.|2://|10:// Fields:|68:// ncomps Number of image components in a scan, 1-4 legal.|55:// gray_scale If TRUE, decode only the Y channel.|72:// start_spec Start coefficient of spectral or predictor selector.|57:// end_spec End coefficient of spectral selector.|65:// approx_high High bit position in successive approximation|39:// Progressive coding.|64:// approx_low Low bit position in successive approximation|39:// Progressive coding.|52:// restart_interv Restart interval, 0 if disabled.|67:// curxMCU Next horizontal MCU index to be processed after|40:// an interrupted SCAN.|65:// curyMCU Next vertical MCU index to be processed after|40:// an interrupted SCAN.|64:// dc_diff Array of DC predictor values for DPCM modes.|73:// comps Array of ncomps SCAN_COMPONENT component identifiers.|2://|76:////////////////////////////////////////////////////////////////////////////|17: PSCAN = ^TSCAN;|16: TSCAN = record|29: ncomps : Integer;|29: gray_scale : Integer;|29: start_spec : Integer;|29: end_spec : Integer;|29: approx_high : Integer;|29: approx_low : Integer;|26: restart_interv : UINT;|27: curxMCU : DWORD;|27: curyMCU : DWORD;|45: dc_diff : array [0..3] of Integer;|37: comps : PSCAN_COMPONENT;|6: end;|0:|76:////////////////////////////////////////////////////////////////////////////|23:// Name: DCTTYPE|2://|70:// Purpose: Possible algorithms to be used to perform the discrete|39:// cosine transform (DCT).|2://|10:// Fields:|65:// IJL_AAN The AAN (Arai, Agui, and Nakajima) algorithm from|66:// Trans. IEICE, vol. E 71(11), 1095-1097, Nov. 1988.|64:// IJL_IPP The modified K. R. Rao and P. Yip algorithm from|52:// Intel Performance Primitives Library|2://|76:////////////////////////////////////////////////////////////////////////////|14: TDCTTYPE = (|21: IJL_AAN, // = 0|21: IJL_IPP // = 1|4: );|0:|76:////////////////////////////////////////////////////////////////////////////|31:// Name: UPSAMPLING_TYPE|2://|78:// Purpose: - Possible algorithms to be used to perform upsampling|2://|10:// Fields:|80:// IJL_BOX_FILTER - the algorithm is simple replication of the input pixel|76:// onto the corresponding output pixels (box filter);|74:// IJL_TRIANGLE_FILTER - 3/4 * nearer pixel + 1/4 * further pixel in each|35:// dimension|76:////////////////////////////////////////////////////////////////////////////|22: TUPSAMPLING_TYPE = (|30: IJL_BOX_FILTER, // = 0|30: IJL_TRIANGLE_FILTER // = 1|4: );|0:|76:////////////////////////////////////////////////////////////////////////////|30:// Name: SAMPLING_STATE|2://|74:// Purpose: Stores current conditions of sampling. Only for upsampling|49:// with triangle filter is used now.|2://|10:// Fields:|77:// top_row - pointer to buffer with MCUs, that are located above than|41:// current row of MCUs;|64:// cur_row - pointer to buffer with current row of MCUs;|77:// bottom_row - pointer to buffer with MCUs, that are located below than|41:// current row of MCUs;|67:// last_row - pointer to bottom boundary of last row of MCUs|61:// cur_row_number - number of row of MCUs, that is decoding;|77:// user_interrupt - field to store jprops->interrupt, because of we prohibit|68:// interrupts while top row of MCUs is upsampling.|76:////////////////////////////////////////////////////////////////////////////|37: PSAMPLING_STATE = ^TSAMPLING_STATE;|26: TSAMPLING_STATE = record|28: top_row : PShort;|28: cur_row : PShort;|28: bottom_row : PShort;|28: last_row : PShort;|29: cur_row_number : Integer;|6: end;|0:|76:////////////////////////////////////////////////////////////////////////////|30:// Name: PROCESSOR_TYPE|2://|45:// Purpose: Possible types of processors.|66:// Note that the enums are defined in ascending order|70:// depending upon their various IA32 instruction support.|2://|10:// Fields:|2://|17:// IJL_OTHER_PROC|50:// Does not support the CPUID instruction and|53:// assumes no Pentium(R) processor instructions.|2://|19:// IJL_PENTIUM_PROC|52:// Corresponds to an Intel(R) Pentium processor|48:// (or a 100% compatible) that supports the|39:// Pentium processor instructions.|2://|23:// IJL_PENTIUM_PRO_PROC|53:// Corresponds to an Intel Pentium Pro processor|48:// (or a 100% compatible) that supports the|43:// Pentium Pro processor instructions.|2://|28:// IJL_PENTIUM_PROC_MMX_TECH|49:// Corresponds to an Intel Pentium processor|54:// with MMX(TM) technology (or a 100% compatible)|43:// that supports the MMX instructions.|2://|22:// IJL_PENTIUM_II_PROC|52:// Corresponds to an Intel Pentium II processor|53:// (or a 100% compatible) that supports both the|50:// Pentium Pro processor instructions and the|25:// MMX instructions.|2://|58:// Any additional processor types that support a superset|58:// of both the Pentium Pro processor instructions and the|58:// MMX instructions should be given an enum value greater|29:// than IJL_PENTIUM_II_PROC.|2://|76:////////////////////////////////////////////////////////////////////////////|21: TPROCESSOR_TYPE = (|38: IJL_OTHER_PROC, // = 0,|38: IJL_PENTIUM_PROC, // = 1,|38: IJL_PENTIUM_PRO_PROC, // = 2,|38: IJL_PENTIUM_PROC_MMX_TECH, // = 3,|37: IJL_PENTIUM_II_PROC, // = 4|37: IJL_PENTIUM_III_PROC // = 5|4: );|0:|76:////////////////////////////////////////////////////////////////////////////|29:// Name: ENTROPYSTRUCT|2://|72:// Purpose: Stores the decoder state information necessary to "jump"|71:// to a particular MCU row in a compressed entropy stream.|2://|73:// Context: Used to persist the decoder state within Decode_Scan when|36:// decoding using ROIs.|2://|10:// Fields:|69:// offset Offset (in bytes) into the entropy stream|47:// from the beginning.|66:// dcval1 DC val at the beginning of the MCU row|44:// for component 1.|66:// dcval2 DC val at the beginning of the MCU row|44:// for component 2.|66:// dcval3 DC val at the beginning of the MCU row|44:// for component 3.|66:// dcval4 DC val at the beginning of the MCU row|44:// for component 4.|70:// bit_buffer_64 64-bit Huffman bit buffer. Stores current|65:// bit buffer at the start of a MCU row.|66:// Also used as a 32-bit buffer on 32-bit|42:// architectures.|73:// bitbuf_bits_valid Number of valid bits in the above bit buffer.|65:// unread_marker Have any markers been decoded but not|68:// processed at the beginning of a MCU row?|71:// This entry holds the unprocessed marker, or|38:// 0 if none.|2://|76:////////////////////////////////////////////////////////////////////////////|35: PENTROPYSTRUCT = ^TENTROPYSTRUCT;|25: TENTROPYSTRUCT = record|30: offset : DWORD;|32: dcval1 : Integer;|32: dcval2 : Integer;|32: dcval3 : Integer;|32: dcval4 : Integer;|35: bit_buffer_64 : IJL_UINT64;|32: bitbuf_bits_valid : Integer;|29: unread_marker : Byte;|6: end;|0:|76:////////////////////////////////////////////////////////////////////////////|21:// Name: STATE|2://|51:// Purpose: Stores the active state of the IJL.|2://|72:// Context: Used by all low-level routines to store pseudo-global or|32:// state variables.|2://|10:// Fields:|68:// bit_buffer_64 64-bit bitbuffer utilized by Huffman|77:// encoder/decoder algorithms utilizing routines|64:// designed for MMX(TM) technology.|70:// bit_buffer_32 32-bit bitbuffer for all other Huffman|59:// encoder/decoder algorithms.|75:// bitbuf_bits_valid Number of bits in the above two fields that|42:// are valid.|2://|70:// cur_entropy_ptr Current position (absolute address) in|51:// the entropy buffer.|71:// start_entropy_ptr Starting position (absolute address) of|51:// the entropy buffer.|69:// end_entropy_ptr Ending position (absolute address) of|51:// the entropy buffer.|66:// entropy_bytes_processed Number of bytes actually processed|68:// (passed over) in the entropy buffer.|63:// entropy_buf_maxsize Max size of the entropy buffer.|75:// entropy_bytes_left Number of bytes left in the entropy buffer.|62:// Prog_EndOfBlock_Run Progressive block run counter.|2://|75:// DIB_ptr Temporary offset into the input/output DIB.|2://|76:// unread_marker If a marker has been read but not processed,|55:// stick it in this field.|74:// processor_type (0, 1, or 2) == current processor does not|61:// support MMX(TM) instructions.|66:// (3 or 4) == current processor does|61:// support MMX(TM) instructions.|78:// cur_scan_comp On which component of the scan are we working?|55:// file Process file handle, or|65:// 0x00000000 if no file is defined.|53:// JPGBuffer Entropy buffer (~4K).|2://|2://|76:////////////////////////////////////////////////////////////////////////////|19: PSTATE = ^TSTATE;|17: TSTATE = record|18: // Bit buffer.|35: bit_buffer_64 : IJL_UINT64;|30: bit_buffer_32 : DWORD;|32: bitbuf_bits_valid : Integer;|0:|15: // Entropy.|36: cur_entropy_ptr : PByte;|36: start_entropy_ptr : PByte;|36: end_entropy_ptr : PByte;|38: entropy_bytes_processed : Longint;|38: entropy_buf_maxsize : Longint;|38: entropy_bytes_left : Integer;|38: Prog_EndOfBlock_Run : Integer;|0:|27: // Input or output DIB.|27: DIB_ptr : PByte;|0:|26: unread_marker : Byte;|37: processor_type : TPROCESSOR_TYPE;|29: cur_scan_comp : Integer;|44: hFile : TIJL_HANDLE; //THandle;|51: JPGBuffer : array [0..JBUFSIZE-1] of Byte;|6: end;|0:|76:////////////////////////////////////////////////////////////////////////////|40:// Name: FAST_MCU_PROCESSING_TYPE|2://|56:// Purpose: Advanced Control Option. Do NOT modify.|59:// WARNING: Used for internal reference only.|2://|10:// Fields:|2://|67:// IJL_(sampling)_(JPEG color space)_(sampling)_(DIB color space)|51:// Decode is read left to right w/ upsampling.|52:// Encode is read right to left w/ subsampling.|2://|76:////////////////////////////////////////////////////////////////////////////|31: TFAST_MCU_PROCESSING_TYPE = (|47: IJL_NO_CC_OR_US, // = 0,|0:|47: IJL_111_YCBCR_111_RGB, // = 1,|47: IJL_111_YCBCR_111_BGR, // = 2,|0:|47: IJL_411_YCBCR_111_RGB, // = 3,|47: IJL_411_YCBCR_111_BGR, // = 4,|0:|47: IJL_422_YCBCR_111_RGB, // = 5,|47: IJL_422_YCBCR_111_BGR, // = 6,|0:|47: IJL_111_YCBCR_1111_RGBA_FPX, // = 7,|47: IJL_411_YCBCR_1111_RGBA_FPX, // = 8,|47: IJL_422_YCBCR_1111_RGBA_FPX, // = 9,|0:|48: IJL_1111_YCBCRA_FPX_1111_RGBA_FPX, // = 10,|48: IJL_4114_YCBCRA_FPX_1111_RGBA_FPX, // = 11,|48: IJL_4224_YCBCRA_FPX_1111_RGBA_FPX, // = 12,|0:|48: IJL_111_RGB_1111_RGBA_FPX, // = 13,|0:|47: IJL_1111_RGBA_FPX_1111_RGBA_FPX // = 14|4: );|0:|76:////////////////////////////////////////////////////////////////////////////|31:// Name: JPEG_PROPERTIES|2://|72:// Purpose: Stores low-level and control information. It is used by|72:// both the encoder and decoder. An advanced external user|65:// may access this structure to expand the interface|27:// capability.|2://|69:// See the Developer's Guide for an expanded description|46:// of this structure and its use.|2://|68:// Context: Used by all interface methods and most IJL routines.|2://|10:// Fields:|2://|64:// iotype IN: Specifies type of data operation|56:// (read/write/other) to be|67:// performed by IJL_Read or IJL_Write.|70:// roi IN: Rectangle-Of-Interest to read from, or|52:// write to, in pixels.|57:// dcttype IN: DCT alogrithm to be used.|72:// fast_processing OUT: Supported fast pre/post-processing path.|55:// This is set by the IJL.|72:// interrupt IN: Signals an interrupt has been requested.|2://|71:// DIBBytes IN: Pointer to buffer of uncompressed data.|59:// DIBWidth IN: Width of uncompressed data.|60:// DIBHeight IN: Height of uncompressed data.|65:// DIBPadBytes IN: Padding (in bytes) at end of each|61:// row in the uncompressed data.|59:// DIBChannels IN: Number of components in the|50:// uncompressed data.|65:// DIBColor IN: Color space of uncompressed data.|56:// DIBSubsampling IN: Required to be IJL_NONE.|69:// DIBLineBytes OUT: Number of bytes in an output DIB line|50:// including padding.|2://|59:// JPGFile IN: Pointer to file based JPEG.|61:// JPGBytes IN: Pointer to buffer based JPEG.|68:// JPGSizeBytes IN: Max buffer size. Used with JPGBytes.|67:// OUT: Number of compressed bytes written.|52:// JPGWidth IN: Width of JPEG image.|66:// OUT: After reading (except READHEADER).|53:// JPGHeight IN: Height of JPEG image.|66:// OUT: After reading (except READHEADER).|67:// JPGChannels IN: Number of components in JPEG image.|66:// OUT: After reading (except READHEADER).|58:// JPGColor IN: Color space of JPEG image.|58:// JPGSubsampling IN: Subsampling of JPEG image.|66:// OUT: After reading (except READHEADER).|70:// JPGThumbWidth OUT: JFIF embedded thumbnail width [0-255].|71:// JPGThumbHeight OUT: JFIF embedded thumbnail height [0-255].|2://|73:// cconversion_reqd OUT: If color conversion done on decode, TRUE.|67:// upsampling_reqd OUT: If upsampling done on decode, TRUE.|69:// jquality IN: [0-100] where highest quality is 100.|62:// jinterleaveType IN/OUT: 0 => MCU interleaved file, and|58:// 1 => 1 scan per component.|66:// numxMCUs OUT: Number of MCUs in the x direction.|66:// numyMCUs OUT: Number of MCUs in the y direction.|2://|62:// nqtables IN/OUT: Number of quantization tables.|69:// maxquantindex IN/OUT: Maximum index of quantization tables.|60:// nhuffActables IN/OUT: Number of AC Huffman tables.|60:// nhuffDctables IN/OUT: Number of DC Huffman tables.|64:// maxhuffindex IN/OUT: Maximum index of Huffman tables.|66:// jFmtQuant IN/OUT: Formatted quantization table info.|64:// jFmtAcHuffman IN/OUT: Formatted AC Huffman table info.|64:// jFmtDcHuffman IN/OUT: Formatted DC Huffman table info.|2://|63:// jEncFmtQuant IN/OUT: Pointer to one of the above, or|62:// to externally persisted table.|63:// jEncFmtAcHuffman IN/OUT: Pointer to one of the above, or|62:// to externally persisted table.|63:// jEncFmtDcHuffman IN/OUT: Pointer to one of the above, or|62:// to externally persisted table.|2://|67:// use_default_qtables IN: Set to default quantization tables.|57:// Clear to supply your own.|62:// use_default_htables IN: Set to default Huffman tables.|57:// Clear to supply your own.|68:// rawquanttables IN: Up to 4 sets of quantization tables.|68:// rawhufftables IN: Alternating pairs (DC/AC) of up to 4|59:// sets of raw Huffman tables.|64:// HuffIdentifierAC IN: Indicates what channel the user-|68:// supplied Huffman AC tables apply to.|64:// HuffIdentifierDC IN: Indicates what channel the user-|68:// supplied Huffman DC tables apply to.|2://|67:// jframe OUT: Structure with frame-specific info.|68:// needframe OUT: TRUE when a frame has been detected.|2://|65:// jscan Persistence for current scan pointer when|36:// interrupted.|2://|70:// state OUT: Contains info on the state of the IJL.|70:// SawAdobeMarker OUT: Decoder saw an APP14 marker somewhere.|70:// AdobeXform OUT: If SawAdobeMarker TRUE, this indicates|74:// the JPEG color space given by that marker.|2://|67:// rowoffsets Persistence for the decoder MCU row origins|64:// when decoding by ROI. Offsets (in bytes|63:// from the beginning of the entropy data)|65:// to the start of each of the decoded rows.|65:// Fill the offsets with -1 if they have not|61:// been initalized and NULL could be the|48:// offset to the first row.|2://|65:// MCUBuf OUT: Quadword aligned internal buffer.|62:// Big enough for the largest MCU|63:// (10 blocks) with extra room for|54:// additional operations.|68:// tMCUBuf OUT: Version of above, without alignment.|2://|66:// processor_type OUT: Determines type of processor found|54:// during initialization.|2://|71:// ignoreDCTs IN: PyAssert to bypass DCTs when processing|63:// data. Required for conformance|40:// testing.|2://|66:// progressive_found OUT: 1 when progressive image detected.|69:// coef_buffer IN: Pointer to a larger buffer containing|64:// frequency coefficients when they|61:// cannot be decoded dynamically|67:// (i.e., as in progressive decoding).|2://|49:// upsampling_type IN: Type of sampling:|70:// IJL_BOX_FILTER or IJL_TRIANGLE_FILTER.|72:// SAMPLING_STATE* OUT: pointer to structure, describing current|55:// condition of upsampling|2://|77:// AdobeVersion OUT version field, if Adobe APP14 marker detected|76:// AdobeFlags0 OUT flags0 field, if Adobe APP14 marker detected|76:// AdobeFlags1 OUT flags1 field, if Adobe APP14 marker detected|2://|65:// jfif_app0_detected OUT: 1 - if JFIF APP0 marker detected,|42:// 0 - if not|53:// jfif_app0_version IN/OUT The JFIF file version|63:// jfif_app0_units IN/OUT units for the X and Y densities|61:// 0 - no units, X and Y specify|58:// the pixel aspect ratio|61:// 1 - X and Y are dots per inch|59:// 2 - X and Y are dots per cm|56:// jfif_app0_Xdensity IN/OUT horizontal pixel density|54:// jfif_app0_Ydensity IN/OUT vertical pixel density|2://|56:// jpeg_comment IN pointer to JPEG comments|63:// jpeg_comment_size IN/OUT size of JPEG comments, in bytes|2://|76:////////////////////////////////////////////////////////////////////////////|39: PJPEG_PROPERTIES = ^TJPEG_PROPERTIES;|27: TJPEG_PROPERTIES = record|41: // Compression/Decompression control.|71: iotype : TIJLIOTYPE; // default = IJL_SETUP|63: roi : TIJL_RECT; // default = 0|69: dcttype : TDCTTYPE; // default = IJL_AAN|77: fast_processing : TFAST_MCU_PROCESSING_TYPE; // default = IJL_NO_CC_OR_US|67: intr : DWORD; // default = FALSE|0:|40: // DIB specific I/O data specifiers.|59: DIBBytes : PByte; // default = NULL|56: DIBWidth : DWORD; // default = 0|56: DIBHeight : Integer; // default = 0|56: DIBPadBytes : DWORD; // default = 0|56: DIBChannels : DWORD; // default = 3|62: DIBColor : TIJL_COLOR; // default = IJL_BGR|63: DIBSubsampling : TIJL_DIBSUBSAMPLING; // default = IJL_NONE|56: DIBLineBytes : Integer; // default = 0|0:|41: // JPEG specific I/O data specifiers.|59: JPGFile : PChar; // default = NULL|59: JPGBytes : PByte; // default = NULL|56: JPGSizeBytes : DWORD; // default = 0|56: JPGWidth : DWORD; // default = 0|56: JPGHeight : DWORD; // default = 0|56: JPGChannels : DWORD; // default = 3|64: JPGColor : TIJL_COLOR; // default = IJL_YCBCR|62: JPGSubsampling : TIJL_JPGSUBSAMPLING; // default = IJL_411|56: JPGThumbWidth : DWORD; // default = 0|56: JPGThumbHeight : DWORD; // default = 0|0:|34: // JPEG conversion properties.|59: cconversion_reqd : DWORD; // default = TRUE|59: upsampling_reqd : DWORD; // default = TRUE|57: jquality : DWORD; // default = 75|56: jinterleaveType : DWORD; // default = 0|56: numxMCUs : DWORD; // default = 0|56: numyMCUs : DWORD; // default = 0|0:|14: // Tables.|26: nqtables : DWORD;|26: maxquantindex : DWORD;|26: nhuffActables : DWORD;|26: nhuffDctables : DWORD;|26: maxhuffindex : DWORD;|0:|49: jFmtQuant : array [0..3] of TQUANT_TABLE;|51: jFmtAcHuffman : array [0..3] of THUFFMAN_TABLE;|51: jFmtDcHuffman : array [0..3] of THUFFMAN_TABLE;|0:|46: jEncFmtQuant : array [0..3] of PSHORT;|54: jEncFmtAcHuffman : array [0..3] of PHUFFMAN_TABLE;|54: jEncFmtDcHuffman : array [0..3] of PHUFFMAN_TABLE;|0:|33: // Allow user-defined tables.|32: use_default_qtables : DWORD;|32: use_default_htables : DWORD;|0:|55: rawquanttables : array [0..3] of TJPEGQuantTable;|54: rawhufftables : array [0..7] of TJPEGHuffTable;|44: HuffIdentifierAC : array [0..3] of Byte;|44: HuffIdentifierDC : array [0..3] of Byte;|0:|30: // Frame specific members.|23: jframe : TFRAME;|24: needframe : Integer;|0:|31: // SCAN persistent members.|18: jscan : PSCAN;|0:|42: Pad : DWORD; // 8-byte alignment!!!|0:|21: // State members.|28: state : TSTATE;|27: SawAdobeMarker : DWORD;|27: AdobeXform : DWORD;|0:|27: // ROI decoder members.|32: rowoffsets : PENTROPYSTRUCT;|0:|28: // Intermediate buffers.|20: MCUBuf : PByte;|48: tMCUBuf : array [0..720*2-1] of Byte; // ???|0:|26: // Processor detected.|37: processor_type : TPROCESSOR_TYPE;|0:|29: // Test specific members.|23: ignoreDCTs : DWORD;|0:|32: // Progressive mode members.|32: progressive_found : Integer;|31: coef_buffer : PShort;|0:|31: // Upsampling mode members.|42: upsampling_type : TUPSAMPLING_TYPE;|41: sampling_state_ptr : PSAMPLING_STATE;|0:|36: // Adobe APP14 segment variables|50: AdobeVersion : Short; // default = 100|48: AdobeFlags0 : Short; // default = 0|48: AdobeFlags1 : Short; // default = 0|0:|34: // JFIF APP0 segment variables|33: jfif_app0_detected : Integer;|54: jfif_app0_version : Short; // default = 0x0101|57: jfif_app0_units : UCHAR; // default = 0 - pixel|49: jfif_app0_Xdensity : Short; // default = 1|49: jfif_app0_Ydensity : Short; // default = 1|0:|30: // comments related fields|52: jpeg_comment : PChar; // default = NULL|49: jpeg_comment_size : Short; // default = 0|0:|6: end;|0:|76:////////////////////////////////////////////////////////////////////////////|36:// Name: JPEG_CORE_PROPERTIES|2://|70:// Purpose: This is the primary data structure between the IJL and|68:// the external user. It stores JPEG state information|61:// and controls the IJL. It is user-modifiable.|2://|75:// See the Developer's Guide for details on appropriate usage.|2://|59:// Context: Used by all low-level IJL routines to store|42:// pseudo-global information.|2://|10:// Fields:|2://|66:// UseJPEGPROPERTIES Set this flag != 0 if you wish to override|69:// the JPEG_CORE_PROPERTIES "IN" parameters with|55:// the JPEG_PROPERTIES parameters.|2://|71:// DIBBytes IN: Pointer to buffer of uncompressed data.|59:// DIBWidth IN: Width of uncompressed data.|60:// DIBHeight IN: Height of uncompressed data.|65:// DIBPadBytes IN: Padding (in bytes) at end of each|61:// row in the uncompressed data.|59:// DIBChannels IN: Number of components in the|50:// uncompressed data.|65:// DIBColor IN: Color space of uncompressed data.|56:// DIBSubsampling IN: Required to be IJL_NONE.|2://|59:// JPGFile IN: Pointer to file based JPEG.|61:// JPGBytes IN: Pointer to buffer based JPEG.|68:// JPGSizeBytes IN: Max buffer size. Used with JPGBytes.|67:// OUT: Number of compressed bytes written.|52:// JPGWidth IN: Width of JPEG image.|66:// OUT: After reading (except READHEADER).|53:// JPGHeight IN: Height of JPEG image.|66:// OUT: After reading (except READHEADER).|67:// JPGChannels IN: Number of components in JPEG image.|66:// OUT: After reading (except READHEADER).|58:// JPGColor IN: Color space of JPEG image.|58:// JPGSubsampling IN: Subsampling of JPEG image.|66:// OUT: After reading (except READHEADER).|70:// JPGThumbWidth OUT: JFIF embedded thumbnail width [0-255].|71:// JPGThumbHeight OUT: JFIF embedded thumbnail height [0-255].|2://|73:// cconversion_reqd OUT: If color conversion done on decode, TRUE.|67:// upsampling_reqd OUT: If upsampling done on decode, TRUE.|69:// jquality IN: [0-100] where highest quality is 100.|2://|55:// jprops "Low-Level" IJL data structure.|2://|76:////////////////////////////////////////////////////////////////////////////|4:type|49: PJPEG_CORE_PROPERTIES = ^TJPEG_CORE_PROPERTIES;|32: TJPEG_CORE_PROPERTIES = record|59: UseJPEGPROPERTIES : DWORD; // default = 0|0:|40: // DIB specific I/O data specifiers.|62: DIBBytes : PByte; // default = NULL|59: DIBWidth : DWORD; // default = 0|59: DIBHeight : Integer; // default = 0|59: DIBPadBytes : DWORD; // default = 0|59: DIBChannels : DWORD; // default = 3|65: DIBColor : TIJL_COLOR; // default = IJL_BGR|66: DIBSubsampling : TIJL_DIBSUBSAMPLING; // default = IJL_NONE|0:|41: // JPEG specific I/O data specifiers.|62: JPGFile : PChar; // default = NULL|62: JPGBytes : PByte; // default = NULL|59: JPGSizeBytes : DWORD; // default = 0|59: JPGWidth : DWORD; // default = 0|59: JPGHeight : DWORD; // default = 0|59: JPGChannels : DWORD; // default = 3|67: JPGColor : TIJL_COLOR; // default = IJL_YCBCR|65: JPGSubsampling : TIJL_JPGSUBSAMPLING; // default = IJL_411|59: JPGThumbWidth : DWORD; // default = 0|59: JPGThumbHeight : DWORD; // default = 0|0:|34: // JPEG conversion properties.|62: cconversion_reqd : DWORD; // default = TRUE|62: upsampling_reqd : DWORD; // default = TRUE|60: jquality : DWORD; // default = 75|0:|67: Pad : DWORD; // 8-byte alignment!!!|28: // Low-level properties.|41: jprops : TJPEG_PROPERTIES;|6: end;|0:|76:////////////////////////////////////////////////////////////////////////////|22:// Name: IJLERR|2://|70:// Purpose: Listing of possible "error" codes returned by the IJL.|2://|75:// See the Developer's Guide for details on appropriate usage.|2://|40:// Context: Used for error checking.|2://|76:////////////////////////////////////////////////////////////////////////////|5:const|61: // The following "error" values indicate an "OK" condition.|44: IJL_OK = 0;|44: IJL_INTERRUPT_OK = 1;|44: IJL_ROI_OK = 2;|0:|65: // The following "error" values indicate an error has occurred.|44: IJL_EXCEPTION_DETECTED = -1;|44: IJL_INVALID_ENCODER = -2;|44: IJL_UNSUPPORTED_SUBSAMPLING = -3;|44: IJL_UNSUPPORTED_BYTES_PER_PIXEL = -4;|44: IJL_MEMORY_ERROR = -5;|44: IJL_BAD_HUFFMAN_TABLE = -6;|44: IJL_BAD_QUANT_TABLE = -7;|44: IJL_INVALID_JPEG_PROPERTIES = -8;|44: IJL_ERR_FILECLOSE = -9;|44: IJL_INVALID_FILENAME = -10;|44: IJL_ERROR_EOF = -11;|44: IJL_PROG_NOT_SUPPORTED = -12;|44: IJL_ERR_NOT_JPEG = -13;|44: IJL_ERR_COMP = -14;|44: IJL_ERR_SOF = -15;|44: IJL_ERR_DNL = -16;|44: IJL_ERR_NO_HUF = -17;|44: IJL_ERR_NO_QUAN = -18;|44: IJL_ERR_NO_FRAME = -19;|44: IJL_ERR_MULT_FRAME = -20;|44: IJL_ERR_DATA = -21;|44: IJL_ERR_NO_IMAGE = -22;|44: IJL_FILE_ERROR = -23;|44: IJL_INTERNAL_ERROR = -24;|44: IJL_BAD_RST_MARKER = -25;|44: IJL_THUMBNAIL_DIB_TOO_SMALL = -26;|44: IJL_THUMBNAIL_DIB_WRONG_COLOR = -27;|44: IJL_BUFFER_TOO_SMALL = -28;|44: IJL_UNSUPPORTED_FRAME = -29;|44: IJL_ERR_COM_BUFFER = -30;|44: IJL_RESERVED = -99;|31:////Выше - взято из IJL.pas////|0:|0:|4:type|28: THiAsmClass = class(TDebug)|10: private|22: isInitJPG:boolean;|75: ijlInit : function(jcprops : PJPEG_CORE_PROPERTIES) : Integer; stdcall;|75: ijlFree : function(jcprops : PJPEG_CORE_PROPERTIES) : Integer; stdcall;|96: ijlRead : function(jcprops : PJPEG_CORE_PROPERTIES; IoType : TIJLIOTYPE) : Integer; stdcall;|97: ijlWrite : function(jcprops : PJPEG_CORE_PROPERTIES; IoType : TIJLIOTYPE) : Integer; stdcall;|19: jpgLib : HINST;|9: public|24: onLoadJPG:THI_Event;|28: dtStrFileName:THI_Event;|0:|23: constructor Create;|33: destructor Destroy; override;|50: procedure doLoadJPG(var dt:TData; index:word);|5: end;|0:|14:implementation|0:|31:constructor THiAsmClass.Create;|5:begin|18: inherited Create;|66: jpgLib := LoadLibrary(DLL); //константа опредлена в начале модуля|22: if (jpgLib <> 0) then|7: begin|49: ijlInit := GetProcAddress(jpgLib, 'ijlInit');|49: ijlFree := GetProcAddress(jpgLib, 'ijlFree');|49: ijlRead := GetProcAddress(jpgLib, 'ijlRead');|50: ijlWrite := GetProcAddress(jpgLib, 'ijlWrite');|21: isInitJPG := true;|5: end|25: else isInitJPG := False;|4:end;|0:|31:destructor THiAsmClass.Destroy;|5:begin|21: FreeLibrary(jpgLib);|19: inherited Destroy;|4:end;|0:|0:|32:procedure THiAsmClass.doLoadJPG;|3:var|17: jErr,i: Integer;|33: jpgProps: TJPEG_CORE_PROPERTIES;|19: bmInfo:BITMAPINFO;|14: sDIB:HBITMAP;|21: sMemBits:PRGBTriple;|11: Fn:string;|13: Bmp:PBitmap;|5:begin|36: fn := ReadString(dt,dtStrFileName);|11: sDIB := 0;|37: if FileExists(fn) and isInitJPG then|7: begin|30: jErr := ijlInit(@jpgProps);|33: if (jErr <> IJL_OK) then Exit;|33: jpgProps.JPGFile := Pchar(fn);|52: jErr := ijlRead(@jpgProps, IJL_JFILE_READPARAMS);|33: if (jErr <> IJL_OK) then Exit;|47: bmInfo.bmiHeader.biWidth:=jpgProps.JPGWidth;|49: bmInfo.bmiHeader.biHeight:=jpgProps.JPGHeight;|32: bmInfo.bmiHeader.biPlanes:=1;|35: bmInfo.bmiHeader.biBitCount:=24;|42: bmInfo.bmiHeader.biCompression:=BI_RGB;|35: bmInfo.bmiHeader.biSizeImage:=0;|42: bmInfo.bmiHeader.biXPelsPerMeter:=2834;|42: bmInfo.bmiHeader.biYPelsPerMeter:=2834;|33: bmInfo.bmiHeader.biClrUsed:=0;|38: bmInfo.bmiHeader.biClrImportant:=0;|53: bmInfo.bmiHeader.biSize:=SizeOf(bmInfo.bmiHeader);|80: sDIB:=CreateDIBSection(GetDC(0),bmInfo,DIB_RGB_COLORS,Pointer(sMemBits),0,0);|31: i:=bmInfo.bmiHeader.biWidth;|28: i:=(i*3)-((i*3) div 4)*4;|23: if i<>0 then i:=4-i;|49: jpgProps.DIBWidth := bmInfo.bmiHeader.biWidth;|52: jpgProps.DIBHeight := -bmInfo.bmiHeader.biHeight;|59: jpgProps.DIBPadBytes := i; // Make sure bytes are padded|40: jpgProps.DIBBytes := PByte(sMemBits);|28: jpgProps.jquality := 100;|31: case jpgProps.JPGChannels of|34: 1: jpgProps.JPGColor := IJL_G;|38: 3: jpgProps.JPGColor := IJL_YCBCR;|7: else|47: jpgProps.DIBColor := TIJL_COLOR(IJL_OTHER);|47: jpgProps.JPGColor := TIJL_COLOR(IJL_OTHER);|7: end;|56: jErr := ijlRead(@jpgProps, IJL_JFILE_READWHOLEIMAGE);|33: if (jErr <> IJL_OK) then Exit;|22: ijlFree(@jpgProps);|6: end;|70: Bmp := NewBitmap(bmInfo.bmiHeader.biWidth,bmInfo.bmiHeader.biHeight);|20: Bmp.Handle := sDIB;|28: _hi_OnEvent(onLoadJPG,bmp);|10: Bmp.Free;|4:end;|0:|4:end.| link(onLoadJPG,2288735:doWork3,[(522,552)]) link(dtStrFileName,9954928:Var3,[(475,362)]) }