ImagingExtras.pas 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. {
  2. $Id$
  3. Vampyre Imaging Library
  4. by Marek Mauder
  5. http://imaginglib.sourceforge.net
  6. The contents of this file are used with permission, subject to the Mozilla
  7. Public License Version 1.1 (the "License"); you may not use this file except
  8. in compliance with the License. You may obtain a copy of the License at
  9. http://www.mozilla.org/MPL/MPL-1.1.html
  10. Software distributed under the License is distributed on an "AS IS" basis,
  11. WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
  12. the specific language governing rights and limitations under the License.
  13. Alternatively, the contents of this file may be used under the terms of the
  14. GNU Lesser General Public License (the "LGPL License"), in which case the
  15. provisions of the LGPL License are applicable instead of those above.
  16. If you wish to allow use of your version of this file only under the terms
  17. of the LGPL License and not to allow others to use your version of this file
  18. under the MPL, indicate your decision by deleting the provisions above and
  19. replace them with the notice and other provisions required by the LGPL
  20. License. If you do not delete the provisions above, a recipient may use
  21. your version of this file under either the MPL or the LGPL License.
  22. For more information about the LGPL: http://www.gnu.org/copyleft/lesser.html
  23. }
  24. { This is helper unit that registers all image file formats in Extras package
  25. to Imaging core loading and saving functions. Just put this unit in your uses
  26. clause instead of adding every unit that provides new file format support.
  27. Also new constants for SetOption/GetOption functions for new file formats
  28. are located here.}
  29. unit ImagingExtras;
  30. {$I ImagingOptions.inc}
  31. //{$DEFINE DONT_LINK_JPEG2000} // link support for JPEG2000 images
  32. //{$DEFINE DONT_LINK_TIFF} // link support for TIFF images
  33. //{$DEFINE DONT_LINK_PSD} // link support for PSD images
  34. //{$DEFINE DONT_LINK_PCX} // link support for PCX images
  35. //{$DEFINE DONT_LINK_XPM} // link support for XPM images
  36. {$DEFINE DONT_LINK_ELDER} // link support for Elder Imagery images
  37. {$IF not (Defined(DELPHI) or
  38. (Defined(FPC) and not Defined(MSDOS) and
  39. ((Defined(CPU86) and (Defined(LINUX) or Defined(WIN32)) or
  40. (Defined(CPUX86_64) and Defined(UNIX)))))
  41. )}
  42. // JPEG2000 only for 32bit Windows and for 32bit/64bit Linux with FPC
  43. {$DEFINE DONT_LINK_JPEG2000}
  44. {$IFEND}
  45. {$IF not Defined(DELPHI)}
  46. {$DEFINE DONT_LINK_TIFF} // Only for Delphi now
  47. {$IFEND}
  48. interface
  49. const
  50. { Those are new options for GetOption/SetOption interface. }
  51. { Controls JPEG 2000 lossy compression quality. It is number in range 1..100.
  52. 1 means small/ugly file, 100 means large/nice file. Default is 80.}
  53. ImagingJpeg2000Quality = 55;
  54. { Controls whether JPEG 2000 image is saved with full file headers or just
  55. as code stream. Default value is False (0).}
  56. ImagingJpeg2000CodeStreamOnly = 56;
  57. { Specifies JPEG 2000 image compression type. If True (1), saved JPEG 2000 files
  58. will be losslessly compressed. Otherwise lossy compression is used.
  59. Default value is False (0).}
  60. ImagingJpeg2000LosslessCompression = 57;
  61. { Specifies compression scheme used when saving TIFF images. Supported values
  62. are 0 (Uncompressed), 1 (LZW), 2 (PackBits RLE), 3 (Deflate - ZLib), 4 (JPEG).
  63. Default is 1 (LZW). Note that not all images can be stored with
  64. JPEG compression - these images will be saved with default compression if
  65. JPEG is set.}
  66. ImagingTiffCompression = 65;
  67. { If enabled image data is saved as layer of PSD file. This is required
  68. to get proper transparency when opened in Photoshop for images with
  69. alpha data (will be opened with one layer, RGB color channels, and transparency).
  70. If you don't need this Photoshop compatibility turn this option off as you'll get
  71. smaller file (will be opened in PS as background raster with RGBA channels).
  72. Default value is True (1). }
  73. ImagingPSDSaveAsLayer = 70;
  74. implementation
  75. uses
  76. {$IFNDEF DONT_LINK_JPEG2000}
  77. ImagingJpeg2000,
  78. {$ENDIF}
  79. {$IFNDEF DONT_LINK_TIFF}
  80. ImagingTiff,
  81. {$ENDIF}
  82. {$IFNDEF DONT_LINK_PSD}
  83. ImagingPsd,
  84. {$ENDIF}
  85. {$IFNDEF DONT_LINK_PCX}
  86. ImagingPcx,
  87. {$ENDIF}
  88. {$IFNDEF DONT_LINK_XPM}
  89. ImagingXpm,
  90. {$ENDIF}
  91. {$IFNDEF DONT_LINK_ELDER}
  92. ElderImagery,
  93. {$ENDIF}
  94. Imaging;
  95. {
  96. File Notes:
  97. -- TODOS ----------------------------------------------------
  98. - nothing now
  99. -- 0.26.1 Changes/Bug Fixes ---------------------------------
  100. - ElderImagery formats are disabled by default, TIFF enabled.
  101. - Changed _LINK_ symbols according to changes in ImagingOptions.inc.
  102. -- 0.24.1 Changes/Bug Fixes ---------------------------------
  103. - Allowed JPEG2000 for x86_64 CPUS in Linux
  104. -- 0.23 Changes/Bug Fixes -----------------------------------
  105. - Better IF conditional to disable JPEG2000 on unsupported platforms.
  106. - Added PSD and TIFF related stuff.
  107. -- 0.21 Changes/Bug Fixes -----------------------------------
  108. - Created with initial stuff.
  109. }
  110. end.