2 erebus - photorealistic renderer
3 Copyright (C) 2018 John Tsiombikas <nuclear@member.fsf.org>
5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <https://www.gnu.org/licenses/>.
34 struct erb_render_status {
35 long progress_percent; /* derived from the data below */
36 long blocks, max_blocks; /* completed pixel blocks in current sample pass */
37 long samples, max_samples; /* completed samples in current frame */
38 long frames, max_frames; /* completed frames in multi-frame job */
45 struct erebus *erb_init(void);
46 void erb_destroy(struct erebus *ctx);
48 void erb_clear(struct erebus *ctx);
50 void erb_setopti(struct erebus *ctx, enum erb_option opt, int val);
51 void erb_setoptf(struct erebus *ctx, enum erb_option opt, float val);
52 void erb_setoptfv(struct erebus *ctx, enum erb_option opt, float *vec);
54 int erb_getopti(struct erebus *ctx, enum erb_option opt);
55 float erb_getoptf(struct erebus *ctx, enum erb_option opt);
56 float *erb_getoptfv(struct erebus *ctx, enum erb_option opt);
58 float *erb_get_framebuffer(struct erebus *ctx);
60 void erb_begin_frame(struct erebus *ctx, long ms);
61 void erb_end_frame(struct erebus *ctx);
63 int erb_render(struct erebus *ctx, long timeout);
64 int erb_render_rect(struct erebus *ctx, int x, int y, int width, int height, long timeout);
66 int erb_get_progress(struct erebus *ctx);
67 int erb_get_status(struct erebus *ctx, struct erb_render_status *stat);
69 int erb_load_scene(struct erebus *ctx, const char *fname);
70 /*int erb_proc_cmd(struct erebus *ctx, const char *cmd);*/
76 #endif /* LIBEREBUS_H_ */