home *** CD-ROM | disk | FTP | other *** search
/ PDA Software Library / pdasoftwarelib.iso / HP95_100 / GRAPHICS / LXPIC / LXPIC3_4.DOC < prev   
Encoding:
Text File  |  1997-01-26  |  33.0 KB  |  832 lines

  1. ───────────────────────────────────────────────────────────────
  2.                           LxPic V3.4
  3.           (c)1997 Stefan Peichl, Heidelberg, Germany
  4. ───────────────────────────────────────────────────────────────
  5.  
  6. LxPic displays color pictures in simulated shades of grey on
  7. monitors in B&W mode. It is specially designed for the HP
  8. Palmtops but runs also on any desktop.
  9.  
  10. LxPic processes BMP,GIF,JPG,PCX and ICN files of any kind.
  11. BMP and PCX files may have 2, 4, 256 or True Colors (16 Mio).
  12. JPG files may have 256 gray scales or True Colors. GIF files
  13. may have Version 87a or 89a with up to 256 colors.
  14.  
  15. The pictures may have any size and dimension, as long as you
  16. have enough storage capacity to keep them.
  17.  
  18. The special HP Palmtop resize command 'H' corrects the dispro-
  19. portion of the Palmtops pixel ratio.
  20.  
  21. LxPic is very small (9K) and needs as a COM file only 64K of
  22. main memory while running, no matter how large the picture is.
  23.  
  24. LxPic uses a distinctive dither algorithm to get most of the
  25. color information into the B&W representation. Once the picture
  26. is transformed, you may adjust contrast, brightness, shadow,
  27. highlight and color and save it as a B&W PCX file with less
  28. storage requirement and much better display performance.
  29.  
  30. LxPic has an interface, to use it as a 'subroutine' in other
  31. programs or batch files. See PROGRAMMERS INTERFACE section of
  32. this documentation for further information.
  33.  
  34. LxPic recognizes your display adapter and sets the display to
  35. the best of the following modes, dependant on your hardware:
  36.  
  37. - VGA  (640x480)
  38. - EGA  (640x350)
  39. - CGA  (640x200)
  40. - HP95 (240x128)
  41.  
  42.  
  43.      *The Graphics Interchange Format(c) is the Copyright
  44.       property of CompuServe Incorporated. GIF(sm) is a
  45.       Service Mark property of CompuServe Incorporated.
  46.  
  47. ───────────────────────────────────────────────────────────────
  48.                        REVISION HISTORY
  49. ───────────────────────────────────────────────────────────────
  50.  
  51. Version 1.0  -Only B&W BMP and PCX files
  52.  
  53. Version 2.0  -BMP,GIF,PCX,ICN of any size and dimension
  54.              -VGA,EGA,CGA,HP95 support
  55.              -Dither for color pictures
  56.              -Scrolling
  57.              -Zoom In/Out
  58.              -Edit functions
  59.              -HP resize mode
  60.              -B&W PCX conversion
  61.  
  62. Version 2.1  -Programmers Interface added
  63.  
  64. Version 2.2  -Intrasegment call added to Programmers Interface
  65.  
  66. Version 2.3  -Zoom out 1:8 and zoom in 8:1 added
  67.              -Programmers Interface improvements
  68.  
  69. Version 3.0  -JPEG added
  70.              -/S switch to scan drives or subdirectorys
  71.  
  72. Version 3.1  -More speed: Output interrupted at any command
  73.  
  74. Version 3.2  -Version 3.1 bug fixed
  75.  
  76. Version 3.3  -Correct display of Fujifilm DS-7 JPEG files
  77.  
  78. Version 3.4  -Rename/Move command {N} added
  79.              -Select pixel aspect ratio command {F6} added
  80.  
  81.  
  82. New versions of LxPic will be available on my Internet homepage
  83.  
  84.          http://home.t-online.de/home/stefan.peichl
  85.  
  86. ───────────────────────────────────────────────────────────────
  87.                      SYSTEM REQUIREMENTS
  88. ───────────────────────────────────────────────────────────────
  89.  
  90. - Processor: 8088
  91. - DOS      : 2.11
  92. - Adapter  : HP95,CGA,EGA,VGA
  93. - Memory   : 64 K
  94. - Storage  : 9 K
  95.  
  96. ───────────────────────────────────────────────────────────────
  97.                    WHAT'S IN YOUR ZIP FILE
  98. ───────────────────────────────────────────────────────────────
  99.  
  100. LXPIC.COM      the picture viewer
  101. LXPIC3_4.DOC   this file
  102. LXPIC.ICN      icon for use with system manager
  103. DEMO.PCX       gray scale demo PCX file
  104. DEMO.GIF       256 color demo GIF file
  105. DEMO.JPG       True Color demo JPG file 
  106. CAM2JPG.COM    converts CASIO QV-10A CAM format to JPEG  
  107.  
  108. For programmers only:
  109.  
  110. DEMO.ASM       source code of DEMO.COM for intrasegment calls
  111. DEMO.COM       put all files in C:\PIC and enter DEMO LXPIC.ICN
  112.  
  113. ───────────────────────────────────────────────────────────────
  114.                       HOW TO USE LXPIC
  115. ───────────────────────────────────────────────────────────────
  116.  
  117. LxPic needs no installation. If called without parameters,
  118. LxPic searches the current directory for all files with the
  119. extension BMP,GIF,JPG,ICN or PCX and displays them in the
  120. order, as they are found in the directory. If no files are
  121. found, LxPix exits and displays the help screen.
  122.  
  123. LxPic has no file select feature, but it behaves like the DIR
  124. command of DOS and it accepts the /S command line parameter to
  125. scan all subdirectorys too. Which files are displayed depends
  126. on how you name them and where you keep them. To display a
  127. specific picture, use its full or relative pathname as
  128. parameter for LxPic. The wildcards * and ? are allowed in the
  129. filename, to display a group of pictures with similar names.
  130.  
  131. ─EXAMPLES─
  132.  
  133.   LXPIC
  134. displays all pictures in the current directory
  135.  
  136.   LXPIC/S
  137. displays all pictures in the current directory and its
  138. subdirectorys
  139.  
  140.   LXPIC DEMO.*
  141. displays for example DEMO.PCX, DEMO.GIF and DEMO.JPG in the
  142. current directory
  143.  
  144.   LXPIC \PIC\V?.ICN
  145. displays for example V1.ICN and V2.ICN in the directory PIC of
  146. the current drive (good for Video command)
  147.  
  148.   LXPIC D:/S
  149. displays all pictures on your D: drive
  150.  
  151.   LXPIC C:\DEMO.JPG /S
  152. searches your whole C: drive for the file DEMO.JPG and displays
  153. it, if it was found
  154.  
  155.  
  156. If you use the scan switch /S, LxPic exits after all files have
  157. been displayed. Without /S, LxPic loops endless until you press
  158. ESC. Going back one picture is only possible within one sub-
  159. directory, so don't be confused with unexpected results using
  160. the last picture key 'P' in a scan.
  161.  
  162. The /S switch is most useful to browse a CDROM on the desktop
  163. within seconds. Press the 'A' (=Autozoom) and 'V' (=Video) key
  164. to have the quickest and most informative overview of the
  165. pictures on a CDROM. Using a standard picture viewer under
  166. WINDOWS, it would take hours of mouse clicking to do the same
  167. job.
  168.  
  169. If you want to add LxPic to the Application Manager of your HP
  170. Palmtop, copy LXPIC.COM and LXPIC.ICN into the directory, where
  171. your pictures reside, for example C:\PIC, and enter as path
  172. entry of the new application:
  173.  
  174.   C:\PIC\LXPIC.COM|70
  175.  
  176. ───────────────────────────────────────────────────────────────
  177.                           COMMANDS
  178. ───────────────────────────────────────────────────────────────
  179.  
  180. The Help key F1 pops up a window with all command keys:
  181.  
  182.           ┌─────────────────────────────────────────┐
  183.           │  LxPic V3.4 (c)1997 Peichl, Heidelberg  │
  184.           │Use: LXPIC [path]file.[BMP|GIF|JPG|PCX]/S│
  185.           ├────────────────────┬────────────────────┤
  186.           │F   File info on/off│F1  This help screen│
  187.           │H   HP resize on/off│F2  HP95|CGA|EGA|VGA│
  188.           │C   Clear scr on/off│F3  Convert b&w2grey│
  189.           │I   Invert    on/off│F4  Save as b&w .PCX│
  190.           │Z   Center    on/off│F5  Save screen only│
  191.           │A   Auto zoom on/off│F6  Pix aspect ratio│
  192.           │T   Text zoom on/off│CU..Key Move screens│
  193.           │+=- Zoom   in/no/out│PG..Key Move row/col│
  194.           │S   Slide     on/off├────COLOR PICTURES──┤
  195.           │V   Video     on/off│D   Dither    on/off│
  196.           │><  Sld/Vid  qui/slo│RGB R|G|B color only│
  197.           │BAR Sld/Vid  suspend│M   Mix R+G+B colors│
  198.           │DEL Delete   picture│/   Reset all values│
  199.           │N   Ren/Move picture│7 8 Shadows      - +│
  200.           │P   Previous picture│4 5 Highlights   - +│
  201.           │CR  Next     picture│1 2 Contrast     - +│
  202.           │ESC Exit     (or ^C)│0 . Brightness   - +│
  203.           └────────────────────┴────────────────────┘
  204.  
  205. Press F1 again or press ESC to close the Help window.
  206.  
  207. Almost all commands are single key strokes and I tried to
  208. assign meaningful keys to the commands. The action, taken upon
  209. a command, is valid for the actual and all following images.
  210. If you have a sequence of pictures with little contrast, you
  211. have to adjust contrast only once.
  212.  
  213. If you hear a key click, the pressed key had no function at all
  214. or did not apply to the actual picture type, or you reached the
  215. end of a range.
  216.  
  217. Use the cursor keys to scroll an image. Cursor keys scroll the
  218. image by one screen in the indicated direction. Page keys
  219. (Palmtop: Fn+cursor) scroll the image by 10 columns or 10 lines
  220. in the indicated direction. I exchanged the meaning of these
  221. keys for single key strokes on the Palmtop. I try to keep the
  222. x,y offset in consecutive pictures, to allow you zooming the
  223. same position in a slideshow.
  224.  
  225.  
  226. KEY  FUNCTION
  227.  
  228. F    Display file and parameter information box: 
  229.  
  230.       DEMO.GIF     filename
  231.      ┌───────────┐
  232.      │kbyte :   7│ filesize
  233.      │type  : COL│ picturetype: COL | GREY | B&W
  234.      │deep  :   8│ colordepth in bits:  1 | 4 | 8 | 24
  235.      │wide  : 320│ pixelwidth  of actual representation
  236.      │high  : 100│ pixelheight of actual representation
  237.      │x_0   :   0│ pixelcolumn: upper left displayed corner
  238.      │y_0   :   0│ pixelline  : upper left displayed corner
  239.      │mode  : CGA│ screen mode: VGA | EGA | CGA | HP95
  240.      │ratio : 1:1│ pixel ratio: 1:1|1:.9|1:.8|1:.7|1:.6|1:.5
  241.      │zoom  : 1:1│ zoom in/out: 8:1|4:1|2:1|1:1|1:2|1:4|1:8
  242.      │dither:  ON│ dither mode:  ON | OFF
  243.      │color : RGB│ disp. color: RGB | RED | GRÜN | BLUE | GREY
  244.      │shadow:   0│ shadow     : 0=unchanged, 127=max, -127=min
  245.      │hlight:   0│ highlights : 0=unchanged, 127=max, -127=min
  246.      │contra:   0│ contrast   : 0=unchanged, 127=max, -127=min
  247.      │bright:   0│ brightness : 0=unchanged, 127=max, -127=min
  248.      └───────────┘
  249.  
  250. H    Resizes the picture to a pixel aspect ratio of 1:0.8.
  251.      A picture with 640x240 pixel is resized to 640x200 pixel
  252.      for example. The actual aspect ratio is displayed in the
  253.      file info box. HP resize is off by default. See also
  254.      the more general pixel aspect ratio command {F6}.
  255.  
  256. C    Clear screen between two pictures (default)
  257.  
  258. I    Invert screen. LxPic inverts pictures by default, if
  259.      running on a HP Palmtop
  260.  
  261. Z    Center picture in the middle of the screen (default)
  262.  
  263. A    Auto zoom. If switched on, the zoom mode is selected,
  264.      which displays most of the picture. Auto zoom is off by
  265.      default. If switched on, you see the letter 'A' in the
  266.      'zoom' entry of the file info.
  267.  
  268. T    Text zoom out mode. Zooming out for B&W images is
  269.      implemented by default as 'drop two, keep two' to prevent
  270.      moraine effects from previously dithered pictures. This
  271.      command toggles zoom out mode to 'drop one, keep one',
  272.      which is better for viewing B&W pictures including text,
  273.      like faxes for example. If switched on, you see the letter
  274.      'T' in the 'zoom' entry of the file info. Text zoom is off
  275.      by default.
  276.  
  277. +    Zoom out to 1:2, 1:4 and 1:8
  278.  
  279. =    Reset Zoom to 1:1
  280.  
  281. -    Zoom in to 2:1, 4:1 and 8:1
  282.  
  283. S    Perform a slideshow
  284.  
  285. V    Perform a video. Same as slideshow, but at maximal speed
  286.      without clear screen between pictures. See VIDEO part
  287.      of this documentation.
  288.  
  289. >    Slideshow/Video quicker up to maximal speed
  290.  
  291. <    Slideshow/Video slower
  292.  
  293. BAR  Suspend Slideshow/Video. Press Spacebar again to continue
  294.  
  295. DEL  Delete the actual displayed picture. You have to confirm,
  296.      before the file is deleted
  297.  
  298. N    Rename/Move picture filename. You may not move the file
  299.      to a different drive, because this would be a 'copy',
  300.      which is not supported. After the rename, the next picture
  301.      is displayed.
  302.  
  303. P    Display previous picture, as found in the directory. This
  304.      command also changes the direction for Slideshow/Video.
  305.  
  306. CR   Display next picture, as found in the directory. This
  307.      command resets the direction for Slideshow/Video to
  308.      forward.
  309.  
  310. ESC  Exit LxPic. If you exit LxPic with ^C, an errorlevel of 1
  311.      is returned, which is useful in batch files.
  312.  
  313. F1   Display Help window
  314.  
  315. F2   Change screen mode if possible. The picture is resized to
  316.      100% or autozoomed, if selected
  317.  
  318. F3   Converts B&W picture to a 8 bit grey picture. This enables
  319.      you to edit a B&W picture with the commands, only avail-
  320.      able for color or grey pictures. The performance slows
  321.      down indeed.
  322.  
  323. F4   Save the whole picture -as you see it- to a B&W PCX file.
  324.      You are asked for a filename. You must use another
  325.      filename than the original name and you have to add the
  326.      extension PCX. BMP pictures end upside down, I don't
  327.      change it, turn around your Palmtop!
  328.  
  329. F5   Same as F4, but only the visible part of the picture is
  330.      saved. If you want to select even a smaller part, switch
  331.      with F2 to the HP95 mode and save from there. To invert a
  332.      Palmtop topcard, load it, press 'I' and then F5 to save
  333.      the inverted topcard.
  334.  
  335. F6   Selects pixel aspect ration in a range from 1:1 to 1:0.5.
  336.      Useful for distorted camera pictures and CGA monitors.
  337.      The HP resize command {H} is the shortcut of {F6}{2}.
  338.      The actual aspect ratio is displayed in the file info box.
  339.  
  340.  
  341. ─COLOR PICTURES ONLY─
  342.  
  343. The following commands are only available, if a picture with
  344. more than two colors is dispayed.
  345.  
  346. D    Switch Dithermode OFF/ON (ON by default)
  347.      Without Dither, color values below 127 turn a pixel on,
  348.      values above 127 switch it off
  349.  
  350. R    Display Red   part of the picture only
  351.  
  352. G    Display Green part of the picture only
  353.  
  354. B    Display Blue  part of the picture only
  355.  
  356. M    Mix Red, Green and Blue to Grey = 30%R + 59%G + 11%B
  357.  
  358. /    Reset Shadow, Highlight, Contrast and Brightness to 0.
  359.      Set color to RGB.
  360.  
  361. 7    Decrease Shadows:    Colors <127 move towards Grey
  362.  
  363. 8    Increase Shadows:    Colors <127 move towards Black
  364.  
  365. 4    Decrease Highlights: Colors >127 move towards Grey
  366.  
  367. 5    Increase Highlights: Colors >127 move towards White
  368.  
  369. 1    Decrease Contrast:   All colors  move towards Grey
  370.  
  371. 2    Increase Contrast:   Colors <127 move towards Black
  372.                           Colors >127 move towards White
  373.  
  374. 0    Decrease Brightness: All colors  move towards Black
  375.  
  376. .    Increase Brightness: All colors  move towards White
  377.  
  378. L    Loop through Brightness: Displayes the picture
  379.      contineously with decreasing brightness values
  380.  
  381. ───────────────────────────────────────────────────────────────
  382.                              JPEG
  383. ───────────────────────────────────────────────────────────────
  384.  
  385. You have to understand some basics of JPEG in order to use it
  386. most effectivly on the Palmtop. This applies only, if you have
  387. influence on the JPEG pictures, you want to display, that is,
  388. if you have a software to produce the (or convert to the) JPEG
  389. format.
  390.  
  391. The LxPic implementation of JPEG supports the baseline mode of
  392. operation, which is the most common. I never saw any of the 3
  393. other JPEG modes. Baseline is lossy, that is, when the JPEG
  394. picture is created, the information of the original image is
  395. reduced to save storage space. The amount of information, which
  396. is lost, may be determined by you. Before saving a JPEG file, a
  397. good software asks you for a quality factor. You may go down to
  398. zero quality and still have a good picture on the palmtop,
  399. because most of the quality is anyhow lost in the B&W
  400. representation on the Palmtop.
  401.  
  402. JPEG supports grayscale and True Color images. True Color is
  403. represented by luminace and chrominace values instead of red,
  404. green and blue parts. Furthermore, the luminance part may be
  405. more weighted than the chrominace part of a picture, again, in
  406. order to save space. The luminace component of a JPEG image is
  407. nothing else than it's grayscale representation and gayscale
  408. JPEG images only have one luminace component. LxPic extracts
  409. this luminace component and displays it. The chrominance
  410. components are ignored. That means, you loose no information on
  411. the palmtop, if you use only greyscale JPEG, but you save
  412. space. If you want to use your images on the Palmtop and the
  413. Desktop at the same time, and you want to have colors on the
  414. Desktop, select a subsampling of 4:1:1, which means 4 times
  415. more luminace values than blue chrominace values and red
  416. chrominace values. As with the quality parameter, a good
  417. software let's you select subsampling.
  418.  
  419. A True Color 4:1:1 JPEG image with zero quality may have a
  420. compression rate of 0.2 bit/pixel, which is about 4K for a full
  421. screen CGA image. The same BMP image needs 24 bit/pixel, which
  422. is a factor of 120 times bigger. That is, you save about 99% of
  423. storage capacity and loose only little quality. Compression
  424. rates with greyscale JPEGs are even better. Compared to B&W PCX
  425. images, which use 1 bit/pixel, you still need only 20% of
  426. storage space.
  427.  
  428. LxPic performs best with zero quality greyscale JPEG images,
  429. which also produce the smallest files. The output speed relates
  430. strong with the quality, because the better the quality, the
  431. more time consuming calculation has to be done in the inverse
  432. descrete cosine transform (IDCT).
  433.  
  434. ───────────────────────────────────────────────────────────────
  435.                        DIGITAL CAMERAS
  436. ───────────────────────────────────────────────────────────────
  437.  
  438. Almost all new digital cameras use an incompatible 'JPEG based
  439. compression' for their proper storage format, apparently for no
  440. other reason than to force people to use the camera vendor's
  441. software and not anyone else's. This is really bad politic!
  442. LxPic will never support any of these non standard formats
  443. internaly. Just to show, how easy it would have been for CASIO,
  444. to implement real baseline JPEG, I wrote a tiny program called
  445. CAM2JPG, which converts CAM to JPEG. I will never do the other
  446. direction. This tiny program is based on an excellent
  447. reengineering work of Mr. Iwama and Mr.Yamamoto from Japan,
  448. which was needed, because CASIO refused to make their format
  449. public.
  450.  
  451. Now, that I made CAM available for the Palmtop, this should
  452. *NOT* encourage you to buy their cameras. Wait until the
  453. vendors produce JPEG right out of the box, like the FUJIFILM
  454. DS-7 camera.
  455.  
  456. If you have another digital camera, and want to find out, if
  457. it's format is JPEG compatible, rename the internal storage
  458. files to *.JPG and try to display them with LxPic. You may have
  459. luck, at least you get a message like 'unsupported signature/
  460. version' or 'unsupported mode of operation'. You may also send
  461. me a MIME- or UUE-coded email with a demo file of the internal
  462. file format of your digital camera, and I will have a close
  463. look at it.
  464.  
  465. ───────────────────────────────────────────────────────────────
  466.                            ADVICE
  467. ───────────────────────────────────────────────────────────────
  468.  
  469. If you are concerned of little storage capacity, JPEG will be
  470. your preferred picture format on the Palmtop. But if you want
  471. to have output speed, B&W PCX files have the best speed/size
  472. ratio. With other words, it makes no sense to keep BMP, GIF or
  473. color PCX files on your Palmtop.
  474.  
  475. To convert color pictures to the speedy B&W PCX format, proceed
  476. as follows:
  477.  
  478. - Press 'H' to have the exact width/height proportions
  479. - Adjust contrast, brightness, shadow, highlight
  480. - Zoom in/out, if needed
  481. - Press F4 to save the whole image or
  482. - Press F5 to save only the visible part of the image. If you
  483.   want to select a smaller part than the HP100/200 screen, use
  484.   F2 to switch to the HP95 mode and make your selection in the
  485.   HP95 window and press F5 in the HP95 mode to save this
  486.   smaller part only.
  487. - Delete the original color picture.
  488.  
  489. I do not recommend to use B&W GIF files, because GIF's LZW
  490. decoding is slow compared to PCX's RLE decoding. The slightly
  491. smaller B&W GIF filesize does not predominate this drawback.
  492.  
  493. NOTE: BMP and PCX files with less than 40K, GIF files with
  494.       less than 30K and JPG files with less than 16K perform
  495.       better, because the whole picture can be kept in the
  496.       buffer of LxPic. Bigger files have to be loaded and
  497.       reloaded in portions, which might be time consuming,
  498.       if you use slow storage devices.
  499.  
  500. ───────────────────────────────────────────────────────────────
  501.                             VIDEOS
  502. ───────────────────────────────────────────────────────────────
  503.  
  504. LxPic and its video option allow to display a series of (B&W)
  505. pictures at maximal speed to simulate a video. Start with two
  506. ICN pictures. Use the build in ICN editor of your Palmtop.
  507. Produce two slightly different icons and save them to your C:\
  508. drive as V1.ICN and V2.ICN. Run LxPic from the command line:
  509.  
  510.   LXPIC C:\V?.ICN
  511.  
  512. Press the V key and adjust the speed with the < and > keys. If
  513. you want to use more than two ICN pictures, you have to take
  514. care of how they are stored in your directory. LxPic displays
  515. the files in the sequence as they are found in the directory.
  516. You cannot tell LxPic a different display order. First copy all
  517. files under new names in the sequence, you want to have them
  518. displayed and then delete the old files. Don't rename the
  519. files, because it does not change their directory position.
  520. Use the DIR command of DOS without any sort parameter to see
  521. the new order of the files.
  522.  
  523. ───────────────────────────────────────────────────────────────
  524.                     PROGRAMMERS INTERFACE
  525. ───────────────────────────────────────────────────────────────
  526.  
  527. LxPic has an internal interface for use with other programming
  528. languages or batch files. This interface allows you to output
  529. pictures at a desired position in an already filled application
  530. screen. You may select, if you want to gain back control
  531. immediately after the picture has been output to the screen, or
  532. if you want to pass intermediate control to LxPic and get back
  533. control, when the ESC key of LxPic is pressed. The application
  534. may then write around or even into the picture. Multiple
  535. pictures may be positioned or overlayed on one screen.
  536.  
  537. The interface uses 7 bytes of the bios data area starting at
  538. the absolut address 00458h (40h:58h relative). The bios
  539. resevers these bytes for the cursor coordinates of the text
  540. pages 4-7 in an ascii text mode. In graphic modes, these bytes
  541. are zeroed and unused. Since LxPic works only in graphic modes,
  542. these bytes may be used as an interface for LxPic.
  543.  
  544. ─INTERFACE SPECIFICATION─
  545.  
  546. byte 00458h   Interface selection flag:
  547.               00h = do not use the interface (default)
  548.               01h = use interface, exit via DOS EXIT function
  549.               02h = use interface, exit via RET FAR instruction
  550.               03h = use interface, exit via RET instruction
  551.  
  552.               Set bit 7 in the interface selection flag, if you
  553.               want to pass intermediate control to LxPic.
  554.  
  555. byte 00459h   Mode selection byte. This byte is bit coded.
  556.               7 6 5 4 3 2 1 0 = bit number
  557.                 | | | | | | |                         
  558.                 | | | | | | |   Meaning if bit is set
  559.                 | | | | | | |   ---------------------
  560.                 | | | | | | |___clear screen before output
  561.                 | | | | | |_____invert picture
  562.                 | | | | |_______center picture
  563.                 | | | |_________autozoom
  564.                 | | |___________HP resize
  565.                 | |_____________dither off
  566.                 |_______________text zoom on
  567.  
  568. byte 0045Ah   Zoom factor. Valid values are:
  569.               -3 = 1:8
  570.               -2 = 1:4
  571.               -1 = 1:2
  572.                0 = 1:1
  573.                1 = 2:1
  574.                2 = 4:1
  575.                3 = 8:1
  576.               if the value is not valid, 0 is assumed.
  577.  
  578. word 0045Bh   Pixel row. If the pixel row is not valid in the
  579.               actual graphic mode, 0 is assumed.
  580.  
  581. word 0045Dh   Pixel column. If the pixel column is not valid in
  582.               the actual graphic mode, 0 is assumed.
  583.               NOTE: LxPic output always starts and ends at
  584.               pixel columns, that are multiples of 8.
  585.  
  586.               -----1.Example------     -----2.Example-----
  587.               Pixel width  = 40        Pixel width  = 41
  588.               Pixel column = 16        Pixel column = 15
  589.               LxPic output = 16-56     LxPic output = 8-56
  590.               no blanc columns         blanc columns 49-56
  591.  
  592. ─RETURN CODES─ 
  593.  
  594. LxPic exits via DOS funktion 04Ch or a RET FAR or a RET
  595. instruction leaving behind return codes in register AL. The
  596. codes and their meaning are:
  597.  
  598.           0   errorfree execution
  599.          -1   (reserved for DOS)
  600.          -2   file not found
  601.          -3   invalid screen mode
  602.          -4   unsupported signature/version of picture file
  603.          -5   uncompressed PCX file
  604.          -6   compressed BMP file
  605.          -7   unknown GIF image descriptor
  606.          -8   invalid LZW code in GIF file
  607.          -9   unsupported JPEG mode of operation
  608.          -10  unsupported arithmetic coding in JPEG
  609.          -11  unsupported Y sampling factor in JPEG
  610.          -12  no default DQT table support in JPEG
  611.          -13  no DNL support in JPEG
  612.          -14  no OS/2 DIB support in BMP
  613.  
  614. ─DETAILS─
  615.  
  616. If LxPic finds at address 00458h a value other than 0, it takes
  617. it and puts back 0. That is, you always have to fill in the
  618. interface, if you want to use it. If the value was not 0, LxPic
  619. checks for a valid graphic video mode. If no valid graphic
  620. video mode has been set by you, LxPic exits without action.
  621. Valid graphic modes are:
  622.  
  623.    HP95 = 20h
  624.    CGA  = 06h
  625.    EGA  = 0Fh
  626.    VGA  = 11h
  627.  
  628. Any change of the video mode or any clear screen, performed
  629. using BIOS or DOS functions, resets the interface to 0. That
  630. is, fill in the interface AFTER you configured the screen.
  631.  
  632. If you selected 'center picture' in the mode byte, the pixel
  633. row and pixel column values are ignored.
  634.  
  635. If you selected 'autozoom' in the mode byte, the zoom factor,
  636. the pixel row and pixel column values are ignored.
  637.  
  638.  
  639. ─TURBO-C SAMPLE CODE FOR USE OF LXPIC VIA SYSTEM CALL─
  640.  
  641. /*-----------------------------------------------------------*/
  642. /* This example assumes, that LXPIC.COM and DEMO.PCX are     */
  643. /* stored in the directory C:\PIC of your computer.          */
  644. /* Because of inline assembly, you have to use TCC from the  */
  645. /* command line, to compile this example                     */
  646. /*-----------------------------------------------------------*/
  647. #include <stdio.h>
  648. #include <string.h>
  649. #include <process.h>
  650.  
  651. /* function prototype */
  652. int picture(char mode,char zoom,int line,int column,char *pic);
  653. /*-----------------------------------------------------------*/
  654. main()
  655. {
  656.  /* set a valid graphic mode */
  657.  asm  mov  ax,6                       /* select video mode 6 */
  658.  asm  int  10h                        /* set it              */
  659.  
  660.  /* your code goes here */
  661.  printf("  this is DEMO.PCX");
  662.  
  663.  /* output DEMO.PCX half sized at line 10, column 16 */
  664.  picture(0,-1,10,16,"C:\\PIC\\DEMO.PCX");
  665.  
  666.  /* your code goes here  */
  667.  printf("\n\n\n\n\n\n\n\n  this was DEMO.PCX");
  668. }
  669. /*-----------------------------------------------------------*/
  670. int picture(char mode,char zoom,int line,int column,char *pic)
  671. {
  672.  char lxpic[100]="C:\\PIC\\LXPIC ";  /* full LXPIC pathname  */
  673.  
  674.  /* fill in the interface */
  675.  asm  push ax                        /* save AX              */
  676.  asm  push bx                        /* save BX              */
  677.  asm  push ds                        /* save DS              */
  678.  asm  mov  ax,0                      /* load DS...           */
  679.  asm  mov  ds,ax                     /* ...with segment 0    */
  680.  asm  mov  bx,0458h                  /* load bx with offset  */
  681.  asm  mov  al,1                      /* flag = use DOS EXIT  */
  682.  asm  mov  [bx+0],al                 /* set flag             */
  683.  asm  mov  al,mode                   /* load mode selection  */
  684.  asm  mov  [bx+1],al                 /* set  mode selection  */
  685.  asm  mov  al,zoom                   /* load zoom factor     */
  686.  asm  mov  [bx+2],al                 /* set  zoom factor     */
  687.  asm  mov  ax,line                   /* load pixelline       */
  688.  asm  mov  [bx+3],ax                 /* set  pixelline       */
  689.  asm  mov  ax,column                 /* load pixelcolumn     */
  690.  asm  mov  [bx+5],ax                 /* set  pixelcolumn     */
  691.  asm  pop  ds                        /* restore DS           */
  692.  asm  pop  bx                        /* restore BX           */
  693.  asm  pop  ax                        /* restore AX           */
  694.  
  695.  /* display the picture */
  696.  return(system(strcat(lxpic,pic)));
  697. }
  698. /*-----------------------------------------------------------*/
  699.  
  700.  
  701. ─USE OF LXPIC AS A SUBROUTINE─
  702.  
  703. To use LxPic as a subroutine, using intersegment calls, you
  704. have to do the following:
  705.  
  706. 1- allocate a whole segment of continuous memory (=64K), say
  707.    with segment address SEG.
  708. 2- load the LxPic code at SEG:100h using the DOS loader/exec
  709.    function 04Bh (subfunction AL=3)
  710. 3- set a valid graphic video mode
  711. 4- fill in the command tail at SEG:80h with the filename of the
  712.    picture you want to display. See a DOS documentation for the
  713.    structure of the command tail in the PSP.
  714. 5- fill in the interface, using interface selection flag = 2
  715. 6- set DS=ES=SEG and execute LxPic as a subroutine via
  716.    CALL FAR SEG:100h. LxPic saves and restores all registers
  717.    except AL, which holds the return code.
  718.  
  719. ...repeat steps 4-6...
  720.  
  721. 7- release the 64K memory block
  722.  
  723. To use LxPic as a subroutine, using intrasegment calls, see
  724. DEMO.ASM for an example. LxPic recognizes the intrasegment call
  725. and shrinks its internal buffers, to fit in the rest of the 64k
  726. segment. If you want to create COM files, you have to use
  727. intrasegment calls. Proceed as follows:
  728.  
  729. 1- find the first free paragraph in your 64k segment, say at
  730.    address FREE.
  731. 2- load the LxPic code at FREE+100h using the DOS loader/exec
  732.    function 04Bh (subfunction AL=3)
  733. 3- set a valid graphic video mode
  734. 4- fill in the command tail at FREE+80h with the filename of
  735.    the picture you want to display.
  736. 5- fill in the interface, using interface selection flag = 3
  737. 6- set DS=ES=FREE and execute LxPic as a subroutine via
  738.    CALL FREE+100h. LxPic saves and restores all registers
  739.    except AL, which holds the return code.
  740.  
  741. ...repeat steps 4-6...
  742.  
  743. NOTE: Programs, using the LxPic interface may not be
  744.       distributed commercially without license. Details
  745.       are available from the author.
  746.  
  747. ───────────────────────────────────────────────────────────────
  748.                           TECHNICAL
  749. ───────────────────────────────────────────────────────────────
  750.  
  751. A Grey value is build from 30% Red + 59% Green + 11% Blue.
  752. This takes into account the luminescence of the colors instead
  753. of simply calculating Grey as R+G+B/3. A Grey value of 0 means
  754. Black, a Grey value of 127 means Grey and a Grey value of 255
  755. means White.
  756.  
  757. B&W pictures use only a palette with two colors. The index into
  758. the palette is 0 or 1, represented by the corresponding pixel.
  759. The index 0 in the grey palette means a Grey value 0, which is
  760. Black, the index 1 means a Grey value of 255, which is White.
  761. The simple method of writing the index values of a B&W picture
  762. directly to the screen, instead of translating them before, is
  763. correct for white on black monitors, but leeds to an inverted
  764. image on the Palmtops black on white monitor.
  765.  
  766. The dither mode uses Floyd-Steinberg error diffusion, where the
  767. color error of a pixel is distributed to the adjacent pixels.
  768.  
  769. The inverse discrete cosine transform (IDCT) of JPEG uses an
  770. algorithm with only 4 multiplications, which I developed to
  771. make things go at some speed on the Palmtop's 80186.
  772.  
  773. LxPic does not use internal bitmap representation because of
  774. restricted memory. It decodes directly to the screen via a line
  775. buffer. Any action leeds to a completely new decoding of the
  776. picture.
  777.  
  778. LxPic is developped on a HP200LX. It is written in Assembler.
  779. Yes, this language still exists and tends to produce small and
  780. quick code.
  781.  
  782. LxPic is also a demonstration of what can be done in graphics
  783. with 9K code in 64K memory. Think of what could be done in 1MB
  784. code and 32MB memory with 80568 processor and compare it with
  785. todays reality!
  786.  
  787.  
  788. ─RESTRICTIONS─
  789.  
  790. - no uncompressed PCX files
  791. - no compressed BMP files
  792. - only sequential DCT (baseline) JPEG mode of operation
  793. - only first image of multi image GIF files
  794. - interlaced GIF files display at half height
  795. - zooming in is restricted to 1600 pixel in width for color
  796.   pictures. Exceeding columns are cut off
  797.  
  798. ───────────────────────────────────────────────────────────────
  799.                      DISCLAIMER AGREEMENT
  800. ───────────────────────────────────────────────────────────────
  801.  
  802. LxPic is copyrighted freeware. LxPic may not be distributed
  803. commercially or bundeld with commercial products without
  804. license. This applies also to programs, which use the internal
  805. interface of LxPic.
  806.  
  807. Users of LxPic must accept this disclaimer of warranty:
  808.  
  809. "LxPic is supplied as is. The author disclaims all warranties,
  810. expressed or implied, including, without limitation, the
  811. warranties of merchantability and of fitness for any purpose.
  812. The author assumes no liability for damages, direct or
  813. consequential, which may result from the use of LxPic."
  814.  
  815. ───────────────────────────────────────────────────────────────
  816.                             AUTHOR
  817. ───────────────────────────────────────────────────────────────
  818.  
  819.              Address your comments and suggestions to
  820.  
  821.  
  822.                          Stefan Peichl
  823.                        Karl-Ludwig-Str.4
  824.                        69117  Heidelberg
  825.                             Germany
  826.  
  827.                     Phone:0049-6221-184867
  828.  
  829.                 eMail: 06221184867@btxgate.de
  830.  
  831.       Internet: http://home.t-online.de/home/stefan.peichl
  832.