DEADSOFTWARE

hopefully no more windows
[d2df-editor.git] / src / lib / vampimg / ImagingExtras.pas
1 {
2 Vampyre Imaging Library
3 by Marek Mauder
4 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
11 Software distributed under the License is distributed on an "AS IS" basis,
12 WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
13 the specific language governing rights and limitations under the License.
15 Alternatively, the contents of this file may be used under the terms of the
16 GNU Lesser General Public License (the "LGPL License"), in which case the
17 provisions of the LGPL License are applicable instead of those above.
18 If you wish to allow use of your version of this file only under the terms
19 of the LGPL License and not to allow others to use your version of this file
20 under the MPL, indicate your decision by deleting the provisions above and
21 replace them with the notice and other provisions required by the LGPL
22 License. If you do not delete the provisions above, a recipient may use
23 your version of this file under either the MPL or the LGPL License.
25 For more information about the LGPL: http://www.gnu.org/copyleft/lesser.html
26 }
28 { This is helper unit that registers all image file formats in Extras package
29 to Imaging core loading and saving functions. Just put this unit in your uses
30 clause instead of adding every unit that provides new file format support.
31 Also new constants for SetOption/GetOption functions for new file formats
32 are located here.}
33 unit ImagingExtras;
35 {$I ImagingOptions.inc}
37 {$DEFINE DONT_LINK_JPEG2000} // link support for JPEG2000 images
38 {$DEFINE DONT_LINK_TIFF} // link support for TIFF images
39 //{$DEFINE DONT_LINK_PSD} // link support for PSD images
40 //{$DEFINE DONT_LINK_PCX} // link support for PCX images
41 //{$DEFINE DONT_LINK_XPM} // link support for XPM images
42 //{$IFNDEF FULL_FEATURE_SET}
43 {$DEFINE DONT_LINK_ELDER} // link support for Elder Imagery images
44 //{$ENDIF}
46 {$IF not (
47 (Defined(DCC) and Defined(CPUX86) and not Defined(MACOS)) or
48 (Defined(FPC) and not Defined(MSDOS) and
49 ((Defined(CPUX86) and (Defined(LINUX) or Defined(WIN32) or Defined(MACOS)) or
50 (Defined(CPUX64) and Defined(LINUX)))))
51 )}
52 // JPEG2000 only for 32bit Windows/Linux/OSX and for 64bit Unix with FPC
53 {$DEFINE DONT_LINK_JPEG2000}
54 {$IFEND}
56 {$IF not (Defined(DCC) and Defined(CPUX86) and not Defined(MACOS))}
57 {$DEFINE DONT_LINK_TIFF} // Only for Delphi now
58 {$IFEND}
60 interface
62 const
63 { Those are new options for GetOption/SetOption interface. }
65 { Controls JPEG 2000 lossy compression quality. It is number in range 1..100.
66 1 means small/ugly file, 100 means large/nice file. Default is 80.}
67 ImagingJpeg2000Quality = 55;
68 { Controls whether JPEG 2000 image is saved with full file headers or just
69 as code stream. Default value is False (0).}
70 ImagingJpeg2000CodeStreamOnly = 56;
71 { Specifies JPEG 2000 image compression type. If True (1), saved JPEG 2000 files
72 will be losslessly compressed. Otherwise lossy compression is used.
73 Default value is False (0).}
74 ImagingJpeg2000LosslessCompression = 57;
75 { Specifies compression scheme used when saving TIFF images. Supported values
76 are 0 (Uncompressed), 1 (LZW), 2 (PackBits RLE), 3 (Deflate - ZLib), 4 (JPEG),
77 5 (CCITT Group 4 fax encoding - for binary images only).
78 Default is 1 (LZW). Note that not all images can be stored with
79 JPEG compression - these images will be saved with default compression if
80 JPEG is set.}
81 ImagingTiffCompression = 65;
82 { Controls compression quality when selected TIFF compression is Jpeg.
83 It is number in range 1..100. 1 means small/ugly file,
84 100 means large/nice file. Accessible trough ImagingTiffJpegQuality option.}
85 ImagingTiffJpegQuality = 66;
86 { When activated (True = 1) existing TIFF files are not overwritten when saving but
87 new images are instead appended thus producing multipage TIFFs.
88 Default value is False (0).}
89 ImagingTiffAppendMode = 67;
90 { If enabled image data is saved as layer of PSD file. This is required
91 to get proper transparency when opened in Photoshop for images with
92 alpha data (will be opened with one layer, RGB color channels, and transparency).
93 If you don't need this Photoshop compatibility turn this option off as you'll get
94 smaller file (will be opened in PS as background raster with RGBA channels).
95 Default value is True (1). }
96 ImagingPSDSaveAsLayer = 70;
98 implementation
100 uses
101 {$IFNDEF DONT_LINK_JPEG2000}
102 ImagingJpeg2000,
103 {$ENDIF}
104 {$IFNDEF DONT_LINK_TIFF}
105 ImagingLibTiffDelphi,
106 {$ENDIF}
107 {$IFNDEF DONT_LINK_PSD}
108 ImagingPsd,
109 {$ENDIF}
110 {$IFNDEF DONT_LINK_PCX}
111 ImagingPcx,
112 {$ENDIF}
113 {$IFNDEF DONT_LINK_XPM}
114 ImagingXpm,
115 {$ENDIF}
116 {$IFNDEF DONT_LINK_ELDER}
117 ElderImagery,
118 {$ENDIF}
119 Imaging;
122 File Notes:
124 -- TODOS -----------------------------------------------------
125 - nothing now
127 -- 0.77 -----------------------------------------------------
128 - Added ImagingTiffAppendMode option.
130 -- 0.26.5 Changes/Bug Fixes ---------------------------------
131 - Added Group 4 Fax encoding as compression for TIFF files.
132 - Added ImagingTiffJpegQuality option.
134 -- 0.26.3 Changes/Bug Fixes ---------------------------------
135 - Allowed JPEG2000 for Mac OS X x86
137 -- 0.26.1 Changes/Bug Fixes ---------------------------------
138 - ElderImagery formats are disabled by default, TIFF enabled.
139 - Changed _LINK_ symbols according to changes in ImagingOptions.inc.
141 -- 0.24.1 Changes/Bug Fixes ---------------------------------
142 - Allowed JPEG2000 for x86_64 CPUS in Linux
144 -- 0.23 Changes/Bug Fixes -----------------------------------
145 - Better IF conditional to disable JPEG2000 on unsupported platforms.
146 - Added PSD and TIFF related stuff.
148 -- 0.21 Changes/Bug Fixes -----------------------------------
149 - Created with initial stuff.
153 end.