Skip to content

Commit c7ec2e4

Browse files
committed
Fixed compilation issue, added uint32 variant of max3
1 parent f700868 commit c7ec2e4

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

src/common/dttypes.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@
2727
//#define NO_COLORMATRIX_NAN
2828

2929
#include <float.h>
30+
#include <gmodule.h>
3031
#include <math.h>
32+
#include <stdint.h>
3133

3234
// When included by a C++ file, restrict qualifiers are not allowed
3335
#ifdef __cplusplus
@@ -256,6 +258,11 @@ static inline int dt_is_valid_colormatrix(float matrix)
256258

257259
#endif /* NO_COLORMATRIX_NAN */
258260

261+
static inline uint32_t max3i(const uint32_t* array)
262+
{
263+
return MAX(MAX(array[0], array[1]), array[2]);
264+
}
265+
259266
static inline float max3f(const float* array)
260267
{
261268
return fmaxf(fmaxf(array[0], array[1]), array[2]);

src/iop/rgbcurve.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -891,7 +891,7 @@ static gboolean _area_draw_callback(GtkWidget *widget,
891891
float hist_max;
892892

893893
if(autoscale == DT_S_SCALE_AUTOMATIC_RGB)
894-
hist_max = max3f(self->histogram_max);
894+
hist_max = max3i(self->histogram_max);
895895
else
896896
hist_max = self->histogram_max[ch];
897897

src/iop/rgblevels.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ static gboolean _area_draw_callback(GtkWidget *widget,
464464
float hist_max;
465465

466466
if(p->autoscale == DT_IOP_RGBLEVELS_LINKED_CHANNELS)
467-
hist_max = max3f(self->histogram_max);
467+
hist_max = max3i(self->histogram_max);
468468
else
469469
hist_max = self->histogram_max[ch];
470470

0 commit comments

Comments
 (0)