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 20 #ifndef RS_LENS_H 21 #define RS_LENS_H 22 23 #include <glib-object.h> 24 #include <rawstudio.h> 25 26 G_BEGIN_DECLS 27 28 #define RS_TYPE_LENS rs_lens_get_type() 29 #define RS_LENS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RS_TYPE_LENS, RSLens)) 30 #define RS_LENS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RS_TYPE_LENS, RSLensClass)) 31 #define RS_IS_LENS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RS_TYPE_LENS)) 32 #define RS_IS_LENS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RS_TYPE_LENS)) 33 #define RS_LENS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RS_TYPE_LENS, RSLensClass)) 34 GType rs_lens_get_type(void); 35 36 typedef struct _RSLens RSLens; 37 38 typedef struct { 39 GObjectClass parent_class; 40 } RSLensClass; 41 42 /** 43 * Instantiate a new RSLens 44 * @return A new RSLens with a refcount of 1 45 */ 46 RSLens *rs_lens_new(void); 47 48 /** 49 * Instantiate a new RSLens from a RSMetadata 50 * @param metadata A RSMetadata type with lens information embedded 51 * @return A new RSLens with a refcount of 1 52 */ 53 RSLens *rs_lens_new_from_medadata(RSMetadata *metadata); 54 55 /** 56 * Get the Lensfun make from a RSLens 57 * @param lens A RSLens 58 * @return The make as used by Lensfun or NULL if unknown 59 */ 60 const gchar *rs_lens_get_lensfun_make(RSLens *lens); 61 62 /** 63 * Get the Lensfun model from a RSLens 64 * @param lens A RSLens 65 * @return The model as used by Lensfun or NULL if unknown 66 */ 67 const gchar *rs_lens_get_lensfun_model(RSLens *lens); 68 69 /** 70 * Get a human readable description of the lens 71 * @param lens A RSLens 72 * @return A human readble string describing the lens 73 */ 74 const gchar *rs_lens_get_description(RSLens *lens); 75 76 void rs_lens_set_lensfun_make(RSLens *lens, gchar *make); 77 void rs_lens_set_lensfun_model(RSLens *lens, gchar *model); 78 void rs_lens_set_lensfun_enabled(RSLens *lens, gboolean enabled); 79 gboolean rs_lens_get_lensfun_enabled(RSLens *lens); 80 81 G_END_DECLS 82 83 #endif /* RS_LENS_H */ 84