MULTIVIEW - Version 2.0 by Wayne Hogue A.U.R.A. (Amiga Users of Regina Association) January 14, 1988 You are now here because after looking at that screenfull of pretty gadgets you became totally confused and that Mouse turned out to be an inept tour guide. Well, throw that rodent a chunk of cheese and read on. WHAT THE PROGRAM DOES: ---------------------- 1. Read Graphics Files in following forms a) IFF - ILBM (InterLeaved Bit Map) - ACBM (Amiga Continuous Bit Map) (Note: IFF = Interchange File Format) b) Atari ST - DEGAS Elite - NEOchrome c) Macintosh d) SPUT - my special form for AmigaBasic PUT command e) SBOB - my special form for AmigaBasic BOB's f) DECODE - extract pictures buried in complicated files 2. Write Graphics Images as a) IFF - ILBM non-compressed format - ACBM b) SPUT - with special header information - without special header information c) SBOB - with special header information - without special header information d) Image structure for 'C' programmers 3. Create GIANT ICONS for the Workbench Screens (Just the effect needed for your custom program that took you so long to write.) THE PROGRAM: ------------ The program can either be run from the CLI or by double clicking on its icon. A window opens which can be reduced in size so that it can be placed any where you like on the screen. All parts of the program are accessed through gadgets. Whenever you see a word totally capitalized such as CLOSE this means I am referring to a gadget. To Quit: -------- So, to begin let's start at the end. At the upper left corner of the window is the CLOSEWINDOW gadget. Pressing this gadget brings up a requester that gives you the choice of really quitting the program or continuing with the program. Sizing the Window: ------------------ Just below CLOSEWINDOW is the SIZEWINDOW gadget. Selecting this gadget either shrinks or enlarges the winow. In its shrunk size you can drag the window to any spot on the Workbench screen. When the window is changed back to its original size it will position itself to the right spot on the screen. Views and ViewPorts: -------------------- Its now time to let the techies cringe with this simple description of how you see things on the monitor. Below SIZEWINDOW are two gadgets for selecting the type of view to use. They are called SCREEN and SUPER. With SCREEN you create a standard Amiga screen where the entire picture is seen on the screen. Using SUPER you create a view that uses a super bitmap which can hold a picture that is larger than what you can see on the screen. When SUPER is selected you must then decide how big to make the bitmap. The bitmap can measure as much as 1024 pixels by 1024 lines. Use the SUPERWIDTH and SUPERHEIGHT gadgets and type in them the size you want. A maximum size bitmap at maximum depth is too large for 512K of CHIP memory. After deciding on whether to use SCREEN or SUPER, you must then decide on how many colors to have in the picture. This is done by choosing the Depth. DEPTH Colors ----- ------ 1 2 2 4 3 8 4 16 5 32 6 4096 The more colors used mean more CHIP memory is needed. Now use WIDTH (320 or 640) and HEIGHT (200 or 400) to determine the size the picture will be on the monitor. (Note: To give you overscan just means changing the gadgets). A superbit map should really be larger than the screen size you choose here. If a depth of 5 or 6 is chosen for a superbit and then you make the viewport 640 pixels wide then only 4 bit planes of data will be displayed. Selecting OPEN now creates the screen or super bitmap display. If you now select DISPLAY only a blank screen will appear because no picture has been loaded yet. To get back to the Workbench screen you can do a Left_Amiga_N or for a SCREEN use the hidden BACK/FRONT gadgets at the top right hand corner or for a SUPER view press the or keys. For some reason the and keys do not work the first time the SUPER view is displayed. The CLOSE gadget closes down the screen or super view. For a super view if the bitmap is larger than 320x200 then you can resize the viewport without loosing the picture already loaded. Just select the new WIDTH and HEIGHT and then press RESIZE. When displaying a super view you can scroll the picture around using the keys on the numeric keypad. The keys mimic the action of a joystick. Using the Up and Down arrow keys you can change the speed of the scroll. If a screen or super view is open then a picture will be read into that size of view. If you want a picture to load into the size of screen for which it was created then choose CLOSE before loading the picture. Degas, Neo and Mac pictures will always close down any open view and load to the view size needed. Reading and Saving: ------------------- Over at the right top are PICTURE and COLORMAP. COLORMAP can only be used if there is an open screen or super view. Gadgets READ, SAVE and DECODE can be used with either PICTURE or COLORMAP. To read in a picture select PICTURE and READ. Now below these gadgets is another bunch which determines what type of graphic file to read. The choices are: 1. IFF file in ILBM format 2. IFF file in ACBM format 3. SPUT format with header information 4. SPUT format without header information 5. SBOB format with header information 6. SBOB format without header information 7. DEGAS format for an Atari ST 8. NEO format for an Atari ST 9. MAC format for a Macintosh (Note: for READ only, types 1,2,3,5 are interchangeable because the first 4 bytes identify the file type. No checking is done to see if the type is really 4,6,7,8,9 so some interesting things can happen.) Last of all select GO. A file requester window will now open. You can select the volume name and file name by just clicking with the mouse. Clicking once on a file name will put the name in the FILE gadget. Clicking on a file name that is already displayed is the same as using the gadget in the bottom left hand corner of the requester window that says Read (or in other cases Save or Pick). You can type the path and file names directly into the DRAWER and FILE gadgets if you wish. Experiment to find out everything the file requester window will do for you. After choosing the file the graphic will be read in and then displayed for you. Picture files are read in and displayed a little slower than other display programs that have been released. This is because my program is doing more checks while decoding the file data. Atari ST and Macintosh pictures were obtained by loading the files onto a 5 1/4" disk on an Atari. The disk was then transferred to an Amiga equipped with a 5 1/4" drive and transferred to 3 1/2" disk using the program on the Extras disk. DEGAS and NEO picture files are very similar and contain information in the first 2 bytes which tell what screen resolution to use. The screen is opened according to these first 2 bytes in the file and not by the extension on the file name so you can call the files whatever you want to. Macintosh files are not checked to see if they are indeed picture files. The right number of bytes are skipped and the picture load continues (I had no information on Mac file structure available) The DEGAS file format was available and so I used this information to decode the files. For NEO pictures I only had a couple of example files so the file structure was determined through trial and error. Atari pictures are loaded to a Screen and Macintosh pictures are loaded to a View. A Macintosh picture always loads to a super bitmap view because it is 576 pixels wide by 720 pixels high. To save a displayed picture select PICTURE, SAVE, file type 1 to 9 and then select GO. Then choose the path and file name using the file requester. You can not save pictures in DEGAS, NEO, or MAC format because I am not interested in transferring pictures in that direction. When you want to save a SBOB another requester window opens after selecting GO. You design your BOB characteristics here. Note the button to the left of the gadget requesting the file name. Selecting this button will open the file requester window for you. NOTE: for SBOB files no check is currently being made on the size of picture being stored. Thus you can save a BOB that is too large to load in an AmigaBasic program. If you are a C programmer, you can read in a picture and then select SAVE_IMAGE and GO. Another requester window opens that allows you to save the picture as an image structure. Sure beats doing the calculations by hand. I may later add the code section that saves the data as a sprite data structure. Decoding: --------- Pictures can be extracted from other programs such as games using a little detective work. Open a SCREEN or SUPER and then select PICTURE, DECODE and GO. Another requester window will open but before this: The file first has to be examined through the CLI using the command TYPE "some file name" OPT H to determine where the picture data might be. If information can not be found you will have to guess at the screen and object size and the screen depth. After giving the file name including path name determine how many bytes in the file to skip and type this in and then select either HEXadecimal or DECimal. Specify in decimal the object width and height. The picture data could then be in the file as either ACBM or ILBM (compressed or non-compressed) format for an Amiga or in Atari format for an Atari ST. MAC pictures are stored as ILBM compressed using 1 bitplane. Through much trial and error pictures can be pulled out of files. NOTE: for Atari uncompressed pictures select Atari gadget but select IFF gadget for compressed pictures. Example: This can be applied to any IFF file TYPE WOODWITCH OPT H yields the following information from this IFF file. 0000: 464F524D 0000E07E 494C424D 424D4844 FORM...~ILBMBMHD 0010: 00000014 01400154 00000000 05020100 .....@.T........ 0020: 001A0A0B 014000C8 434D4150 00000060 .....@..CMAP...` 0030: 000000E0 C0A01010 10202020 404040A0 ......... @@@. 0040: A0207070 10402000 50302060 40308050 . pp.@ .P0 `@0.P 0050: 40B07060 C09080B0 8070A070 60906050 @.p`.....p.p`.`P 0060: 00B00000 90000070 00005000 302010F0 .......p..P.0 .. 0070: F0F0D0D0 D0B0B0B0 90909070 7070A0E0 ...........ppp.. 0080: F0D01010 B01010A0 10108010 10701010 .............p.. 0090: 44505056 00000068 00000000 0000FFF1 DPPV...h........ 00A0: 01680000 014000C8 0002005A 00020000 .h...@.....Z.... 00B0: 00020000 00020000 00000000 00000000 ................ 00C0: 00000000 00000000 00000000 00000000 ................ 00D0: 00140001 FFAC0001 00000000 0000F747 ...............G 00E0: 00004242 00000000 FFFFBDBE 0000F747 ..BB...........G 00F0: 00000000 00000000 00000000 00010002 ................ 0100: 43524E47 00000008 FFFF0019 00021012 CRNG............ 0110: 43524E47 00000008 00004E78 00040709 CRNG......Nx.... 0120: 43524E47 00000008 00FDAB4A FFFFFFF7 CRNG.......J.... 0130: 43524E47 00000008 FFFFFFF4 00000000 CRNG............ 0140: 424F4459 0000DF3E FCFF22F1 00080004 BODY...>.."..... 0150: 00100405 04020800 20261414 06938802 ........ &...... Unlike a game program file I know where to find information in this IFF file. The first column gives the location in the file in the Hexadecimal numbering system (no lessons are being given), then the next four columns list 4 bytes each of data for a total of 16 bytes, and finally the last large column lists the ASCII characters for each byte with a period being used for an unprintable ASCII character. Note the first byte in the file is numbered as 0 and not 1. In an IFF file the actual data for the picture or brush is located after the chunk name BODY. The first 4 bytes after the chunk name give the actual count of the data bytes to follow. Therefore the picture data starts $148 in (Hexadecimal) or 328 (decimal) bytes from the start of the record. In the requester for bytes to skip type either A4 or 164 and then select the gadget for the numbering system being used. Listed after the chunk name BMHD you will find the object width as $140 = 320 and the object height as $154 = 340. The pageWidth is given as $140 = 320 and the pageHeigeht as $C8 = 200. Select the CANCEL gadget to close down the requester and open a screen with a depth = 5, a width = 320 and a height = 200 or 400 depending on whether you want to see the full size of the picture or not. Enter in decimal the obect width as 320 and the height as either 200 or 340 depending on what height you made the screen. At this point you are not allowed to enter the width and height in Hexadecimal. The data for the picture is stored as Compressed ILBM data so select the gadget marked YES. If you select the OKAY gadget know the picture will load in but there is something wrong with the colors. It is necessary to load in the correct colormap. (If this test had been done with LEGENDS the colors would have been correct because the default colormap matchs up with LEGENDS.) Now select COLORMAP and DECODE and get a requester. The colormap is stored after the chunk name CMAP at $30 = 48. Data in IFF files needs three bytes to store the values for each color and in the RAM in the Amiga two bytes are used to store the values for each color. In the requester enter the file name WOODWITCH, the number of bytes to skip and either the HEX or DEC gadgets, and finally select the IFF gadget because the color values are stored in that format. Click the OKAY gadget and the colors in the picture will now be correct. Make Giant Icons: ----------------- So you want to impress somebody with your Amiga or give a presentation to your club but all you have are those tiny icons on the Workbench screen. Well now you can have the icons as large as the screen. Just go into your favorite paint program (remember the Workbench screen is only 640x200 or 640x400 with 4 colors) and design your icon. Your Giant Icon will have a main image and an alternate image to show when selected. Thus design two pictures or brushs of the same size (the alternate image will be chopped to the size of the main image). The select GIANT_ICON and GO and fill in the rquired information in the displayed requester window. Click OKAY and you shortly have a giant icon. Remember that the larger the icons are then more CHIP memory will be needed to display them. This program does not create Icon files (file names have the extender .info) but only changes the image data in an existing Icon file. If you need an Icon file just copy from an identical type ICON. If you needed a TOOL type icon the Clock program on the Workbench disk is of this type. The command to type would be COPY CLOCK.INFO NEWFILE.INFO CMAP Header Information: ------------------------ CMAP file structure is: Bytes Description ----- ----------- 4 File ID = CMAP 4 to 64 Two bytes used per color Depth = 1; colors = 2; bytes = 4 Depth = 2; colors = 4; bytes = 8 Depth = 3; colors = 8; bytes = 16 Depth = 4; colors = 16; bytes = 32 Depth = 5; colors = 32; bytes = 64 SPUT or SBOB Header Information: -------------------------------- File structure is: Bytes Description ----- ----------- 4 File ID = SPUT or SBOB 2 Width of object 2 Height of object 2 Width of screen 2 Height of screen 2 Depth of screen 4 to 64 Two bytes used per color Depth = 1; colors = 2; bytes = 4 Depth = 2; colors = 4; bytes = 8 Depth = 3; colors = 8; bytes = 16 Depth = 4; colors = 16; bytes = 32 Depth = 5; colors = 32; bytes = 64 4 Number of bytes to follow Variable PUT or BOB data bytes exactly as need by AmigaBasic THAT'S ALL ---------- If you are still with me that's persistence. Have fun with the program and keep that rodent working hard. (Editor's Note: This program keeps causing the GURU to make infrequent visits. This is very annoying.) ==================================================================== Jonathan P. Crone Vice President, AURA, (Amiga Users of Regina Associated.) (Regina, Sask. Canada ) (eh???) CRONEJP@UREGINA1.BITNET ....rutgers!mimsy!uunet!mcl!cronejp come on now.... does ANYONE give a damn about what i have to say? ====================================================================