1/**************************************************************************
2 *
3 * Copyright 2011 Lauri Kasanen
4 * All Rights Reserved.
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the
8 * "Software"), to deal in the Software without restriction, including
9 * without limitation the rights to use, copy, modify, merge, publish,
10 * distribute, sub license, and/or sell copies of the Software, and to
11 * permit persons to whom the Software is furnished to do so, subject to
12 * the following conditions:
13 *
14 * The above copyright notice and this permission notice (including the
15 * next paragraph) shall be included in all copies or substantial portions
16 * of the Software.
17 *
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
19 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
21 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
22 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
23 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
24 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25 *
26 **************************************************************************/
27
28#ifndef POSTPROCESS_H
29#define POSTPROCESS_H
30
31#include "pipe/p_state.h"
32
33#ifdef __cplusplus
34extern "C" {
35#endif
36
37struct cso_context;
38struct st_context_iface;
39
40struct pp_queue_t;              /* Forward definition */
41struct pp_program;
42
43/* Less typing later on */
44typedef void (*pp_func) (struct pp_queue_t *, struct pipe_resource *,
45                         struct pipe_resource *, unsigned int);
46
47/* Main functions */
48
49/**
50 * Note enabled is an array of values, one per filter stage.
51 * Zero indicates the stage is disabled.  Non-zero indicates the
52 * stage is enabled.  For some stages, the value controls quality.
53 */
54struct pp_queue_t *pp_init(struct pipe_context *pipe,
55                           const unsigned int *enabled,
56                           struct cso_context *,
57                           struct st_context_iface *st);
58
59void pp_run(struct pp_queue_t *, struct pipe_resource *,
60            struct pipe_resource *, struct pipe_resource *);
61void pp_free(struct pp_queue_t *);
62
63void pp_init_fbos(struct pp_queue_t *, unsigned int, unsigned int);
64
65
66/* The filters */
67
68void pp_nocolor(struct pp_queue_t *, struct pipe_resource *,
69                struct pipe_resource *, unsigned int);
70
71void pp_jimenezmlaa(struct pp_queue_t *, struct pipe_resource *,
72                    struct pipe_resource *, unsigned int);
73void pp_jimenezmlaa_color(struct pp_queue_t *, struct pipe_resource *,
74                          struct pipe_resource *, unsigned int);
75
76/* The filter init functions */
77
78bool pp_celshade_init(struct pp_queue_t *, unsigned int, unsigned int);
79
80bool pp_nored_init(struct pp_queue_t *, unsigned int, unsigned int);
81bool pp_nogreen_init(struct pp_queue_t *, unsigned int, unsigned int);
82bool pp_noblue_init(struct pp_queue_t *, unsigned int, unsigned int);
83
84bool pp_jimenezmlaa_init(struct pp_queue_t *, unsigned int, unsigned int);
85bool pp_jimenezmlaa_init_color(struct pp_queue_t *, unsigned int,
86                               unsigned int);
87
88/* The filter free functions */
89
90void pp_celshade_free(struct pp_queue_t *, unsigned int);
91void pp_nocolor_free(struct pp_queue_t *, unsigned int);
92void pp_jimenezmlaa_free(struct pp_queue_t *, unsigned int);
93
94
95#ifdef __cplusplus
96}
97#endif
98
99#endif
100