BRL-CAD
filters.h
Go to the documentation of this file.
1/* F I L T E R S . H
2 * BRL-CAD
3 *
4 * Copyright (c) 2011-2023 United States Government as represented by
5 * the U.S. Army Research Laboratory.
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public License
9 * version 2.1 as published by the Free Software Foundation.
10 *
11 * This library is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this file; see the file named COPYING for more
18 * information.
19 */
20/** @addtogroup icv_filters
21 *
22 * @brief
23 * Routines for image filtering.
24 *
25 * This is done mainly using the convolution of images. Both Gray Scale and RGB
26 * images are taken care of.
27 *
28 */
29
30#ifndef ICV_FILTERS_H
31#define ICV_FILTERS_H
32
33#include "common.h"
34#include "icv/defines.h"
35
36__BEGIN_DECLS
37
38/** @{ */
39/** @file icv/filters.h */
40
41typedef enum {
50
51typedef enum {
58
59/**
60 * Filters an image with the specified filter type. Basically
61 * convolves kernel with the image. Does zero_padding for outbound
62 * pixels.
63 *
64 * @param img Image to be filtered.
65 * @param filter_type Type of filter to be used.
66 *
67 */
68ICV_EXPORT extern int icv_filter(icv_image_t *img, ICV_FILTER filter_type);
69
70
71/**
72 * Filters a set of three image with the specified filter type. Does
73 * zero_padding for outbound pixels. Finds the resultant pixel with
74 * the help of neighboring pixels in all the three images.
75 *
76 *
77 * @return Resultant image.
78 *
79 */
80ICV_EXPORT extern icv_image_t *icv_filter3(icv_image_t *old_img,
81 icv_image_t *curr_img,
82 icv_image_t *new_img,
83 ICV_FILTER3 filter_type);
84
85/**
86 * @brief
87 * Fades an image in place.
88 *
89 * icv_fade will darken a pix by a certain fraction.
90 *
91 * @param img ICV Image to be faded.
92 * @param fraction should be between 0 to 1. Amount by which the image
93 * is needed to faded.
94 */
95ICV_EXPORT extern int icv_fade(icv_image_t *img, double fraction);
96
97/** @} */
98
99__END_DECLS
100
101#endif /* ICV_FILTERS_H */
102
103/*
104 * Local Variables:
105 * tab-width: 8
106 * mode: C
107 * indent-tabs-mode: t
108 * c-file-style: "stroustrup"
109 * End:
110 * ex: shiftwidth=4 tabstop=8
111 */
Header file for the BRL-CAD common definitions.
int icv_fade(icv_image_t *img, double fraction)
Fades an image in place.
ICV_FILTER
Definition: filters.h:41
int icv_filter(icv_image_t *img, ICV_FILTER filter_type)
ICV_FILTER3
Definition: filters.h:51
icv_image_t * icv_filter3(icv_image_t *old_img, icv_image_t *curr_img, icv_image_t *new_img, ICV_FILTER3 filter_type)
@ ICV_FILTER_BOXCAR_AVERAGE
Definition: filters.h:48
@ ICV_FILTER_HORIZONTAL_GRAD
Definition: filters.h:44
@ ICV_FILTER_LOW_PASS
Definition: filters.h:42
@ ICV_FILTER_NULL
Definition: filters.h:47
@ ICV_FILTER_VERTICAL_GRAD
Definition: filters.h:45
@ ICV_FILTER_LAPLACIAN
Definition: filters.h:43
@ ICV_FILTER_HIGH_PASS
Definition: filters.h:46
@ ICV_FILTER3_ANIMATION_SMEAR
Definition: filters.h:55
@ ICV_FILTER3_NULL
Definition: filters.h:56
@ ICV_FILTER3_LOW_PASS
Definition: filters.h:52
@ ICV_FILTER3_HIGH_PASS
Definition: filters.h:53
@ ICV_FILTER3_BOXCAR_AVERAGE
Definition: filters.h:54