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 34 extern "C" { 35 #endif 36 37 struct cso_context; 38 struct st_context_iface; 39 40 struct pp_queue_t; /* Forward definition */ 41 struct pp_program; 42 43 /* Less typing later on */ 44 typedef 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 */ 54 struct 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 59 void pp_run(struct pp_queue_t *, struct pipe_resource *, 60 struct pipe_resource *, struct pipe_resource *); 61 void pp_free(struct pp_queue_t *); 62 63 void pp_init_fbos(struct pp_queue_t *, unsigned int, unsigned int); 64 65 66 /* The filters */ 67 68 void pp_nocolor(struct pp_queue_t *, struct pipe_resource *, 69 struct pipe_resource *, unsigned int); 70 71 void pp_jimenezmlaa(struct pp_queue_t *, struct pipe_resource *, 72 struct pipe_resource *, unsigned int); 73 void pp_jimenezmlaa_color(struct pp_queue_t *, struct pipe_resource *, 74 struct pipe_resource *, unsigned int); 75 76 /* The filter init functions */ 77 78 bool pp_celshade_init(struct pp_queue_t *, unsigned int, unsigned int); 79 80 bool pp_nored_init(struct pp_queue_t *, unsigned int, unsigned int); 81 bool pp_nogreen_init(struct pp_queue_t *, unsigned int, unsigned int); 82 bool pp_noblue_init(struct pp_queue_t *, unsigned int, unsigned int); 83 84 bool pp_jimenezmlaa_init(struct pp_queue_t *, unsigned int, unsigned int); 85 bool pp_jimenezmlaa_init_color(struct pp_queue_t *, unsigned int, 86 unsigned int); 87 88 /* The filter free functions */ 89 90 void pp_celshade_free(struct pp_queue_t *, unsigned int); 91 void pp_nocolor_free(struct pp_queue_t *, unsigned int); 92 void pp_jimenezmlaa_free(struct pp_queue_t *, unsigned int); 93 94 95 #ifdef __cplusplus 96 } 97 #endif 98 99 #endif 100