1 /* 2 * * Copyright (C) 2006-2011 Anders Brander <anders@brander.dk>, 3 * * Anders Kvist <akv@lnxbx.dk> and Klaus Post <klauspost@gmail.com> 4 * 5 * This program is free software; you can redistribute it and/or 6 * modify it under the terms of the GNU General Public License 7 * as published by the Free Software Foundation; either version 2 8 * of the License, or (at your option) any later version. 9 * 10 * This program is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNU General Public License for more details. 14 * 15 * You should have received a copy of the GNU General Public License 16 * along with this program; if not, write to the Free Software 17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 */ 19 #ifndef APPLICATION_H 20 #define APPLICATION_H 21 22 #include <rawstudio.h> 23 #include <gtk/gtk.h> 24 #include <glib.h> 25 #include <stdint.h> 26 #include <sqlite3.h> 27 28 /* Check for thread support */ 29 #if (!defined(G_THREADS_ENABLED) || defined(G_THREADS_IMPL_NONE)) 30 #error GLib was not compiled with thread support, Rawstudio needs threads - sorry. 31 #endif 32 33 typedef struct _RSStore RSStore; 34 35 /* Opaque definition, declared in rs-batch.h */ 36 typedef struct _RS_QUEUE RS_QUEUE; 37 38 typedef struct _photo { 39 GObject parent; 40 gchar *filename; 41 RS_IMAGE16 *input; 42 RSFilterResponse *input_response; 43 RSSettings *settings[3]; 44 gulong settings_signal[3]; 45 gint priority; 46 guint orientation; 47 RSMetadata *metadata; 48 RS_RECT *crop; 49 gdouble angle; 50 gboolean exported; 51 RSColorSpace *embedded_profile; 52 RSDcpFile *dcp; 53 RSIccProfile *icc; 54 gboolean dispose_has_run; 55 RSFilter *thumbnail_filter; 56 RS_RECT *proposed_crop; 57 RSFilter *auto_wb_filter; 58 gdouble *auto_wb_mul; 59 } RS_PHOTO; 60 61 typedef struct { 62 RS_PHOTO *photo; 63 RSSettings *settings_buffer; 64 RSDcpFile *dcp_buffer; 65 RSIccProfile *icc_buffer; 66 GtkWidget *curve[3]; 67 gint current_setting; 68 RS_QUEUE *queue; 69 RSStore *store; 70 71 /* These should be moved to a future RS_WINDOW */ 72 GtkWidget *window; 73 gboolean window_fullscreen; 74 GtkWidget *iconbox; 75 GtkWidget *tools; 76 GtkWidget *toolbox; 77 GtkWidget *preview; 78 GtkWidget *window_preview_screen; 79 80 /* Generic filter chain */ 81 RSFilter *filter_input; 82 RSFilter *filter_demosaic; 83 RSFilter *filter_fuji_rotate; 84 RSFilter *filter_demosaic_cache; 85 RSFilter *filter_lensfun; 86 RSFilter *filter_rotate; 87 RSFilter *filter_crop; 88 RSFilter *filter_end; 89 } RS_BLOB; 90 91 gboolean rs_photo_save(RS_PHOTO *photo, RSFilter *prior_to_resample, RSOutput *output, 92 gint width, gint height, gboolean keep_aspect, gdouble scale, gint snapshot); 93 gboolean rs_photo_copy_to_clipboard(RS_PHOTO *photo, RSFilter *prior_to_resample, gint width, gint height, gboolean keep_aspect, gdouble scale, gint snapshot); 94 RS_BLOB *rs_new(void); 95 void rs_free(RS_BLOB *rs); 96 /* Cheater function to get the main blob - use carefully! */ 97 RS_BLOB* rs_get_blob(void); 98 void rs_set_photo(RS_BLOB *rs, RS_PHOTO *photo); 99 void rs_white_black_point(RS_BLOB *rs); 100 101 #endif /* APPLICATION_H */ 102