summaryrefslogtreecommitdiff
path: root/dmagick/c/compress.d
blob: 4e0856a39e61d84ebdf7e85452ab43f3bbb451f4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
module dmagick.c.compress;

import dmagick.c.image;
import dmagick.c.magickType;

extern(C)
{
	/**
	 * Express the desired compression type when encoding an image. Be aware
	 * that most image types only support a sub-set of the available
	 * compression types. If the compression type specified is incompatible
	 * with the image, ImageMagick selects a compression type compatible
	 * with the image type.
	 */
	enum CompressionType
	{
		/** */
		UndefinedCompression,

		/**
		 * The default for most formats.
		 */
		NoCompression,
		
		/**
		 * BZip (Burrows-Wheeler block-sorting text compression algorithm
		 * and Huffman coding) as used by bzip2 utilities
		 */
		BZipCompression,
		
		/** */
		DXT1Compression,
		
		/** */
		DXT3Compression,
		
		/** */
		DXT5Compression,
		
		/**
		 * CCITT Group 3 FAX compression.
		 */
		FaxCompression,
		
		/**
		 * CCITT Group 4 FAX compression (used only for TIFF).
		 */
		Group4Compression,
		
		/**
		 * JPEG compression.
		 * 
		 * See_Also: $(LINK2 http://www.faqs.org/faqs/jpeg-faq/part1/,
		 *     The JPEG image compression FAQ).
		 */
		JPEGCompression,
		
		/**
		 * JPEG2000 compression for compressed PDF images.
		 * 
		 * ISO/IEC std 15444-1
		 */
		JPEG2000Compression,
		
		/** */
		LosslessJPEGCompression,
		
		/**
		 * Lempel-Ziv-Welch (LZW) compression.
		 */
		LZWCompression,
		
		/**
		 * Run-length encoding.
		 * 
		 * See_Also: $(LINK2 http://en.wikipedia.org/wiki/Run_length_encoding,
		 *     Wikipedia).
		 */
		RLECompression,
		
		/**
		 * Lempel-Ziv compression (LZ77) as used in PKZIP and GNU gzip.
		 */
		ZipCompression,
		
		/** */
		ZipSCompression,
		
		/** */
		PizCompression,
		
		/** */
		Pxr24Compression,
		
		/** */
		B44Compression,
		
		/** */
		B44ACompression,
		
		/**
		 * Lempel-Ziv-Markov chain algorithm
		 */
		LZMACompression,
		
		/**
		 * ISO/IEC std 11544 / ITU-T rec T.82
		 */
		JBIG1Compression,
		
		/**
		 * ISO/IEC std 14492 / ITU-T rec T.88
		 */
		JBIG2Compression
	}

	struct Ascii85Info {}

	MagickBooleanType HuffmanDecodeImage(Image*);
	MagickBooleanType HuffmanEncodeImage(const(ImageInfo)*, Image*, Image*);
	MagickBooleanType LZWEncodeImage(Image*, const size_t, ubyte*);
	MagickBooleanType PackbitsEncodeImage(Image*, const size_t, ubyte*);
	MagickBooleanType ZLIBEncodeImage(Image*, const size_t, ubyte*);

	void Ascii85Encode(Image*, const ubyte);
	void Ascii85Flush(Image*);
	void Ascii85Initialize(Image*);
}