home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 112.lha / multiview.doc < prev    next >
Text File  |  1986-11-20  |  19KB  |  365 lines

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