aboutsummaryrefslogtreecommitdiffstats
path: root/src/output.h
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2016-07-10 21:57:04 +0200
committerMattias Andrée <maandree@kth.se>2016-07-10 21:57:04 +0200
commit96399ca27c075339791a088feb80e03f9f3587d1 (patch)
treeffad2ffb2b2ac2228b0a8b805192bcbc4457e3c0 /src/output.h
parentm (diff)
downloadcoopgammad-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 'src/output.h')
-rw-r--r--src/output.h52
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);
+