1 | /*****************************************************************************/ |
2 | // Copyright 2006-2009 Adobe Systems Incorporated |
3 | // All Rights Reserved. |
4 | // |
5 | // NOTICE: Adobe permits you to use, modify, and distribute this file in |
6 | // accordance with the terms of the Adobe license agreement accompanying it. |
7 | /*****************************************************************************/ |
8 | |
9 | /* $Id: //mondo/dng_sdk_1_4/dng_sdk/source/dng_reference.h#1 $ */ |
10 | /* $DateTime: 2012/05/30 13:28:51 $ */ |
11 | /* $Change: 832332 $ */ |
12 | /* $Author: tknoll $ */ |
13 | |
14 | /*****************************************************************************/ |
15 | |
16 | #ifndef __dng_reference__ |
17 | #define __dng_reference__ |
18 | |
19 | /*****************************************************************************/ |
20 | |
21 | #include "dng_bottlenecks.h" |
22 | |
23 | /*****************************************************************************/ |
24 | |
25 | void RefZeroBytes (void *dPtr, |
26 | uint32 count); |
27 | |
28 | void RefCopyBytes (const void *sPtr, |
29 | void *dPtr, |
30 | uint32 count); |
31 | |
32 | /*****************************************************************************/ |
33 | |
34 | void RefSwapBytes16 (uint16 *dPtr, |
35 | uint32 count); |
36 | |
37 | void RefSwapBytes32 (uint32 *dPtr, |
38 | uint32 count); |
39 | |
40 | /*****************************************************************************/ |
41 | |
42 | void RefSetArea8 (uint8 *dPtr, |
43 | uint8 value, |
44 | uint32 rows, |
45 | uint32 cols, |
46 | uint32 planes, |
47 | int32 rowStep, |
48 | int32 colStep, |
49 | int32 planeStep); |
50 | |
51 | void RefSetArea16 (uint16 *dPtr, |
52 | uint16 value, |
53 | uint32 rows, |
54 | uint32 cols, |
55 | uint32 planes, |
56 | int32 rowStep, |
57 | int32 colStep, |
58 | int32 planeStep); |
59 | |
60 | void RefSetArea32 (uint32 *dPtr, |
61 | uint32 value, |
62 | uint32 rows, |
63 | uint32 cols, |
64 | uint32 planes, |
65 | int32 rowStep, |
66 | int32 colStep, |
67 | int32 planeStep); |
68 | |
69 | /*****************************************************************************/ |
70 | |
71 | void RefCopyArea8 (const uint8 *sPtr, |
72 | uint8 *dPtr, |
73 | uint32 rows, |
74 | uint32 cols, |
75 | uint32 planes, |
76 | int32 sRowStep, |
77 | int32 sColStep, |
78 | int32 sPlaneStep, |
79 | int32 dRowStep, |
80 | int32 dColStep, |
81 | int32 dPlaneStep); |
82 | |
83 | void RefCopyArea16 (const uint16 *sPtr, |
84 | uint16 *dPtr, |
85 | uint32 rows, |
86 | uint32 cols, |
87 | uint32 planes, |
88 | int32 sRowStep, |
89 | int32 sColStep, |
90 | int32 sPlaneStep, |
91 | int32 dRowStep, |
92 | int32 dColStep, |
93 | int32 dPlaneStep); |
94 | |
95 | void RefCopyArea32 (const uint32 *sPtr, |
96 | uint32 *dPtr, |
97 | uint32 rows, |
98 | uint32 cols, |
99 | uint32 planes, |
100 | int32 sRowStep, |
101 | int32 sColStep, |
102 | int32 sPlaneStep, |
103 | int32 dRowStep, |
104 | int32 dColStep, |
105 | int32 dPlaneStep); |
106 | |
107 | void RefCopyArea8_16 (const uint8 *sPtr, |
108 | uint16 *dPtr, |
109 | uint32 rows, |
110 | uint32 cols, |
111 | uint32 planes, |
112 | int32 sRowStep, |
113 | int32 sColStep, |
114 | int32 sPlaneStep, |
115 | int32 dRowStep, |
116 | int32 dColStep, |
117 | int32 dPlaneStep); |
118 | |
119 | void RefCopyArea8_S16 (const uint8 *sPtr, |
120 | int16 *dPtr, |
121 | uint32 rows, |
122 | uint32 cols, |
123 | uint32 planes, |
124 | int32 sRowStep, |
125 | int32 sColStep, |
126 | int32 sPlaneStep, |
127 | int32 dRowStep, |
128 | int32 dColStep, |
129 | int32 dPlaneStep); |
130 | |
131 | void RefCopyArea8_32 (const uint8 *sPtr, |
132 | uint32 *dPtr, |
133 | uint32 rows, |
134 | uint32 cols, |
135 | uint32 planes, |
136 | int32 sRowStep, |
137 | int32 sColStep, |
138 | int32 sPlaneStep, |
139 | int32 dRowStep, |
140 | int32 dColStep, |
141 | int32 dPlaneStep); |
142 | |
143 | void RefCopyArea16_S16 (const uint16 *sPtr, |
144 | int16 *dPtr, |
145 | uint32 rows, |
146 | uint32 cols, |
147 | uint32 planes, |
148 | int32 sRowStep, |
149 | int32 sColStep, |
150 | int32 sPlaneStep, |
151 | int32 dRowStep, |
152 | int32 dColStep, |
153 | int32 dPlaneStep); |
154 | |
155 | void RefCopyArea16_32 (const uint16 *sPtr, |
156 | uint32 *dPtr, |
157 | uint32 rows, |
158 | uint32 cols, |
159 | uint32 planes, |
160 | int32 sRowStep, |
161 | int32 sColStep, |
162 | int32 sPlaneStep, |
163 | int32 dRowStep, |
164 | int32 dColStep, |
165 | int32 dPlaneStep); |
166 | |
167 | void RefCopyArea8_R32 (const uint8 *sPtr, |
168 | real32 *dPtr, |
169 | uint32 rows, |
170 | uint32 cols, |
171 | uint32 planes, |
172 | int32 sRowStep, |
173 | int32 sColStep, |
174 | int32 sPlaneStep, |
175 | int32 dRowStep, |
176 | int32 dColStep, |
177 | int32 dPlaneStep, |
178 | uint32 pixelRange); |
179 | |
180 | void RefCopyArea16_R32 (const uint16 *sPtr, |
181 | real32 *dPtr, |
182 | uint32 rows, |
183 | uint32 cols, |
184 | uint32 planes, |
185 | int32 sRowStep, |
186 | int32 sColStep, |
187 | int32 sPlaneStep, |
188 | int32 dRowStep, |
189 | int32 dColStep, |
190 | int32 dPlaneStep, |
191 | uint32 pixelRange); |
192 | |
193 | void RefCopyAreaS16_R32 (const int16 *sPtr, |
194 | real32 *dPtr, |
195 | uint32 rows, |
196 | uint32 cols, |
197 | uint32 planes, |
198 | int32 sRowStep, |
199 | int32 sColStep, |
200 | int32 sPlaneStep, |
201 | int32 dRowStep, |
202 | int32 dColStep, |
203 | int32 dPlaneStep, |
204 | uint32 pixelRange); |
205 | |
206 | void RefCopyAreaR32_8 (const real32 *sPtr, |
207 | uint8 *dPtr, |
208 | uint32 rows, |
209 | uint32 cols, |
210 | uint32 planes, |
211 | int32 sRowStep, |
212 | int32 sColStep, |
213 | int32 sPlaneStep, |
214 | int32 dRowStep, |
215 | int32 dColStep, |
216 | int32 dPlaneStep, |
217 | uint32 pixelRange); |
218 | |
219 | void RefCopyAreaR32_16 (const real32 *sPtr, |
220 | uint16 *dPtr, |
221 | uint32 rows, |
222 | uint32 cols, |
223 | uint32 planes, |
224 | int32 sRowStep, |
225 | int32 sColStep, |
226 | int32 sPlaneStep, |
227 | int32 dRowStep, |
228 | int32 dColStep, |
229 | int32 dPlaneStep, |
230 | uint32 pixelRange); |
231 | |
232 | void RefCopyAreaR32_S16 (const real32 *sPtr, |
233 | int16 *dPtr, |
234 | uint32 rows, |
235 | uint32 cols, |
236 | uint32 planes, |
237 | int32 sRowStep, |
238 | int32 sColStep, |
239 | int32 sPlaneStep, |
240 | int32 dRowStep, |
241 | int32 dColStep, |
242 | int32 dPlaneStep, |
243 | uint32 pixelRange); |
244 | |
245 | /*****************************************************************************/ |
246 | |
247 | void RefRepeatArea8 (const uint8 *sPtr, |
248 | uint8 *dPtr, |
249 | uint32 rows, |
250 | uint32 cols, |
251 | uint32 planes, |
252 | int32 rowStep, |
253 | int32 colStep, |
254 | int32 planeStep, |
255 | uint32 repeatV, |
256 | uint32 repeatH, |
257 | uint32 phaseV, |
258 | uint32 phaseH); |
259 | |
260 | void RefRepeatArea16 (const uint16 *sPtr, |
261 | uint16 *dPtr, |
262 | uint32 rows, |
263 | uint32 cols, |
264 | uint32 planes, |
265 | int32 rowStep, |
266 | int32 colStep, |
267 | int32 planeStep, |
268 | uint32 repeatV, |
269 | uint32 repeatH, |
270 | uint32 phaseV, |
271 | uint32 phaseH); |
272 | |
273 | void RefRepeatArea32 (const uint32 *sPtr, |
274 | uint32 *dPtr, |
275 | uint32 rows, |
276 | uint32 cols, |
277 | uint32 planes, |
278 | int32 rowStep, |
279 | int32 colStep, |
280 | int32 planeStep, |
281 | uint32 repeatV, |
282 | uint32 repeatH, |
283 | uint32 phaseV, |
284 | uint32 phaseH); |
285 | |
286 | /*****************************************************************************/ |
287 | |
288 | void RefShiftRight16 (uint16 *dPtr, |
289 | uint32 rows, |
290 | uint32 cols, |
291 | uint32 planes, |
292 | int32 rowStep, |
293 | int32 colStep, |
294 | int32 planeStep, |
295 | uint32 shift); |
296 | |
297 | /*****************************************************************************/ |
298 | |
299 | void RefBilinearRow16 (const uint16 *sPtr, |
300 | uint16 *dPtr, |
301 | uint32 cols, |
302 | uint32 patPhase, |
303 | uint32 patCount, |
304 | const uint32 * kernCounts, |
305 | const int32 * const * kernOffsets, |
306 | const uint16 * const * kernWeights, |
307 | uint32 sShift); |
308 | |
309 | void RefBilinearRow32 (const real32 *sPtr, |
310 | real32 *dPtr, |
311 | uint32 cols, |
312 | uint32 patPhase, |
313 | uint32 patCount, |
314 | const uint32 * kernCounts, |
315 | const int32 * const * kernOffsets, |
316 | const real32 * const * kernWeights, |
317 | uint32 sShift); |
318 | |
319 | /*****************************************************************************/ |
320 | |
321 | void RefBaselineABCtoRGB (const real32 *sPtrA, |
322 | const real32 *sPtrB, |
323 | const real32 *sPtrC, |
324 | real32 *dPtrR, |
325 | real32 *dPtrG, |
326 | real32 *dPtrB, |
327 | uint32 count, |
328 | const dng_vector &cameraWhite, |
329 | const dng_matrix &cameraToRGB); |
330 | |
331 | void RefBaselineABCDtoRGB (const real32 *sPtrA, |
332 | const real32 *sPtrB, |
333 | const real32 *sPtrC, |
334 | const real32 *sPtrD, |
335 | real32 *dPtrR, |
336 | real32 *dPtrG, |
337 | real32 *dPtrB, |
338 | uint32 count, |
339 | const dng_vector &cameraWhite, |
340 | const dng_matrix &cameraToRGB); |
341 | |
342 | /*****************************************************************************/ |
343 | |
344 | void RefBaselineHueSatMap (const real32 *sPtrR, |
345 | const real32 *sPtrG, |
346 | const real32 *sPtrB, |
347 | real32 *dPtrR, |
348 | real32 *dPtrG, |
349 | real32 *dPtrB, |
350 | uint32 count, |
351 | const dng_hue_sat_map &lut, |
352 | const dng_1d_table *encodeTable, |
353 | const dng_1d_table *decodeTable); |
354 | |
355 | /*****************************************************************************/ |
356 | |
357 | void RefBaselineRGBtoGray (const real32 *sPtrR, |
358 | const real32 *sPtrG, |
359 | const real32 *sPtrB, |
360 | real32 *dPtrG, |
361 | uint32 count, |
362 | const dng_matrix &matrix); |
363 | |
364 | void RefBaselineRGBtoRGB (const real32 *sPtrR, |
365 | const real32 *sPtrG, |
366 | const real32 *sPtrB, |
367 | real32 *dPtrR, |
368 | real32 *dPtrG, |
369 | real32 *dPtrB, |
370 | uint32 count, |
371 | const dng_matrix &matrix); |
372 | |
373 | /*****************************************************************************/ |
374 | |
375 | void RefBaseline1DTable (const real32 *sPtr, |
376 | real32 *dPtr, |
377 | uint32 count, |
378 | const dng_1d_table &table); |
379 | |
380 | /*****************************************************************************/ |
381 | |
382 | void RefBaselineRGBTone (const real32 *sPtrR, |
383 | const real32 *sPtrG, |
384 | const real32 *sPtrB, |
385 | real32 *dPtrR, |
386 | real32 *dPtrG, |
387 | real32 *dPtrB, |
388 | uint32 count, |
389 | const dng_1d_table &table); |
390 | |
391 | /*****************************************************************************/ |
392 | |
393 | void RefResampleDown16 (const uint16 *sPtr, |
394 | uint16 *dPtr, |
395 | uint32 sCount, |
396 | int32 sRowStep, |
397 | const int16 *wPtr, |
398 | uint32 wCount, |
399 | uint32 pixelRange); |
400 | |
401 | void RefResampleDown32 (const real32 *sPtr, |
402 | real32 *dPtr, |
403 | uint32 sCount, |
404 | int32 sRowStep, |
405 | const real32 *wPtr, |
406 | uint32 wCount); |
407 | |
408 | /*****************************************************************************/ |
409 | |
410 | void RefResampleAcross16 (const uint16 *sPtr, |
411 | uint16 *dPtr, |
412 | uint32 dCount, |
413 | const int32 *coord, |
414 | const int16 *wPtr, |
415 | uint32 wCount, |
416 | uint32 wStep, |
417 | uint32 pixelRange); |
418 | |
419 | void RefResampleAcross32 (const real32 *sPtr, |
420 | real32 *dPtr, |
421 | uint32 dCount, |
422 | const int32 *coord, |
423 | const real32 *wPtr, |
424 | uint32 wCount, |
425 | uint32 wStep); |
426 | |
427 | /*****************************************************************************/ |
428 | |
429 | bool RefEqualBytes (const void *sPtr, |
430 | const void *dPtr, |
431 | uint32 count); |
432 | |
433 | bool RefEqualArea8 (const uint8 *sPtr, |
434 | const uint8 *dPtr, |
435 | uint32 rows, |
436 | uint32 cols, |
437 | uint32 planes, |
438 | int32 sRowStep, |
439 | int32 sColStep, |
440 | int32 sPlaneStep, |
441 | int32 dRowStep, |
442 | int32 dColStep, |
443 | int32 dPlaneStep); |
444 | |
445 | bool RefEqualArea16 (const uint16 *sPtr, |
446 | const uint16 *dPtr, |
447 | uint32 rows, |
448 | uint32 cols, |
449 | uint32 planes, |
450 | int32 sRowStep, |
451 | int32 sColStep, |
452 | int32 sPlaneStep, |
453 | int32 dRowStep, |
454 | int32 dColStep, |
455 | int32 dPlaneStep); |
456 | |
457 | bool RefEqualArea32 (const uint32 *sPtr, |
458 | const uint32 *dPtr, |
459 | uint32 rows, |
460 | uint32 cols, |
461 | uint32 planes, |
462 | int32 sRowStep, |
463 | int32 sColStep, |
464 | int32 sPlaneStep, |
465 | int32 dRowStep, |
466 | int32 dColStep, |
467 | int32 dPlaneStep); |
468 | |
469 | /*****************************************************************************/ |
470 | |
471 | void RefVignetteMask16 (uint16 *mPtr, |
472 | uint32 rows, |
473 | uint32 cols, |
474 | int32 rowStep, |
475 | int64 offsetH, |
476 | int64 offsetV, |
477 | int64 stepH, |
478 | int64 stepV, |
479 | uint32 tBits, |
480 | const uint16 *table); |
481 | |
482 | /*****************************************************************************/ |
483 | |
484 | void RefVignette16 (int16 *sPtr, |
485 | const uint16 *mPtr, |
486 | uint32 rows, |
487 | uint32 cols, |
488 | uint32 planes, |
489 | int32 sRowStep, |
490 | int32 sPlaneStep, |
491 | int32 mRowStep, |
492 | uint32 mBits); |
493 | |
494 | /*****************************************************************************/ |
495 | |
496 | void RefVignette32 (real32 *sPtr, |
497 | const uint16 *mPtr, |
498 | uint32 rows, |
499 | uint32 cols, |
500 | uint32 planes, |
501 | int32 sRowStep, |
502 | int32 sPlaneStep, |
503 | int32 mRowStep, |
504 | uint32 mBits); |
505 | |
506 | /*****************************************************************************/ |
507 | |
508 | void RefMapArea16 (uint16 *dPtr, |
509 | uint32 count0, |
510 | uint32 count1, |
511 | uint32 count2, |
512 | int32 step0, |
513 | int32 step1, |
514 | int32 step2, |
515 | const uint16 *map); |
516 | |
517 | /*****************************************************************************/ |
518 | |
519 | #endif |
520 | |
521 | /*****************************************************************************/ |
522 | |