ilscaleint.h 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  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: ilscaleint.h /main/3 1995/10/23 16:00:23 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 ILSCALEINT_H
  40. #define ILSCALEINT_H
  41. /* PRIVATE definitions shared between scaling code, e.g. /ilc/ilscale.c .
  42. NO OTHER CODE SHOULD INCLUDE THIS FILE !
  43. */
  44. /* In /ilc/ilbigray.c : */
  45. /* Called by ilScale().
  46. Adds an element to "pipe" to scale the pipe image to "dstWidth" by "dstHeight"
  47. which both must be > 0. The input pipe image must be a bitonal,
  48. bit-per-pixel image, with the given "blackIsZero". "pInfo" points to the
  49. pipe info, "dstWidth/Height" is the (> 0) size to scale to, and nGrayLevels
  50. is the number of levels of gray. The output image is a gray image.
  51. Only a scale down in both directions is allowed; the following must be true:
  52. srcWidth must be >= dstWidth and srcHeight must be >= dstHeight!
  53. */
  54. IL_EXTERN void _ilScaleBitonalToGray (
  55. ilPipe pipe,
  56. unsigned long dstWidth,
  57. unsigned long dstHeight,
  58. unsigned long nGrayLevels,
  59. ilBool blackIsZero,
  60. ilPipeInfo *pInfo
  61. );
  62. /* Called by ilScale().
  63. Adds an element to "pipe" to scale the pipe image to "dstWidth" by "dstHeight"
  64. which both must be > 0. The input pipe image must be a bitonal,
  65. bit-per-pixel image, with _any_ "blackIsZero". The resulting image is of the
  66. same type. "pInfo" points to the pipe info, "dstWidth/Height" is the (> 0) size
  67. to scale to.
  68. Only a scale down in both directions is allowed; the following must be true:
  69. srcWidth must be >= dstWidth and srcHeight must be >= dstHeight!
  70. Logically the same as ilScaleBitonalToGray(): a gray byte is produced for
  71. each destination pixel, using 256 levels of gray. If that byte is
  72. >= "*pGrayThreshold"; a white pixel is written; else a black pixel is written.
  73. NOTE: the value at "*pGrayThreshold" is read each time the pipe is executed
  74. (during Init()); the caller change its value and get different results without
  75. recreating the pipe. If "pGrayThreshold" is NULL, a default value is used.
  76. */
  77. IL_EXTERN void _ilAreaScaleBitonal (
  78. ilPipe pipe,
  79. unsigned long dstWidth,
  80. unsigned long dstHeight,
  81. int *pGrayThreshold,
  82. ilPipeInfo *pInfo
  83. );
  84. IL_EXTERN void _ilScaleSample (
  85. ilPipe pipe,
  86. int Ncomponents,
  87. unsigned long dstWidth,
  88. unsigned long dstHeight,
  89. unsigned long nLevels,
  90. ilBool blackIsZero,
  91. ilPipeInfo *pInfo
  92. );
  93. #endif