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