ilpipeint.h 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  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: ilpipeint.h /main/3 1995/10/23 15:58:54 rswiston $ */
  24. /**---------------------------------------------------------------------
  25. ***
  26. *** (c)Copyright 1991 Hewlett-Packard Co.
  27. ***
  28. *** RESTRICTED RIGHTS LEGEND
  29. *** Use, duplication, or disclosure by the U.S. Government is subject to
  30. *** restrictions as set forth in sub-paragraph (c)(1)(ii) of the Rights in
  31. *** Technical Data and Computer Software clause in DFARS 252.227-7013.
  32. *** Hewlett-Packard Company
  33. *** 3000 Hanover Street
  34. *** Palo Alto, CA 94304 U.S.A.
  35. *** Rights for non-DOD U.S. Government Departments and Agencies are as set
  36. *** forth in FAR 52.227-19(c)(1,2).
  37. ***
  38. ***-------------------------------------------------------------------*/
  39. #ifndef ILPIPEINT_H
  40. #define ILPIPEINT_H
  41. /* Private definitions for special hooks into /ilc/ilpipe.c . Not needed
  42. to access normal pipe functions!
  43. */
  44. #ifndef ILINT_H
  45. #include "ilint.h"
  46. #endif
  47. #ifndef ILIMAGE_H
  48. #include "ilimage.h"
  49. #endif
  50. /* Values for pipe producerCode, defines what producer was */
  51. #define IL_PIPE_FEED_IMAGE 0 /* previous was ilFeedFromImage() */
  52. #define IL_PIPE_IMAGE 1 /* previous was ilReadImage() */
  53. #define IL_PIPE_NOT_IMAGE 2 /* previous element not an image */
  54. /* In /ilc/ilpipe.c : */
  55. /* Called by ilReadImage() to set *pImage as the producer to this pipe.
  56. The pipe MUST be in the empty state. "needProducerThrottle" is true iff a
  57. throttle must be inserted before next element added by ilAddPipeElement().
  58. */
  59. IL_EXTERN ilBool _ilAddProducerImage (
  60. ilPipe pipe,
  61. ilImagePtr pImage,
  62. unsigned int producerCode,
  63. long height,
  64. long stripHeight,
  65. ilBool constantStrip,
  66. ilBool needProducerThrottle
  67. );
  68. /* Called by ilFeedPipe() to set info for the first element in the given pipe,
  69. which will be ilFeedProducerThrottleExecute(). If feeding compressed data:
  70. "start" is the byte offset into the compressed data, and "nCompBytes" is
  71. the number of bytes at that offset. If uncompressed data: "start" is the
  72. starting line, and "nCompBytes" is ignored. Returns FALSE if the pipe was
  73. not started with a ilFeedFromImage() producer.
  74. */
  75. IL_EXTERN ilBool _ilSetFeedPipeData (
  76. ilPipe pipe,
  77. long start,
  78. long nLines,
  79. long nCompBytes
  80. );
  81. /* Called by ilConvert() to "typecast" the pipe image to the given des and/or
  82. format (ignored if pDes/pFormat null). No validation is done on the result!
  83. */
  84. IL_EXTERN void _ilSetPipeDesFormat (
  85. ilPipe pipe,
  86. ilImageDes *pDes,
  87. ilImageFormat *pFormat
  88. );
  89. /* Add the given object to a list of objects to be destroyed when this pipe
  90. is emptied. The object's refCount should be inc'd before this call, so that
  91. the object cannot be freed until this pipe is destroyed.
  92. The pipe must be in the forming or complete state.
  93. NOTE: a hard limit exists on the # of objects which can be added; not intended
  94. for unlimited use, e.g. by filters!
  95. Sets context->error to error code or success.
  96. */
  97. IL_EXTERN ilBool _ilAddPipeDestroyObject (
  98. ilPipe pipe,
  99. ilObject object
  100. );
  101. /* In /ilc/ilrwimage.c : */
  102. /* Insert a "filter" which merely copies the pipe image to the dest image.
  103. This is necessary when the pipe is "<Read Image> <WriteImage>", because both
  104. ilReadImage() allows the next filter to read directly from its image, and
  105. ilWriteImage() allows the previous filter to write directly to its image,
  106. but together, there needs to be a filter in between.
  107. "height" is the height of the pipe image.
  108. */
  109. IL_EXTERN ilBool _ilInsertCopyFilter (
  110. ilPipe pipe,
  111. long height
  112. );
  113. /* Insert a "filter" which copies the compressed pipe image to the dest image.
  114. This is the equivalent to ilInsertCopyFilter(), except for compressed images.
  115. */
  116. IL_EXTERN ilBool _ilInsertCompressedCopyFilter (
  117. ilPipe pipe
  118. );
  119. /* Called by ilAddPipeElement to add a "throttle" pipe element to feed
  120. strips of height "stripHeight" or zero (0) to the next element.
  121. For uncompressed images only: if "constantStrip" is true, the strips out of
  122. this filter must all be "stripHeight" or zero lines high, except for the last
  123. strip; if false, the height of each strip must be <= "stripHeight".
  124. If "producerCode" is not IL_PIPE_NOT_IMAGE, then the throttle is a
  125. logical producer: the pipe began with an ilReadImage() or ilFeedFromImage()
  126. and must signal IL_ERROR_LAST_STRIP; else the throttle is not the producer.
  127. This flag is used in place of "tempImage" in pipe info which IS INCORRECT -
  128. ilExecutePipe() changes it to avoid infinite recursion.
  129. The strip height from this filter is returned to "*pStripHeight", and
  130. "*pConstantStrip" is set true if constant strips are output.
  131. Returns: true if success, else false.
  132. */
  133. IL_EXTERN ilBool _ilAddThrottlePipeElement (
  134. ilPipe pipe,
  135. long stripHeight,
  136. ilBool constantStrip,
  137. unsigned int producerCode,
  138. long *pStripHeight,
  139. ilBool *pConstantStrip
  140. );
  141. #endif