Imported Debian version 1.0~trusty
[deb_vid.stab.git] / src / transformfloat.h
1 /*
2 * transformfloat.h
3 *
4 * Copyright (C) Georg Martius - June 2011
5 * georg dot martius at web dot de
6 *
7 * This file is part of vid.stab video stabilization library
8 *
9 * vid.stab is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License,
11 * as published by the Free Software Foundation; either version 2, or
12 * (at your option) any later version.
13 *
14 * vid.stab is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with GNU Make; see the file COPYING. If not, write to
21 * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
22 *
23 * This work is licensed under the Creative Commons
24 * Attribution-NonCommercial-ShareAlike 2.5 License. To view a copy of
25 * this license, visit http://creativecommons.org/licenses/by-nc-sa/2.5/
26 * or send a letter to Creative Commons, 543 Howard Street, 5th Floor,
27 * San Francisco, California, 94105, USA.
28 * This EXCLUDES COMMERCIAL USAGE
29 *
30 */
31 #ifndef __TRANSFORMFLOAT_H
32 #define __TRANSFORMFLOAT_H
33
34 #include "transformtype.h"
35 #include <stdint.h>
36
37 #ifdef TESTING
38 #define _FLT(n) n ## _float
39 #else
40 #define _FLT(n) n
41 #endif
42
43 struct _VSTransformData;
44
45 /// does the actual transformation in Packed space
46 int _FLT(transformPacked)(struct _VSTransformData* td, VSTransform t);
47 /// does the actual transformation in Planar space
48 int _FLT(transformPlanar)(struct _VSTransformData* td, VSTransform t);
49
50 /**
51 * interpolate: general interpolation function pointer for one channel image data
52 *
53 * Parameters:
54 * rv: destination pixel (call by reference)
55 * x,y: the source coordinates in the image img. Note this
56 * are real-value coordinates, that's why we interpolate
57 * img: source image
58 * img_linesize: length of one line in bytes (>= width)
59 * width,height: dimension of image
60 * def: default value if coordinates are out of range
61 * Return value: None
62 */
63 typedef void (*_FLT(vsInterpolateFun))(uint8_t *rv, float x, float y,
64 const uint8_t *img, int img_linesize,
65 int width, int height, uint8_t def);
66
67 /* forward deklarations, please look in the .c file for documentation*/
68 void _FLT(interpolateBiLinBorder)(uint8_t *rv, float x, float y,
69 const uint8_t *img, int img_linesize,
70 int w, int h, uint8_t def);
71 void _FLT(interpolateBiCub)(uint8_t *rv, float x, float y,
72 const uint8_t *img, int img_linesize,
73 int width, int height, uint8_t def);
74 void _FLT(interpolateBiLin)(uint8_t *rv, float x, float y,
75 const uint8_t *img, int img_linesize,
76 int w, int h, uint8_t def);
77 void _FLT(interpolateLin)(uint8_t *rv, float x, float y,
78 const uint8_t *img, int img_linesize,
79 int w, int h, uint8_t def);
80 void _FLT(interpolateZero)(uint8_t *rv, float x, float y,
81 const uint8_t *img, int img_linesize,
82 int w, int h, uint8_t def);
83 void _FLT(interpolateN)(uint8_t *rv, float x, float y,
84 const uint8_t *img, int img_linesize,
85 int width, int height,
86 uint8_t N, uint8_t channel, uint8_t def);
87
88 #endif
89
90 /*
91 * Local variables:
92 * c-file-style: "stroustrup"
93 * c-file-offsets: ((case-label . *) (statement-case-intro . *))
94 * indent-tabs-mode: nil
95 * End:
96 *
97 * vim: expandtab shiftwidth=4:
98 */