home *** CD-ROM | disk | FTP | other *** search
/ Gold Fish 3 / goldfish_volume_3.bin / files / gfx / misc / imagefx_sdk / doc / scan.autodoc < prev   
Encoding:
Text File  |  1995-02-15  |  72.9 KB  |  2,998 lines

  1. TABLE OF CONTENTS
  2.  
  3. scan.library/AddBrush (2.0)
  4. scan.library/AddBuffer (2.0)
  5. scan.library/AllocBuffer
  6. scan.library/AllocChipBitMap
  7. scan.library/AllocFastBitMap
  8. scan.library/ArrangePanel
  9. scan.library/Bar
  10. scan.library/BClose
  11. scan.library/BeginBar
  12. scan.library/BFlush
  13. scan.library/BGetc
  14. scan.library/BGets
  15. scan.library/BOpen
  16. scan.library/BPutc
  17. scan.library/BPuts
  18. scan.library/BRead
  19. scan.library/BSeek
  20. scan.library/BWrite
  21. scan.library/CheckCloseness (1.6)
  22. scan.library/ClearBitMap
  23. scan.library/CloseWindowSafely
  24. scan.library/CreatePreview (2.0)
  25. scan.library/DeleteBitMap
  26. scan.library/DeletePreview (2.0)
  27. scan.library/DoPreviewWindowA (2.0)
  28. scan.library/DrawBoxOnPreview (2.0)
  29. scan.library/DrawLineOnPreview (2.0)
  30. scan.library/DrawOvalOnPreview (2.0)
  31. scan.library/DrawPreview (2.0)
  32. scan.library/EasyProcess
  33. scan.library/EndBar
  34. scan.library/Error
  35. scan.library/FreeBuffer
  36. scan.library/FreeSourceArea (1.6)
  37. scan.library/GetBufLine
  38. scan.library/GetBufLines
  39. scan.library/GetError
  40. scan.library/GetPreset (1.6)
  41. scan.library/GetPresetAspect (1.6)
  42. scan.library/GetPresetBoth (1.6)
  43. scan.library/GetSourceArea (1.6)
  44. scan.library/HidePanel
  45. scan.library/InitBuffer
  46. scan.library/IntegerRequest
  47. scan.library/IsAnimation
  48. scan.library/KillBuffer
  49. scan.library/MakePreview (2.0)
  50. scan.library/mixer
  51. scan.library/NewBrush (2.0)
  52. scan.library/NewGetFile
  53. scan.library/NewGetPreset (2.0)
  54. scan.library/NumberRequest
  55. scan.library/ObtainBuffer
  56. scan.library/ParseCommand
  57. scan.library/PutBufLine
  58. scan.library/PutBufLines
  59. scan.library/PutNewBufLine
  60. scan.library/ReadBuffer
  61. scan.library/RedrawArea
  62. scan.library/RedrawBrush (1.6)
  63. scan.library/RedrawCurrent (1.6)
  64. scan.library/RedrawFull
  65. scan.library/ReleaseBuffer
  66. scan.library/ReplaceBuffer
  67. scan.library/SaveBrush
  68. scan.library/SaveMapped
  69. scan.library/SaveUndo
  70. scan.library/SetError
  71. scan.library/ShowPanel
  72. scan.library/ShowStatus
  73. scan.library/StringRequest
  74. scan.library/TogglePanel
  75. scan.library/VBoolRequest
  76. scan.library/VErrorf
  77. scan.library/VInfoRequest
  78. scan.library/zzzzzz
  79.  
  80.  
  81.  
  82. scan.library/
  83.  
  84.     NAME
  85.  
  86.     SYNOPSIS
  87.  
  88.     FUNCTION
  89.  
  90.     INPUTS
  91.  
  92.     RESULT
  93.  
  94.     EXAMPLE
  95.  
  96.     NOTES
  97.  
  98.     BUGS
  99.  
  100.     SEE ALSO
  101.  
  102.  
  103. scan.library/AddBrush (2.0)
  104.  
  105.     NAME
  106.         AddBrush - Add a new brush into the multiple brush list.
  107.  
  108.     SYNOPSIS
  109.         success = AddBrush ( brush );
  110.         D0.L                 A0
  111.  
  112.         BOOL AddBrush ( struct Buffer * );
  113.  
  114.     FUNCTION
  115.         Allocate a new brush node and add it to the multiple brush
  116.         list.
  117.  
  118.     INPUTS
  119.         brush -- The brush to add.  It should be fully initialized.
  120.  
  121.     RESULT
  122.         success -- TRUE if the buffer was successfully added, or FALSE
  123.             if something went wrong (typically memory allocation failure
  124.             on the node structure).
  125.  
  126.     EXAMPLE
  127.  
  128.     NOTES
  129.         KillBuffer() automatically removes a multiple-buffer node.
  130.  
  131.     BUGS
  132.  
  133.     SEE ALSO
  134.         scan.library/AddBuffer,scan.library/KillBuffer
  135.  
  136.  
  137. scan.library/AddBuffer (2.0)
  138.  
  139.     NAME
  140.         AddBuffer - Add a new buffer into the multiple buffer list.
  141.  
  142.     SYNOPSIS
  143.         success = AddBuffer ( buffer );
  144.         D0.L                  A0
  145.  
  146.         BOOL AddBuffer ( struct Buffer * );
  147.  
  148.     FUNCTION
  149.         Allocate a new buffer node and add it to the multiple buffer
  150.         list.
  151.  
  152.     INPUTS
  153.         buffer -- The buffer to add.  It should be fully initialized.
  154.  
  155.     RESULT
  156.         success -- TRUE if the buffer was successfully added, or FALSE
  157.             if something went wrong (typically memory allocation failure
  158.             on the node structure).
  159.  
  160.     EXAMPLE
  161.  
  162.     NOTES
  163.         KillBuffer() automatically removes a multiple-buffer node.
  164.  
  165.     BUGS
  166.  
  167.     SEE ALSO
  168.         scan.library/AddBrush,scan.library/KillBuffer
  169.  
  170.  
  171. scan.library/AllocBuffer
  172.  
  173.     NAME
  174.         AllocBuffer - Allocate and initialize a Buffer structure.
  175.  
  176.     SYNOPSIS
  177.         buffer = AllocBuffer ( name, width, height, depth, bits, flags );
  178.         D0.L                   A0    D0.W   D1.W    D2.W   D3.W  D4.W
  179.  
  180.         struct Buffer *AllocBuffer ( char *, short, short, short,
  181.                                      short, short );
  182.  
  183.     FUNCTION
  184.         Allocate a Buffer structure, complete with image data planes.
  185.         Initializes the structure to suitable default values.
  186.  
  187.     INPUTS
  188.         name -- Name of buffer.  Currently ignored.  Use NULL.
  189.  
  190.         width -- Width of buffer in pixels.
  191.  
  192.         height -- Height of buffer in pixels.
  193.  
  194.         depth -- Depth of buffer in 8-bit planes, use 1 for a greyscale
  195.             buffer or 3 for a color buffer.
  196.  
  197.         bits -- Number of bits per plane.  Always use 8.
  198.  
  199.         flags -- Flag bits.  Set one or more of the following:
  200.  
  201.                     BUFF_DISK   - force buffer to be created on disk.
  202.                                   (use only if you know what you're doing.)
  203.                     BUFF_BRUSH  - buffer is really a brush.
  204.                                   (rarely, if ever, needed.)
  205.                     BUFF_NOVMEM - should not use virtual memory for the buffer.
  206.                                   (try to avoid this one.)
  207.  
  208.                   More often than not, you will simply want to use
  209.                   a flags value of 0.  If the buffer is too large to
  210.                   fit in memory, the user will be asked if he wants
  211.                   to use virtual memory, in which case the buffer will
  212.                   be created on disk anyway.
  213.  
  214.     RESULT
  215.         buffer --- Pointer to a properly filled-in Buffer structure,
  216.             with allocated image data space.  NULL on failure,
  217.             with a secondary result code set in the global
  218.             error.
  219.  
  220.     EXAMPLE
  221.  
  222.     NOTES
  223.         DO NOT ASSUME THE IMAGE DATA IS CLEARED!!
  224.  
  225.     BUGS
  226.  
  227.     SEE ALSO
  228.         scan.library/KillBuffer,scan/buf.h
  229.  
  230.  
  231. scan.library/AllocChipBitMap                     scan.library/AllocChipBitMap
  232.  
  233.     NAME
  234.         AllocChipBitMap -- Allocate a bitmap from chip memory.
  235.  
  236.     SYNOPSIS
  237.         bitmap = AllocChipBitMap ( width, height, depth );
  238.         D0.L                       D0.L   D1.L    D2.L
  239.  
  240.         struct BitMap *AllocChipBitMap ( int, int, int );
  241.  
  242.     FUNCTION
  243.         Allocate a BitMap structure and bitplanes from chip memory, suitable
  244.         for use on an Amiga display.  The bitplanes are cleared.
  245.  
  246.     INPUTS
  247.         width -- Width of the bitmap in pixels.
  248.  
  249.         height -- Height of the bitmap in pixels.
  250.  
  251.         depth -- Depth of bitmap in planes.
  252.  
  253.     RESULTS
  254.         bitmap -- Pointer to an initialized BitMap structure, ready for use.
  255.  
  256.     EXAMPLE
  257.  
  258.     NOTES
  259.         Uses the new graphics.library AllocBitMap() function under V39.
  260.  
  261.     BUGS
  262.  
  263.     SEE ALSO
  264.         scan.library/AllocFastBitMap,scan.library/DeleteBitMap
  265.  
  266.  
  267. scan.library/AllocFastBitMap                     scan.library/AllocFastBitMap
  268.  
  269.     NAME
  270.         AllocFastBitMap -- Allocate a bitmap from fast memory.
  271.  
  272.     SYNOPSIS
  273.         bitmap = AllocFastBitMap ( width, height, depth );
  274.         D0.L                       D0.L   D1.L    D2.L
  275.  
  276.         struct BitMap *AllocFastBitMap ( int, int, int );
  277.  
  278.     FUNCTION
  279.         Allocate a BitMap structure and bitplanes from fast memory.
  280.         The bitplanes are cleared.
  281.  
  282.     INPUTS
  283.         width -- Width of the bitmap in pixels.
  284.  
  285.         height -- Height of the bitmap in pixels.
  286.  
  287.         depth -- Depth of bitmap in planes.
  288.  
  289.     RESULTS
  290.         bitmap -- Pointer to an initialized BitMap structure, ready for use.
  291.  
  292.     EXAMPLE
  293.  
  294.     NOTES
  295.         Uses the new graphics.library AllocBitMap() function under V39.
  296.  
  297.     BUGS
  298.  
  299.     SEE ALSO
  300.         scan.library/AllocFastBitMap,scan.library/DeleteBitMap
  301.  
  302.  
  303. scan.library/ArrangePanel                           scan.library/ArrangePanel
  304.  
  305.     NAME
  306.         ArrangePanel -- Arrange the ImageFX screens properly.
  307.  
  308.     SYNOPSIS
  309.         ArrangePanel ()
  310.  
  311.         void ArrangePanel ( void );
  312.  
  313.     FUNCTION
  314.         Arrange all of the screens that ImageFX uses such that they are
  315.         displayed properly.  Normally one would call this function right after
  316.         opening a screen of your own, so that the menu and possibly the
  317.         palette screens are shown over the bottom properly.  You should always
  318.         call this function instead of doing it yourself, for various reasons.
  319.  
  320.         Note however, that under V39, any screens you open yourself will
  321.         always appear in front of all ImageFX screens, unless you take
  322.         steps to attach the new screen to the ImageFX screens, like this:
  323.  
  324.            YourScreen = OpenScreenTags(NULL,
  325.                                        SA_Parent, ScanBase->sb_vScreen,
  326.                                        ....
  327.                                        TAG_END);
  328.            ArrangePanel();
  329.  
  330.     INPUTS
  331.         None.
  332.  
  333.     RESULTS
  334.         None.
  335.  
  336.     EXAMPLE
  337.  
  338.     NOTES
  339.  
  340.     BUGS
  341.  
  342.     SEE ALSO
  343.  
  344.  
  345. scan.library/Bar
  346.  
  347.     NAME
  348.         Bar - Increment status bar display.
  349.  
  350.     SYNOPSIS
  351.         cancelled = Bar ( iteration );
  352.         D0.L              D0.L
  353.  
  354.         int Bar ( int );
  355.  
  356.     FUNCTION
  357.         Calculates the status bar scale to show the given iteration
  358.         count.
  359.  
  360.     INPUTS
  361.         iteration -- The current iteration of the operation.  For
  362.             example, while loading a file you would call
  363.             Bar() for each scanline and pass the line number.
  364.  
  365.     RESULT
  366.         cancelled -- If you specified that there should be a Cancel
  367.             gadget with the BeginBar() function, then if
  368.             the user clicks that Cancel you will get a
  369.             non-zero result from Bar().  Otherwise, a
  370.             zero result means to continue the operation.
  371.  
  372.     EXAMPLE
  373.         BeginBar ("Chugging", 57, TRUE);
  374.         for (i = 0; i < 57; i++) {
  375.             if (Bar(i)) {
  376.                 Errorf ("You dope, you cancelled me!");
  377.                 break;
  378.             }
  379.             /* perform some calculation here */
  380.         }
  381.         EndBar(NULL);
  382.  
  383.     NOTES
  384.  
  385.     BUGS
  386.  
  387.     SEE ALSO
  388.         scan.library/BeginBar,scan.library/EndBar
  389.  
  390.  
  391. scan.library/BClose                                       scan.library/BClose
  392.  
  393.     NAME
  394.         BClose -- Close a buffered file.
  395.  
  396.     SYNOPSIS
  397.         BClose ( handle );
  398.                  A0
  399.  
  400.         void BClose ( struct BIO * );
  401.  
  402.     FUNCTION
  403.         Closes a buffered file previously opened with BOpen.
  404.  
  405.     INPUTS
  406.         handle -- file handle as returned by BOpen.
  407.  
  408.     RESULTS
  409.         None.
  410.  
  411.     EXAMPLE
  412.  
  413.     NOTES
  414.  
  415.     BUGS
  416.  
  417.     SEE ALSO
  418.         scan.library/BOpen
  419.  
  420.  
  421. scan.library/BeginBar
  422.  
  423.     NAME
  424.         BeginBar - Start a status bar operation.
  425.  
  426.     SYNOPSIS
  427.         BeginBar ( title, maxvalue, abortable );
  428.                    A0     D0.L      D1.L
  429.  
  430.         void BeginBar (char *, int, BOOL)
  431.  
  432.     FUNCTION
  433.         Initializes the status bar in preparation for a long operation.
  434.         Also displays the busy pointer, and prevents the user from
  435.         selecting gadgets on the menu panel.  Note that you MUST call
  436.         EndBar() to get back to normal operations; if you exit without
  437.         calling EndBar(), the user will not be able to do anything as
  438.         all the gadget input will be locked.
  439.  
  440.     INPUTS
  441.         title -- The title to display for the operation.  This
  442.             should be kepts as short as possible (10 characters
  443.             or so), as there is not a lot of room to display this.
  444.  
  445.         maxvalue -- The total number of iterations expected in the
  446.             operation.  For example, if you were loading a
  447.             file you would place the expected number of rows here.
  448.  
  449.         abortable -- If TRUE, a Cancel gadget will be presented to
  450.             the user.  Otherwise, the operation is non-stoppable.
  451.  
  452.     RESULT
  453.         None.
  454.  
  455.     EXAMPLE
  456.         See scan.library/Bar.
  457.  
  458.     NOTES
  459.  
  460.     BUGS
  461.  
  462.     SEE ALSO
  463.         scan.library/Bar,scan.library/EndBar
  464.  
  465.  
  466. scan.library/BFlush                                       scan.library/BFlush
  467.  
  468.     NAME
  469.         BFlush -- Flush current buffer to disk.
  470.  
  471.     SYNOPSIS
  472.         BFlush ( handle );
  473.                  A0
  474.  
  475.         void BFlush ( struct BIO * );
  476.  
  477.     FUNCTION
  478.         For a MODE_NEWFILE buffered file, flush the contents of the buffer to
  479.         disk.  For a read file, this function does nothing.
  480.  
  481.     INPUTS
  482.         handle -- file handle as returned by BOpen.
  483.  
  484.     RESULTS
  485.         None.
  486.  
  487.     EXAMPLE
  488.  
  489.     NOTES
  490.  
  491.     BUGS
  492.  
  493.     SEE ALSO
  494.  
  495.  
  496. scan.library/BGetc                                         scan.library/BGetc
  497.  
  498.     NAME
  499.         BGetc -- Read a character from buffered file.
  500.  
  501.     SYNOPSIS
  502.         character = BGetc ( handle );
  503.         D0.L                A0
  504.  
  505.         int BGetc ( struct BIO * );
  506.  
  507.     FUNCTION
  508.         Read the next available character from the given buffered file.  The
  509.         file handle must have been opened by BOpen as MODE_OLDFILE.
  510.  
  511.     INPUTS
  512.         handle -- file handle as returned by BOpen.
  513.  
  514.     RESULTS
  515.         character -- character that was read, or -1 on failure (eg. disk
  516.             error).
  517.  
  518.     EXAMPLE
  519.  
  520.     NOTES
  521.  
  522.     BUGS
  523.  
  524.     SEE ALSO
  525.  
  526.  
  527. scan.library/BGets                                         scan.library/BGets
  528.  
  529.     NAME
  530.         BGets -- Read a string from a buffered file.
  531.  
  532.     SYNOPSIS
  533.         count = BGets ( handle, buffer, maxlength );
  534.         D0.L            A0      A1      D0.L
  535.  
  536.         int BGets ( struct BIO *, UBYTE *, int );
  537.  
  538.     FUNCTION
  539.         Read from the given buffered file until the next newline.  The newline
  540.         is NOT stripped.  The file handle must have been opened by BOpen as
  541.         MODE_OLDFILE.
  542.  
  543.     INPUTS
  544.         handle -- file handle as returned by BOpen.
  545.  
  546.         buffer -- buffer into which to read the characters.
  547.  
  548.         maxlength -- maximum number of characters to read.
  549.  
  550.     RESULTS
  551.         count -- number of characters actually read.
  552.  
  553.     EXAMPLE
  554.  
  555.     NOTES
  556.  
  557.     BUGS
  558.  
  559.     SEE ALSO
  560.  
  561.  
  562. scan.library/BOpen                                         scan.library/BOpen
  563.  
  564.     NAME
  565.         BOpen -- Open a file for buffered reading or writing.
  566.  
  567.     SYNOPSIS
  568.         handle = BOpen ( filename, accessmode, bufsize );
  569.         D0.L             A0        D0.L        D1.L
  570.  
  571.         struct BIO *BOpen ( char *, ULONG, ULONG );
  572.  
  573.     FUNCTION
  574.         Open a file for buffered access.
  575.  
  576.     INPUTS
  577.         filename -- name of file to open.
  578.  
  579.         accessmode -- MODE_OLDFILE for reading or MODE_NEWFILE for writing.
  580.  
  581.         bufsize -- size of buffer for reading or writing.  If 0, then a
  582.             default value will be used.
  583.  
  584.     RESULTS
  585.         handle -- handle for subsequent access.  Do not attempt to examine the
  586.             contents of this structure.
  587.  
  588.     EXAMPLE
  589.  
  590.     NOTES
  591.  
  592.     BUGS
  593.  
  594.     SEE ALSO
  595.         scan.library/BClose
  596.  
  597.  
  598. scan.library/BPutc                                         scan.library/BPutc
  599.  
  600.     NAME
  601.         BPutc -- Write a character to buffered file.
  602.  
  603.     SYNOPSIS
  604.         success = BPutc ( handle, character );
  605.         D0.L              A0      D0.B
  606.  
  607.     FUNCTION
  608.         Write a single (unsigned) character to the given buffered file.  The
  609.         file handle must have been opened by BOpen as MODE_NEWFILE.
  610.  
  611.     INPUTS
  612.         handle -- file handle as returned by BOpen.
  613.  
  614.         character -- byte to write to the file.
  615.  
  616.     RESULTS
  617.         success -- TRUE if the character was sucessfully written, or FALSE if
  618.             something went wrong (eg. disk error).
  619.  
  620.     EXAMPLE
  621.  
  622.     NOTES
  623.  
  624.     BUGS
  625.  
  626.     SEE ALSO
  627.  
  628.  
  629. scan.library/BPuts                                         scan.library/BPuts
  630.  
  631.     NAME
  632.         BPuts -- Write a string to a buffered file.
  633.  
  634.     SYNOPSIS
  635.         success = BPuts ( handle, string );
  636.         D0.L              A0      A1
  637.  
  638.         BOOL BPuts ( struct BIO *, UBYTE * );
  639.  
  640.     FUNCTION
  641.         Write a null-terminated string to the given buffered file.  The
  642.         file handle must have been opened by BOpen as MODE_NEWFILE.  A newline
  643.         will be appended to the string when written to the file.
  644.  
  645.     INPUTS
  646.         handle -- file handle as returned by BOpen.
  647.  
  648.         string -- null-terminated string to write to the file.  A newline will
  649.             be appended.
  650.  
  651.     RESULTS
  652.         success -- TRUE if the string was sucessfully written, or FALSE if
  653.             something went wrong (eg. disk error).
  654.  
  655.     EXAMPLE
  656.  
  657.     NOTES
  658.  
  659.     BUGS
  660.  
  661.     SEE ALSO
  662.  
  663.  
  664. scan.library/BRead                                         scan.library/BRead
  665.  
  666.     NAME
  667.         BRead -- Read a block of characters from a buffered file.
  668.  
  669.     SYNOPSIS
  670.         count = BRead ( handle, buffer, length );
  671.         D0.L            A0      A1      D0.L
  672.  
  673.         int BRead ( struct BIO *, UBYTE *, int );
  674.  
  675.     FUNCTION
  676.         Read a fixed number of characters from a buffered file.  The
  677.         file handle must have been opened by BOpen as MODE_OLDFILE.
  678.  
  679.     INPUTS
  680.         handle -- file handle as returned by BOpen.
  681.  
  682.         buffer -- pointer to where to store read characters.
  683.  
  684.         length -- number of characters to read.
  685.  
  686.     RESULTS
  687.         count -- number of characters actually read from the file, or -1 on
  688.             failure (eg. disk error).
  689.  
  690.     EXAMPLE
  691.  
  692.     NOTES
  693.  
  694.     BUGS
  695.  
  696.     SEE ALSO
  697.  
  698.  
  699. scan.library/BSeek                                         scan.library/BSeek
  700.  
  701.     NAME
  702.         BSeek -- Seek to a file position within a buffered file.
  703.  
  704.     SYNOPSIS
  705.         oldposition = BSeek ( handle, offset, from );
  706.         D0.L                  A0      D0.L    D1.L
  707.  
  708.         int BSeek ( struct BIO *, int, int );
  709.  
  710.     FUNCTION
  711.         Seek to a specific file position in a way compatible with buffered
  712.         files.
  713.  
  714.     INPUTS
  715.         handle -- file handle as returned by BOpen.
  716.  
  717.         offset -- new file position.
  718.  
  719.         from -- where to seek from, OFFSET_BEGINNING, OFFSET_CURRENT, or
  720.             OFFSET_END.
  721.  
  722.     RESULTS
  723.         oldposition -- previous file position.
  724.  
  725.     EXAMPLE
  726.  
  727.     NOTES
  728.  
  729.     BUGS
  730.  
  731.     SEE ALSO
  732.  
  733.  
  734. scan.library/BWrite                                       scan.library/BWrite
  735.  
  736.     NAME
  737.         BWrite -- Write a block of characters to a buffered file.
  738.  
  739.     SYNOPSIS
  740.         count = BWrite ( handle, buffer, length );
  741.         D0.L             A0      A1      D0.L
  742.  
  743.         int BWrite ( struct BIO *, UBYTE *, int );
  744.  
  745.     FUNCTION
  746.         Write a fixed number of characters to a buffered file.  The
  747.         file handle must have been opened by BOpen as MODE_NEWFILE.
  748.  
  749.     INPUTS
  750.         handle -- file handle as returned by BOpen.
  751.  
  752.         buffer -- pointer to characters to write.
  753.  
  754.         length -- number of characters to write.
  755.  
  756.     RESULTS
  757.         count -- number of characters actually written to the file, or -1 on
  758.             failure (eg. disk error).
  759.  
  760.     EXAMPLE
  761.  
  762.     NOTES
  763.  
  764.     BUGS
  765.  
  766.     SEE ALSO
  767.  
  768.  
  769. scan.library/CheckCloseness                       scan.library/CheckCloseness
  770.  
  771.     NAME
  772.         CheckCloseness -- Check RGB color to see if it's "close" (1.6)
  773.  
  774.     SYNOPSIS
  775.  
  776.     FUNCTION
  777.  
  778.     INPUTS
  779.  
  780.     RESULTS
  781.  
  782.     EXAMPLE
  783.  
  784.     NOTES
  785.  
  786.     BUGS
  787.  
  788.     SEE ALSO
  789.  
  790.  
  791. scan.library/ClearBitMap                             scan.library/ClearBitMap
  792.  
  793.     NAME
  794.         ClearBitMap -- Clear the contents of a BitMap.
  795.  
  796.     SYNOPSIS
  797.         ClearBitMap ( bitmap );
  798.                       A0
  799.  
  800.         void ClearBitMap ( struct BitMap * );
  801.  
  802.     FUNCTION
  803.         Clears the bitplane memory of the given bitmap.  The bitplanes may be
  804.         in chip memory or fast memory.
  805.  
  806.     INPUTS
  807.         bitmap -- pointer to a BitMap structure.
  808.  
  809.     RESULTS
  810.         None.
  811.  
  812.     EXAMPLE
  813.  
  814.     NOTES
  815.  
  816.     BUGS
  817.  
  818.     SEE ALSO
  819.  
  820.  
  821. scan.library/CloseWindowSafely                 scan.library/CloseWindowSafely
  822.  
  823.     NAME
  824.         CloseWindowSafely -- Safely close a shared IDCMP window.
  825.  
  826.     SYNOPSIS
  827.         CloseWindowSafely ( window );
  828.                             A0
  829.  
  830.         void CloseWindowSafely ( struct Window *window );
  831.  
  832.     FUNCTION
  833.         If you open a window that share's ImageFX main IDCMP, you should
  834.         use this function to close the window or else risk fireworks.
  835.  
  836.     INPUTS
  837.         window -- pointer to Window to close.
  838.  
  839.     RESULTS
  840.         None.
  841.  
  842.     EXAMPLE
  843.  
  844.     NOTES
  845.  
  846.     BUGS
  847.  
  848.     SEE ALSO
  849.  
  850.  
  851. scan.library/CreatePreview                         scan.library/CreatePreview
  852.  
  853.     NAME
  854.         CreatePreview -- Create a preview thumbnail context.  (2.0)
  855.  
  856.     SYNOPSIS
  857.         previnfo = CreatePreview ( buffer, width, height, flags )
  858.         D0.L                       A0      D0.L   D1.L    D2.L
  859.  
  860.         struct PrevInfo *CreatePreview ( struct Buffer *buffer,
  861.                                          int width, int height,
  862.                                          ULONG flags )
  863.  
  864.     FUNCTION
  865.         Create a preview thumbnail context.  Given a source Buffer
  866.         structure, a small thumbnail representation of that buffer
  867.         (the original or "before" buffer) is rendered.  A palette
  868.         is built based on the original buffer.  The thumbnail size
  869.         is set by the 'width' and 'height' arguments.
  870.  
  871.     INPUTS
  872.         buffer -- Buffer struct from which to build the "before"
  873.             thumbnail image.
  874.  
  875.         width -- Pixel width for thumbnail image.
  876.  
  877.         height -- Pixel height for thumbnail image.
  878.  
  879.         flags -- Various flags:
  880.  
  881.                 PIF_NORENDER
  882.                     Suppresses rendering the thumbnail image
  883.                     (ie. it just makes a scaled down 24-bit
  884.                     version of the original buffer, but doesn't
  885.                     quantize it to the menu screen colors.)
  886.  
  887.     RESULTS
  888.         previnfo -- PrevInfo structure used in subsequent
  889.             thumbnail function calls.  Contains context information
  890.             such as rendered thumbnails, computed palette, etc.
  891.             The information within should definitely be considered
  892.             read only.
  893.  
  894.     EXAMPLE
  895.  
  896.     NOTES
  897.  
  898.     BUGS
  899.  
  900.     SEE ALSO
  901.  
  902.  
  903. scan.library/DeleteBitMap                           scan.library/DeleteBitMap
  904.  
  905.     NAME
  906.         DeleteBitMap -- Deallocate a bitmap structure.
  907.  
  908.     SYNOPSIS
  909.         DeleteBitMap ( bitmap );
  910.                        A0
  911.  
  912.         void DeleteBitMap ( struct BitMap * );
  913.  
  914.     FUNCTION
  915.         Frees the bitplane memory and BitMap structure of the given bitmap.
  916.         Dimensions of the bitmap are obtained from the BitMap structure
  917.         itself.  Only use this function on BitMaps obtained with the
  918.         AllocChipBitMap() or AllocFastBitMap() functions.
  919.  
  920.     INPUTS
  921.         bitmap -- pointer to BitMap to free.
  922.  
  923.     RESULTS
  924.         None.
  925.  
  926.     EXAMPLE
  927.  
  928.     NOTES
  929.         Uses the new graphics.library FreeBitMap() function under V39.
  930.  
  931.     BUGS
  932.  
  933.     SEE ALSO
  934.  
  935.  
  936. scan.library/DeletePreview                         scan.library/DeletePreview
  937.  
  938.     NAME
  939.         DeletePreview -- Delete a preview thumbnail context.  (2.0)
  940.  
  941.     SYNOPSIS
  942.         VOID DeletePreview ( previnfo )
  943.                              A0
  944.  
  945.         VOID DeletePreview ( struct PrevInfo *previnfo )
  946.  
  947.     FUNCTION
  948.         Frees all memory associated with a preview thumbnail context.
  949.  
  950.     INPUTS
  951.         previnfo -- PrevInfo structure from CreatePreview.
  952.  
  953.     RESULTS
  954.         None.
  955.  
  956.     EXAMPLE
  957.  
  958.     NOTES
  959.         It is safe to pass a NULL pointer to this function.
  960.  
  961.     BUGS
  962.  
  963.     SEE ALSO
  964.  
  965.  
  966. scan.library/DoPreviewWindowA                   scan.library/DoPreviewWindowA
  967.  
  968.     NAME
  969.         DoPreviewWindowA -- open and handle a thumbnail-style window. (2.0)
  970.         DoPreviewWindow
  971.  
  972.     SYNOPSIS
  973.         returncode = DoPreviewWindowA ( taglist )
  974.         D0.L                            A0
  975.  
  976.         int DoPreviewWindowA ( LONG *taglist )
  977.  
  978.         int DoPreviewWindow ( LONG tag1, ... )
  979.  
  980.     FUNCTION
  981.         Opens a window similar to GedWin(), but automatically places
  982.         preview thumbnail images in the window.
  983.  
  984.         The function builds the window structure, the borders, and
  985.         provides the Okay & Cancel gadget (and optionally others).
  986.         You need only provide the "inside" gadgets.
  987.  
  988.         The function also takes care of the "Preview" button, although
  989.         you must provide a function to be called to actually do
  990.         something to a thumbnail buffer.
  991.  
  992.     INPUTS
  993.         taglist -- tags (see <scan/previnfo.h>)
  994.  
  995.     RESULTS
  996.         Returns a code just like GedWin() does.
  997.  
  998.     EXAMPLE
  999.  
  1000.         struct NewGad newgads[] = {
  1001.             { HSlider_ID, ID_slider, /* ... */ }
  1002.             { End_ID }
  1003.         };
  1004.  
  1005.         int __saveds doMyEffect (struct Buffer *buf)
  1006.         {
  1007.             /* perform weird effect on 'buf' */
  1008.             return(1);      /* or 0 on failure */
  1009.         }
  1010.  
  1011.         BOOL MyCoolEffect (struct Buffer *buf)
  1012.         {
  1013.             int retcode;
  1014.  
  1015.             retcode = DoPreviewWindow(  DPW_NewGads, newgads,
  1016.                                         DPW_OkayGadget, "_Okay",
  1017.                                         DPW_CancelGadget, "_Cancel",
  1018.                                         DPW_MainBuf, buf,
  1019.                                         DPW_Affect, doMyEffect,
  1020.                                         0
  1021.                                      );
  1022.  
  1023.             if (retcode == ID_PCancel) return(FALSE);
  1024.  
  1025.             if (!doMyEffect(buf)) return(FALSE);
  1026.  
  1027.             return(TRUE);
  1028.         }
  1029.  
  1030.     NOTES
  1031.         You must link with scan.lib to get the vararg DoPreviewWindow().
  1032.  
  1033.         For future compatibility, I would recommend against putting gadgets
  1034.         underneath of the "Preview" gadget.  Ie. don't assume that the
  1035.         preview areas will always be the same size.
  1036.  
  1037.     BUGS
  1038.  
  1039.     SEE ALSO
  1040.         scan.library/GedWin
  1041.  
  1042.  
  1043. scan.library/DrawBoxOnPreview                   scan.library/DrawBoxOnPreview
  1044.  
  1045.     NAME
  1046.         DrawBoxOnPreview -- Draw an inverse box on the preview screen.  (2.0)
  1047.  
  1048.     SYNOPSIS
  1049.         DrawBoxOnPreview ( left, top, right, bottom );
  1050.                            D0.L  D1.L D2.L   D3.L
  1051.  
  1052.         void DrawBoxOnPreview ( int left, int top, int right, int bottom );
  1053.  
  1054.     FUNCTION
  1055.         Draw an inverse video (complement) box on the preview screen.
  1056.         This is preferable to using graphics.library functions because
  1057.         this function is guaranteed to work on any type of preview.
  1058.  
  1059.     INPUTS
  1060.         left, top, right, bottom -- position at which to draw the box,
  1061.             in BUFFER coordinates.  These coordinates are translated
  1062.             into screen coordinates based on the current scaling
  1063.             factor.
  1064.  
  1065.     RESULTS
  1066.         None.
  1067.  
  1068.     EXAMPLE
  1069.  
  1070.     NOTES
  1071.         Clipping is performed.
  1072.  
  1073.     BUGS
  1074.  
  1075.     SEE ALSO
  1076.  
  1077.  
  1078. scan.library/DrawLineOnPreview                 scan.library/DrawLineOnPreview
  1079.  
  1080.     NAME
  1081.         DrawLineOnPreview -- Draw an inverse line on the preview screen.  (2.0)
  1082.  
  1083.     SYNOPSIS
  1084.         DrawLineOnPreview ( startx, starty, endx, endy );
  1085.                             D0.L    D1.L    D2.L  D3.L
  1086.  
  1087.         void DrawLineOnPreview ( int startx, int starty,
  1088.                                  int endx, int endy );
  1089.  
  1090.     FUNCTION
  1091.         Draw an inverse video (complement) line on the preview screen.
  1092.         This is preferable to using graphics.library functions because
  1093.         this function is guaranteed to work on any type of preview.
  1094.  
  1095.     INPUTS
  1096.         startx, starty -- starting pixel position of the line,
  1097.             in BUFFER coordinates.  These coordinates are translated
  1098.             into screen coordinates based on the current scaling
  1099.             factor.
  1100.  
  1101.         endx, endy -- ending pixel position of the line.
  1102.  
  1103.     RESULTS
  1104.         None.
  1105.  
  1106.     EXAMPLE
  1107.  
  1108.     NOTES
  1109.         Clipping is performed.
  1110.  
  1111.     BUGS
  1112.  
  1113.     SEE ALSO
  1114.  
  1115.  
  1116. scan.library/DrawOvalOnPreview                 scan.library/DrawOvalOnPreview
  1117.  
  1118.     NAME
  1119.         DrawOvalOnPreview -- Draw an inverse oval on the preview screen.  (2.0)
  1120.  
  1121.     SYNOPSIS
  1122.         DrawOvalOnPreview ( centerx, centery, radiusx, radiusy );
  1123.                             D0.L     D1.L     D2.L     D3.L
  1124.  
  1125.         void DrawOvalOnPreview ( int centerx, int centery,
  1126.                                  int radiusx, int radiusy );
  1127.  
  1128.     FUNCTION
  1129.         Draw an inverse video (complement) oval on the preview screen.
  1130.         This is preferable to using graphics.library functions because
  1131.         this function is guaranteed to work on any type of preview.
  1132.  
  1133.     INPUTS
  1134.         centerx, centery -- center pixel position of the oval,
  1135.             in BUFFER coordinates.  These coordinates are translated
  1136.             into screen coordinates based on the current scaling
  1137.             factor.
  1138.  
  1139.         radiusx, radiusy -- horizontal and vertical pixel radius of
  1140.             oval, in buffer coordinates.
  1141.  
  1142.     RESULTS
  1143.  
  1144.     EXAMPLE
  1145.  
  1146.     NOTES
  1147.         Clipping is performed.
  1148.  
  1149.     BUGS
  1150.  
  1151.     SEE ALSO
  1152.  
  1153.  
  1154. scan.library/DrawPreview                             scan.library/DrawPreview
  1155.  
  1156.     NAME
  1157.         DrawPreview -- Draw original preview thumbnail image.  (2.0)
  1158.  
  1159.     SYNOPSIS
  1160.         success = DrawPreview ( previnfo, rastport, left, top )
  1161.         D0.L                    A0        A1        D0.L  D1.L
  1162.  
  1163.         BOOL DrawPreview ( struct PrevInfo *previnfo,
  1164.                            struct RastPort *rastport,
  1165.                            int left, int top )
  1166.  
  1167.     FUNCTION
  1168.         Draw the thumbnail representation of the original ("before")
  1169.         buffer into the supplied RastPort at the supplied location.
  1170.  
  1171.     INPUTS
  1172.         previnfo -- PrevInfo structure obtained from CreatePreview.
  1173.  
  1174.         rastport -- RastPort into which to render.
  1175.  
  1176.         left, top -- Position at which to render.
  1177.  
  1178.     RESULTS
  1179.         success -- TRUE if successful or FALSE on failure.
  1180.  
  1181.     EXAMPLE
  1182.  
  1183.     NOTES
  1184.         This function currently cannot fail.
  1185.  
  1186.     BUGS
  1187.  
  1188.     SEE ALSO
  1189.  
  1190.  
  1191. scan.library/EasyProcess                             scan.library/EasyProcess
  1192.  
  1193.     NAME
  1194.         EasyProcess -- Perform a simple 1:1 effect on an ImageFX buffer.
  1195.  
  1196.     SYNOPSIS
  1197.         success = EasyProcess ( title, color_callback, grey_callback );
  1198.         D0.L                    A0     A1              A2
  1199.  
  1200.         BOOL EasyProcess ( char *, void (*color_callback)(),
  1201.                             void (*grey_callback)() );
  1202.  
  1203.     FUNCTION
  1204.         Perform a simple affect on the user's currently selected region (main
  1205.         buffer, brush, or region thereof).  Regional information, feathering,
  1206.         and other factors will affect the operation.  You should try to use
  1207.         this function if possible, as it does a great deal of work for you.
  1208.  
  1209.     INPUTS
  1210.         title -- title to place in status bar while in progress.
  1211.  
  1212.         color_callback -- callback function which actually modifies color
  1213.             pixels.  It's prototype is:
  1214.  
  1215.                 void color_callback (UBYTE *redptr, UBYTE *grnptr,
  1216.                                      UBYTE *bluptr, short x, short y);
  1217.  
  1218.             Where:
  1219.                 redptr -- pointer to current red pixel to be modified.
  1220.                 grnptr -- pointer to current green pixel to be modified.
  1221.                 bluptr -- pointer to current blue pixel to be modified.
  1222.                 x -- current horizontal pixel location.
  1223.                 y -- current vertical pixel location.
  1224.  
  1225.         grey_callback -- callback function which actually modifies grey
  1226.             pixels.  It's prototype is:
  1227.  
  1228.                 void grey_callback (UBYTE *greyptr, short x, short y);
  1229.  
  1230.             Where:
  1231.                 greyptr -- pointer to current grey pixel to be modified.
  1232.                 x -- current horizontal pixel location.
  1233.                 y -- current vertical pixel location.
  1234.  
  1235.             Arguments are passed on the stack.  You must make sure to restore
  1236.             A4 in your callback functions if you are using small data model!
  1237.  
  1238.             EasyProcess() will decide whether to use the color or greyscale
  1239.             callback function, based on the image it is working on.
  1240.  
  1241.     RESULTS
  1242.         success -- TRUE if the process was successful, FALSE on failure.
  1243.  
  1244.     EXAMPLE
  1245.         /* A simple color negative effect */
  1246.  
  1247.         void __saveds colorback (UBYTE *r, UBYTE *g, UBYTE *b,
  1248.                                  short x, short y)
  1249.         {
  1250.             *r = 255 - *r;
  1251.             *g = 255 - *g;
  1252.             *b = 255 - *b;
  1253.         }
  1254.  
  1255.         void __saveds greyback (UBYTE *g, short x, short y)
  1256.         {
  1257.             *g = 255 - *g;
  1258.         }
  1259.  
  1260.         void DoEffect (void)
  1261.         {
  1262.             EasyProcess("Negative", colorback, greyback);
  1263.         }
  1264.  
  1265.     NOTES
  1266.         This should not be used to do geometric or translational effects on a
  1267.         buffer (ie. where pixel positions are moved).  This is only good for
  1268.         doing simple color effects.
  1269.  
  1270.     BUGS
  1271.  
  1272.     SEE ALSO
  1273.  
  1274.  
  1275. scan.library/EndBar
  1276.  
  1277.     NAME
  1278.         EndBar - End a status bar operation.
  1279.  
  1280.     SYNOPSIS
  1281.         EndBar ( dummy );
  1282.  
  1283.         void EndBar (void *);
  1284.  
  1285.     FUNCTION
  1286.         This cleans up and ends a status bar operation.  It clears
  1287.         the busy pointer and allows the user to select gadgets in the
  1288.         menu panel again.
  1289.  
  1290.     INPUTS
  1291.         None, really.  There used to be an argument, but it has been
  1292.         removed.  You should pass NULL as the argument.
  1293.  
  1294.     RESULT
  1295.         None.
  1296.  
  1297.     EXAMPLE
  1298.         See scan.library/Bar.
  1299.  
  1300.     NOTES
  1301.  
  1302.     BUGS
  1303.         None known.
  1304.  
  1305.     SEE ALSO
  1306.         scan.library/BeginBar,scan.library/Bar
  1307.  
  1308.  
  1309. scan.library/Error
  1310.  
  1311.     NAME
  1312.         Error - Show error message for last generated error.
  1313.  
  1314.     SYNOPSIS
  1315.         Error ();
  1316.  
  1317.         void Error ( void );
  1318.  
  1319.     FUNCTION
  1320.         Will display a requester to the user showing the text for
  1321.         the last error generated.  This function does not return
  1322.         until the user clicks Okay.
  1323.  
  1324.     INPUTS
  1325.         None.
  1326.  
  1327.     RESULT
  1328.         None.
  1329.  
  1330.     EXAMPLE
  1331.  
  1332.         buffer = AllocBuffer (NULL, 320, 200, 1, 8, 0);
  1333.         if (buffer == NULL) {   /* can't get buffer? */
  1334.             Error();            /* tell what happend */
  1335.             return;
  1336.         }
  1337.  
  1338.     NOTES
  1339.  
  1340.     BUGS
  1341.  
  1342.     SEE ALSO
  1343.         scan.library/Errorf,scan.library/SetError
  1344.  
  1345.  
  1346. scan.library/FreeBuffer                               scan.library/FreeBuffer
  1347.  
  1348.     NAME
  1349.         FreeBuffer -- Free ImageFX's main buffer.
  1350.  
  1351.     SYNOPSIS
  1352.         FreeBuffer ();
  1353.  
  1354.         void FreeBuffer ( void );
  1355.  
  1356.     FUNCTION
  1357.         Frees the current main buffer, by calling KillBuffer().
  1358.  
  1359.     INPUTS
  1360.         None.
  1361.  
  1362.     RESULTS
  1363.         None.
  1364.  
  1365.     EXAMPLE
  1366.  
  1367.     NOTES
  1368.  
  1369.     BUGS
  1370.  
  1371.     SEE ALSO
  1372.  
  1373.  
  1374. scan.library/FreeSourceArea                       scan.library/FreeSourceArea
  1375.  
  1376.     NAME
  1377.         FreeSourceArea -- Free source region after processing (1.6)
  1378.  
  1379.     SYNOPSIS
  1380.  
  1381.     FUNCTION
  1382.  
  1383.     INPUTS
  1384.  
  1385.     RESULTS
  1386.  
  1387.     EXAMPLE
  1388.  
  1389.     NOTES
  1390.  
  1391.     BUGS
  1392.  
  1393.     SEE ALSO
  1394.         scan.library/GetSourceArea
  1395.  
  1396.  
  1397. scan.library/GetBufLine
  1398.  
  1399.     NAME
  1400.         GetBufLine - Get pointer(s) to a Buffer scanline.
  1401.  
  1402.     SYNOPSIS
  1403.         success = GetBufLine ( buffer, redptr, grnptr, bluptr, row );
  1404.         D0.L                   A0      A1      A2      A3      D0.W
  1405.  
  1406.         int GetBufLine ( struct Buffer *, UBYTE **, UBYTE **, UBYTE **,
  1407.                          short );
  1408.  
  1409.     FUNCTION
  1410.         Fills in the supplied pointers with pointers to the image data
  1411.         for a Buffer.  You should ONLY reference a buffer by using
  1412.         this function, as there is more work than meets the eye for
  1413.         a buffer maintained on disk.
  1414.  
  1415.     INPUTS
  1416.         buffer -- Pointer to a Buffer obtained via. ObtainBuffer().
  1417.  
  1418.         redptr -- Where to store Red scanline pointer.
  1419.  
  1420.         grnptr -- Where to store Green scanline pointer.
  1421.  
  1422.         bluptr -- Where to store Blue scanline pointer.
  1423.  
  1424.         row -- Which scanline to retreive, starting from 0 at the
  1425.             topmost scanline.
  1426.  
  1427.     RESULT
  1428.         success -- Non-zero if the command was successful.  It can
  1429.             only fail if the buffer is maintained on disk and
  1430.             enough memory cannot be allocated to read the
  1431.             scanline.  A rare occurance, but one worth checking for.
  1432.  
  1433.     EXAMPLE
  1434.  
  1435.     NOTES
  1436.         For a greyscale buffer, "grnptr" and "bluptr" are set
  1437.         to point to the same data as "redptr".
  1438.  
  1439.         PAY ATTENTION TO THE RETURN VALUE!!  Failing to gracefully
  1440.         handle a GetBufLine failure can cause serious problems.
  1441.  
  1442.     BUGS
  1443.  
  1444.     SEE ALSO
  1445.         scan.library/PutBufLine,scan.library/PutNewBufLine
  1446.  
  1447.  
  1448. scan.library/GetBufLines                             scan.library/GetBufLines
  1449.  
  1450.     NAME
  1451.         GetBufLines -- Get multiple buffer scanlines at once.
  1452.  
  1453.     SYNOPSIS
  1454.         success = GetBufLines ( buffer, rptr, gptr, bptr, top, rows );
  1455.         D0.L                    A0      A1    A2    A3    D0.L D1.L
  1456.  
  1457.         int GetBufLines ( struct Buffer *buffer,
  1458.                           UBYTE **rptr, UBYTE **gptr, UBYTE **bptr,
  1459.                           short top, short rows );
  1460.  
  1461.     FUNCTION
  1462.         Fills in the supplied pointers with pointers to a "chunk" of an
  1463.         image, consisting of more than one scanline.  This is handy for
  1464.         convolution-style operations.  You should try to use this
  1465.         whenever possible when you need two or more adjacent scanlines,
  1466.         as it is somewhat faster than multiple GetBufLine()'s.
  1467.  
  1468.     INPUTS
  1469.         buffer -- Pointer to a Buffer obtained via. ObtainBuffer().
  1470.  
  1471.         redptr -- Where to store Red scanline pointer.
  1472.  
  1473.         grnptr -- Where to store Green scanline pointer.
  1474.  
  1475.         bluptr -- Where to store Blue scanline pointer.
  1476.  
  1477.         top -- Topmost scanline to retreive, starting from 0 at the
  1478.             topmost scanline.
  1479.  
  1480.         rows -- Number of scanlines to retreive.
  1481.  
  1482.     RESULTS
  1483.         success -- non-zero if successful, or zero on failure.
  1484.  
  1485.     EXAMPLE
  1486.  
  1487.     NOTES
  1488.         It *is* possible to, for example, grab a topedge of -1 and a
  1489.         row count of 3 (ie. go out of bounds of the image), but the
  1490.         image data outside the area of the image will be undefined.
  1491.  
  1492.     BUGS
  1493.  
  1494.     SEE ALSO
  1495.  
  1496.  
  1497. scan.library/GetError                                   scan.library/GetError
  1498.  
  1499.     NAME
  1500.         GetError -- Retreive secondary error code.
  1501.  
  1502.     SYNOPSIS
  1503.         error = GetError ();
  1504.         D0.L
  1505.  
  1506.         ULONG GetError ( void );
  1507.  
  1508.     FUNCTION
  1509.         Returns the current secondary error code, as set by a previous call to
  1510.         SetError().
  1511.  
  1512.     INPUTS
  1513.         None.
  1514.  
  1515.     RESULTS
  1516.         error -- current error code.  See "scan/errors.h".
  1517.  
  1518.     EXAMPLE
  1519.  
  1520.     NOTES
  1521.  
  1522.     BUGS
  1523.  
  1524.     SEE ALSO
  1525.  
  1526.  
  1527. scan.library/GetPreset                                 scan.library/GetPreset
  1528.  
  1529.     NAME
  1530.         GetPreset -- Ask user to select a preset resolution (1.6)
  1531.  
  1532.     SYNOPSIS
  1533.         success = GetPreset ( &width, &height );
  1534.         D0.L                  A0      A1
  1535.  
  1536.         BOOL GetPreset ( short *width, short *height );
  1537.  
  1538.     FUNCTION
  1539.         Display the Preset Resolution window and allow the user
  1540.         to select a choice.  Returns when the user clicks Okay
  1541.         or Cancel.
  1542.  
  1543.     INPUTS
  1544.         width,height -- where to store the resulting width and
  1545.             height the user selected.
  1546.  
  1547.     RESULTS
  1548.         success -- TRUE if user selected a resolution, FALSE
  1549.             on failure or cancel.
  1550.  
  1551.     EXAMPLE
  1552.  
  1553.     NOTES
  1554.  
  1555.     BUGS
  1556.  
  1557.     SEE ALSO
  1558.  
  1559.  
  1560. scan.library/GetPresetAspect                     scan.library/GetPresetAspect
  1561.  
  1562.     NAME
  1563.         GetPresetAspect -- Ask user to pick a preset aspect ratio (1.6)
  1564.  
  1565.     SYNOPSIS
  1566.         success = GetPresetAspect ( &aspectx, &aspecty );
  1567.         D0.L                        A0        A1
  1568.  
  1569.         BOOL GetPreset ( short *aspectx, short *aspecty );
  1570.  
  1571.     FUNCTION
  1572.         Display the Preset Resolution window and allow the user
  1573.         to select an aspect ratio.  Returns when the user clicks Okay
  1574.         or Cancel.
  1575.  
  1576.     INPUTS
  1577.         aspectx,aspecty -- where to store the resulting aspect ratio
  1578.             the user selected.
  1579.  
  1580.     RESULTS
  1581.         success -- TRUE if user selected a resolution, FALSE
  1582.             on failure or cancel.
  1583.  
  1584.     EXAMPLE
  1585.  
  1586.     NOTES
  1587.  
  1588.     BUGS
  1589.  
  1590.     SEE ALSO
  1591.  
  1592.  
  1593. scan.library/GetPresetBoth                         scan.library/GetPresetBoth
  1594.  
  1595.     NAME
  1596.         GetPresetBoth -- Ask user to pick preset size/aspect (1.6)
  1597.  
  1598.     SYNOPSIS
  1599.         success = GetPresetBoth ( &width, &height, &aspectx, &aspecty );
  1600.         D0.L                      A0      A1       A2        A3
  1601.  
  1602.         BOOL GetPresetBoth ( short *width, short *height,
  1603.                              short *aspectx, short *aspecty );
  1604.  
  1605.     FUNCTION
  1606.         Display the Preset Resolution window and allow the user
  1607.         to select a resolution and aspect ratio.  Returns when the
  1608.         user clicks Okay or Cancel.
  1609.  
  1610.     INPUTS
  1611.         width,height -- where to store the resulting width and
  1612.             height the user selected.
  1613.         aspectx,aspecty -- where to store the aspect ratio of
  1614.             the size the user selected.
  1615.  
  1616.     RESULTS
  1617.         success -- TRUE if user selected a resolution, FALSE
  1618.             on failure or cancel.
  1619.  
  1620.     EXAMPLE
  1621.  
  1622.     NOTES
  1623.  
  1624.     BUGS
  1625.  
  1626.     SEE ALSO
  1627.  
  1628.  
  1629. scan.library/GetSourceArea                         scan.library/GetSourceArea
  1630.  
  1631.     NAME
  1632.         GetSourceArea -- Get current region for processing (1.6)
  1633.  
  1634.     SYNOPSIS
  1635.  
  1636.     FUNCTION
  1637.  
  1638.     INPUTS
  1639.  
  1640.     RESULTS
  1641.  
  1642.     EXAMPLE
  1643.  
  1644.     NOTES
  1645.  
  1646.     BUGS
  1647.  
  1648.     SEE ALSO
  1649.         scan.library/FreeSourceArea
  1650.  
  1651.  
  1652. scan.library/HidePanel                                 scan.library/HidePanel
  1653.  
  1654.     NAME
  1655.         HidePanel -- Push the menu screen to the back.
  1656.  
  1657.     SYNOPSIS
  1658.         HidePanel ()
  1659.  
  1660.         void HidePanel (void);
  1661.  
  1662.     FUNCTION
  1663.         Pushes the menu screen ("panel") to the back, if it is not already
  1664.         hidden.
  1665.  
  1666.     INPUTS
  1667.         None.
  1668.  
  1669.     RESULTS
  1670.         None.
  1671.  
  1672.     EXAMPLE
  1673.  
  1674.     NOTES
  1675.  
  1676.     BUGS
  1677.  
  1678.     SEE ALSO
  1679.         scan.library/ShowPanel,scan.library/TogglePanel
  1680.  
  1681.  
  1682. scan.library/InitBuffer                               scan.library/InitBuffer
  1683.  
  1684.     NAME
  1685.         InitBuffer -- Create ImageFX main buffer.
  1686.  
  1687.     SYNOPSIS
  1688.         InitBuffer ( name, width, height, depth, bits, flags );
  1689.                      A0    D0.W   D1.W    D2.W   D3.W  D4.W
  1690.  
  1691.         void InitBuffer ( char *, short, short, short, short, short );
  1692.  
  1693.     FUNCTION
  1694.         Creates a main image buffer, deleting the old one first if it exists.
  1695.         This function is otherwise identical to AllocBuffer().
  1696.  
  1697.     INPUTS
  1698.         See AllocBuffer().
  1699.  
  1700.     RESULTS
  1701.         None.
  1702.  
  1703.     EXAMPLE
  1704.  
  1705.     NOTES
  1706.         You can tell whether the call was succesful or not by checking the
  1707.         result of GetError(), or by doing an ObtainBuffer(0).
  1708.  
  1709.         DO NOT ASSUME THE IMAGE DATA IS CLEARED!!
  1710.  
  1711.     BUGS
  1712.  
  1713.     SEE ALSO
  1714.  
  1715.  
  1716. scan.library/IntegerRequest                       scan.library/IntegerRequest
  1717.  
  1718.     NAME
  1719.         IntegerRequest -- Present a slider gadget requester to the user.
  1720.  
  1721.     SYNOPSIS
  1722.         result = IntegerRequest ( title, low, high, initial );
  1723.         D0.L                      A0     D0.L D1.L  D2.L
  1724.  
  1725.         LONG IntegerRequest ( char *, LONG, LONG, LONG );
  1726.  
  1727.     FUNCTION
  1728.         Display a requester containing a slider gadget to the user.  The user
  1729.         must select a value or cancel before this function will return.
  1730.  
  1731.     INPUTS
  1732.         title -- Title of the requester.
  1733.  
  1734.         low -- Lowest value that can be selected with the slider.
  1735.  
  1736.         high -- Highest value that can be selected with the slider.
  1737.  
  1738.         initial -- Initial value of the slider.
  1739.  
  1740.     RESULTS
  1741.         result -- value selected by the user.  If the value is less than the
  1742.             lowest possible value, then the user cancelled the requester.
  1743.  
  1744.     EXAMPLE
  1745.         value = IntegerRequest("Pick a number:", -10, 10, 0);
  1746.         if (value < -10) Errorf("Hey, you can't cancel me!");
  1747.  
  1748.     NOTES
  1749.  
  1750.     BUGS
  1751.  
  1752.     SEE ALSO
  1753.  
  1754.  
  1755. scan.library/IsAnimation                             scan.library/IsAnimation
  1756.  
  1757.     NAME
  1758.         IsAnimation -- Determine if a file is an animation (1.50).
  1759.  
  1760.     SYNOPSIS
  1761.         result = IsAnimation ( filename, format );
  1762.         D0.L                   A0        A1
  1763.  
  1764.         int IsAnimation ( char *filename, char *format );
  1765.  
  1766.     FUNCTION
  1767.         Determine if an image file is an animation (has multiple frames)
  1768.         or not.  First finds out the type of file, then returns whether
  1769.         that type of file is capable of multiple frames.
  1770.  
  1771.     INPUTS
  1772.         filename -- name of file to check.
  1773.  
  1774.         format -- NULL to make ImageFX determine the file format,
  1775.             or the name of a file format to force it to check
  1776.             that format.
  1777.  
  1778.     RESULTS
  1779.         result -- non-zero if the file is an animation, zero if it
  1780.             is not.
  1781.  
  1782.     EXAMPLE
  1783.  
  1784.     NOTES
  1785.  
  1786.     BUGS
  1787.  
  1788.     SEE ALSO
  1789.  
  1790.  
  1791. scan.library/KillBuffer
  1792.  
  1793.     NAME
  1794.         KillBuffer - Deallocate a Buffer structure.
  1795.  
  1796.     SYNOPSIS
  1797.         KillBuffer ( buffer );
  1798.                      A0
  1799.  
  1800.         void KillBuffer ( struct Buffer * );
  1801.  
  1802.     FUNCTION
  1803.         Deallocates all the memory used in a Buffer structure,
  1804.         including image data memory, structure memory, and anything
  1805.         in between.  The buffer no longer exists when this function
  1806.         returns.
  1807.  
  1808.     INPUTS
  1809.         buffer -- Pointer to a Buffer structure.
  1810.  
  1811.     RESULT
  1812.         None.
  1813.  
  1814.     EXAMPLE
  1815.  
  1816.     NOTES
  1817.  
  1818.     BUGS
  1819.  
  1820.     SEE ALSO
  1821.         scan.library/AllocBuffer,scan/buf.h
  1822.  
  1823.  
  1824. scan.library/MakePreview                             scan.library/MakePreview
  1825.  
  1826.     NAME
  1827.         MakePreview -- Generate a preview thumbnail image.  (2.0)
  1828.  
  1829.     SYNOPSIS
  1830.         success = MakePreview ( previnfo, buffer, rastport, left, top )
  1831.         D0.L                    A0        A2      A1        D0.L  D1.L
  1832.  
  1833.         BOOL MakePreview ( struct PrevInfo *pi, struct Buffer *buffer,
  1834.                            struct RastPort *rp, int left, int top)
  1835.  
  1836.     FUNCTION
  1837.         Renders a preview thumbnail image of the supplied Buffer into
  1838.         a supplied RastPort using the palette information contained in
  1839.         the supplied PrevInfo structure.  Generally used for "Preview"
  1840.         buttons.
  1841.  
  1842.     INPUTS
  1843.         pi -- PrevInfo structure obtained from CreatePreview.  Contains
  1844.             the palette information used in the rendering process, and
  1845.             the size at which to generate the thumbnail.
  1846.  
  1847.         buffer -- Buffer struct from which to render thumbnail image.
  1848.  
  1849.         rp -- RastPort into which to render the image.
  1850.  
  1851.         left, top -- Position at which to render the image.
  1852.  
  1853.     RESULTS
  1854.         success -- TRUE if successful or FALSE on failure (eg. out of
  1855.             memory).
  1856.  
  1857.     EXAMPLE
  1858.  
  1859.     NOTES
  1860.  
  1861.     BUGS
  1862.  
  1863.     SEE ALSO
  1864.  
  1865.  
  1866. scan.library/mixer                                         scan.library/mixer
  1867.  
  1868.     NAME
  1869.         mixer -- Mix two color values.
  1870.  
  1871.     SYNOPSIS
  1872.         result = mixer ( oldvalue, newvalue, blend );
  1873.         D0.W             D0.W      D1.W      D2.W
  1874.  
  1875.         short mixer ( short oldvalue, short newvalue, short blend );
  1876.  
  1877.     FUNCTION
  1878.         Mix two color values using a blend percentage.
  1879.  
  1880.     INPUTS
  1881.         oldvalue -- original value (0-255).
  1882.  
  1883.         newvalue -- new value to blend into the old value (0-255).
  1884.  
  1885.         blend -- blend value (0-255) ; higher blend values blend
  1886.             more of the new value into the old value.
  1887.  
  1888.     RESULTS
  1889.         result -- resulting value (0-255).
  1890.  
  1891.     EXAMPLE
  1892.  
  1893.     NOTES
  1894.         This function is handy for alpha channel blending style
  1895.         operations.
  1896.  
  1897.     BUGS
  1898.         None known.
  1899.  
  1900.     SEE ALSO
  1901.  
  1902.  
  1903. scan.library/NewBrush                                   scan.library/NewBrush
  1904.  
  1905.     NAME
  1906.         NewBrush -- Install a buffer as the current brush.  (2.0)
  1907.  
  1908.     SYNOPSIS
  1909.         NewBrush ( newbrush );
  1910.                    A0
  1911.  
  1912.         void NewBrush ( struct Buffer *newbrush );
  1913.  
  1914.     FUNCTION
  1915.         Replace any existing brush with the brush buffer supplied.  This
  1916.         function performs all of the necessary display refresh to make
  1917.         the new brush visible.  The previous brush will be deleted.
  1918.  
  1919.     INPUTS
  1920.         newbrush -- pointer to a properly filled-in Buffer structure
  1921.             that will become the new brush.
  1922.  
  1923.     RESULTS
  1924.         None.
  1925.  
  1926.     EXAMPLE
  1927.  
  1928.     NOTES
  1929.  
  1930.     BUGS
  1931.  
  1932.     SEE ALSO
  1933.  
  1934.  
  1935. scan.library/NewGetFile                               scan.library/NewGetFile
  1936.  
  1937.     NAME
  1938.         NewGetFile -- Open a file requester.
  1939.  
  1940.     SYNOPSIS
  1941.         file = NewGetFile ( fileinfo, title, flags );
  1942.         D0.L                A0        A1     D0.L
  1943.  
  1944.         char *NewGetFile ( struct FileInfo *, char *, ULONG );
  1945.  
  1946.     FUNCTION
  1947.         Present a file requester from which the user may select a file or
  1948.         directory.  Uses the user's preferred file requester (as set in
  1949.         Prefs).
  1950.  
  1951.     INPUTS
  1952.         fileinfo -- pointer to a FileInfo structure, describing how to open
  1953.             the file requester.  You should fill in the following fields (do
  1954.             not touch any others):
  1955.  
  1956.                 Dir:
  1957.                     Directory where file requester should open.
  1958.  
  1959.                 File:
  1960.                     Default filename.
  1961.  
  1962.                 Pattern:
  1963.                     Filename pattern.
  1964.  
  1965.                 Screen:
  1966.                     Pointer to a custom screen on which to open.
  1967.  
  1968.         title -- title of the file requester.
  1969.  
  1970.         flags -- various flags for the file requester.
  1971.  
  1972.                 FI_SAVE:
  1973.                     Set when this requester is a save action.
  1974.  
  1975.                 FI_DIRONLY:
  1976.                     Only allow selection of a directory.
  1977.  
  1978.                 FI_SCREEN:
  1979.                     Force requester to open on the screen specified by
  1980.                     FileInfo.Screen.
  1981.  
  1982.     RESULTS
  1983.         file -- complete path to filename chosen by the user if successful, or
  1984.             FALSE on failure.  The FileInfo structure will also be updated to
  1985.             reflect the user's selection.
  1986.  
  1987.     EXAMPLE
  1988.  
  1989.     NOTES
  1990.  
  1991.     BUGS
  1992.  
  1993.     SEE ALSO
  1994.  
  1995.  
  1996. scan.library/NewGetPreset (2.0)               scan.library/NewGetPreset (2.0)
  1997.  
  1998.     NAME
  1999.         NewGetPreset (2.0) -- Ask user for a preset resolution/aspect/dpi.
  2000.  
  2001.     SYNOPSIS
  2002.         success = NewGetPreset ( preset, title, flags );
  2003.         D0.L                     A0      A1     D0.L
  2004.  
  2005.         BOOL NewGetPreset ( struct Preset *, char *, ULONG );
  2006.  
  2007.     FUNCTION
  2008.         Present a requester to the user asking for a preset resolution.
  2009.  
  2010.     INPUTS
  2011.         preset -- where to store the resulting preset info selected.
  2012.  
  2013.         title -- title of the requester.
  2014.  
  2015.         flags -- flag bits:
  2016.  
  2017.                         PRESET_SIZE:        Show preset sizes.
  2018.                         PRESET_ASPECT:      Show preset aspect ratios.
  2019.                         PRESET_DPI:         Show preset DPI sizes.
  2020.  
  2021.     RESULTS
  2022.         success -- TRUE if requester was successful, FALSE on failure (eg.
  2023.             the user cancelled the requester).
  2024.  
  2025.     EXAMPLE
  2026.         {
  2027.             struct Preset pre;
  2028.             int width, height;
  2029.  
  2030.             if (success = NewGetPreset(&pre, "Select A Size:", PRESET_SIZE))
  2031.             {
  2032.                 width = pre.Width;
  2033.                 height = pre.Height;
  2034.             }
  2035.         }
  2036.  
  2037.     NOTES
  2038.         This function replaces GetPreset(), GetPresetAspect(), and
  2039.         GetPresetBoth().
  2040.  
  2041.     BUGS
  2042.  
  2043.     SEE ALSO
  2044.         <scan/presets.h>
  2045.  
  2046.  
  2047. scan.library/NumberRequest                         scan.library/NumberRequest
  2048.  
  2049.     NAME
  2050.         NumberRequest -- Present an integer gadget requester to the user.
  2051.  
  2052.     SYNOPSIS
  2053.         result = NumberRequest ( title, low, high, initial );
  2054.         D0.L                     A0     D0.L D1.L  D2.L
  2055.  
  2056.         LONG NumberRequest ( char *, LONG, LONG, LONG );
  2057.  
  2058.     FUNCTION
  2059.         Display a requester containing a numeric integer gadget to the user.
  2060.         The user must enter a value or cancel before this function will
  2061.         return.
  2062.  
  2063.     INPUTS
  2064.         title -- Title of the requester.
  2065.  
  2066.         low -- Lowest value that can be selected with the slider (THIS IS
  2067.             CURRENTLY IGNORED except to determine cancelled values).
  2068.  
  2069.         high -- Highest value that can be selected with the slider (THIS IS
  2070.             CURRENTLY IGNORED).
  2071.  
  2072.         initial -- Initial value of the slider.
  2073.  
  2074.     RESULTS
  2075.         result -- value selected by the user.  If the value is less than the
  2076.             lowest possible value, then the user cancelled the requester.
  2077.  
  2078.     EXAMPLE
  2079.         value = NumberRequest("Pick a number:", -10, 10, 0);
  2080.         if (value < -10) Errorf("Hey, you can't cancel me!");
  2081.  
  2082.     NOTES
  2083.  
  2084.     BUGS
  2085.  
  2086.     SEE ALSO
  2087.  
  2088.  
  2089. scan.library/ObtainBuffer
  2090.  
  2091.     NAME
  2092.         ObtainBuffer - Get a pointer to an image Buffer.
  2093.  
  2094.     SYNOPSIS
  2095.         buffer = ObtainBuffer ( which );
  2096.         D0.L                    D0.L
  2097.  
  2098.         struct Buffer *ObtainBuffer ( int );
  2099.  
  2100.     FUNCTION
  2101.         Returns a pointer to one of the image buffers in use
  2102.         within ImageFX.  You should ALWAYS use this function to get
  2103.         at these buffers, as there is special initialization when the
  2104.         buffer is actually maintained on disk.
  2105.  
  2106.     INPUTS
  2107.         which -- Which buffer to get:
  2108.  
  2109.                     0 = Main buffer
  2110.                     1 = Swap buffer
  2111.                     2 = Alpha channel
  2112.                     3 = Undo buffer
  2113.                     4 = Brush buffer
  2114.  
  2115.     RESULT
  2116.         buffer -- A pointer to the Buffer or NULL if it could not
  2117.             be obtained for some reason.  A typical reason for
  2118.             failure is that the given buffer does not exist.
  2119.  
  2120.     EXAMPLE
  2121.  
  2122.     NOTES
  2123.         You don't get a copy of the buffer, you get the actual pointer
  2124.         to the actual buffer, so be careful which fields you play with.
  2125.         A lot of the fields in the Buffer structure are for internal
  2126.         use only.
  2127.  
  2128.         Currently, two tasks can ObtainBuffer() the same buffer and
  2129.         be successful.  This may change in the future.  For now, try
  2130.         not to nest your ObtainBuffer()/ReleaseBuffer() calls.
  2131.  
  2132.         Remember to ReleaseBuffer() the buffer when you are done.
  2133.  
  2134.     BUGS
  2135.         None known.
  2136.  
  2137.     SEE ALSO
  2138.         scan.library/ReleaseBuffer,scan/buf.h
  2139.  
  2140.  
  2141. scan.library/ParseCommand                           scan.library/ParseCommand
  2142.  
  2143.     NAME
  2144.         ParseCommand -- Parse an ImageFX command string.
  2145.  
  2146.     SYNOPSIS
  2147.         result = ParseCommand ( commandstring, message );
  2148.         D0.L                    A0             A1
  2149.  
  2150.         int ParseCommand ( char *, struct RexxMsg * );
  2151.  
  2152.     FUNCTION
  2153.         Passes a string of commands to ImageFX for it to execute.  This
  2154.         function does not return until the commands are completed (or
  2155.         aborted).  The string may contain more than one command if each is
  2156.         separated by a semi-colon (;).
  2157.  
  2158.     INPUTS
  2159.         commandstring -- pointer to string of commands to execute.
  2160.  
  2161.         message -- invoking Arexx message, used to set result codes.  You
  2162.             should pass NULL.
  2163.  
  2164.     RESULTS
  2165.         result -- result code from the commands, 0 for success or non-zero on
  2166.             failure.
  2167.  
  2168.     EXAMPLE
  2169.         ParseCommand("Negative; Swap; Color2Grey Luma", NULL);
  2170.  
  2171.     NOTES
  2172.         See the ImageFX manual chapter on Arexx commands for details of the
  2173.         commands that ImageFX understands.
  2174.  
  2175.     BUGS
  2176.  
  2177.     SEE ALSO
  2178.  
  2179.  
  2180. scan.library/PutBufLine
  2181.  
  2182.     NAME
  2183.         PutBufLine - Restore last scanline read to a Buffer.
  2184.  
  2185.     SYNOPSIS
  2186.         success = PutBufLine ( buffer );
  2187.         D0.L                   A0
  2188.  
  2189.         int PutBufLine ( struct Buffer *buffer );
  2190.  
  2191.     FUNCTION
  2192.         Restores to the given buffer the last scanline read with the
  2193.         GetBufLine() function.  This function must be called if any
  2194.         changes are made to the scanline.  You *MUST* call GetBufLine()
  2195.         before calling this function.
  2196.  
  2197.     INPUTS
  2198.         buffer -- Pointer to a Buffer structure as returned by ObtainBuffer().
  2199.  
  2200.     RESULT
  2201.         success -- Non-zero if successful.
  2202.  
  2203.     EXAMPLE
  2204.         buffer = ObtainBuffer(0);
  2205.         if (buffer) {
  2206.             for (row = 0; row < buffer->Height; row++) {
  2207.                 GetBufLine (buffer, &red, &grn, &blu, row);
  2208.                 /* make some changes to the data */
  2209.                 PutBufLine (buffer);
  2210.             }
  2211.             ReleaseBuffer (buffer);
  2212.         }
  2213.  
  2214.     NOTES
  2215.         Not calling this function after making changes to a scanline will
  2216.         only become apparent when working on disk buffers.
  2217.  
  2218.         PAY ATTENTION TO THE RETURN VALUE!!  Failing to gracefully
  2219.         handle a PutBufLine failure can cause serious problems.
  2220.  
  2221.     BUGS
  2222.  
  2223.     SEE ALSO
  2224.         scan.library/GetBufLine
  2225.  
  2226.  
  2227. scan.library/PutBufLines                             scan.library/PutBufLines
  2228.  
  2229.     NAME
  2230.         PutBufLines -- Restore multiple scanlines to a buffer.
  2231.  
  2232.     SYNOPSIS
  2233.         success = PutBufLines ( buffer, topedge, rows );
  2234.         D0.L                    A0      D0.L     D1.L
  2235.  
  2236.         int PutBufLines ( struct Buffer *buffer, short topedge, short rows );
  2237.  
  2238.     FUNCTION
  2239.         Restore the last batch of scanlines retreived with GetBufLines().
  2240.         The scanline data may be replaced anywhere in the image, but it
  2241.         is generally a good idea to put it back where it came from.
  2242.  
  2243.     INPUTS
  2244.         buffer -- buffer to replace data into (must be the same as where it
  2245.             came from).
  2246.  
  2247.         topedge -- topedge location of where to restore the data (-1 means
  2248.             restore it where it came from).
  2249.  
  2250.         rows -- number of rows of data to restore (-1 means restore the
  2251.             same amount that was gotten).
  2252.  
  2253.     RESULTS
  2254.         success -- non-zero if successful, zero on failure.
  2255.  
  2256.     EXAMPLE
  2257.  
  2258.     NOTES
  2259.  
  2260.     BUGS
  2261.  
  2262.     SEE ALSO
  2263.         scan.library/GetBufLines
  2264.  
  2265.  
  2266. scan.library/PutNewBufLine
  2267.  
  2268.     NAME
  2269.         PutNewBufLine - Store new image data into a buffer scanline.
  2270.  
  2271.     SYNOPSIS
  2272.         success = PutNewBufLine ( buffer, reddata, grndata, bludata, row );
  2273.         D0.L                      A0      A1       A2       A3       D0.W
  2274.  
  2275.         int PutNewBufLine ( struct Buffer *, UBYTE *, UBYTE *, UBYTE *,
  2276.                             short );
  2277.  
  2278.     FUNCTION
  2279.         Stores image data into a buffer at any arbitrary scanline.
  2280.         You do NOT need to call GetBufLine() beforehand.  The image
  2281.         data is copied, so you don't need to hold onto the data.
  2282.  
  2283.     INPUTS
  2284.         buffer -- Buffer structure as returned by ObtainBuffer().
  2285.  
  2286.         reddata -- Pointer to Red image data.
  2287.  
  2288.         grndata -- Pointer to Green image data.
  2289.  
  2290.         bludata -- Pointer to Blue image data.
  2291.  
  2292.         row -- Scanline to store the data, starting from 0.
  2293.  
  2294.     RESULT
  2295.         success -- Non-zero if successful.
  2296.  
  2297.     EXAMPLE
  2298.         buffer = ObtainBuffer(0);
  2299.         if (buffer) {
  2300.             for (row = 0; row < buffer->Height; row += 4) {
  2301.                 /* build a scanline of data */
  2302.                 PutNewBufLine (buffer, red, grn, blu, row);
  2303.             }
  2304.             ReleaseBuffer (buffer);
  2305.         }
  2306.  
  2307.     NOTES
  2308.         This function can only fail if the buffer is maintained on disk
  2309.         and memory could not be obtained to swap the relavant page into
  2310.         memory.
  2311.  
  2312.         When storing to a greyscale buffer, the Red pointer should point
  2313.         to the greyscale data.  The other two pointers are ignored.
  2314.  
  2315.         PAY ATTENTION TO THE RETURN VALUE!!  Failing to gracefully
  2316.         handle a PutNewBufLine failure can cause serious problems.
  2317.  
  2318.     BUGS
  2319.  
  2320.     SEE ALSO
  2321.         scan.library/GetBufLine,scan.library/PutBufLine
  2322.  
  2323.  
  2324. scan.library/ReadBuffer                               scan.library/ReadBuffer
  2325.  
  2326.     NAME
  2327.         ReadBuffer -- Attempt to read an image file from disk.
  2328.  
  2329.     SYNOPSIS
  2330.         buffer = ReadBuffer ( filename, args );
  2331.         D0.L                  A0        A1
  2332.  
  2333.         struct Buffer *ReadBuffer ( char *filename, char *args );
  2334.  
  2335.     FUNCTION
  2336.         Read image data from a disk file into an ImageFX Buffer
  2337.         structure.  ImageFX will automatically figure out the file
  2338.         format and call the appropriate loader.
  2339.  
  2340.     INPUTS
  2341.         filename -- filename of image file to read.
  2342.  
  2343.         args -- argument string to be passed to the loader module
  2344.             that gets called (eg. could be used to specify a frame
  2345.             number for an animation loader).
  2346.  
  2347.     RESULTS
  2348.         buffer -- pointer to a properly filled-in Buffer structure,
  2349.             which can be used in any future operation.
  2350.  
  2351.     EXAMPLE
  2352.  
  2353.     NOTES
  2354.         Remember to KillBuffer() the buffer when you're done with it!
  2355.  
  2356.     BUGS
  2357.  
  2358.     SEE ALSO
  2359.  
  2360.  
  2361. scan.library/RedrawArea                               scan.library/RedrawArea
  2362.  
  2363.     NAME
  2364.         RedrawArea -- Redraw a portion of the main image buffer.
  2365.  
  2366.     SYNOPSIS
  2367.         RedrawArea ( left, top, right, bottom );
  2368.                      D0.L  D1.L D2.L   D3.L
  2369.  
  2370.         void RedrawArea ( int, int, int, int );
  2371.  
  2372.     FUNCTION
  2373.         Redraw only a portion of the current ImageFX main buffer.  If
  2374.         redrawing has been disabled (with the "Redraw Off" command),
  2375.         no update will take place, but the screen will be refreshed when
  2376.         redraw is turned back on.
  2377.  
  2378.         You should call this or the RedrawFull() function after you have made
  2379.         a modification to an image buffer.
  2380.  
  2381.     INPUTS
  2382.         left, top -- upper left corner of the area you want to redraw,
  2383.             measured in pixels.
  2384.  
  2385.         right, bottom -- bottom right corner of the area you want to redraw,
  2386.             measured in pixels.
  2387.  
  2388.     RESULTS
  2389.         None.
  2390.  
  2391.     EXAMPLE
  2392.  
  2393.     NOTES
  2394.  
  2395.     BUGS
  2396.  
  2397.     SEE ALSO
  2398.  
  2399.  
  2400. scan.library/RedrawBrush                             scan.library/RedrawBrush
  2401.  
  2402.     NAME
  2403.         RedrawBrush -- Redraw the current brush (1.6)
  2404.  
  2405.     SYNOPSIS
  2406.  
  2407.     FUNCTION
  2408.  
  2409.     INPUTS
  2410.  
  2411.     RESULTS
  2412.  
  2413.     EXAMPLE
  2414.  
  2415.     NOTES
  2416.  
  2417.     BUGS
  2418.  
  2419.     SEE ALSO
  2420.  
  2421.  
  2422. scan.library/RedrawCurrent                         scan.library/RedrawCurrent
  2423.  
  2424.     NAME
  2425.         RedrawCurrent -- Redraw the current area (1.6)
  2426.  
  2427.     SYNOPSIS
  2428.  
  2429.     FUNCTION
  2430.  
  2431.     INPUTS
  2432.  
  2433.     RESULTS
  2434.  
  2435.     EXAMPLE
  2436.  
  2437.     NOTES
  2438.  
  2439.     BUGS
  2440.  
  2441.     SEE ALSO
  2442.  
  2443.  
  2444. scan.library/RedrawFull                               scan.library/RedrawFull
  2445.  
  2446.     NAME
  2447.         RedrawFull -- Redraw main image buffer.
  2448.  
  2449.     SYNOPSIS
  2450.         RedrawFull ();
  2451.  
  2452.         void RedrawFull ( void );
  2453.  
  2454.     FUNCTION
  2455.         Redraw the current ImageFX main buffer.  If redrawing has been
  2456.         disabled (with the "Redraw Off" command), no update will take place,
  2457.         but the screen will be refreshed when redraw is turned back on.
  2458.  
  2459.         You should call this or the RedrawArea() function after you have made
  2460.         a modification to an image buffer.
  2461.  
  2462.     INPUTS
  2463.         None.
  2464.  
  2465.     RESULTS
  2466.         None.
  2467.  
  2468.     EXAMPLE
  2469.  
  2470.     NOTES
  2471.  
  2472.     BUGS
  2473.  
  2474.     SEE ALSO
  2475.         scan.library/RedrawArea
  2476.  
  2477.  
  2478. scan.library/ReleaseBuffer
  2479.  
  2480.     NAME
  2481.         ReleaseBuffer - Release a Buffer after you're finished.
  2482.  
  2483.     SYNOPSIS
  2484.         ReleaseBuffer ( buffer );
  2485.                         A0
  2486.  
  2487.         void ReleaseBuffer ( struct Buffer * );
  2488.  
  2489.     FUNCTION
  2490.         Releases a Buffer obtained with ObtainBuffer(), doing any
  2491.         cleanup necessary.  You should ALWAYS call this function
  2492.         when you are done with the Buffer, as there is special
  2493.         cleanup involved if the buffer is maintained on disk.
  2494.  
  2495.     INPUTS
  2496.         buffer -- Pointer to a Buffer structure obtained with
  2497.             the ObtainBuffer() structure.
  2498.  
  2499.     RESULT
  2500.         None.
  2501.  
  2502.     EXAMPLE
  2503.  
  2504.     NOTES
  2505.  
  2506.     BUGS
  2507.  
  2508.     SEE ALSO
  2509.         scan.library/ObtainBuffer,scan/buf.h
  2510.  
  2511.  
  2512. scan.library/ReplaceBuffer                         scan.library/ReplaceBuffer
  2513.  
  2514.     NAME
  2515.         ReplaceBuffer -- Replace the contents of one buffer with another.
  2516.  
  2517.     SYNOPSIS
  2518.         ReplaceBuffer ( oldBuf, newBuf );
  2519.                         A0      A1
  2520.  
  2521.         void ReplaceBuffer ( struct Buffer *, struct Buffer * );
  2522.  
  2523.     FUNCTION
  2524.         Replaces the image data of the old buffer with the image data of the
  2525.         new buffer.  The new buffer is then freed.
  2526.  
  2527.     INPUTS
  2528.         oldBuf -- pointer to Buffer to replace.
  2529.  
  2530.         newBuf -- pointer to Buffer with the image data that is to replace the
  2531.             old buffer.  This buffer will be freed when the function returns.
  2532.  
  2533.     RESULTS
  2534.         None.
  2535.  
  2536.     EXAMPLE
  2537.  
  2538.     NOTES
  2539.  
  2540.     BUGS
  2541.  
  2542.     SEE ALSO
  2543.  
  2544.  
  2545. scan.library/SaveBrush                                 scan.library/SaveBrush
  2546.  
  2547.     NAME
  2548.         SaveBrush -- Save a Buffer structure to disk.
  2549.  
  2550.     SYNOPSIS
  2551.         success = SaveBrush ( buffer, filename, format, args );
  2552.         D0.L                  A0      A1        A2      A3
  2553.  
  2554.         BOOL SaveBrush ( struct Buffer *buffer, char *filename,
  2555.                          char *format, char *args );
  2556.  
  2557.     FUNCTION
  2558.         Save the image data of a Buffer structure to disk using
  2559.         a specified file format.  ImageFX will load and call the
  2560.         appropriate saver module for the file format you specify.
  2561.  
  2562.     INPUTS
  2563.         buffer -- properly initialized Buffer structure to be saved.
  2564.  
  2565.         filename -- filename where image is stored.
  2566.  
  2567.         format -- file format to save in (eg. "ILBM", "ANIM", etc.).
  2568.  
  2569.         args -- argument string to be passed to the saver module
  2570.             that is called (eg. could be used to specify compression
  2571.             options).
  2572.  
  2573.     RESULTS
  2574.         success -- TRUE if the save was successful, or FALSE if it
  2575.             was not.
  2576.  
  2577.     EXAMPLE
  2578.  
  2579.     NOTES
  2580.         Yes, I know the function *should* be called SaveBuffer...
  2581.         But for various convoluted and not entirely valid reasons,
  2582.         it's still called SaveBrush.
  2583.  
  2584.     BUGS
  2585.  
  2586.     SEE ALSO
  2587.  
  2588.  
  2589. scan.library/SaveMapped                               scan.library/SaveMapped
  2590.  
  2591.     NAME
  2592.         SaveMapped -- Save a colormapped image to disk.
  2593.  
  2594.     SYNOPSIS
  2595.         success = SaveMapped ( filename, format, image, args );
  2596.         D0.L                   A0        A1      A2     A3
  2597.  
  2598.         BOOL SaveMapped ( char *filenae, char *format,
  2599.                           struct MappedImage *image, char *args );
  2600.  
  2601.     FUNCTION
  2602.         Save a colormapped (eg. bitmap) image to disk using a
  2603.         specified file format.  This is used to save rendered
  2604.         images.
  2605.  
  2606.     INPUTS
  2607.         filename -- name of file to save to.
  2608.  
  2609.         format -- file format name (eg. "ILBM", "ANIM", etc.).
  2610.  
  2611.         image -- pointer to a valid MappedImage structure.  The
  2612.             following fields should be filled in:
  2613.  
  2614.                 Width           width of image in pixels.
  2615.  
  2616.                 Height          height of image in pixels.
  2617.  
  2618.                 BitMap          pointer to image's BitMap (the bitmap need
  2619.                                 not be in chip RAM).
  2620.  
  2621.                 Palette.Depth   depth of image (same as BitMap->Depth)
  2622.  
  2623.                 Palette.Count   count of colors used in the image
  2624.                                 (usually a power of two, but not required).
  2625.  
  2626.                 Palette.Table   pointer to RGB triplets of palette data.
  2627.  
  2628.                 Modes           viewmode of the image (if known).
  2629.  
  2630.                 AspectX,AspectY horizontal and vertical aspect
  2631.                                 ratio of the image.
  2632.  
  2633.         args -- argument string to be passed to the saver module
  2634.             that is called.
  2635.  
  2636.     RESULTS
  2637.         success -- TRUE if the save was successful, or FALSE if something
  2638.             went wrong.
  2639.  
  2640.     EXAMPLE
  2641.  
  2642.     NOTES
  2643.         Note the argument order is NOT the same as SaveBrush.
  2644.  
  2645.     BUGS
  2646.  
  2647.     SEE ALSO
  2648.         scan/loadsave.h
  2649.  
  2650.  
  2651. scan.library/SaveUndo                                   scan.library/SaveUndo
  2652.  
  2653.     NAME
  2654.         SaveUndo -- Save an area of a buffer to the undo buffer.
  2655.  
  2656.     SYNOPSIS
  2657.         continue = SaveUndo ( buffer, left, top, width, height );
  2658.         D0.L                  A0      D0.W  D1.W D2.W   D3.W
  2659.  
  2660.         BOOL SaveUndo ( struct Buffer *, short, short, short, short );
  2661.  
  2662.     FUNCTION
  2663.         Stores a copy of the selected area of the buffer in the undo buffer.
  2664.         The previous contents of the undo buffer are lost.  Only enough memory
  2665.         to hold the requested area is allocated for the undo buffer, to keep
  2666.         memory useage to a minimum.
  2667.  
  2668.         Always use this function if you are about to permanently alter
  2669.         ImageFX's main buffer, to give the user a chance to change his mind.
  2670.  
  2671.     INPUTS
  2672.         buffer -- pointer to Buffer from which to save the data.  This will
  2673.             usually be either the main buffer or a brush.
  2674.  
  2675.         left, top -- upper left pixel coordinate of the area to save, starting
  2676.             from 0,0 at the upper left of the image.
  2677.  
  2678.         width, height -- pixel size of the area to save.
  2679.  
  2680.     RESULTS
  2681.         continue -- if there is not enough memory to save an undo buffer, the
  2682.             user will be asked if he would like to continue without one.  The
  2683.             results of that request are returned here.  TRUE means either
  2684.             there was enough memory or the user wants to continue, FALSE means
  2685.             the operation should be terminated.
  2686.  
  2687.     EXAMPLE
  2688.         if (buf = ObtainBuffer(0)) {
  2689.             if (SaveUndo(buf, 0, 0, buf->Width, buf->Height)) {
  2690.                 /* do something to entire image */
  2691.             }
  2692.             ReleaseBuffer(buf);
  2693.         }
  2694.  
  2695.     NOTES
  2696.  
  2697.     BUGS
  2698.  
  2699.     SEE ALSO
  2700.  
  2701.  
  2702. scan.library/SetError
  2703.  
  2704.     NAME
  2705.         SetError - Set secondary error code.
  2706.  
  2707.     SYNOPSIS
  2708.         SetError ( errorcode )
  2709.                    D0.L
  2710.  
  2711.         void SetError ( ULONG );
  2712.  
  2713.     FUNCTION
  2714.         Sets the secondary error code upon failure.  Normally, functions
  2715.         simply return a TRUE or FALSE for success or failure.  On
  2716.         failure, a person can look to the secondary error code to
  2717.         find more information about why a particular function failed.
  2718.         This presumes that the failing function puts some meaningful
  2719.         information in the secondary error code.
  2720.  
  2721.     INPUTS
  2722.         errorcode -- A code describing an error condition.  Use the codes
  2723.             defined in "scan/errors.h".  The ERR_UserCancel code will
  2724.             not generate a requester on failure, all others will.
  2725.  
  2726.     RESULT
  2727.         None.
  2728.  
  2729.     EXAMPLE
  2730.  
  2731.     NOTES
  2732.  
  2733.     BUGS
  2734.  
  2735.     SEE ALSO
  2736.         scan/errors.h
  2737.  
  2738.  
  2739. scan.library/ShowPanel                                 scan.library/ShowPanel
  2740.  
  2741.     NAME
  2742.         ShowPanel -- Bring the the menu screen to the front.
  2743.  
  2744.     SYNOPSIS
  2745.         ShowPanel ()
  2746.  
  2747.         void ShowPanel ( void );
  2748.  
  2749.     FUNCTION
  2750.         Bring the menu screen ("panel") to the front, if it is not already
  2751.         visible.  You should always use this function instead of
  2752.         ScreenToFront(pScreen) so that the palette screen is handled properly.
  2753.  
  2754.     INPUTS
  2755.  
  2756.     RESULTS
  2757.  
  2758.     EXAMPLE
  2759.  
  2760.     NOTES
  2761.  
  2762.     BUGS
  2763.  
  2764.     SEE ALSO
  2765.         scan.library/HidePanel,scan.library/TogglePanel
  2766.  
  2767.  
  2768. scan.library/ShowStatus
  2769.  
  2770.     NAME
  2771.         ShowStatus -- display buffer information on ImageFX menu.
  2772.  
  2773.     SYNOPSIS
  2774.         ShowStatus ( buffer )
  2775.                      A0
  2776.  
  2777.         void ShowStatus ( struct Buffer * )
  2778.  
  2779.     FUNCTION
  2780.         Updates the Image Scan information display (which shows
  2781.         the name of the current image and its width and height),
  2782.         updates the mode indicators and the channel gadgets.
  2783.  
  2784.     INPUTS
  2785.         buffer -- The buffer from which to get all the information
  2786.             to display.  If NULL, then the current main buffer information
  2787.             will be used.
  2788.  
  2789.     RESULT
  2790.         None.
  2791.  
  2792.     EXAMPLE
  2793.  
  2794.     NOTES
  2795.         The main purpose for this is for Loaders to display the
  2796.         width/height/etc. of the file they are loading while
  2797.         decoding the file, so the user knows what he is loading.
  2798.  
  2799.     BUGS
  2800.  
  2801.     SEE ALSO
  2802.  
  2803.  
  2804. scan.library/StringRequest                         scan.library/StringRequest
  2805.  
  2806.     NAME
  2807.         StringRequest -- Present a string gadget requester to the user.
  2808.  
  2809.     SYNOPSIS
  2810.         result = StringRequest ( title, initial );
  2811.         D0.L                     A0     A1
  2812.  
  2813.         char *StringRequest ( char *, char * );
  2814.  
  2815.     FUNCTION
  2816.         Displays a string gadget requester where the user may enter a text
  2817.         string.  The function does not return until the user enters a string
  2818.         or cancels.
  2819.  
  2820.     INPUTS
  2821.         title -- Title for the requester.
  2822.  
  2823.         initial -- Initial contents of the string gadget, may be NULL.
  2824.  
  2825.     RESULTS
  2826.         result -- pointer to the string the user entered or NULL if the user
  2827.             cancels the requester.  You should make a copy of the string as
  2828.             soon as possible, because the next call to StringRequest() will
  2829.             destroy it.
  2830.  
  2831.     EXAMPLE
  2832.  
  2833.     NOTES
  2834.  
  2835.     BUGS
  2836.  
  2837.     SEE ALSO
  2838.  
  2839.  
  2840. scan.library/TogglePanel                             scan.library/TogglePanel
  2841.  
  2842.     NAME
  2843.         TogglePanel -- Toggle the visibility of the menu screen.
  2844.  
  2845.     SYNOPSIS
  2846.         TogglePanel ()
  2847.  
  2848.         void TogglePanel ( void );
  2849.  
  2850.     FUNCTION
  2851.         Toggles the menu screen ("panel") in front or back of the other
  2852.         screens.  This is what happens in response to a right mouse button
  2853.         click.
  2854.  
  2855.     INPUTS
  2856.         None.
  2857.  
  2858.     RESULTS
  2859.         None.
  2860.  
  2861.     EXAMPLE
  2862.  
  2863.     NOTES
  2864.  
  2865.     BUGS
  2866.  
  2867.     SEE ALSO
  2868.         scan.library/HidePanel,scan.library/ShowPanel
  2869.  
  2870.  
  2871. scan.library/VBoolRequest                           scan.library/VBoolRequest
  2872.  
  2873.     NAME
  2874.         VBoolRequest -- Present boolean Okay/Cancel requester to user.
  2875.         BoolRequest -- varargs stub to VBoolRequest.
  2876.  
  2877.     SYNOPSIS
  2878.         result = VBoolRequest ( title, arglist );
  2879.         D0.L                    A0     A1
  2880.  
  2881.         BOOL VBoolRequest ( char *, ULONG * );
  2882.  
  2883.         result = BoolRequest ( title, ... );
  2884.  
  2885.         BOOL BoolRequest ( char *, ... );
  2886.  
  2887.     FUNCTION
  2888.         Display a boolean Okay/Cancel requester to the user.  The function
  2889.         does not return until the user presses either the Okay or Cancel
  2890.         gadgets.
  2891.  
  2892.     INPUTS
  2893.         title -- Title of the requester.  Can contain printf-style formatting
  2894.             information.
  2895.  
  2896.         arglist -- pointer to list of arguments used to format the title
  2897.             string.
  2898.  
  2899.     RESULTS
  2900.         result -- TRUE if user selected Okay, FALSE if he selected Cancel.
  2901.  
  2902.     EXAMPLE
  2903.  
  2904.     NOTES
  2905.         BoolRequest() is defined in "scan.lib".
  2906.  
  2907.     BUGS
  2908.  
  2909.     SEE ALSO
  2910.  
  2911.  
  2912. scan.library/VErrorf
  2913.  
  2914.     NAME
  2915.         VErrorf -- Display generic error message to user.
  2916.         Errorf -- varargs stub to VErrorf().
  2917.  
  2918.     SYNOPSIS
  2919.         VErrorf ( controlstring, arglistptr )
  2920.                   A0             A1
  2921.  
  2922.         void VErrorf (char *, LONG * );
  2923.  
  2924.         Errorf ( controlstring, firstArg, ... );
  2925.  
  2926.         void Errorf ( char *, ... );
  2927.  
  2928.     FUNCTION
  2929.         Displays a bit of text to the user as an error message.  The
  2930.         function does not return until the user clicks the Okay
  2931.         gadget in the requester.
  2932.  
  2933.     INPUTS
  2934.         controlstring -- A printf()-style formatting string.
  2935.  
  2936.         arglistptr -- pointer to a longword array of arguments to be formatted
  2937.             for display.
  2938.  
  2939.     RESULT
  2940.         None.
  2941.  
  2942.     EXAMPLE
  2943.         Errorf ("Your %ls didn't work on attempt #%ld!",
  2944.                     bean_string, attempt_number);
  2945.  
  2946.     NOTES
  2947.         Errorf() is defined in "scan.lib".
  2948.  
  2949.     BUGS
  2950.  
  2951.     SEE ALSO
  2952.         scan.library/Error
  2953.  
  2954.  
  2955. scan.library/VInfoRequest                           scan.library/VInfoRequest
  2956.  
  2957.     NAME
  2958.         VInfoRequest -- Display informational requester.
  2959.         InfoRequest -- varargs stub to VInfoRequest.
  2960.  
  2961.     SYNOPSIS
  2962.         VInfoRequest ( controlstring, arglistptr )
  2963.                        A0             A1
  2964.  
  2965.         void VInfoRequest (char *, ULONG * );
  2966.  
  2967.         InfoRequest ( controlstring, firstArg, ... );
  2968.  
  2969.         void InfoRequest ( char *, ... );
  2970.  
  2971.  
  2972.     FUNCTION
  2973.         Display a simple 1-line informational requester.  The user must select
  2974.         the Okay gadget to proceed.
  2975.  
  2976.     INPUTS
  2977.         controlstring -- A printf()-style formatting string.
  2978.  
  2979.         arglistptr -- pointer to a longword array of arguments to be formatted
  2980.             for display.
  2981.  
  2982.     RESULTS
  2983.         None.
  2984.  
  2985.     EXAMPLE
  2986.  
  2987.     NOTES
  2988.         InfoRequest() is defined in "scan.lib".
  2989.  
  2990.     BUGS
  2991.  
  2992.     SEE ALSO
  2993.  
  2994.  
  2995. scan.library/zzzzzz
  2996.  
  2997. (That's so my autodoc-insertion macro works properly...)
  2998.