Kodi Development 22.0
for Binary and Script based Add-Ons
 
Loading...
Searching...
No Matches
shaderpreset.h
1/*
2 * Copyright (C) 2022-2025 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
4 *
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
7 */
8
9#ifndef C_API_ADDONINSTANCE_SHADER_PRESET_H
10#define C_API_ADDONINSTANCE_SHADER_PRESET_H
11
12#include "../addon_base.h"
13
14#include <stdbool.h>
15#include <stddef.h>
16
17#ifdef __cplusplus
18extern "C"
19{
20#endif /* __cplusplus */
21 //============================================================================
26 typedef void* preset_file;
27
38 typedef enum SHADER_SCALE_TYPE
39 {
46 SHADER_SCALE_TYPE_INPUT,
47
55 SHADER_SCALE_TYPE_ABSOLUTE,
56
63 SHADER_SCALE_TYPE_VIEWPORT
64 } SHADER_SCALE_TYPE;
65
66 typedef enum SHADER_FILTER_TYPE
67 {
68 SHADER_FILTER_TYPE_UNSPEC,
69 SHADER_FILTER_TYPE_LINEAR,
70 SHADER_FILTER_TYPE_NEAREST
71 } SHADER_FILTER_TYPE;
72
76 typedef enum SHADER_WRAP_TYPE
77 {
78 SHADER_WRAP_TYPE_BORDER, /* Deprecated, will be translated to EDGE in GLES */
79 SHADER_WRAP_TYPE_EDGE,
80 SHADER_WRAP_TYPE_REPEAT,
81 SHADER_WRAP_TYPE_MIRRORED_REPEAT
82 } SHADER_WRAP_TYPE;
83
87 typedef struct fbo_scale_axis
88 {
89 SHADER_SCALE_TYPE type;
90 union
91 {
92 float scale;
93 unsigned abs;
94 };
96
100 typedef struct fbo_scale
101 {
106
115 bool fp_fbo;
116
121
126 } fbo_scale;
127
129 {
130 char* id;
131 char* desc;
132 float current;
133 float minimum;
134 float initial;
135 float maximum;
136 float step;
138
139 typedef struct video_shader_pass
140 {
145
150
156
161
167 SHADER_FILTER_TYPE filter;
168
172 SHADER_WRAP_TYPE wrap;
173
178
182 bool mipmap;
183
187 char* alias;
189
190 typedef struct video_shader_lut
191 {
195 char* id;
196
200 char* path;
201
205 SHADER_FILTER_TYPE filter;
206
210 SHADER_WRAP_TYPE wrap;
211
215 bool mipmap;
217
218 typedef struct video_shader
219 {
220 unsigned pass_count;
221 video_shader_pass* passes;
222
223 unsigned lut_count;
224 video_shader_lut* luts;
225
226 unsigned parameter_count;
227 video_shader_parameter* parameters;
228 } video_shader;
229 //----------------------------------------------------------------------------
230
232
233 //--==----==----==----==----==----==----==----==----==----==----==----==----==--
234
241 {
245 const char* user_path;
246
250 const char* addon_path;
252
258
265 {
266 KODI_HANDLE kodiInstance;
268
275 {
276 KODI_HANDLE addonInstance;
277
278 preset_file(__cdecl* PresetFileNew)(const struct AddonInstance_ShaderPreset*, const char*);
279 void(__cdecl* PresetFileFree)(const struct AddonInstance_ShaderPreset*, preset_file);
280 bool(__cdecl* VideoShaderRead)(const struct AddonInstance_ShaderPreset*,
281 preset_file,
282 struct video_shader*);
283 bool(__cdecl* VideoShaderWrite)(const struct AddonInstance_ShaderPreset*,
284 preset_file,
285 const struct video_shader*);
286 bool(__cdecl* VideoShaderResolveParameters)(const struct AddonInstance_ShaderPreset*,
287 preset_file,
288 struct video_shader*);
289 void(__cdecl* VideoShaderFree)(const struct AddonInstance_ShaderPreset*, struct video_shader*);
291
303
304#ifdef __cplusplus
305}
306#endif /* __cplusplus */
307
308#endif /* !C_API_ADDONINSTANCE_SHADER_PRESET_H */
ShaderPreset instance.
Definition shaderpreset.h:298
ShaderPreset properties.
Definition shaderpreset.h:241
const char * addon_path
The path to this add-on.
Definition shaderpreset.h:250
const char * user_path
The path to the user profile.
Definition shaderpreset.h:245
ShaderPreset callbacks.
Definition shaderpreset.h:265
ShaderPreset function hooks.
Definition shaderpreset.h:275
FBO scaling parameters for a single axis.
Definition shaderpreset.h:88
FBO parameters.
Definition shaderpreset.h:101
fbo_scale_axis scale_y
Scaling parameters for Y axis.
Definition shaderpreset.h:125
bool srgb_fbo
sRGB framebuffer
Definition shaderpreset.h:105
fbo_scale_axis scale_x
Scaling parameters for X axis.
Definition shaderpreset.h:120
bool fp_fbo
Float framebuffer.
Definition shaderpreset.h:115
Definition shaderpreset.h:191
SHADER_WRAP_TYPE wrap
Texture wrapping mode.
Definition shaderpreset.h:210
bool mipmap
Use mipmapping for the texture.
Definition shaderpreset.h:215
char * path
Path of the texture.
Definition shaderpreset.h:200
SHADER_FILTER_TYPE filter
Filtering for the texture.
Definition shaderpreset.h:205
char * id
Name of the sampler uniform, e.g. uniform sampler2D foo.
Definition shaderpreset.h:195
Definition shaderpreset.h:129
Definition shaderpreset.h:140
SHADER_WRAP_TYPE wrap
Wrapping mode.
Definition shaderpreset.h:172
bool mipmap
Mipmapping.
Definition shaderpreset.h:182
char * vertex_source
The vertex shader source.
Definition shaderpreset.h:149
char * source_path
Path to the shader pass source.
Definition shaderpreset.h:144
fbo_scale fbo
FBO parameters.
Definition shaderpreset.h:160
char * alias
Aliased pass name.
Definition shaderpreset.h:187
char * fragment_source
The fragment shader source, if separate from the vertex source, or NULL otherwise.
Definition shaderpreset.h:155
unsigned frame_count_mod
Frame count mod.
Definition shaderpreset.h:177
SHADER_FILTER_TYPE filter
Defines how the result of this pass will be filtered.
Definition shaderpreset.h:167
Definition shaderpreset.h:219