home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fresh Fish 9
/
FreshFishVol9-CD2.bin
/
bbs
/
util
/
filer-3.22.lha
/
Filer
/
Rexx
/
Picasso.filer
< prev
next >
Wrap
Text File
|
1994-03-11
|
23KB
|
582 lines
/*
$VER: Picasso.filer 1.5 (10.03.94)
Author:
Michael Böhnisch (billy@uni-paderborn.de) (mb)
Matthias Scheler (tron@lyssa.pb.owl.de) (ms)
Function:
ViewGIF, the GIF viewer that accompanies the Picasso II graphics
board, often selects wrong resolutions when displaying oversized
pictures. E.g. I´ve got a picture, 600×800 in size, ViewGIF
displays on a 1024×768 screen, cropping off the lower 34 rows.
Picasso.filer scans the GIF file for the picture size and forces
ViewGIF into a better resolution.
ViewJPEG uses 640×480×24 by default, regardless whether it crops
the image or not. I prefer seeing the whole image when possible,
so Picasso.filer allows 16 or 8 bits per pixel resolutions. Bigger
pictures may take a while to display, especially on unaccelerated
Amigas. Stay patient.
ViewIFF does not show Multi Palette pictures (PCHG chunk)
correctly. Picasso.filer provides a fallback to an external viewer
when such pictures are selected.
Pixels on the Picasso II board usually are square shaped, or in
other words have an X/Y aspect ratio of 1. This results in
distorted picture displays for special view modes like "NTSC:LoRes
Lace".
Picasso.filer handles this by supplying one of the keywords DOUBLEX
or DOUBLEY to ViewIFF as appropriate. For extreme distortions
(e.g. pictures for PAL:SuperHighres non-interlaced) a fallback to
an external external viewer on conservative Amiga screens is
choosen.
Requires:
Picasso II graphics board
ViewGIF, ViewJPEG and ViewIFF supplied with Picasso II
VT 2.0 by Thomas Krehbiel or any other standard IFF viewer. Must
support PCHG Multi Palette pictures if you want to view this
picture type.
Call:
Picasso TYPE FILE
Where TYPE is one of GIF, IFF or JPG. Picasso.filer relies on the
correctness of this info and does no further file type checking.
Example for "Filer.RC":
REXXCLASS "#?","GIF8","Picasso GIF %s"
REXXCLASS "#?","??????JFIF","Picasso JPG %s"
REXXCLASS "#?","FORM????ILBM","Picasso IFF %s"
ToDo:
IFF pictures with aspect ratios outside the range from 0.35 to 2.83
are displayed on standard Amiga screens. Maybe some tool should be
used to do a scale operation on the picture first and then forward
it to the Picasso viewer.
History:
06.02.94 1.0 Initial Release (mb)
07.02.94 1.1 IFF & JPEG added (mb)
08.02.94 1.2 fallback for HAM/EHB pictures removed (ms)
09.02.94 1.3 removed VT dependency for GIF
removed VT dependency for IFF, any viewer
wil do now
added IFF PCHG fallback
added fallback for non-square aspect ratios (mb)
10.02.94 1.4 used ViewIFF keywords DOUBLEX and DOUBLEY
for a wider range of pictures displayed on
the Picasso II (mb)
10.03.94 1.5 removed VT dependency for JPEG
no need for rexxsupport.library any longer
added user confirmation for oversized JPEGs (mb)
*/
/* -------------------------------------------------------------------- */
/* External commands. Adjust these to your individual settings. */
/* -------------------------------------------------------------------- */
vtcommand = "VT"
vgcommand = "ViewGIF"
vjcommand = "ViewJPEG"
vicommand = "ViewIFF"
/* -------------------------------------------------------------------- */
OPTIONS RESULTS /* we need response from filer */
PARSE ARG TYPE PICFILE /* get arguments */
TYPE = STRIP( TYPE )
PICFILE = STRIP( PICFILE )
/* -------------------------------------------------------------------- */
/* Default to Filer's AReXX port and prevent Filer from quitting */
/* -------------------------------------------------------------------- */
ADDRESS 'FilerRexx'
LOCKFILER
Key = RESULT
/* -------------------------------------------------------------------- */
/* Get source dircetory name, append "/" if it is not a device name. */
/* Tag name of file to view. */
/* -------------------------------------------------------------------- */
GETSOURCEPATH
SrcPath = RESULT
IF RIGHT(SrcPath, 1) = ':' THEN
FileName = SrcPath || STRIP( PICFILE, B, X2C(22) )
ELSE
FileName = SrcPath || '/' || STRIP( PICFILE, B, X2C(22) )
SELECT
/* ---------------------------------------------------------------- */
/* Show GIF picture */
/* ---------------------------------------------------------------- */
WHEN TYPE = 'GIF' THEN DO
/* ------------------------------------------------------------ */
/* determine ViewGIF RESOLUTION parameter and call viewer */
/* ------------------------------------------------------------ */
CALL GIFSize
PARSE VAR RESULT xsize ysize depth
xsize = STRIP( xsize )
ysize = STRIP( ysize )
depth = STRIP( depth )
res = 1600
IF ( xsize <= 1280 ) & ( ysize <= 1024 ) THEN res = 1280
IF ( xsize <= 1152 ) & ( ysize <= 900 ) THEN res = 1152
IF ( xsize <= 1120 ) & ( ysize <= 832 ) THEN res = 1120
IF ( xsize <= 1024 ) & ( ysize <= 768 ) THEN res = 1024
IF ( xsize <= 800 ) & ( ysize <= 600 ) THEN res = 800
IF ( xsize <= 640 ) & ( ysize <= 480 ) THEN res = 640
IF ( xsize <= 320 ) & ( ysize <= 240 ) THEN res = 320
HISTORY 'Picasso: GIF "' || FileName || '"' xsize || '×' || ysize || '×' || depth
SHELL COMMAND vgcommand RESOLUTION res CENTER FileName '>NIL:'
END
/* ---------------------------------------------------------------- */
/* Show JPG picture */
/* ---------------------------------------------------------------- */
WHEN TYPE = 'JPG' THEN DO
/* ------------------------------------------------------------ */
/* Determine JPEG picture size */
/* ------------------------------------------------------------ */
CALL JPGSize
PARSE VAR RESULT xsize ysize depth
xsize = STRIP( xsize )
ysize = STRIP( ysize )
depth = STRIP( depth )
/* ------------------------------------------------------------ */
/* choose maximum number of colors available without cropping */
/* and call ViewJPG */
/* ------------------------------------------------------------ */
dep = '8BIT'
IF ( xsize <= 1152 ) & ( ysize <= 900 ) THEN dep = '16BIT'
IF ( xsize <= 800 ) & ( ysize <= 600 ) THEN dep = '24BIT'
banner = xsize || '×' || ysize || '×' || depth
HISTORY 'Picasso: JPG "' || FileName || '"' banner '(' || dep || ')'
/* ------------------------------------------------------------ */
/* Ask for confirmation if picture is "on the big side" */
/* ------------------------------------------------------------ */
display = 1
IF xsize * ysize > 1000000 THEN DO
txt = "This operation may take a long time.|"
txt = txt || " Shall I continue anyway?"
QUESTBOX txt
display = RESULT
END
IF display = 1 THEN SHELL COMMAND vjcommand dep FileName '>NIL:'
END
/* ---------------------------------------------------------------- */
/* Show IFF ILBM picture */
/* -------------------------------------------------