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_FILTER_REQUEST_H
21 #define RS_FILTER_REQUEST_H
22 
23 #include <glib-object.h>
24 #include "rs-filter-param.h"
25 
26 G_BEGIN_DECLS
27 
28 #define RS_TYPE_FILTER_REQUEST rs_filter_request_get_type()
29 #define RS_FILTER_REQUEST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RS_TYPE_FILTER_REQUEST, RSFilterRequest))
30 #define RS_FILTER_REQUEST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RS_TYPE_FILTER_REQUEST, RSFilterRequestClass))
31 #define RS_IS_FILTER_REQUEST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RS_TYPE_FILTER_REQUEST))
32 #define RS_IS_FILTER_REQUEST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RS_TYPE_FILTER_REQUEST))
33 #define RS_FILTER_REQUEST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RS_TYPE_FILTER_REQUEST, RSFilterRequestClass))
34 
35 typedef struct _RSFilterRequest RSFilterRequest;
36 
37 typedef struct {
38 	RSFilterParamClass parent_class;
39 } RSFilterRequestClass;
40 
41 GType rs_filter_request_get_type(void);
42 
43 /**
44  * Instantiate a new RSFilterRequest
45  * @return A new RSFilterRequest with a refcount of 1
46  */
47 RSFilterRequest *rs_filter_request_new(void);
48 
49 #define RS_FILTER_REQUEST_QUICK rs_filter_request_get_quick_singleton()
50 
51 /**
52  * Get a RSFilterRequest singleton with quick set to TRUE
53  * @return A RSFilterRequest, this should not be unreffed
54  */
55 const RSFilterRequest *rs_filter_request_get_quick_singleton(void);
56 
57 /**
58  * Clone a RSFilterRequest
59  * @param filter_request A RSFilterRequest
60  * @return A new RSFilterRequest with a refcount of 1 with the same settings as
61  *         filter_request
62  */
63 RSFilterRequest *rs_filter_request_clone(const RSFilterRequest *filter_request);
64 
65 /**
66  * Set a region of interest
67  * @param filter_request A RSFilterRequest
68  * @param roi A GdkRectangle describing the ROI or NULL to disable
69  */
70 void rs_filter_request_set_roi(RSFilterRequest *filter_request, GdkRectangle *roi);
71 
72 /**
73  * Get the region of interest from a RSFilterRequest
74  * @param filter_request A RSFilterRequest
75  * @return A GdkRectangle describing the ROI or NULL if none is set, the
76  *         GdkRectangle belongs to the filter_request and should not be freed
77  */
78 GdkRectangle *rs_filter_request_get_roi(const RSFilterRequest *filter_request);
79 
80 /**
81  * Mark a request as "quick" allowing filters to priotize speed over quality
82  * @param filter_request A RSFilterRequest
83  * @param quick TRUE to mark a request as QUICK, FALSE to set normal (default)
84  */
85 void rs_filter_request_set_quick(RSFilterRequest *filter_request, gboolean quick);
86 
87 /**
88  * Get quick status of a RSFilterRequest
89  * @param filter_request A RSFilterRequest
90  * @return TRUE if quality should be sacrified for speed, FALSE otherwise
91  */
92 gboolean rs_filter_request_get_quick(const RSFilterRequest *filter_request);
93 
94 G_END_DECLS
95 
96 #endif /* RS_FILTER_REQUEST_H */
97