home *** CD-ROM | disk | FTP | other *** search
/ Fish 'n' More 1 / FishNMoreVol1.bin / more / graphics / viewers / multiviewv2.0 / multiview.doc2.0 < prev    next >
Text File  |  1990-05-15  |  18KB  |  351 lines

  1.                 MULTIVIEW - Version 2.0
  2.  
  3.                          by
  4.  
  5.                       Wayne Hogue
  6.  
  7.                         A.U.R.A.
  8.              (Amiga Users of Regina Association)
  9.  
  10.                      January 14, 1988
  11.  
  12. You are now here because after looking at that screenfull of pretty gadgets
  13. you became totally confused and that Mouse turned out to be an inept tour
  14.  guide. Well, throw that rodent a chunk of cheese and read on.
  15.  
  16.  
  17. WHAT THE PROGRAM DOES:
  18. ----------------------
  19.      1. Read Graphics Files in following forms
  20.           a) IFF - ILBM (InterLeaved Bit Map)
  21.                  - ACBM (Amiga Continuous Bit Map)
  22.              (Note: IFF = Interchange File Format)
  23.           b) Atari ST - DEGAS Elite
  24.                       - NEOchrome
  25.           c) Macintosh
  26.           d) SPUT - my special form for AmigaBasic PUT command
  27.           e) SBOB - my special form for AmigaBasic BOB's
  28.           f) DECODE - extract pictures buried in complicated files
  29.  
  30.      2. Write Graphics Images as
  31.           a) IFF - ILBM non-compressed format
  32.                  - ACBM
  33.           b) SPUT - with special header information
  34.                   - without special header information
  35.           c) SBOB - with special header information
  36.                   - without special header information
  37.           d) Image structure for 'C' programmers
  38.  
  39.      3. Create GIANT ICONS for the Workbench Screens
  40.         (Just the effect needed for your custom program that took you so long
  41.          to write.)
  42.  
  43.    THE PROGRAM:
  44.    ------------
  45.    The program can either be run from the CLI or by double clicking on its
  46.    icon. A window opens which can be reduced in size so that it can be 
  47.    placed any where you like on the screen. All parts of the program are
  48.    accessed through gadgets. Whenever you see a word totally capitalized
  49.    such as CLOSE this means I am referring to a gadget.
  50.  
  51.    To Quit:
  52.    --------
  53.    So, to begin let's start at the end. At the upper left corner of the window
  54.    is the CLOSEWINDOW gadget. Pressing this gadget brings up a requester
  55.    that gives you the choice of really quitting the program or continuing
  56.    with the program.
  57.  
  58.    Sizing the Window:
  59.    ------------------
  60.    Just below CLOSEWINDOW is the SIZEWINDOW gadget. Selecting this gadget
  61.    either shrinks or enlarges the winow. In its shrunk size you can drag
  62.    the window to any spot on the Workbench screen. When the window is
  63.    changed back to its original size it will position itself to the right
  64.    spot on the screen.
  65.  
  66.    Views and ViewPorts:
  67.    --------------------
  68.    Its now time to let the techies cringe with this simple description of how
  69.    you see things on the monitor. Below SIZEWINDOW are two gadgets for 
  70.    selecting the type of view to use. They are called SCREEN and SUPER. With
  71.    SCREEN you create a standard Amiga screen where the entire picture is
  72.    seen on the screen. Using SUPER you create a view that uses a super bitmap 
  73.    which can hold a picture that is larger than what you can see on the screen.
  74.    When SUPER is selected you must then decide how big to make the bitmap.
  75.    The bitmap can measure as much as 1024 pixels by 1024 lines. Use the
  76.    SUPERWIDTH and SUPERHEIGHT gadgets and type in them the size you want.
  77.    A maximum size bitmap at maximum depth is too large for 512K of CHIP
  78.    memory.
  79.  
  80.    After deciding on whether to use SCREEN  or SUPER, you must then decide
  81.    on how many colors to have in the picture. This is done by choosing the
  82.    Depth.
  83.           DEPTH    Colors
  84.           -----    ------
  85.             1         2
  86.             2         4
  87.             3         8
  88.             4        16
  89.             5        32
  90.             6       4096 
  91.    The more colors used mean more CHIP  memory is needed.
  92.  
  93.    Now use WIDTH (320 or 640) and HEIGHT (200 or 400) to determine the size
  94.    the picture will be on the monitor. (Note: To give you overscan just
  95.    means changing the gadgets). A superbit map should really be larger
  96.    than the screen size you choose here. If a depth of 5 or 6 is chosen for
  97.    a superbit and then you make the viewport 640 pixels wide then only
  98.    4 bit planes of data will be displayed.
  99.  
  100.    Selecting OPEN now creates the screen or super bitmap display. If you
  101.    now select DISPLAY only a blank screen will appear because no picture
  102.    has been loaded yet. To get back to the Workbench screen you can do a
  103.    Left_Amiga_N or for a SCREEN use the hidden BACK/FRONT gadgets at the
  104.    top right hand corner or for a SUPER view press the <return> or <enter>
  105.    keys. For some reason the <return> and <enter> keys do not work the first
  106.    time the SUPER view is displayed.
  107.  
  108.    The CLOSE gadget closes down the screen or super view. For a super view
  109.    if the bitmap is larger than 320x200 then you can resize the viewport
  110.    without loosing the picture already loaded. Just select the new WIDTH
  111.    and HEIGHT and then press RESIZE. 
  112.  
  113.    When displaying a super view you can scroll the picture around using
  114.    the keys on the numeric keypad. The keys mimic the action of a joystick.
  115.    Using the Up and Down arrow keys you can change the speed of the scroll.
  116.  
  117.    If a screen or super view is open then a picture will be read into
  118.    that size of view. If you want a picture to load into the size of screen
  119.    for which it was created then choose CLOSE before loading the picture.
  120.    Degas, Neo and Mac pictures will always close down any open view and 
  121.    load to the view size needed.
  122.  
  123.  
  124.    Reading and Saving:
  125.    -------------------
  126.    Over at the right top are PICTURE and COLORMAP. COLORMAP can only be
  127.    used if there is an open screen or super view. Gadgets READ, SAVE and
  128.    DECODE can be used with either PICTURE or COLORMAP.
  129.  
  130.    To read in a picture select PICTURE and READ. Now below these gadgets
  131.    is another bunch which determines what type of graphic file to read.
  132.    The choices are:
  133.      1. IFF file in ILBM format
  134.      2. IFF file in ACBM format
  135.      3. SPUT format with header information
  136.      4. SPUT format without header information
  137.      5. SBOB format with header information
  138.      6. SBOB format without header information
  139.      7. DEGAS format for an Atari ST
  140.      8. NEO format for an Atari ST
  141.      9. MAC format for a Macintosh
  142.  
  143.    (Note: for READ only, types 1,2,3,5 are interchangeable because the first
  144.           4 bytes identify the file type. No checking is done to see if
  145.           the type is really 4,6,7,8,9 so some interesting things can happen.)
  146.  
  147.    Last of all select GO. A file requester window will now open. You can select
  148.    the volume name and file name by just clicking with the mouse. Clicking once
  149.    on a file name will put the name in the FILE gadget. Clicking on a file name
  150.    that is already displayed is the same as using the gadget in the bottom left
  151.    hand corner of the requester window that says Read (or in other cases Save
  152.    or Pick). You can type the path and file names directly into the DRAWER and
  153.    FILE gadgets if you wish. Experiment to find out everything the file 
  154.    requester window will do for you. After choosing the file the graphic will
  155.    be read in and then displayed for you.
  156.  
  157.    Picture files are read in and displayed a little slower than other
  158.    display programs that have been released. This is because my program
  159.    is doing more checks while decoding the file data.
  160.  
  161.    Atari ST and Macintosh pictures were obtained by loading the files onto
  162.    a 5 1/4" disk on an Atari. The disk was then transferred to an Amiga
  163.    equipped with a 5 1/4" drive and transferred to 3 1/2" disk using
  164.    the program on the Extras disk. DEGAS and NEO picture files are very
  165.    similar and contain information in the first 2 bytes which tell
  166.    what screen resolution to use. The screen is opened according to these
  167.    first 2 bytes in the file and not by the extension on the file name
  168.    so you can call the files whatever you want to. Macintosh files are
  169.    not checked to see if they are indeed picture files. The right number
  170.    of bytes are skipped and the picture load continues (I had no information
  171.    on Mac file structure available) The DEGAS file format was available
  172.    and so I used this information to decode the files. For NEO pictures
  173.    I only had a couple of example files so the file structure was determined
  174.    through trial and error.  Atari pictures are loaded to a Screen and
  175.    Macintosh pictures are loaded to a View. A Macintosh picture always loads
  176.    to a super bitmap view because it is 576 pixels wide by 720 pixels high.
  177.  
  178.    To save a displayed picture select PICTURE, SAVE, file type 1 to 9 and then
  179.    select GO. Then choose the path and file name using the file requester.
  180.    You can not save pictures in DEGAS, NEO, or MAC format because I am not
  181.    interested in transferring pictures in that direction. When you want to
  182.    save a SBOB another requester window opens after selecting GO. You design
  183.    your BOB characteristics here. Note the button to the left of the gadget
  184.    requesting the file name. Selecting this button will open the file
  185.    requester window for you.
  186.    
  187.      NOTE: for SBOB files no check is currently being made on the size of
  188.            picture being stored. Thus you can save a BOB that is too large
  189.            to load in an AmigaBasic program.
  190.  
  191.    If you are a C programmer, you can read in a picture and then select
  192.    SAVE_IMAGE and GO. Another requester window opens that allows you
  193.    to save the picture as an image structure. Sure beats doing the calculations
  194.    by hand. I may later add the code section that saves the data as a
  195.    sprite data structure.
  196.  
  197.    Decoding:
  198.    ---------
  199.    Pictures can be extracted from other programs such as games using a little
  200.    detective work. Open a SCREEN or SUPER and then select PICTURE, DECODE and
  201.    GO. Another requester window will open but before this:
  202.  
  203.    The file first has to be examined through the CLI using the command
  204.    TYPE "some file name" OPT H
  205.    to determine where the picture data might be. If information can not
  206.    be found you will have to guess at the screen and object size and
  207.    the screen depth. After giving the file name including path name
  208.    determine how many bytes in the file to skip and type this in and then
  209.    select either HEXadecimal or DECimal. Specify in decimal the object
  210.    width and height. The picture data could then be in the file as either
  211.    ACBM or ILBM (compressed or non-compressed) format for an Amiga or in
  212.    Atari format for an Atari ST. MAC pictures are stored as ILBM compressed
  213.    using 1 bitplane. Through much trial and error pictures can be pulled
  214.    out of files. NOTE: for Atari uncompressed pictures select Atari gadget
  215.                        but select IFF gadget for compressed pictures.
  216.  
  217.    Example:  This can be applied to any IFF file
  218.              TYPE WOODWITCH OPT H
  219.              yields the following information from this IFF file.
  220.  
  221.              0000: 464F524D 0000E07E 494C424D 424D4844    FORM...~ILBMBMHD
  222.              0010: 00000014 01400154 00000000 05020100    .....@.T........
  223.              0020: 001A0A0B 014000C8 434D4150 00000060    .....@..CMAP...`
  224.              0030: 000000E0 C0A01010 10202020 404040A0    .........   @@@.
  225.              0040: A0207070 10402000 50302060 40308050    . pp.@ .P0 `@0.P
  226.              0050: 40B07060 C09080B0 8070A070 60906050    @.p`.....p.p`.`P
  227.              0060: 00B00000 90000070 00005000 302010F0    .......p..P.0 ..
  228.              0070: F0F0D0D0 D0B0B0B0 90909070 7070A0E0    ...........ppp..
  229.              0080: F0D01010 B01010A0 10108010 10701010    .............p..
  230.              0090: 44505056 00000068 00000000 0000FFF1    DPPV...h........
  231.              00A0: 01680000 014000C8 0002005A 00020000    .h...@.....Z....
  232.              00B0: 00020000 00020000 00000000 00000000    ................
  233.              00C0: 00000000 00000000 00000000 00000000    ................
  234.              00D0: 00140001 FFAC0001 00000000 0000F747    ...............G
  235.              00E0: 00004242 00000000 FFFFBDBE 0000F747    ..BB...........G
  236.              00F0: 00000000 00000000 00000000 00010002    ................
  237.              0100: 43524E47 00000008 FFFF0019 00021012    CRNG............
  238.              0110: 43524E47 00000008 00004E78 00040709    CRNG......Nx....
  239.              0120: 43524E47 00000008 00FDAB4A FFFFFFF7    CRNG.......J....
  240.              0130: 43524E47 00000008 FFFFFFF4 00000000    CRNG............
  241.              0140: 424F4459 0000DF3E FCFF22F1 00080004    BODY...>..".....
  242.              0150: 00100405 04020800 20261414 06938802    ........ &......
  243.  
  244.              Unlike a game program file I know where to find information in
  245.              this IFF file. The first column gives the location in the file
  246.              in the Hexadecimal numbering system (no lessons are being
  247.              given), then the next four columns list 4 bytes each of data
  248.              for a total of 16 bytes, and finally the last large column
  249.              lists the ASCII characters for each byte with a period being
  250.              used for an unprintable ASCII character. Note the first byte
  251.              in the file is numbered as 0 and not 1.
  252.              
  253.              In an IFF file the actual data for the picture or brush is
  254.              located after the chunk name BODY. The first 4 bytes after
  255.              the chunk name give the actual count of the data bytes to
  256.              follow. Therefore the picture data starts $148 in (Hexadecimal)
  257.              or 328 (decimal) bytes from the start of the record.
  258.              In the requester for bytes to skip type either A4 or 164 and
  259.              then select the gadget for the numbering system being used.
  260.              Listed after the chunk name BMHD you will find the object
  261.              width as $140 = 320 and the object height as $154 = 340.
  262.              The pageWidth is given as $140 = 320 and the pageHeigeht as
  263.              $C8 = 200. Select the CANCEL gadget to close down the requester
  264.              and open a screen with a depth = 5, a width = 320
  265.              and a height = 200 or 400 depending on whether you want to
  266.              see the full size of the picture or not. Enter in decimal the
  267.              obect width as 320 and the height as either 200 or 340 depending
  268.              on what height you made the screen. At this point you are not
  269.              allowed to enter the width and height in Hexadecimal. The data
  270.              for the picture is stored as Compressed ILBM data so select the
  271.              gadget marked YES. If you select the OKAY gadget know the picture
  272.              will load in but there is something wrong with the colors. It is
  273.              necessary to load in the correct colormap. (If this test had
  274.              been done with LEGENDS the colors would have been correct
  275.              because the default colormap matchs up with LEGENDS.)
  276.              Now select COLORMAP and DECODE  and get a requester.
  277.              The colormap is stored after the chunk name CMAP at $30 = 48.
  278.              Data in IFF files needs three bytes to store the values for
  279.              each color and in the RAM in the Amiga two bytes are used
  280.              to store the values for each color. In the requester enter
  281.              the file name WOODWITCH, the number of bytes to skip and
  282.              either the HEX or DEC gadgets, and finally select the IFF
  283.              gadget because the color values are stored in that format.
  284.              Click the OKAY gadget and the colors in the picture will
  285.              now be correct.
  286.  
  287.    Make Giant Icons:
  288.    -----------------
  289.    So you want to impress somebody with your Amiga or give a presentation
  290.    to your club but all you have are those tiny icons on the Workbench
  291.    screen. Well now you can have the icons as large as the screen. Just go
  292.    into your favorite paint program (remember the Workbench screen is only
  293.    640x200 or 640x400 with 4 colors) and design your icon. Your Giant Icon will
  294.    have a main image and an alternate image to show when selected. Thus
  295.    design two pictures or brushs of the same size (the alternate image will
  296.    be chopped to the size of the main image). The select GIANT_ICON and GO
  297.    and fill in the rquired information in the displayed requester window.
  298.    Click OKAY and you shortly have a giant icon. Remember that the larger
  299.    the icons are  then more CHIP memory will be needed to display them.
  300.  
  301.    This program does not create Icon files (file names have the extender
  302.    .info) but only changes the image data in an existing Icon file.
  303.    If you need an Icon file just copy from an identical type ICON.
  304.    If you needed a TOOL type icon the Clock program on the Workbench
  305.    disk is of this type. The command to type would be
  306.    COPY CLOCK.INFO NEWFILE.INFO
  307.  
  308.  
  309.    CMAP Header Information:
  310.    ------------------------
  311.    CMAP file structure is:
  312.            Bytes      Description
  313.            -----      -----------
  314.              4        File ID = CMAP
  315.            4 to 64    Two bytes used per color
  316.                       Depth = 1; colors =  2; bytes =  4
  317.                       Depth = 2; colors =  4; bytes =  8
  318.                       Depth = 3; colors =  8; bytes = 16
  319.                       Depth = 4; colors = 16; bytes = 32
  320.                       Depth = 5; colors = 32; bytes = 64
  321.                      
  322.  
  323.     SPUT or SBOB Header Information:
  324.     --------------------------------
  325.     File structure is:
  326.            Bytes      Description
  327.            -----      -----------
  328.              4        File ID = SPUT or SBOB
  329.              2        Width of object
  330.              2        Height of object
  331.              2        Width of screen
  332.              2        Height of screen
  333.              2        Depth of screen
  334.            4 to 64    Two bytes used per color
  335.                       Depth = 1; colors =  2; bytes =  4
  336.                       Depth = 2; colors =  4; bytes =  8
  337.                       Depth = 3; colors =  8; bytes = 16
  338.                       Depth = 4; colors = 16; bytes = 32
  339.                       Depth = 5; colors = 32; bytes = 64
  340.              4        Number of bytes to follow
  341.            Variable   PUT or BOB data bytes exactly as need by AmigaBasic
  342.  
  343.  
  344.     THAT'S ALL
  345.     ----------
  346.     If you are still with me that's persistence. Have fun with the program
  347.     and keep that rodent working hard.
  348.  
  349.     (Editor's Note: This program keeps causing the GURU to make infrequent
  350.                     visits. This is very annoying.)
  351.