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;
38
39struct pp_queue_t;              /* Forward definition */
40struct pp_program;
41
42/* Less typing later on */
43typedef void (*pp_func) (struct pp_queue_t *, struct pipe_resource *,
44                         struct pipe_resource *, unsigned int);
45
46/* Main functions */
47
48/**
49 * Note enabled is an array of values, one per filter stage.
50 * Zero indicates the stage is disabled.  Non-zero indicates the
51 * stage is enabled.  For some stages, the value controls quality.
52 */
53struct pp_queue_t *pp_init(struct pipe_context *pipe,
54                           const unsigned int *enabled,
55                           struct cso_context *);
56
57void pp_run(struct pp_queue_t *, struct pipe_resource *,
58            struct pipe_resource *, struct pipe_resource *);
59void pp_free(struct pp_queue_t *);
60
61void pp_init_fbos(struct pp_queue_t *, unsigned int, unsigned int);
62
63
64/* The filters */
65
66void pp_nocolor(struct pp_queue_t *, struct pipe_resource *,
67                struct pipe_resource *, unsigned int);
68
69void pp_jimenezmlaa(struct pp_queue_t *, struct pipe_resource *,
70                    struct pipe_resource *, unsigned int);
71void pp_jimenezmlaa_color(struct pp_queue_t *, struct pipe_resource *,
72                          struct pipe_resource *, unsigned int);
73
74/* The filter init functions */
75
76bool pp_celshade_init(struct pp_queue_t *, unsigned int, unsigned int);
77
78bool pp_nored_init(struct pp_queue_t *, unsigned int, unsigned int);
79bool pp_nogreen_init(struct pp_queue_t *, unsigned int, unsigned int);
80bool pp_noblue_init(struct pp_queue_t *, unsigned int, unsigned int);
81
82bool pp_jimenezmlaa_init(struct pp_queue_t *, unsigned int, unsigned int);
83bool pp_jimenezmlaa_init_color(struct pp_queue_t *, unsigned int,
84                               unsigned int);
85
86/* The filter free functions */
87
88void pp_celshade_free(struct pp_queue_t *, unsigned int);
89void pp_nocolor_free(struct pp_queue_t *, unsigned int);
90void pp_jimenezmlaa_free(struct pp_queue_t *, unsigned int);
91
92
93#ifdef __cplusplus
94}
95#endif
96
97#endif
98