ifftools.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. /* =============================================================================
  2. * PROGRAM: CODE LIBRARY
  3. * FILENAME: ifftools.h
  4. *
  5. * DESCRIPTION:
  6. * This module provides functions to read IFF ILBM files and free the bitmaps
  7. * for ILBM files read.
  8. *
  9. * =============================================================================
  10. * COPYRIGHT:
  11. *
  12. * Copyright (c) 1996, 2004, Julian Olds
  13. * All rights reserved.
  14. *
  15. * Redistribution and use in source and binary forms, with or without
  16. * modification, are permitted provided that the following conditions
  17. * are met:
  18. *
  19. * . Redistributions of source code must retain the above copyright notice,
  20. * this list of conditions and the following disclaimer.
  21. *
  22. * . Redistributions in binary form must reproduce the above copyright
  23. * notice, this list of conditions and the following disclaimer in the
  24. * documentation and/or other materials provided with the distribution.
  25. *
  26. * The name of the author may not be used to endorse or promote products
  27. * derived from this software without specific prior written permission.
  28. *
  29. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  30. * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  31. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  32. * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
  33. * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  34. * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  35. * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  36. * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  37. * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  38. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
  39. * THE POSSIBILITY OF SUCH DAMAGE.
  40. *
  41. * =============================================================================
  42. * EXPORTED VARIABLES
  43. *
  44. * None.
  45. *
  46. * =============================================================================
  47. * EXPORTED FUNCTIONS
  48. *
  49. * FreeBitmap : This function frees the bitmap for an ILBM file.
  50. * ReadIff : This function reads an IFF ILBM file and returns the bitmap.
  51. *
  52. * =============================================================================
  53. */
  54. #ifndef _IFF_TOOLS_H
  55. #define _IFF_TOOLS_H
  56. #include <graphics/gfx.h>
  57. /* =============================================================================
  58. * FUNCTION: FreeBitmap
  59. *
  60. * DESCRIPTION:
  61. * This function frees a bitmap.
  62. *
  63. * PARAMETERS:
  64. *
  65. * Bitmap : A pointer to the bitmap to be freed.
  66. *
  67. * RETURN VALUE:
  68. *
  69. * None.
  70. */
  71. void FreeBitmap(struct BitMap *Bitmap);
  72. /* =============================================================================
  73. * FUNCTION: ReadIff
  74. *
  75. * DESCRIPTION:
  76. * This function reads an IFF ILBM file from the specified filename and
  77. * returns a pointer to a bitmap of the image contained in the file.
  78. * The palette of the bitmap is returned in Palette.
  79. *
  80. * PARAMETERS:
  81. *
  82. * FileName : The name of the IFF ILBM file to read.
  83. *
  84. * Palette : This must point to an array of ULONG big enough to store the
  85. * entire palette of the bitmap.
  86. * each entry in the array stroes a RGB triplet in the format
  87. * 0x00RRGGBB
  88. *
  89. * RETURN VALUE:
  90. *
  91. * BitMap *: A pointer to the bitmap inthe file, or NULL if the read failed.
  92. */
  93. struct BitMap *ReadIff(char *FileName, ULONG *Palette);
  94. #endif