DEADSOFTWARE

added Vampyre Imaging Library; now textures can be in various formats, including...
[d2df-sdl.git] / src / lib / vampimg / ImagingExtras.pas
1 {
2 $Id: ImagingExtras.pas 171 2009-09-02 01:34:19Z galfar $
3 Vampyre Imaging Library
4 by Marek Mauder
5 http://imaginglib.sourceforge.net
7 The contents of this file are used with permission, subject to the Mozilla
8 Public License Version 1.1 (the "License"); you may not use this file except
9 in compliance with the License. You may obtain a copy of the License at
10 http://www.mozilla.org/MPL/MPL-1.1.html
12 Software distributed under the License is distributed on an "AS IS" basis,
13 WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
14 the specific language governing rights and limitations under the License.
16 Alternatively, the contents of this file may be used under the terms of the
17 GNU Lesser General Public License (the "LGPL License"), in which case the
18 provisions of the LGPL License are applicable instead of those above.
19 If you wish to allow use of your version of this file only under the terms
20 of the LGPL License and not to allow others to use your version of this file
21 under the MPL, indicate your decision by deleting the provisions above and
22 replace them with the notice and other provisions required by the LGPL
23 License. If you do not delete the provisions above, a recipient may use
24 your version of this file under either the MPL or the LGPL License.
26 For more information about the LGPL: http://www.gnu.org/copyleft/lesser.html
27 }
29 { This is helper unit that registers all image file formats in Extras package
30 to Imaging core loading and saving functions. Just put this unit in your uses
31 clause instead of adding every unit that provides new file format support.
32 Also new constants for SetOption/GetOption functions for new file formats
33 are located here.}
34 unit ImagingExtras;
36 {$I ImagingOptions.inc}
38 {$DEFINE DONT_LINK_JPEG2000} // link support for JPEG2000 images
39 {$DEFINE DONT_LINK_TIFF} // link support for TIFF images
40 //{$DEFINE DONT_LINK_PSD} // link support for PSD images
41 //{$DEFINE DONT_LINK_PCX} // link support for PCX images
42 //{$DEFINE DONT_LINK_XPM} // link support for XPM images
43 { $IFNDEF FULL_FEATURE_SET}
44 {$DEFINE DONT_LINK_ELDER} // link support for Elder Imagery images
45 { $ENDIF}
47 {$IF not (Defined(DELPHI) or
48 (Defined(FPC) and not Defined(MSDOS) and
49 ((Defined(CPU86) and (Defined(LINUX) or Defined(WIN32) or Defined(DARWIN)) or
50 (Defined(CPUX86_64) 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(DELPHI)}
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 Default is 1 (LZW). Note that not all images can be stored with
78 JPEG compression - these images will be saved with default compression if
79 JPEG is set.}
80 ImagingTiffCompression = 65;
81 { If enabled image data is saved as layer of PSD file. This is required
82 to get proper transparency when opened in Photoshop for images with
83 alpha data (will be opened with one layer, RGB color channels, and transparency).
84 If you don't need this Photoshop compatibility turn this option off as you'll get
85 smaller file (will be opened in PS as background raster with RGBA channels).
86 Default value is True (1). }
87 ImagingPSDSaveAsLayer = 70;
89 implementation
91 uses
92 {$IFNDEF DONT_LINK_JPEG2000}
93 ImagingJpeg2000,
94 {$ENDIF}
95 {$IFNDEF DONT_LINK_TIFF}
96 ImagingTiff,
97 {$ENDIF}
98 {$IFNDEF DONT_LINK_PSD}
99 ImagingPsd,
100 {$ENDIF}
101 {$IFNDEF DONT_LINK_PCX}
102 ImagingPcx,
103 {$ENDIF}
104 {$IFNDEF DONT_LINK_XPM}
105 ImagingXpm,
106 {$ENDIF}
107 {$IFNDEF DONT_LINK_ELDER}
108 ElderImagery,
109 {$ENDIF}
110 Imaging;
113 File Notes:
115 -- TODOS ----------------------------------------------------
116 - nothing now
118 -- 0.26.3 Changes/Bug Fixes ---------------------------------
119 - Allowed JPEG2000 for Mac OS X x86
121 -- 0.26.1 Changes/Bug Fixes ---------------------------------
122 - ElderImagery formats are disabled by default, TIFF enabled.
123 - Changed _LINK_ symbols according to changes in ImagingOptions.inc.
125 -- 0.24.1 Changes/Bug Fixes ---------------------------------
126 - Allowed JPEG2000 for x86_64 CPUS in Linux
128 -- 0.23 Changes/Bug Fixes -----------------------------------
129 - Better IF conditional to disable JPEG2000 on unsupported platforms.
130 - Added PSD and TIFF related stuff.
132 -- 0.21 Changes/Bug Fixes -----------------------------------
133 - Created with initial stuff.
137 end.