home *** CD-ROM | disk | FTP | other *** search
- ───────────────────────────────────────────────────────────────
- LxPic V3.4
- (c)1997 Stefan Peichl, Heidelberg, Germany
- ───────────────────────────────────────────────────────────────
-
- LxPic displays color pictures in simulated shades of grey on
- monitors in B&W mode. It is specially designed for the HP
- Palmtops but runs also on any desktop.
-
- LxPic processes BMP,GIF,JPG,PCX and ICN files of any kind.
- BMP and PCX files may have 2, 4, 256 or True Colors (16 Mio).
- JPG files may have 256 gray scales or True Colors. GIF files
- may have Version 87a or 89a with up to 256 colors.
-
- The pictures may have any size and dimension, as long as you
- have enough storage capacity to keep them.
-
- The special HP Palmtop resize command 'H' corrects the dispro-
- portion of the Palmtops pixel ratio.
-
- LxPic is very small (9K) and needs as a COM file only 64K of
- main memory while running, no matter how large the picture is.
-
- LxPic uses a distinctive dither algorithm to get most of the
- color information into the B&W representation. Once the picture
- is transformed, you may adjust contrast, brightness, shadow,
- highlight and color and save it as a B&W PCX file with less
- storage requirement and much better display performance.
-
- LxPic has an interface, to use it as a 'subroutine' in other
- programs or batch files. See PROGRAMMERS INTERFACE section of
- this documentation for further information.
-
- LxPic recognizes your display adapter and sets the display to
- the best of the following modes, dependant on your hardware:
-
- - VGA (640x480)
- - EGA (640x350)
- - CGA (640x200)
- - HP95 (240x128)
-
-
- *The Graphics Interchange Format(c) is the Copyright
- property of CompuServe Incorporated. GIF(sm) is a
- Service Mark property of CompuServe Incorporated.
-
- ───────────────────────────────────────────────────────────────
- REVISION HISTORY
- ───────────────────────────────────────────────────────────────
-
- Version 1.0 -Only B&W BMP and PCX files
-
- Version 2.0 -BMP,GIF,PCX,ICN of any size and dimension
- -VGA,EGA,CGA,HP95 support
- -Dither for color pictures
- -Scrolling
- -Zoom In/Out
- -Edit functions
- -HP resize mode
- -B&W PCX conversion
-
- Version 2.1 -Programmers Interface added
-
- Version 2.2 -Intrasegment call added to Programmers Interface
-
- Version 2.3 -Zoom out 1:8 and zoom in 8:1 added
- -Programmers Interface improvements
-
- Version 3.0 -JPEG added
- -/S switch to scan drives or subdirectorys
-
- Version 3.1 -More speed: Output interrupted at any command
-
- Version 3.2 -Version 3.1 bug fixed
-
- Version 3.3 -Correct display of Fujifilm DS-7 JPEG files
-
- Version 3.4 -Rename/Move command {N} added
- -Select pixel aspect ratio command {F6} added
-
-
- New versions of LxPic will be available on my Internet homepage
-
- http://home.t-online.de/home/stefan.peichl
-
- ───────────────────────────────────────────────────────────────
- SYSTEM REQUIREMENTS
- ───────────────────────────────────────────────────────────────
-
- - Processor: 8088
- - DOS : 2.11
- - Adapter : HP95,CGA,EGA,VGA
- - Memory : 64 K
- - Storage : 9 K
-
- ───────────────────────────────────────────────────────────────
- WHAT'S IN YOUR ZIP FILE
- ───────────────────────────────────────────────────────────────
-
- LXPIC.COM the picture viewer
- LXPIC3_4.DOC this file
- LXPIC.ICN icon for use with system manager
- DEMO.PCX gray scale demo PCX file
- DEMO.GIF 256 color demo GIF file
- DEMO.JPG True Color demo JPG file
- CAM2JPG.COM converts CASIO QV-10A CAM format to JPEG
-
- For programmers only:
-
- DEMO.ASM source code of DEMO.COM for intrasegment calls
- DEMO.COM put all files in C:\PIC and enter DEMO LXPIC.ICN
-
- ───────────────────────────────────────────────────────────────
- HOW TO USE LXPIC
- ───────────────────────────────────────────────────────────────
-
- LxPic needs no installation. If called without parameters,
- LxPic searches the current directory for all files with the
- extension BMP,GIF,JPG,ICN or PCX and displays them in the
- order, as they are found in the directory. If no files are
- found, LxPix exits and displays the help screen.
-
- LxPic has no file select feature, but it behaves like the DIR
- command of DOS and it accepts the /S command line parameter to
- scan all subdirectorys too. Which files are displayed depends
- on how you name them and where you keep them. To display a
- specific picture, use its full or relative pathname as
- parameter for LxPic. The wildcards * and ? are allowed in the
- filename, to display a group of pictures with similar names.
-
- ─EXAMPLES─
-
- LXPIC
- displays all pictures in the current directory
-
- LXPIC/S
- displays all pictures in the current directory and its
- subdirectorys
-
- LXPIC DEMO.*
- displays for example DEMO.PCX, DEMO.GIF and DEMO.JPG in the
- current directory
-
- LXPIC \PIC\V?.ICN
- displays for example V1.ICN and V2.ICN in the directory PIC of
- the current drive (good for Video command)
-
- LXPIC D:/S
- displays all pictures on your D: drive
-
- LXPIC C:\DEMO.JPG /S
- searches your whole C: drive for the file DEMO.JPG and displays
- it, if it was found
-
-
- If you use the scan switch /S, LxPic exits after all files have
- been displayed. Without /S, LxPic loops endless until you press
- ESC. Going back one picture is only possible within one sub-
- directory, so don't be confused with unexpected results using
- the last picture key 'P' in a scan.
-
- The /S switch is most useful to browse a CDROM on the desktop
- within seconds. Press the 'A' (=Autozoom) and 'V' (=Video) key
- to have the quickest and most informative overview of the
- pictures on a CDROM. Using a standard picture viewer under
- WINDOWS, it would take hours of mouse clicking to do the same
- job.
-
- If you want to add LxPic to the Application Manager of your HP
- Palmtop, copy LXPIC.COM and LXPIC.ICN into the directory, where
- your pictures reside, for example C:\PIC, and enter as path
- entry of the new application:
-
- C:\PIC\LXPIC.COM|70
-
- ───────────────────────────────────────────────────────────────
- COMMANDS
- ───────────────────────────────────────────────────────────────
-
- The Help key F1 pops up a window with all command keys:
-
- ┌─────────────────────────────────────────┐
- │ LxPic V3.4 (c)1997 Peichl, Heidelberg │
- │Use: LXPIC [path]file.[BMP|GIF|JPG|PCX]/S│
- ├────────────────────┬────────────────────┤
- │F File info on/off│F1 This help screen│
- │H HP resize on/off│F2 HP95|CGA|EGA|VGA│
- │C Clear scr on/off│F3 Convert b&w2grey│
- │I Invert on/off│F4 Save as b&w .PCX│
- │Z Center on/off│F5 Save screen only│
- │A Auto zoom on/off│F6 Pix aspect ratio│
- │T Text zoom on/off│CU..Key Move screens│
- │+=- Zoom in/no/out│PG..Key Move row/col│
- │S Slide on/off├────COLOR PICTURES──┤
- │V Video on/off│D Dither on/off│
- │>< Sld/Vid qui/slo│RGB R|G|B color only│
- │BAR Sld/Vid suspend│M Mix R+G+B colors│
- │DEL Delete picture│/ Reset all values│
- │N Ren/Move picture│7 8 Shadows - +│
- │P Previous picture│4 5 Highlights - +│
- │CR Next picture│1 2 Contrast - +│
- │ESC Exit (or ^C)│0 . Brightness - +│
- └────────────────────┴────────────────────┘
-
- Press F1 again or press ESC to close the Help window.
-
- Almost all commands are single key strokes and I tried to
- assign meaningful keys to the commands. The action, taken upon
- a command, is valid for the actual and all following images.
- If you have a sequence of pictures with little contrast, you
- have to adjust contrast only once.
-
- If you hear a key click, the pressed key had no function at all
- or did not apply to the actual picture type, or you reached the
- end of a range.
-
- Use the cursor keys to scroll an image. Cursor keys scroll the
- image by one screen in the indicated direction. Page keys
- (Palmtop: Fn+cursor) scroll the image by 10 columns or 10 lines
- in the indicated direction. I exchanged the meaning of these
- keys for single key strokes on the Palmtop. I try to keep the
- x,y offset in consecutive pictures, to allow you zooming the
- same position in a slideshow.
-
-
- KEY FUNCTION
-
- F Display file and parameter information box:
-
- DEMO.GIF filename
- ┌───────────┐
- │kbyte : 7│ filesize
- │type : COL│ picturetype: COL | GREY | B&W
- │deep : 8│ colordepth in bits: 1 | 4 | 8 | 24
- │wide : 320│ pixelwidth of actual representation
- │high : 100│ pixelheight of actual representation
- │x_0 : 0│ pixelcolumn: upper left displayed corner
- │y_0 : 0│ pixelline : upper left displayed corner
- │mode : CGA│ screen mode: VGA | EGA | CGA | HP95
- │ratio : 1:1│ pixel ratio: 1:1|1:.9|1:.8|1:.7|1:.6|1:.5
- │zoom : 1:1│ zoom in/out: 8:1|4:1|2:1|1:1|1:2|1:4|1:8
- │dither: ON│ dither mode: ON | OFF
- │color : RGB│ disp. color: RGB | RED | GRÜN | BLUE | GREY
- │shadow: 0│ shadow : 0=unchanged, 127=max, -127=min
- │hlight: 0│ highlights : 0=unchanged, 127=max, -127=min
- │contra: 0│ contrast : 0=unchanged, 127=max, -127=min
- │bright: 0│ brightness : 0=unchanged, 127=max, -127=min
- └───────────┘
-
- H Resizes the picture to a pixel aspect ratio of 1:0.8.
- A picture with 640x240 pixel is resized to 640x200 pixel
- for example. The actual aspect ratio is displayed in the
- file info box. HP resize is off by default. See also
- the more general pixel aspect ratio command {F6}.
-
- C Clear screen between two pictures (default)
-
- I Invert screen. LxPic inverts pictures by default, if
- running on a HP Palmtop
-
- Z Center picture in the middle of the screen (default)
-
- A Auto zoom. If switched on, the zoom mode is selected,
- which displays most of the picture. Auto zoom is off by
- default. If switched on, you see the letter 'A' in the
- 'zoom' entry of the file info.
-
- T Text zoom out mode. Zooming out for B&W images is
- implemented by default as 'drop two, keep two' to prevent
- moraine effects from previously dithered pictures. This
- command toggles zoom out mode to 'drop one, keep one',
- which is better for viewing B&W pictures including text,
- like faxes for example. If switched on, you see the letter
- 'T' in the 'zoom' entry of the file info. Text zoom is off
- by default.
-
- + Zoom out to 1:2, 1:4 and 1:8
-
- = Reset Zoom to 1:1
-
- - Zoom in to 2:1, 4:1 and 8:1
-
- S Perform a slideshow
-
- V Perform a video. Same as slideshow, but at maximal speed
- without clear screen between pictures. See VIDEO part
- of this documentation.
-
- > Slideshow/Video quicker up to maximal speed
-
- < Slideshow/Video slower
-
- BAR Suspend Slideshow/Video. Press Spacebar again to continue
-
- DEL Delete the actual displayed picture. You have to confirm,
- before the file is deleted
-
- N Rename/Move picture filename. You may not move the file
- to a different drive, because this would be a 'copy',
- which is not supported. After the rename, the next picture
- is displayed.
-
- P Display previous picture, as found in the directory. This
- command also changes the direction for Slideshow/Video.
-
- CR Display next picture, as found in the directory. This
- command resets the direction for Slideshow/Video to
- forward.
-
- ESC Exit LxPic. If you exit LxPic with ^C, an errorlevel of 1
- is returned, which is useful in batch files.
-
- F1 Display Help window
-
- F2 Change screen mode if possible. The picture is resized to
- 100% or autozoomed, if selected
-
- F3 Converts B&W picture to a 8 bit grey picture. This enables
- you to edit a B&W picture with the commands, only avail-
- able for color or grey pictures. The performance slows
- down indeed.
-
- F4 Save the whole picture -as you see it- to a B&W PCX file.
- You are asked for a filename. You must use another
- filename than the original name and you have to add the
- extension PCX. BMP pictures end upside down, I don't
- change it, turn around your Palmtop!
-
- F5 Same as F4, but only the visible part of the picture is
- saved. If you want to select even a smaller part, switch
- with F2 to the HP95 mode and save from there. To invert a
- Palmtop topcard, load it, press 'I' and then F5 to save
- the inverted topcard.
-
- F6 Selects pixel aspect ration in a range from 1:1 to 1:0.5.
- Useful for distorted camera pictures and CGA monitors.
- The HP resize command {H} is the shortcut of {F6}{2}.
- The actual aspect ratio is displayed in the file info box.
-
-
- ─COLOR PICTURES ONLY─
-
- The following commands are only available, if a picture with
- more than two colors is dispayed.
-
- D Switch Dithermode OFF/ON (ON by default)
- Without Dither, color values below 127 turn a pixel on,
- values above 127 switch it off
-
- R Display Red part of the picture only
-
- G Display Green part of the picture only
-
- B Display Blue part of the picture only
-
- M Mix Red, Green and Blue to Grey = 30%R + 59%G + 11%B
-
- / Reset Shadow, Highlight, Contrast and Brightness to 0.
- Set color to RGB.
-
- 7 Decrease Shadows: Colors <127 move towards Grey
-
- 8 Increase Shadows: Colors <127 move towards Black
-
- 4 Decrease Highlights: Colors >127 move towards Grey
-
- 5 Increase Highlights: Colors >127 move towards White
-
- 1 Decrease Contrast: All colors move towards Grey
-
- 2 Increase Contrast: Colors <127 move towards Black
- Colors >127 move towards White
-
- 0 Decrease Brightness: All colors move towards Black
-
- . Increase Brightness: All colors move towards White
-
- L Loop through Brightness: Displayes the picture
- contineously with decreasing brightness values
-
- ───────────────────────────────────────────────────────────────
- JPEG
- ───────────────────────────────────────────────────────────────
-
- You have to understand some basics of JPEG in order to use it
- most effectivly on the Palmtop. This applies only, if you have
- influence on the JPEG pictures, you want to display, that is,
- if you have a software to produce the (or convert to the) JPEG
- format.
-
- The LxPic implementation of JPEG supports the baseline mode of
- operation, which is the most common. I never saw any of the 3
- other JPEG modes. Baseline is lossy, that is, when the JPEG
- picture is created, the information of the original image is
- reduced to save storage space. The amount of information, which
- is lost, may be determined by you. Before saving a JPEG file, a
- good software asks you for a quality factor. You may go down to
- zero quality and still have a good picture on the palmtop,
- because most of the quality is anyhow lost in the B&W
- representation on the Palmtop.
-
- JPEG supports grayscale and True Color images. True Color is
- represented by luminace and chrominace values instead of red,
- green and blue parts. Furthermore, the luminance part may be
- more weighted than the chrominace part of a picture, again, in
- order to save space. The luminace component of a JPEG image is
- nothing else than it's grayscale representation and gayscale
- JPEG images only have one luminace component. LxPic extracts
- this luminace component and displays it. The chrominance
- components are ignored. That means, you loose no information on
- the palmtop, if you use only greyscale JPEG, but you save
- space. If you want to use your images on the Palmtop and the
- Desktop at the same time, and you want to have colors on the
- Desktop, select a subsampling of 4:1:1, which means 4 times
- more luminace values than blue chrominace values and red
- chrominace values. As with the quality parameter, a good
- software let's you select subsampling.
-
- A True Color 4:1:1 JPEG image with zero quality may have a
- compression rate of 0.2 bit/pixel, which is about 4K for a full
- screen CGA image. The same BMP image needs 24 bit/pixel, which
- is a factor of 120 times bigger. That is, you save about 99% of
- storage capacity and loose only little quality. Compression
- rates with greyscale JPEGs are even better. Compared to B&W PCX
- images, which use 1 bit/pixel, you still need only 20% of
- storage space.
-
- LxPic performs best with zero quality greyscale JPEG images,
- which also produce the smallest files. The output speed relates
- strong with the quality, because the better the quality, the
- more time consuming calculation has to be done in the inverse
- descrete cosine transform (IDCT).
-
- ───────────────────────────────────────────────────────────────
- DIGITAL CAMERAS
- ───────────────────────────────────────────────────────────────
-
- Almost all new digital cameras use an incompatible 'JPEG based
- compression' for their proper storage format, apparently for no
- other reason than to force people to use the camera vendor's
- software and not anyone else's. This is really bad politic!
- LxPic will never support any of these non standard formats
- internaly. Just to show, how easy it would have been for CASIO,
- to implement real baseline JPEG, I wrote a tiny program called
- CAM2JPG, which converts CAM to JPEG. I will never do the other
- direction. This tiny program is based on an excellent
- reengineering work of Mr. Iwama and Mr.Yamamoto from Japan,
- which was needed, because CASIO refused to make their format
- public.
-
- Now, that I made CAM available for the Palmtop, this should
- *NOT* encourage you to buy their cameras. Wait until the
- vendors produce JPEG right out of the box, like the FUJIFILM
- DS-7 camera.
-
- If you have another digital camera, and want to find out, if
- it's format is JPEG compatible, rename the internal storage
- files to *.JPG and try to display them with LxPic. You may have
- luck, at least you get a message like 'unsupported signature/
- version' or 'unsupported mode of operation'. You may also send
- me a MIME- or UUE-coded email with a demo file of the internal
- file format of your digital camera, and I will have a close
- look at it.
-
- ───────────────────────────────────────────────────────────────
- ADVICE
- ───────────────────────────────────────────────────────────────
-
- If you are concerned of little storage capacity, JPEG will be
- your preferred picture format on the Palmtop. But if you want
- to have output speed, B&W PCX files have the best speed/size
- ratio. With other words, it makes no sense to keep BMP, GIF or
- color PCX files on your Palmtop.
-
- To convert color pictures to the speedy B&W PCX format, proceed
- as follows:
-
- - Press 'H' to have the exact width/height proportions
- - Adjust contrast, brightness, shadow, highlight
- - Zoom in/out, if needed
- - Press F4 to save the whole image or
- - Press F5 to save only the visible part of the image. If you
- want to select a smaller part than the HP100/200 screen, use
- F2 to switch to the HP95 mode and make your selection in the
- HP95 window and press F5 in the HP95 mode to save this
- smaller part only.
- - Delete the original color picture.
-
- I do not recommend to use B&W GIF files, because GIF's LZW
- decoding is slow compared to PCX's RLE decoding. The slightly
- smaller B&W GIF filesize does not predominate this drawback.
-
- NOTE: BMP and PCX files with less than 40K, GIF files with
- less than 30K and JPG files with less than 16K perform
- better, because the whole picture can be kept in the
- buffer of LxPic. Bigger files have to be loaded and
- reloaded in portions, which might be time consuming,
- if you use slow storage devices.
-
- ───────────────────────────────────────────────────────────────
- VIDEOS
- ───────────────────────────────────────────────────────────────
-
- LxPic and its video option allow to display a series of (B&W)
- pictures at maximal speed to simulate a video. Start with two
- ICN pictures. Use the build in ICN editor of your Palmtop.
- Produce two slightly different icons and save them to your C:\
- drive as V1.ICN and V2.ICN. Run LxPic from the command line:
-
- LXPIC C:\V?.ICN
-
- Press the V key and adjust the speed with the < and > keys. If
- you want to use more than two ICN pictures, you have to take
- care of how they are stored in your directory. LxPic displays
- the files in the sequence as they are found in the directory.
- You cannot tell LxPic a different display order. First copy all
- files under new names in the sequence, you want to have them
- displayed and then delete the old files. Don't rename the
- files, because it does not change their directory position.
- Use the DIR command of DOS without any sort parameter to see
- the new order of the files.
-
- ───────────────────────────────────────────────────────────────
- PROGRAMMERS INTERFACE
- ───────────────────────────────────────────────────────────────
-
- LxPic has an internal interface for use with other programming
- languages or batch files. This interface allows you to output
- pictures at a desired position in an already filled application
- screen. You may select, if you want to gain back control
- immediately after the picture has been output to the screen, or
- if you want to pass intermediate control to LxPic and get back
- control, when the ESC key of LxPic is pressed. The application
- may then write around or even into the picture. Multiple
- pictures may be positioned or overlayed on one screen.
-
- The interface uses 7 bytes of the bios data area starting at
- the absolut address 00458h (40h:58h relative). The bios
- resevers these bytes for the cursor coordinates of the text
- pages 4-7 in an ascii text mode. In graphic modes, these bytes
- are zeroed and unused. Since LxPic works only in graphic modes,
- these bytes may be used as an interface for LxPic.
-
- ─INTERFACE SPECIFICATION─
-
- byte 00458h Interface selection flag:
- 00h = do not use the interface (default)
- 01h = use interface, exit via DOS EXIT function
- 02h = use interface, exit via RET FAR instruction
- 03h = use interface, exit via RET instruction
-
- Set bit 7 in the interface selection flag, if you
- want to pass intermediate control to LxPic.
-
- byte 00459h Mode selection byte. This byte is bit coded.
- 7 6 5 4 3 2 1 0 = bit number
- | | | | | | |
- | | | | | | | Meaning if bit is set
- | | | | | | | ---------------------
- | | | | | | |___clear screen before output
- | | | | | |_____invert picture
- | | | | |_______center picture
- | | | |_________autozoom
- | | |___________HP resize
- | |_____________dither off
- |_______________text zoom on
-
- byte 0045Ah Zoom factor. Valid values are:
- -3 = 1:8
- -2 = 1:4
- -1 = 1:2
- 0 = 1:1
- 1 = 2:1
- 2 = 4:1
- 3 = 8:1
- if the value is not valid, 0 is assumed.
-
- word 0045Bh Pixel row. If the pixel row is not valid in the
- actual graphic mode, 0 is assumed.
-
- word 0045Dh Pixel column. If the pixel column is not valid in
- the actual graphic mode, 0 is assumed.
- NOTE: LxPic output always starts and ends at
- pixel columns, that are multiples of 8.
-
- -----1.Example------ -----2.Example-----
- Pixel width = 40 Pixel width = 41
- Pixel column = 16 Pixel column = 15
- LxPic output = 16-56 LxPic output = 8-56
- no blanc columns blanc columns 49-56
-
- ─RETURN CODES─
-
- LxPic exits via DOS funktion 04Ch or a RET FAR or a RET
- instruction leaving behind return codes in register AL. The
- codes and their meaning are:
-
- 0 errorfree execution
- -1 (reserved for DOS)
- -2 file not found
- -3 invalid screen mode
- -4 unsupported signature/version of picture file
- -5 uncompressed PCX file
- -6 compressed BMP file
- -7 unknown GIF image descriptor
- -8 invalid LZW code in GIF file
- -9 unsupported JPEG mode of operation
- -10 unsupported arithmetic coding in JPEG
- -11 unsupported Y sampling factor in JPEG
- -12 no default DQT table support in JPEG
- -13 no DNL support in JPEG
- -14 no OS/2 DIB support in BMP
-
- ─DETAILS─
-
- If LxPic finds at address 00458h a value other than 0, it takes
- it and puts back 0. That is, you always have to fill in the
- interface, if you want to use it. If the value was not 0, LxPic
- checks for a valid graphic video mode. If no valid graphic
- video mode has been set by you, LxPic exits without action.
- Valid graphic modes are:
-
- HP95 = 20h
- CGA = 06h
- EGA = 0Fh
- VGA = 11h
-
- Any change of the video mode or any clear screen, performed
- using BIOS or DOS functions, resets the interface to 0. That
- is, fill in the interface AFTER you configured the screen.
-
- If you selected 'center picture' in the mode byte, the pixel
- row and pixel column values are ignored.
-
- If you selected 'autozoom' in the mode byte, the zoom factor,
- the pixel row and pixel column values are ignored.
-
-
- ─TURBO-C SAMPLE CODE FOR USE OF LXPIC VIA SYSTEM CALL─
-
- /*-----------------------------------------------------------*/
- /* This example assumes, that LXPIC.COM and DEMO.PCX are */
- /* stored in the directory C:\PIC of your computer. */
- /* Because of inline assembly, you have to use TCC from the */
- /* command line, to compile this example */
- /*-----------------------------------------------------------*/
- #include <stdio.h>
- #include <string.h>
- #include <process.h>
-
- /* function prototype */
- int picture(char mode,char zoom,int line,int column,char *pic);
- /*-----------------------------------------------------------*/
- main()
- {
- /* set a valid graphic mode */
- asm mov ax,6 /* select video mode 6 */
- asm int 10h /* set it */
-
- /* your code goes here */
- printf(" this is DEMO.PCX");
-
- /* output DEMO.PCX half sized at line 10, column 16 */
- picture(0,-1,10,16,"C:\\PIC\\DEMO.PCX");
-
- /* your code goes here */
- printf("\n\n\n\n\n\n\n\n this was DEMO.PCX");
- }
- /*-----------------------------------------------------------*/
- int picture(char mode,char zoom,int line,int column,char *pic)
- {
- char lxpic[100]="C:\\PIC\\LXPIC "; /* full LXPIC pathname */
-
- /* fill in the interface */
- asm push ax /* save AX */
- asm push bx /* save BX */
- asm push ds /* save DS */
- asm mov ax,0 /* load DS... */
- asm mov ds,ax /* ...with segment 0 */
- asm mov bx,0458h /* load bx with offset */
- asm mov al,1 /* flag = use DOS EXIT */
- asm mov [bx+0],al /* set flag */
- asm mov al,mode /* load mode selection */
- asm mov [bx+1],al /* set mode selection */
- asm mov al,zoom /* load zoom factor */
- asm mov [bx+2],al /* set zoom factor */
- asm mov ax,line /* load pixelline */
- asm mov [bx+3],ax /* set pixelline */
- asm mov ax,column /* load pixelcolumn */
- asm mov [bx+5],ax /* set pixelcolumn */
- asm pop ds /* restore DS */
- asm pop bx /* restore BX */
- asm pop ax /* restore AX */
-
- /* display the picture */
- return(system(strcat(lxpic,pic)));
- }
- /*-----------------------------------------------------------*/
-
-
- ─USE OF LXPIC AS A SUBROUTINE─
-
- To use LxPic as a subroutine, using intersegment calls, you
- have to do the following:
-
- 1- allocate a whole segment of continuous memory (=64K), say
- with segment address SEG.
- 2- load the LxPic code at SEG:100h using the DOS loader/exec
- function 04Bh (subfunction AL=3)
- 3- set a valid graphic video mode
- 4- fill in the command tail at SEG:80h with the filename of the
- picture you want to display. See a DOS documentation for the
- structure of the command tail in the PSP.
- 5- fill in the interface, using interface selection flag = 2
- 6- set DS=ES=SEG and execute LxPic as a subroutine via
- CALL FAR SEG:100h. LxPic saves and restores all registers
- except AL, which holds the return code.
-
- ...repeat steps 4-6...
-
- 7- release the 64K memory block
-
- To use LxPic as a subroutine, using intrasegment calls, see
- DEMO.ASM for an example. LxPic recognizes the intrasegment call
- and shrinks its internal buffers, to fit in the rest of the 64k
- segment. If you want to create COM files, you have to use
- intrasegment calls. Proceed as follows:
-
- 1- find the first free paragraph in your 64k segment, say at
- address FREE.
- 2- load the LxPic code at FREE+100h using the DOS loader/exec
- function 04Bh (subfunction AL=3)
- 3- set a valid graphic video mode
- 4- fill in the command tail at FREE+80h with the filename of
- the picture you want to display.
- 5- fill in the interface, using interface selection flag = 3
- 6- set DS=ES=FREE and execute LxPic as a subroutine via
- CALL FREE+100h. LxPic saves and restores all registers
- except AL, which holds the return code.
-
- ...repeat steps 4-6...
-
- NOTE: Programs, using the LxPic interface may not be
- distributed commercially without license. Details
- are available from the author.
-
- ───────────────────────────────────────────────────────────────
- TECHNICAL
- ───────────────────────────────────────────────────────────────
-
- A Grey value is build from 30% Red + 59% Green + 11% Blue.
- This takes into account the luminescence of the colors instead
- of simply calculating Grey as R+G+B/3. A Grey value of 0 means
- Black, a Grey value of 127 means Grey and a Grey value of 255
- means White.
-
- B&W pictures use only a palette with two colors. The index into
- the palette is 0 or 1, represented by the corresponding pixel.
- The index 0 in the grey palette means a Grey value 0, which is
- Black, the index 1 means a Grey value of 255, which is White.
- The simple method of writing the index values of a B&W picture
- directly to the screen, instead of translating them before, is
- correct for white on black monitors, but leeds to an inverted
- image on the Palmtops black on white monitor.
-
- The dither mode uses Floyd-Steinberg error diffusion, where the
- color error of a pixel is distributed to the adjacent pixels.
-
- The inverse discrete cosine transform (IDCT) of JPEG uses an
- algorithm with only 4 multiplications, which I developed to
- make things go at some speed on the Palmtop's 80186.
-
- LxPic does not use internal bitmap representation because of
- restricted memory. It decodes directly to the screen via a line
- buffer. Any action leeds to a completely new decoding of the
- picture.
-
- LxPic is developped on a HP200LX. It is written in Assembler.
- Yes, this language still exists and tends to produce small and
- quick code.
-
- LxPic is also a demonstration of what can be done in graphics
- with 9K code in 64K memory. Think of what could be done in 1MB
- code and 32MB memory with 80568 processor and compare it with
- todays reality!
-
-
- ─RESTRICTIONS─
-
- - no uncompressed PCX files
- - no compressed BMP files
- - only sequential DCT (baseline) JPEG mode of operation
- - only first image of multi image GIF files
- - interlaced GIF files display at half height
- - zooming in is restricted to 1600 pixel in width for color
- pictures. Exceeding columns are cut off
-
- ───────────────────────────────────────────────────────────────
- DISCLAIMER AGREEMENT
- ───────────────────────────────────────────────────────────────
-
- LxPic is copyrighted freeware. LxPic may not be distributed
- commercially or bundeld with commercial products without
- license. This applies also to programs, which use the internal
- interface of LxPic.
-
- Users of LxPic must accept this disclaimer of warranty:
-
- "LxPic is supplied as is. The author disclaims all warranties,
- expressed or implied, including, without limitation, the
- warranties of merchantability and of fitness for any purpose.
- The author assumes no liability for damages, direct or
- consequential, which may result from the use of LxPic."
-
- ───────────────────────────────────────────────────────────────
- AUTHOR
- ───────────────────────────────────────────────────────────────
-
- Address your comments and suggestions to
-
-
- Stefan Peichl
- Karl-Ludwig-Str.4
- 69117 Heidelberg
- Germany
-
- Phone:0049-6221-184867
-
- eMail: 06221184867@btxgate.de
-
- Internet: http://home.t-online.de/home/stefan.peichl