aboutsummaryrefslogtreecommitdiffstats
path: root/src/server.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2016-07-13 02:32:08 +0200
committerMattias Andrée <maandree@kth.se>2016-07-13 02:32:08 +0200
commit8a866b051a7a6826c456d2cb91a7fd557cb2fd35 (patch)
tree35e0b2fcca2a1054f39755aee6da210a765f6536 /src/server.c
parentWork on responses (diff)
downloadcoopgammad-8a866b051a7a6826c456d2cb91a7fd557cb2fd35.tar.gz
coopgammad-8a866b051a7a6826c456d2cb91a7fd557cb2fd35.tar.bz2
coopgammad-8a866b051a7a6826c456d2cb91a7fd557cb2fd35.tar.xz
Applying filters
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'src/server.c')
-rw-r--r--src/server.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/server.c b/src/server.c
index d046a95..06d88da 100644
--- a/src/server.c
+++ b/src/server.c
@@ -603,7 +603,24 @@ static int get_gamma(size_t conn, char* message_id, char* crtc, char* coalesce,
n = (size_t)m;
if (coal)
{
- /* TODO coalesce */
+ if (start == 0)
+ memcpy(buf + n, output->table_sums[end].u8.red, output->ramps_size);
+ else
+ {
+ union gamma_ramps ramps;
+ if (make_plain_ramps(&ramps, output))
+ {
+ int saved_errno = errno;
+ free(buf);
+ errno = saved_errno;
+ return -1;
+ }
+ for (i = start; i < end; i++)
+ apply(&ramps, output->table_filters[i].ramps, output->depth, &ramps);
+ memcpy(buf + n, ramps.u8.red, output->ramps_size);
+ libgamma_gamma_ramps8_destroy(&(ramps.u8));
+ }
+ n += output->ramps_size;
}
else
for (i = start; i < end; i++)