File: gap_morph_main.h

package info (click to toggle)
gimp-gap 2.6.0%2Bdfsg-1
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 19,656 kB
  • ctags: 7,358
  • sloc: ansic: 119,801; sh: 3,890; makefile: 932; lisp: 97; pascal: 55
file content (128 lines) | stat: -rw-r--r-- 4,575 bytes parent folder | download | duplicates (4)
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
/*  gap_morph_main.h
 *
 *  creation of morphing animations (transform source image into des. image) by Wolfgang Hofer
 *  2004/02/11
 */
/* The GIMP -- an image manipulation program
 * Copyright (C) 1995 Spencer Kimball and Peter Mattis
 *
 * 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 program 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 program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 */

/* revision history:
 * version 1.3.15a; 2004/02/12  hof: created
 */

#ifndef _GAP_MORPH_MAIN_H
#define _GAP_MORPH_MAIN_H

#include "libgimp/gimp.h"
#include "gap_lib.h"
#include <gtk/gtk.h>
#include <libgimp/gimp.h>
#include <libgimp/gimpui.h>
#include "gap_pview_da.h"

/* render_mode Radio Buttons */
#define   GAP_MORPH_RENDER_MODE_MORPH    0
#define   GAP_MORPH_RENDER_MODE_WARP     1    

#define   GAP_MORPH_WORKPOINT_FILENAME_MAX_LENGTH     1024 

typedef struct GapMorphWorkPoint { /* nickname: wp */
     gdouble fdst_x;   /* final dest koord (as set by user for last dest. frame) */
     gdouble fdst_y;
     gdouble osrc_x;   /* start source koord (as set by user for the 1.st frame) */
     gdouble osrc_y;

     gdouble dst_x;    /* koord trans */
     gdouble dst_y;
     gdouble src_x;    /* osrc_x scaled to koords of current (dest) frame */
     gdouble src_y;

     void *next;
     
     /* for calculations per pixel */
     gdouble  warp_weight;
     gdouble  gravity;
     gdouble  sqr_dist;
     gdouble  dist;
     gdouble  inv_dist;    /* 1 / sqr_distance */
     gdouble  angle_deg;
     gint     xy_relation;
     gint     sek_idx;
     gboolean is_alive;
     void    *next_selected;
     void    *next_sek;
     
  } GapMorphWorkPoint;


typedef struct GapMorphGlobalParams  { /* nickname: mgpp */
  GimpRunMode  run_mode;
  gint32       image_id;

  gint32              tween_steps;
  gint32              fdst_layer_id;
  gint32              osrc_layer_id;


  GapMorphWorkPoint  *master_wp_list;

  char                workpoint_file_lower[GAP_MORPH_WORKPOINT_FILENAME_MAX_LENGTH];
  char                workpoint_file_upper[GAP_MORPH_WORKPOINT_FILENAME_MAX_LENGTH];

  gboolean            create_tween_layers;       /* FALSE: operate on existing layers only */
  gboolean            have_workpointsets;        /* FALSE: use the default workpointset master_wp_list
                                                  * TRUE: use lower_wp_list and upper_wp_list
                                                  *       foreach handled frame the
                                                  *       lower and upper list are fetched from 
                                                  *       best matching workpointfile.
                                                  *       (using the numberpart of the filename)
                                                  */
  gboolean            use_quality_wp_selection;
  gboolean            use_gravity;
  gdouble             gravity_intensity;     /* 1.0 upto 5 (gravity power) */
  gdouble             affect_radius;         /* distortion pixelradius (0 == no gravity) */

  gint32              render_mode;
  gboolean            do_progress;
  gdouble             master_progress;
  gdouble             layer_progress_step;

  gdouble             tween_mix_factor;  /* 0.0 upto 1.0 wher 0.0 gives source layer 1.0 dest layer as resut */
  gint32              range_from;
  gint32              range_to;
  gboolean            overwrite_flag;
  gboolean            do_simple_fade;   /* bypass morph algortihm when renderiing tweens and use simple fade instead */
} GapMorphGlobalParams;

typedef struct GapMorphWarpCoreAPI  { /* nickname: wcap */
  GapMorphWorkPoint *wp_list;
  gboolean      use_quality_wp_selection;
  gboolean      use_gravity;
  gdouble       gravity_intensity;
  gdouble       affect_radius;         /* distortion pixelradius (0 == no gravity) */
  gdouble       sqr_affect_radius;
  
  
  gdouble       scale_x;
  gdouble       scale_y;
  gboolean      printf_flag;
  
}  GapMorphWarpCoreAPI;

#endif