diff options
author | Mattias Andrée <maandree@kth.se> | 2016-07-10 21:57:04 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2016-07-10 21:57:04 +0200 |
commit | 96399ca27c075339791a088feb80e03f9f3587d1 (patch) | |
tree | ffad2ffb2b2ac2228b0a8b805192bcbc4457e3c0 /src/output.h | |
parent | m (diff) | |
download | coopgammad-96399ca27c075339791a088feb80e03f9f3587d1.tar.gz coopgammad-96399ca27c075339791a088feb80e03f9f3587d1.tar.bz2 coopgammad-96399ca27c075339791a088feb80e03f9f3587d1.tar.xz |
Work on marshalling
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r-- | src/output.h | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/src/output.h b/src/output.h index d3b39ec..b27059f 100644 --- a/src/output.h +++ b/src/output.h @@ -20,6 +20,23 @@ #include <libgamma.h> #include "ramps.h" +#include "filter.h" + + + +/** + * Copy the ramp sizes + * + * This macro supports both `struct output` + * and `struct gamma_ramps` + * + * @param dest The destination + * @param src The source + */ +#define COPY_RAMP_SIZES(dest, src) \ + ((dest)->red_size = (src)->red_size, \ + (dest)->green_size = (src)->green_size, \ + (dest)->blue_size = (src)->blue_size) @@ -85,5 +102,40 @@ struct output * Saved gamma ramps */ union gamma_ramps saved_ramps; + + struct filter* table_filters; + union gamma_ramps* table_sums; + size_t table_alloc; + size_t table_size; }; + + +/** + * Free all resources allocated to an output. + * The allocation of `output` itself is not freed. + * + * @param this The output + */ +void output_destroy(struct output* this); + +/** + * Marshal an output + * + * @param this The output + * @param buf Output buffer for the marshalled output, + * `NULL` just measure how large the buffers + * needs to be + * @return The number of marshalled byte + */ +size_t output_marshal(const struct output* this, char* buf); + +/** + * Unmarshal an output + * + * @param this Output for the output + * @param buf Buffer with the marshalled output + * @return The number of unmarshalled bytes, 0 on error + */ +size_t output_unmarshal(struct output* this, const char* buf); + |