ilpipelem.h 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. /*
  2. * CDE - Common Desktop Environment
  3. *
  4. * Copyright (c) 1993-2012, The Open Group. All rights reserved.
  5. *
  6. * These libraries and programs are free software; you can
  7. * redistribute them and/or modify them under the terms of the GNU
  8. * Lesser General Public License as published by the Free Software
  9. * Foundation; either version 2 of the License, or (at your option)
  10. * any later version.
  11. *
  12. * These libraries and programs are distributed in the hope that
  13. * they will be useful, but WITHOUT ANY WARRANTY; without even the
  14. * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  15. * PURPOSE. See the GNU Lesser General Public License for more
  16. * details.
  17. *
  18. * You should have received a copy of the GNU Lesser General Public
  19. * License along with these libraries and programs; if not, write
  20. * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
  21. * Floor, Boston, MA 02110-1301 USA
  22. */
  23. /* $XConsortium: ilpipelem.h /main/5 1996/06/19 12:21:07 ageorge $ */
  24. /**---------------------------------------------------------------------
  25. ***
  26. *** file: ilpipelem.h
  27. ***
  28. *** description: Definitions for user-defined and internal pipe elements
  29. ***
  30. ***
  31. *** (c)Copyright 1991 Hewlett-Packard Co.
  32. ***
  33. *** RESTRICTED RIGHTS LEGEND
  34. *** Use, duplication, or disclosure by the U.S. Government is subject to
  35. *** restrictions as set forth in sub-paragraph (c)(1)(ii) of the Rights in
  36. *** Technical Data and Computer Software clause in DFARS 252.227-7013.
  37. *** Hewlett-Packard Company
  38. *** 3000 Hanover Street
  39. *** Palo Alto, CA 94304 U.S.A.
  40. *** Rights for non-DOD U.S. Government Departments and Agencies are as set
  41. *** forth in FAR 52.227-19(c)(1,2).
  42. ***
  43. ***-------------------------------------------------------------------*/
  44. #ifndef ILPIPELEM_H
  45. #define ILPIPELEM_H
  46. #ifndef ILINT_H
  47. /* for size_t declaration */
  48. #include <stddef.h>
  49. #endif
  50. #ifndef IL_H
  51. #include "il.h"
  52. #endif
  53. #ifndef NeedFunctionPrototypes
  54. #if defined(FUNCPROTO) || defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus)
  55. #define NeedFunctionPrototypes 1
  56. #else
  57. #define NeedFunctionPrototypes 0
  58. #endif /* __STDC__ */
  59. #endif /* NeedFunctionPrototypes */
  60. #ifndef NeedWidePrototypes
  61. #if defined(NARROWPROTO)
  62. #define NeedWidePrototypes 0
  63. #else
  64. #define NeedWidePrototypes 1 /* default to make interropt. easier */
  65. #endif
  66. #endif
  67. #ifdef __cplusplus /* do not leave open across includes */
  68. extern "C" { /* for C++ V2.0 */
  69. #endif
  70. /* ilAddPipeElement (elementType) */
  71. #define IL_PRODUCER 0
  72. #define IL_CONSUMER 1
  73. #define IL_FILTER 2
  74. #define IL_HOOK 3
  75. /* ilAddPipeElement (flags) */
  76. #define IL_ADD_PIPE_NO_DST (1<<0)
  77. #define IL_ADD_PIPE_HOLD_SRC (1<<1)
  78. #define IL_ADD_PIPE_HOLD_DST (1<<2)
  79. /* ilAddPipeElement (null function pointer) */
  80. #define IL_NPF ((ilError (*)())0)
  81. typedef struct {
  82. ilObject producerObject;
  83. ilBool tempImage;
  84. long width, height;
  85. ilBool constantStrip;
  86. long stripHeight;
  87. long recommendedStripHeight;
  88. unsigned short *pPalette;
  89. ilPtr pCompData;
  90. long filler [8];
  91. } ilPipeInfo;
  92. typedef struct {
  93. ilPtr pPrivate;
  94. ilImageInfo *pSrcImage;
  95. ilImageInfo *pDstImage;
  96. long srcLine;
  97. long *pNextSrcLine;
  98. struct {
  99. long srcOffset;
  100. long nBytesToRead;
  101. long *pDstOffset;
  102. long *pNBytesWritten;
  103. } compressed;
  104. long filler [8];
  105. } ilExecuteData;
  106. typedef struct {
  107. ilObject consumerImage;
  108. long stripHeight;
  109. ilBool constantStrip;
  110. long minBufferHeight;
  111. } ilSrcElementData;
  112. typedef struct {
  113. ilObject producerObject;
  114. const ilImageDes *pDes;
  115. const ilImageFormat *pFormat;
  116. long width, height;
  117. long stripHeight;
  118. ilBool constantStrip;
  119. unsigned short *pPalette;
  120. ilPtr pCompData;
  121. } ilDstElementData;
  122. extern ilBool ilDeclarePipeInvalid (
  123. #if NeedFunctionPrototypes
  124. ilPipe pipe,
  125. ilError error
  126. #endif
  127. );
  128. extern unsigned int ilGetPipeInfo (
  129. #if NeedFunctionPrototypes
  130. ilPipe pipe,
  131. ilBool forceDecompress,
  132. ilPipeInfo *pInfo, /* RETURNED */
  133. ilImageDes *pDes, /* RETURNED */
  134. ilImageFormat *pFormat /* RETURNED */
  135. #endif
  136. );
  137. extern void ilGetBytesPerRow (
  138. #if NeedFunctionPrototypes
  139. const ilImageDes *pDes,
  140. const ilImageFormat *pFormat,
  141. long width,
  142. long *pnBytesPerRow /* RETURNED */
  143. #endif
  144. );
  145. extern long ilRecommendedStripHeight (
  146. #if NeedFunctionPrototypes
  147. const ilImageDes *pDes,
  148. const ilImageFormat *pFormat,
  149. long width,
  150. long height
  151. #endif
  152. );
  153. extern ilPtr ilAddPipeElement (
  154. #if NeedFunctionPrototypes
  155. ilPipe pipe,
  156. int elementType,
  157. /* Use portable type for sizeof() operator, bug report OSF_QAR# 32082 */
  158. size_t nBytesPrivate,
  159. unsigned long flags,
  160. ilSrcElementData *pSrcData,
  161. ilDstElementData *pDstData,
  162. ilError (*Init)(),
  163. ilError (*Cleanup)(),
  164. ilError (*Destroy)(),
  165. /*
  166. ** Added another execute function for passing in a fourth
  167. ** parameter which is a floating pointing.
  168. */
  169. ilError (*ExecuteThree)(),
  170. ilError (*ExecuteFour)( ilExecuteData *,
  171. long,
  172. long *,
  173. float),
  174. unsigned long mustBeZero
  175. #endif
  176. );
  177. #ifdef __cplusplus
  178. } /* for C++ V2.0 */
  179. #endif
  180. #endif