home *** CD-ROM | disk | FTP | other *** search
/ Magazyn Amiga 12 / MA_Cover_12.iso / libs / renderlib / include / render / renderhooks.i < prev   
Encoding:
Text File  |  1999-02-03  |  3.5 KB  |  133 lines

  1.     IFND RENDERHOOKS_I
  2. RENDERHOOKS_I    SET    1
  3. **
  4. **    $VER: renderhooks.i 18.2 (5.3.97)
  5. **
  6. **    render.library definitions for callback hooks
  7. **
  8.  
  9. ;------------------------------------------------------------------------
  10.  
  11.     IFND    EXEC_TYPES_I
  12.     include    "exec/types.i"
  13.     ENDC
  14.  
  15.     IFND    UTILITY_HOOKS_I
  16.     include    "utility/hooks.i"
  17.     ENDC
  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.     STRUCTURE    RND_ProgressMessage,0
  39.         ULONG    RND_PMsg_type        ; type of message, see below
  40.         ULONG    RND_PMsg_count        ; number to be displayed...
  41.         ULONG    RND_PMsg_total        ; ...inside this range
  42.     LABEL        RND_PMsg_SIZEOF
  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. PMSGTYPE_LINES_ADDED        EQU    1
  63.  
  64.  
  65.     ; number of colors chosen during quantization.
  66.     ; a2 is a pointer to the histogram.
  67.  
  68. PMSGTYPE_COLORS_CHOSEN        EQU    2
  69.  
  70.  
  71.     ; number of histogram entries adapted to the palette.
  72.     ; a2 is a pointer to the histogram.
  73.  
  74. PMSGTYPE_COLORS_ADAPTED        EQU    3
  75.  
  76.  
  77.     ; number of lines rendered to a palette.
  78.     ; a2 is a pointer to the palette.
  79.  
  80. PMSGTYPE_LINES_RENDERED        EQU    4
  81.  
  82.  
  83.     ; number of lines converted.
  84.     ; a2 is NULL.
  85.  
  86. PMSGTYPE_LINES_CONVERTED    EQU    5
  87.  
  88.  
  89. ;------------------------------------------------------------------------
  90. ;
  91. ;    Line Hook Message
  92. ;
  93. ;    This hook is executed by functions such as Render() once
  94. ;    before and once after converting a line.
  95. ;
  96. ;    When your line hook is called, your function receives a
  97. ;    pointer to this structure in a1. Check the message type and
  98. ;    proceed accordingly. Also, you get a pointer to the object
  99. ;    of concern in a2. This is either the source or destination
  100. ;    buffer.
  101. ;
  102. ;    This allows you to draw, save, convert etc. while rendering,
  103. ;    and to save memory. Specify RND_DestWidth = 0 to render into
  104. ;    a single-line buffer, and RND_SourceWidth = 0 to fetch from a
  105. ;    single-line buffer.
  106. ;
  107. ;    Your line hook has to return TRUE or FALSE
  108. ;    for continuation respective abortion.
  109. ;
  110. ;------------------------------------------------------------------------
  111.  
  112.     STRUCTURE    RND_LineMessage,0
  113.         ULONG    RND_LMsg_type        ; type of message, see below
  114.         ULONG    RND_LMsg_row        ; the row number being processed
  115.     LABEL        RND_LMsg_SIZEOF        
  116.  
  117.  
  118.     ; just completed a line. a2 is a pointer to the rendered data.
  119.     ; You may read from this buffer.
  120.  
  121. LMSGTYPE_LINE_RENDERED        EQU    6
  122.  
  123.  
  124.     ; now converting a new line. a2 is a pointer to the source buffer
  125.     ; where the input is expected. You may write to this buffer.
  126.  
  127. LMSGTYPE_LINE_FETCH        EQU    7
  128.  
  129.  
  130. ;------------------------------------------------------------------------
  131.  
  132.     ENDC
  133.