Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Sunshow Pro V3.0 - <b>showjpeg</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
ShowJPEG

Display a JPEG image file


Syntax

SHOWJPEG [<switches>] <cFILENAME.JPG> [<nLeft> <nTop> <nSWidth> <nSHeight>]


Switch

/yiq
Use YIQ colorspace (default is YUV).

/d
Dither on display.

/f
Use fast DCT.

/s
Display in 16-bit Sierra modes.

/t
Print execution time.

/16
Reduce to 16-colors (default is 256).

/def16
Reduce to default 16 colors.

/def256
Reduce to default 256 colors.

/noblank
Load image in current video mode.

/nopause
Return to text mode immediately.


Arguments

<cFILENAME.JPG>
The JPEG filename to display.

<nLeft>
Optional left offset of image.

<nTop>
Optional top offset of image.

<nSWidth>
Optional screen width for image display.

<nSHeight>
Optional screen height for image display.


Remarks

ShowJPEG is a direct JPEG display module. 8-bit decompression takes about 
5 to 10 times longer than GIF decompression. It also displays to 16-bit 
Sierra modes for video cards having a Sierra color DAC. ShowJPEG displays 
to raw JPEG format unless flags are invoked. Dithered display is preferable 
for best image quality. If display module is invoked without the command 
line switches, it will display a raw, undithered JPEG image, using the JPEG 
standard algorithm which is slower than our proprietary fast algorithm. 
Normally, the /d (dither) and /f (fast) switches are passed on the command 
line for fastest and best quality display.


JPEG Notes

A common question to our technical support staff is "This JPEG image does 
not display... Why?"

The problem is usually incompatible formats.  Some JPEG hardware/software 
creates a special, proprietary JPEG version that is not standard and has a 
prepended, non-standard header in front of a standard JPEG file.  
OptiVision JPEG hardware boards prepend a JPEG file with a non-standard 
header.  TelePhoto Communications' ALICE software can create JIF format 
images which are non-standard and proprietary.  Since it can easily create 
JPEG format files, you should set the parameters for standard format JPEG.  
XING creates standard JPEG files which are compatible.  Image Alchemy, a 
popular shareware / commercial product also creates standard JPEG files and 
is also compatible.

If you receive the Display Error Message: "Cannot allocate enough memory 
for line buffers" You have insufficient conventional or EMS/XMS memory.  
Check the amount of memory your application is using, check TSRs, devices, 
etc.  Clipper 5.xx can hog all EMS memory (up to 8Meg) unless you use the 
Clipper Environmental Variable to limit Clipper's allocation of memory.  
The Variable may be set on the command line or in your 
AUTOEXEC.BAT prior to compiling your application:

SET CLIPPER=[E,nExpandedKbytes>][;F<nHandles>][;X<nKbytes>]

For example

SET CLIPPER=E0 

or

SET CLIPPER=E2048

See the Clipper 5.01 Programming & Utilities Manual for more information.

When creating your own JPEGs with Sunshow software (using TGA2JPEG), always 
add a palette with the /A switch to avoid many out of memory errors.  This 
is the best insurance to avoid display problems.  The /A switch will 
increase the file size of your JPEG files by 780 bytes, a very small amount 
considering the display problems it may avoid. If the JPEG image does not 
have a color map (standard JFIF), and since ShowJPEG defaults to optimized 
display, a color map must be calculated or created in optimized form, 
resulting in EMS/XMS/conventional memory requirements of image width x image 
height x 3.

If you use TGA2JPEG to create your JPEG and use the /A switch to preprocess 
the JPEG to include an optimized palette, no color map must be created since 
it already exists, resulting in conventional memory requirements only of 
image width x 10 x 3.

If you use ShowJPEG with /DEF256 switch, to include a default or common 
palette, no color map must be created, resulting in Conventional memory 
requirements only of image width x 10 x 3.

If your video card supports High Color video modes with the Sierra DAC, use 
ShowJPEG with /S switch to allow your conventional memory requirements to be 
image width x 10 x 3, independent of whether your JPEG images have a 
previously created color map or not.

If you use ShowJPEG, with /D dither switch, your conventional memory 
requirements will be image width x 22 x 3.

When a JPEG file is displayed on a standard, 8-bit SVGA video card, what 
occurs is a 24-bit type image is converted to 8-bit display, with or without 
dither, with or without palette optimization.  ShowJPEG defaults to 
optimized 256 color display in an 8-bit display mode.  When an insufficient 
memory condition occurs, try using the /DEF256 switch as a test to attempt 
display the image in a situation where not enough EMS/XMS memory might 
exist.

JPEG is basically a very special 24-bit format (also called JFIF) created 
without a color map (JPEG standard does not support color maps) that 
requires certain amounts of conventional memory for RGB line buffers as 
part of the display requirements.  In addition, EMS or XMS memory will be 
required in certain cases.  ShowJPEG does not support virtual memory (paged 
disk memory) because of poor performance when processing a large JPEG file 
from disk.  Sunshow's JPEG format (created with TGA2JPEG) is a 100%-
compatible JFIF standard JPEG file with a optional color map stored in the 
comment field (to preserve compatibility).

Memory Requirements

With previously added color map or default color map & no dither switch:
  640x480    19K minimum conventional memory required
  800x600    24K minimum conventional memory required
  1024x768   31K minimum conventional memory required

With previously added color map or default color map & dither switch:
  640x480    43K minimum conventional memory required
  800x600    53K minimum conventional memory required
  1024x768   68K minimum conventional memory required

With no previously added color map & no dither switch:
  640x480    19K minimum conventional memory required plus 922K EMS/XMS 
             memory
  800x600    24K minimum conventional memory required plus 1.44 Meg EMS/XMS 
             memory
  1024x768   31K minimum conventional memory required plus 2.4 Meg EMS/XMS 
             memory

With no previously added color map & dither switch:
  640x480    43K minimum conventional memory required plus 2K EMS/XMS memory
  800x600    53K minimum conventional memory required plus 44 Meg EMS/XMS 
             memory
  1024x768   68K minimum conventional memory required plus 4 Meg EMS/XMS 
             memory

With Sierra High Color video card, using /S switch:
  640x480    19K minimum conventional memory required only
  800x600    24K minimum conventional memory required only
  1024x768   31K minimum conventional memory required only

ShowJPEG's conventional memory requirements are for RGB line buffers which 
cannot be placed in EMS/XMS memory without serious performance degradation.  
ShowJPEG also cannot use virtual memory (paged disk memory) to processing 
the JPEG image from your harddisk without even more serious performance 
degradation, therefore, ShowJPEG does not support virtual memory.


Example

To display a JPEG image, VALLEY.JPG, 800x600, forced to 1024x768 with 
100 left offset 50 top offset, with the dither flag set, and using the fast 
algorithm option:

SHOWJPEG /D /F VALLEY.JPG 100 50 1024 768

Memory requirements for above JPEG image with the command line parameters 
as specified:

Having a previously created color map:
  800x22x3    53K Conventional memory for RGB line buffers only

Not having a previously created color map:
  800x22x3    53K Conventional memory for RGB line buffers plus 1.44 MB 
              EMS/XMS memory for processing color map



See Also: ShowCEG ShowCUT ShowICO ShowIFF ShowIMG ShowSTY ShowRIX ShowTIF ShowXPM

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson