aboutsummaryrefslogtreecommitdiffstats
path: root/src/filter.h
blob: 1a37f67fece5b1644f1d214d2c11eb5f8b928e8a (plain)
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
/* this file is part of camorama, a gnome webcam viewer
 *
 * AUTHORS
 *        Greg Jones             <greg@fixedgear.org>
 *        Bastien Nocera             <hadess@hadess.net>
 *      Sven Herzberg        <herzi@gnome-de.org>
 *
 * Copyright (C) 2003 Greg Jones
 * Copyright (C) 2003 Bastien Nocera
 * Copyright (C) 2005,2006 Sven Herzberg
 *
 * 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
 */

#ifndef CAMORAMA_FILTER_H
#define CAMORAMA_FILTER_H

#include <glib-object.h>

G_BEGIN_DECLS

typedef struct _CamoramaFilter CamoramaFilter;
typedef struct _CamoramaFilterClass CamoramaFilterClass;

#define CAMORAMA_TYPE_FILTER         (camorama_filter_get_type())
#define CAMORAMA_FILTER(i)           (G_TYPE_CHECK_INSTANCE_CAST((i),       \
                                      CAMORAMA_TYPE_FILTER, CamoramaFilter))
#define CAMORAMA_FILTER_CLASS(c)     (G_TYPE_CHECK_CLASS_CAST((c),          \
                                      CAMORAMA_TYPE_FILTER,                 \
                                      CamoramaFilterClass))
#define CAMORAMA_IS_FILTER(i)        (G_TYPE_CHECK_INSTANCE_TYPE((i),       \
                                      CAMORAMA_TYPE_FILTER))
#define CAMORAMA_IS_FILTER_CLASS(c)  (G_TYPE_CHECK_CLASS_TYPE((c),          \
                                      CAMORAMA_TYPE_FILTER))
#define CAMORAMA_FILTER_GET_CLASS(i) (G_TYPE_INSTANCE_GET_CLASS((i),        \
                                      CAMORAMA_TYPE_FILTER,                 \
                                      CamoramaFilterClass))

GType camorama_filter_get_type(void);
GType camorama_filter_mirror_get_type(void);
GType camorama_filter_laplace_get_type(void);
GType camorama_filter_reichardt_get_type(void);
GType camorama_filter_color_get_type(void);
GType camorama_filter_invert_get_type(void);
GType camorama_filter_threshold_get_type(void);
GType camorama_filter_threshold_channel_get_type(void);
GType camorama_filter_wacky_get_type(void);
GType camorama_filter_mono_get_type(void);
GType camorama_filter_mono_weight_get_type(void);
GType camorama_filter_sobel_get_type(void);
GType camorama_filter_smooth_get_type(void);

void camorama_filter_color_filter(void *__filter, guchar *image, int x, int y,
                                  int depth);

void camorama_filters_init(void);
gchar const *camorama_filter_get_name(CamoramaFilter * self);
void camorama_filter_apply(CamoramaFilter *self, guchar *image,
                           gint width, gint height, gint depth);

struct _CamoramaFilter {
    GObject base_instance;
};

struct _CamoramaFilterClass {
    GObjectClass base_class;

    gchar const *name;

    void (*filter)(void *self,
                    guchar *image, gint width, gint height, gint depth);
};

void yuv420p_to_rgb(guchar *image, guchar *temp, gint x, gint y, gint z);

G_END_DECLS

#endif                          /* !CAMORAMA_FILTER_H */

Privacy Policy