ImagingExtFileFormats.pas 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. {
  2. Vampyre Imaging Library
  3. by Marek Mauder
  4. https://github.com/galfar/imaginglib
  5. https://imaginglib.sourceforge.io
  6. - - - - -
  7. This Source Code Form is subject to the terms of the Mozilla Public
  8. License, v. 2.0. If a copy of the MPL was not distributed with this
  9. file, You can obtain one at https://mozilla.org/MPL/2.0.
  10. }
  11. { This is helper unit that registers all image file formats in Extensions package
  12. to Imaging core loading and saving functions. Just put this unit in your uses
  13. clause instead of adding every unit that provides new file format support.
  14. Also new constants for SetOption/GetOption functions for new file formats
  15. are located here.}
  16. unit ImagingExtFileFormats;
  17. {$I ImagingOptions.inc}
  18. {.$DEFINE DONT_LINK_JPEG2000} // link support for JPEG2000 images
  19. {.$DEFINE DONT_LINK_TIFF} // link support for TIFF images
  20. {.$DEFINE DONT_LINK_PSD} // link support for PSD images
  21. {.$DEFINE DONT_LINK_PCX} // link support for PCX images
  22. {.$DEFINE DONT_LINK_XPM} // link support for XPM images
  23. {$IFNDEF FULL_FEATURE_SET}
  24. {$DEFINE DONT_LINK_ELDER} // link support for Elder Imagery images
  25. {$ENDIF}
  26. interface
  27. const
  28. { Those are new options for GetOption/SetOption interface. }
  29. { Controls JPEG 2000 lossy compression quality. It is number in range 1..100.
  30. 1 means small/ugly file, 100 means large/nice file. Default is 80.}
  31. ImagingJpeg2000Quality = 55;
  32. { Controls whether JPEG 2000 image is saved with full file headers or just
  33. as code stream. Default value is False (0).}
  34. ImagingJpeg2000CodeStreamOnly = 56;
  35. { Specifies JPEG 2000 image compression type. If True (1), saved JPEG 2000 files
  36. will be losslessly compressed. Otherwise lossy compression is used.
  37. Default value is False (0).}
  38. ImagingJpeg2000LosslessCompression = 57;
  39. { Specifies JPEG 2000 output scaling. Since JPEG 2000 supports arbitrary Bit Depths,
  40. the default behaviour is to scale the images up to the next 8^n bit depth.
  41. This can be disabled by setting this option to False.
  42. Default value is True. }
  43. ImagingJpeg2000ScaleOutput = 58;
  44. { Specifies compression scheme used when saving TIFF images. Supported values
  45. are 0 (Uncompressed), 1 (LZW), 2 (PackBits RLE), 3 (Deflate - ZLib), 4 (JPEG),
  46. 5 (CCITT Group 4 fax encoding - for binary images only).
  47. Default is 1 (LZW). Note that not all images can be stored with
  48. JPEG compression - these images will be saved with default compression if
  49. JPEG is set.}
  50. ImagingTiffCompression = 65;
  51. { Controls compression quality when selected TIFF compression is Jpeg.
  52. It is number in range 1..100. 1 means small/ugly file,
  53. 100 means large/nice file. Accessible trough ImagingTiffJpegQuality option.}
  54. ImagingTiffJpegQuality = 66;
  55. { If enabled image data is saved as layer of PSD file. This is required
  56. to get proper transparency when opened in Photoshop for images with
  57. alpha data (will be opened with one layer, RGB color channels, and transparency).
  58. If you don't need this Photoshop compatibility turn this option off as you'll get
  59. smaller file (will be opened in PS as background raster with RGBA channels).
  60. Default value is True (1). }
  61. ImagingPSDSaveAsLayer = 70;
  62. implementation
  63. uses
  64. {$IFNDEF DONT_LINK_FILE_FORMATS}
  65. {$IFNDEF DONT_LINK_JPEG2000}
  66. ImagingJpeg2000,
  67. {$ENDIF}
  68. {$IFNDEF DONT_LINK_TIFF}
  69. ImagingTiff,
  70. {$ENDIF}
  71. {$IFNDEF DONT_LINK_PSD}
  72. ImagingPsd,
  73. {$ENDIF}
  74. {$IFNDEF DONT_LINK_PCX}
  75. ImagingPcx,
  76. {$ENDIF}
  77. {$IFNDEF DONT_LINK_XPM}
  78. ImagingXpm,
  79. {$ENDIF}
  80. {$IFNDEF DONT_LINK_ELDER}
  81. ElderImagery,
  82. {$ENDIF}
  83. {$ENDIF}
  84. Imaging;
  85. {
  86. File Notes:
  87. -- TODOS -----------------------------------------------------
  88. - nothing now
  89. -- 0.26.5 Changes/Bug Fixes ---------------------------------
  90. - Added Group 4 Fax encoding as compression for TIFF files.
  91. - Added ImagingTiffJpegQuality option.
  92. -- 0.26.3 Changes/Bug Fixes ---------------------------------
  93. - Allowed JPEG2000 for Mac OS X x86
  94. -- 0.26.1 Changes/Bug Fixes ---------------------------------
  95. - ElderImagery formats are disabled by default, TIFF enabled.
  96. - Changed _LINK_ symbols according to changes in ImagingOptions.inc.
  97. -- 0.24.1 Changes/Bug Fixes ---------------------------------
  98. - Allowed JPEG2000 for x86_64 CPUS in Linux
  99. -- 0.23 Changes/Bug Fixes -----------------------------------
  100. - Better IF conditional to disable JPEG2000 on unsupported platforms.
  101. - Added PSD and TIFF related stuff.
  102. -- 0.21 Changes/Bug Fixes -----------------------------------
  103. - Created with initial stuff.
  104. }
  105. end.