[495361]: src / panotools-wrappers / pttransform.h Maximize Restore History

Download this file

pttransform.h    116 lines (98 with data), 3.5 kB

  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
/*
* pttransform.h
*
* Copyright Pablo d'Angelo
*
* May 2007
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this software; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*
* Author: Pablo d'Angelo pablo.dangelo@web.de
*
*/
#include <stdio.h>
#include "parser/tparser.h"
#include <pano13/panorama.h>
#include <pano13/filter.h>
/** state of a transform.
*
* Internal data structure, do not access directly
*
*/
typedef struct
{
struct MakeParams mp;
fDesc stack[15], fD; // Parameters for execute
// inverse (src image -> pano image) transform
struct MakeParams invmp;
fDesc invstack[15], invfD; // Parameters for execute
// descriptions of panorama and source image
pt_script_pano pano;
pt_script_image src;
double w2, h2, sw2, sh2;
int crop_circular;
double crop_circular_cx;
double crop_circular_cy;
double crop_circular_radius;
double crop_radius;
double crop_centre;
double crop_left;
double crop_right;
double crop_top;
double crop_bottom;
} pt_transform;
/** Create a panotools transform
*
* @param script path to panotools script file. Created with parser by Daniel
* @param imgNr number of input image
*
* @return pano_transform_ptr pointer to transform struct. needs to be released
* with panoTransformDispose
*/
pt_transform * panoTransformCreate(pt_script * script, int imgNr);
/** Transform coordinates (inverse transform)
*
* @param x_dest x (input) coordinate in destination (panorama) image
* @param y_dest y (input) coordinate in destination (panorama) image
*
* @param x_src x (output) coordinate in source (input) image
* @param y_src y (output) coordinate in source (input) image
*
* @return 0: outside source image, x_src, y_src are not valid,
* either not possible in this projection, or outside
* the image.
* 1: inside src image, x_src, y_src valid.
*
*/
int panoTransformInverse(pt_transform *transform,
double x_dest, double y_dest, double *x_src, double *y_src );
/** Transform coordinates (forward transform)
*
* @param x_src x (input) coordinate in source (input) image
* @param y_src y (input) coordinate in source (input) image
*
* @param x_dest x (output) coordinate in destination (panorama) image
* @param y_dest y (output) coordinate in destination (panorama) image
*
* @return 0: outside source image, x_dest, y_dest are not valid,
* 1: inside src image, x_dest, y_dest valid.
*
*/
int panoTransformForward(pt_transform *transform,
double x_src, double y_src, double *x_dest, double *y_dest );
/** Free a pt_transform struct
*/
void panoTransformDispose(pt_transform **transform);