diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/libcoopgamma.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/libcoopgamma.c b/src/libcoopgamma.c index 2ca0a32..14d085c 100644 --- a/src/libcoopgamma.c +++ b/src/libcoopgamma.c @@ -2510,22 +2510,22 @@ int libcoopgamma_set_gamma_send(const libcoopgamma_filter_t* restrict filter, goto fail; } - switch (filter->depth) + if (filter->lifespan != LIBCOOPGAMMA_REMOVE) { - case LIBCOOPGAMMA_FLOAT: stopwidth = sizeof(float); break; - case LIBCOOPGAMMA_DOUBLE: stopwidth = sizeof(double); break; - default: INTEGRAL_DEPTHS - if ((filter->depth <= 0) || ((filter->depth & 7) != 0)) + switch (filter->depth) { - errno = EINVAL; - goto fail; + case LIBCOOPGAMMA_FLOAT: stopwidth = sizeof(float); break; + case LIBCOOPGAMMA_DOUBLE: stopwidth = sizeof(double); break; + default: INTEGRAL_DEPTHS + if ((filter->depth <= 0) || ((filter->depth & 7) != 0)) + { + errno = EINVAL; + goto fail; + } + stopwidth = (size_t)(filter->depth / 8); + break; } - stopwidth = (size_t)(filter->depth / 8); - break; - } - - if (filter->lifespan != LIBCOOPGAMMA_REMOVE) - { + payload_size = filter->ramps.u8.red_size; payload_size += filter->ramps.u8.green_size; payload_size += filter->ramps.u8.blue_size; |