Fix FTBFS on redefinitions in chalk/sdk/kis_integer_maths.h

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
pull/1/head
Slávek Banko 8 years ago
parent 91809c36a1
commit cbc1062ce2

@ -404,8 +404,8 @@ void KisGrayU16ColorSpace::compositeBurn(TQ_UINT8 *dstRowStart, TQ_INT32 dstRowS
TQ_UINT16 srcColor = src[channel]; TQ_UINT16 srcColor = src[channel];
TQ_UINT16 dstColor = dst[channel]; TQ_UINT16 dstColor = dst[channel];
srcColor = kMin(((UINT16_MAX - dstColor) * (UINT16_MAX + 1u)) / (srcColor + 1u), UINT16_MAX); srcColor = kMin(((UINT16_MAX - dstColor) * (UINT16_MAX + 1u)) / (srcColor + 1u), (unsigned)UINT16_MAX);
srcColor = kClamp(UINT16_MAX - srcColor, 0u, UINT16_MAX); srcColor = kClamp((unsigned)UINT16_MAX - srcColor, 0u, (unsigned)UINT16_MAX);
TQ_UINT16 newColor = UINT16_BLEND(srcColor, dstColor, srcBlend); TQ_UINT16 newColor = UINT16_BLEND(srcColor, dstColor, srcBlend);

@ -746,8 +746,8 @@ void KisGrayColorSpace::compositeBurn(TQ_UINT8 *dstRowStart, TQ_INT32 dstRowStri
TQ_UINT8 srcColor = src[channel]; TQ_UINT8 srcColor = src[channel];
TQ_UINT8 dstColor = dst[channel]; TQ_UINT8 dstColor = dst[channel];
srcColor = kMin(((UINT8_MAX - dstColor) * (UINT8_MAX + 1)) / (srcColor + 1), UINT8_MAX); srcColor = kMin(((UINT8_MAX - dstColor) * (UINT8_MAX + 1u)) / (srcColor + 1u), (unsigned)UINT8_MAX);
srcColor = kClamp(UINT8_MAX - srcColor, 0u, UINT8_MAX); srcColor = kClamp((unsigned)UINT8_MAX - srcColor, 0u, (unsigned)UINT8_MAX);
TQ_UINT8 newColor = UINT8_BLEND(srcColor, dstColor, srcBlend); TQ_UINT8 newColor = UINT8_BLEND(srcColor, dstColor, srcBlend);

@ -444,8 +444,8 @@ void KisRgbU16ColorSpace::compositeBurn(TQ_UINT8 *dstRowStart, TQ_INT32 dstRowSt
TQ_UINT16 srcColor = src[channel]; TQ_UINT16 srcColor = src[channel];
TQ_UINT16 dstColor = dst[channel]; TQ_UINT16 dstColor = dst[channel];
srcColor = kMin(((UINT16_MAX - dstColor) * (UINT16_MAX + 1u)) / (srcColor + 1u), UINT16_MAX); srcColor = kMin(((UINT16_MAX - dstColor) * (UINT16_MAX + 1u)) / (srcColor + 1u), (unsigned)UINT16_MAX);
srcColor = kClamp(UINT16_MAX - srcColor, 0u, UINT16_MAX); srcColor = kClamp((unsigned)UINT16_MAX - srcColor, 0u, (unsigned)UINT16_MAX);
TQ_UINT16 newColor = UINT16_BLEND(srcColor, dstColor, srcBlend); TQ_UINT16 newColor = UINT16_BLEND(srcColor, dstColor, srcBlend);

@ -19,17 +19,38 @@
#ifndef KIS_INTEGER_MATHS_H #ifndef KIS_INTEGER_MATHS_H
#define KIS_INTEGER_MATHS_H #define KIS_INTEGER_MATHS_H
#include <config.h>
#if defined(HAVE_STDINT_H)
#include <stdint.h>
#endif
#if !defined(UINT8_MAX)
#define UINT8_MAX 255u #define UINT8_MAX 255u
#endif
#if !defined(UINT8_MIN)
#define UINT8_MIN 0u #define UINT8_MIN 0u
#endif
#if !defined(UINT16_MAX)
#define UINT16_MAX 65535u #define UINT16_MAX 65535u
#endif
#if !defined(UINT16_MIN)
#define UINT16_MIN 0u #define UINT16_MIN 0u
#endif
#if !defined(UINT32_MAX)
#define UINT32_MAX (4294967295u) #define UINT32_MAX (4294967295u)
#endif
#if !defined(UINT32_MIN)
#define UINT32_MIN 0u #define UINT32_MIN 0u
#endif
#if !defined(INT16_MAX)
#define INT16_MAX 32767 #define INT16_MAX 32767
#endif
#if !defined(INT16_MIN)
#define INT16_MIN -32768 #define INT16_MIN -32768
#endif
/// take a and scale it up by 256*b/255 /// take a and scale it up by 256*b/255
inline uint UINT8_SCALEBY(uint a, uint b) inline uint UINT8_SCALEBY(uint a, uint b)

Loading…
Cancel
Save