FJMovieEditor Pré-Alpha
A GTK video editor for GNOME. Designed for Artists to do, special effects, compositing and animation.

trunk/libfjme/Utils.h

Go to the documentation of this file.
00001 /*
00002 A GTK video editor Designed for Artists to do, special effects, compositing and animation.
00003 Copyright (C) 2011  Fabio J. Gonzalez
00004 
00005 This program is free software: you can redistribute it and/or modify
00006 it under the terms of the GNU General Public License as published by
00007 the Free Software Foundation, either version 3 of the License, or
00008 (at your option) any later version.
00009 
00010 This program is distributed in the hope that it will be useful,
00011 but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013 GNU General Public License for more details.
00014 
00015 You should have received a copy of the GNU General Public License
00016 along with this program.  If not, see <http://www.gnu.org/licenses/>.
00017  */
00018 
00026 #ifndef FJME_UTILS_H
00027 #define FJME_UTILS_H
00028 
00029 #include <glib.h>
00030 #include "video.h"
00031 
00036 #define sq(x) (x*x)
00037 
00043 #define vec_distf( a, b ) \
00044         ( sqrt( sq(b.x - a.x) + sq(b.y - a.y) ) )
00045 
00051 #define between_square( x, y, a, b, width, height ) \
00052   (x >= a && x < a+width && \
00053          y >= b && y < b+height)
00054 
00055 #define setn(x, y) if(x == NULL) x = y
00056 
00057 typedef struct AnmVector2d {
00058     gdouble* x;
00059     gdouble* y;
00060 } AnmVector2d;
00061 
00071 typedef union {
00072     gfloat c[2];
00073 
00074     struct {
00075         gfloat x;
00076         gfloat y;
00077     };
00078 
00079 } Vector2f;
00080 
00098 typedef struct {
00099 
00100     union {
00101         gdouble * c[3];
00102 
00103         struct {
00109             gdouble* r;
00110 
00116             gdouble* g;
00117 
00123             gdouble* b;
00124         };
00125 
00126         struct {
00127             gdouble* red;
00128             gdouble* green;
00129             gdouble* blue;
00130         };
00131 
00132     };
00133 } AnmColor;
00134 
00139 AnmColor* addAnmColor();
00140 
00146 AnmColor* AnmColorFromColorD( Pixeld* c );
00147 
00154 Vector2f* vector2f(gfloat x, gfloat y);
00155 
00170 gboolean draw_plugin(iPlugin* p);
00171 
00177 gboolean draw_plugin_custom( GdkPixbuf* pixels, iPlugin* p );
00178 
00183 gchar* fjme_data_directory();
00184 
00185 
00186 GtkWidget* fjme_button_from_file( gchar* file );
00187 #endif
All Data Structures Files Functions Variables Typedefs Defines