1 #ifndef RENDER_RENDERHOOKS_H
    2 #define RENDER_RENDERHOOKS_H
    3 
    4 /*
    5 **    $VER: renderhooks.h 18.2 (5.3.97)
    6 **
    7 **    render.library definitions for callback hooks
    8 */
    9 
   10 #ifndef EXEC_TYPES_H
   11 #include <exec/types.h>
   12 #endif
   13 
   14 #ifndef UTILITY_HOOKS_H
   15 #include <utility/hooks.h>
   16 #endif
   17 
   18 #pragma pack(2)
   19 
   20 
   21 /******************************************************************************
   22 
   23 	Progress Hook Message
   24 
   25 	Whenever your progress hook is called, your function
   26 	receives a pointer to this structure in a1. Check the
   27 	message type and proceed accordingly.
   28 
   29 	Also, you get a pointer to the object of concern in a2.
   30 	Warning: This is intended for identification only. You
   31 	are NOT allowed to perform operations inside your hook
   32 	function that could modify this object. If you try to
   33 	do so, your code will run into a deadlock.
   34 
   35 	Your progress hook has to return TRUE or FALSE
   36 	for continuation respective abortion.
   37 
   38 ******************************************************************************/
   39 
   40 struct RND_ProgressMessage
   41 {
   42 	ULONG   RND_PMsg_type;          /* type of message, see below      */
   43 	ULONG   RND_PMsg_count;         /* number to be displayed...       */
   44 	ULONG   RND_PMsg_total;         /* ...inside this range of numbers */
   45 };
   46 
   47 /******************************************************************************
   48 
   49 	Types of progress messages
   50 
   51 	Neither depend on a certain number of calls nor on
   52 	calls in a specific order. It's up to the library
   53 	to decide
   54 	- how often to call your progress hook
   55 	- in what order to submit different types of messages
   56 	- in what step rate to call your progress hook
   57 	- whether to call your progress hook at all
   58 
   59 ******************************************************************************/
   60 
   61 	/* number of lines added to a histogram.
   62 	   a2 is a pointer to the histogram. */
   63 
   64 #define PMSGTYPE_LINES_ADDED            1
   65 
   66 
   67 	/* number of colors chosen during quantization.
   68 	   a2 is a pointer to the histogram. */
   69 
   70 #define PMSGTYPE_COLORS_CHOSEN          2
   71 
   72 
   73 	/* number of histogram entries adapted to the palette.
   74 	   a2 is a pointer to the histogram. */
   75 
   76 #define PMSGTYPE_COLORS_ADAPTED         3
   77 
   78 
   79 	/* number of lines rendered to a palette.
   80 	   a2 is a pointer to the palette. */
   81 
   82 #define PMSGTYPE_LINES_RENDERED         4
   83 
   84 
   85 	/* number of lines converted.
   86 	   a2 is NULL. */
   87 
   88 #define PMSGTYPE_LINES_CONVERTED        5
   89 
   90 
   91 
   92 
   93 /******************************************************************************
   94 
   95 	Line Hook Message
   96 
   97 	This hook is executed by functions such as Render() once
   98 	before and once after converting a line.
   99 
  100 	When your line hook is called, your function receives a
  101 	pointer to this structure in a1. Check the message type and
  102 	proceed accordingly. Also, you get a pointer to the object
  103 	of concern in a2. This is either the source or destination
  104 	buffer.
  105 
  106 	This allows you to draw, save, convert etc. while rendering,
  107 	and to save memory. Specify RND_DestWidth = 0 to render into
  108 	a single-line buffer, and RND_SourceWidth = 0 to fetch from a
  109 	single-line buffer.
  110 
  111 	Your line hook has to return TRUE or FALSE
  112 	for continuation respective abortion.
  113 
  114 ******************************************************************************/
  115 
  116 struct RND_LineMessage
  117 {
  118 	ULONG   RND_LMsg_type;          /* type of message, see below */
  119 	ULONG   RND_LMsg_row;           /* the row number being processed */
  120 };
  121 
  122 
  123 
  124 /* just completed a line. a2 is a pointer to the rendered data.
  125    You may read from this buffer. */
  126 
  127 #define LMSGTYPE_LINE_RENDERED          6
  128 
  129 
  130 /* now converting a new line. a2 is a pointer to the source buffer
  131    where the input is expected. You may write to this buffer. */
  132 
  133 #define LMSGTYPE_LINE_FETCH             7
  134 
  135 
  136 
  137 /*****************************************************************************/
  138 
  139 
  140 #pragma pack()
  141 
  142 #endif /* RENDER_RENDERHOOKS_H */