home *** CD-ROM | disk | FTP | other *** search
/ Magazyn Amiga 12 / MA_Cover_12.iso / libs / renderlib / include / render / renderhooks.h < prev    next >
Encoding:
C/C++ Source or Header  |  1999-02-03  |  3.5 KB  |  138 lines

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