summaryrefslogtreecommitdiff
path: root/gpr/source/lib/dng_sdk/dng_preview.h
blob: 2b616e3e99f5f5ded96de01f17d7e9b43c8815ce (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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
/*****************************************************************************/
// Copyright 2007-2011 Adobe Systems Incorporated
// All Rights Reserved.
//
// NOTICE:  Adobe permits you to use, modify, and distribute this file in
// accordance with the terms of the Adobe license agreement accompanying it.
/*****************************************************************************/

/* $Id: //mondo/dng_sdk_1_4/dng_sdk/source/dng_preview.h#1 $ */ 
/* $DateTime: 2012/05/30 13:28:51 $ */
/* $Change: 832332 $ */
/* $Author: tknoll $ */

/*****************************************************************************/

#ifndef __dng_preview__
#define __dng_preview__

/*****************************************************************************/

#include "dng_auto_ptr.h"
#include "dng_classes.h"
#include "dng_ifd.h"
#include "dng_opcode_list.h"
#include "dng_point.h"
#include "dng_sdk_limits.h"

/*****************************************************************************/

class dng_preview
	{
	
	public:
	
		dng_preview_info fInfo;
		
	protected:
	
		dng_preview ();
		
	public:
	
		virtual ~dng_preview ();
		
		virtual dng_basic_tag_set * AddTagSet (dng_tiff_directory &directory) const = 0;
		
		virtual void WriteData (dng_host &host,
								dng_image_writer &writer,
								dng_basic_tag_set &basic,
								dng_stream &stream) const = 0;
		
	};
		
/*****************************************************************************/

class dng_image_preview: public dng_preview
	{
	
	public:
	
		AutoPtr<dng_image> fImage;
		
	private:
		
		mutable dng_ifd fIFD;
		
	public:
	
		dng_image_preview ();
		
		virtual ~dng_image_preview ();
		
		virtual dng_basic_tag_set * AddTagSet (dng_tiff_directory &directory) const;
		
		virtual void WriteData (dng_host &host,
								dng_image_writer &writer,
								dng_basic_tag_set &basic,
								dng_stream &stream) const;
		
	private:
	
		// Hidden copy constructor and assignment operator.
		
		dng_image_preview (const dng_image_preview &preview);
		
		dng_image_preview & operator= (const dng_image_preview &preview);
					 
	};

/*****************************************************************************/

class dng_jpeg_preview: public dng_preview
	{
	
	public:
	
		dng_point fPreviewSize;
		
		uint16 fPhotometricInterpretation;
		
		dng_point fYCbCrSubSampling;
		
		uint16 fYCbCrPositioning;
		
		AutoPtr<dng_memory_block> fCompressedData;

	public:
	
		dng_jpeg_preview ();
		
		virtual ~dng_jpeg_preview ();
		
		virtual dng_basic_tag_set * AddTagSet (dng_tiff_directory &directory) const;
		
		virtual void WriteData (dng_host &host,
								dng_image_writer &writer,
								dng_basic_tag_set &basic,
								dng_stream &stream) const;
		
		void SpoolAdobeThumbnail (dng_stream &stream) const;
		
	private:
	
		// Hidden copy constructor and assignment operator.
		
		dng_jpeg_preview (const dng_jpeg_preview &preview);
		
		dng_jpeg_preview & operator= (const dng_jpeg_preview &preview);
					 
	};

/*****************************************************************************/

class dng_raw_preview: public dng_preview
	{
	
	public:
	
		AutoPtr<dng_image> fImage;
		
		AutoPtr<dng_memory_block> fOpcodeList2Data;
		
		int32 fCompressionQuality;

	private:
		
		mutable dng_ifd fIFD;
		
	public:
	
		dng_raw_preview ();
		
		virtual ~dng_raw_preview ();
		
		virtual dng_basic_tag_set * AddTagSet (dng_tiff_directory &directory) const;
		
		virtual void WriteData (dng_host &host,
								dng_image_writer &writer,
								dng_basic_tag_set &basic,
								dng_stream &stream) const;
		
	private:
	
		// Hidden copy constructor and assignment operator.
		
		dng_raw_preview (const dng_raw_preview &preview);
		
		dng_raw_preview & operator= (const dng_raw_preview &preview);
					 
	};

/*****************************************************************************/

class dng_mask_preview: public dng_preview
	{
	
	public:
	
		AutoPtr<dng_image> fImage;
		
		int32 fCompressionQuality;

	private:
		
		mutable dng_ifd fIFD;
		
	public:
	
		dng_mask_preview ();
		
		virtual ~dng_mask_preview ();
		
		virtual dng_basic_tag_set * AddTagSet (dng_tiff_directory &directory) const;
		
		virtual void WriteData (dng_host &host,
								dng_image_writer &writer,
								dng_basic_tag_set &basic,
								dng_stream &stream) const;
		
	private:
	
		// Hidden copy constructor and assignment operator.
		
		dng_mask_preview (const dng_mask_preview &preview);
		
		dng_mask_preview & operator= (const dng_mask_preview &preview);
					 
	};

/*****************************************************************************/

class dng_preview_list
	{
	
	private:
	
		uint32 fCount;
		
		AutoPtr<dng_preview> fPreview [kMaxDNGPreviews];
		
	public:
	
		dng_preview_list ();
		
		~dng_preview_list ();
		
		uint32 Count () const
			{
			return fCount;
			}
			
		const dng_preview & Preview (uint32 index) const
			{
			return *(fPreview [index]);
			}
			
		void Append (AutoPtr<dng_preview> &preview);
	
	};

/*****************************************************************************/

#endif
	
/*****************************************************************************/