Skip to content

Commit

Permalink
Merge branch '8.16' into 8.16-fix-morph
Browse files Browse the repository at this point in the history
  • Loading branch information
kleisauke authored Nov 4, 2024
2 parents 4e0b1b2 + b0e8d2a commit e8c1ba5
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 7 deletions.
1 change: 1 addition & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
8.16.1

- support multipage JXL
- fix PFM byte order on little-endian machines [agoode]
- morph: fix erode Highway path [kleisauke]
- morph: fix C-paths with masks containing zero [kleisauke]

Expand Down
14 changes: 12 additions & 2 deletions libvips/arithmetic/maxpair.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,16 @@ G_DEFINE_TYPE(VipsMaxpair, vips_maxpair, VIPS_TYPE_BINARY);
q[x] = VIPS_MAX(left[x], right[x]); \
}

#define FLOOP(TYPE) \
{ \
TYPE *restrict left = (TYPE *) in[0]; \
TYPE *restrict right = (TYPE *) in[1]; \
TYPE *restrict q = (TYPE *) out; \
\
for (int x = 0; x < sz; x++) \
q[x] = VIPS_FMAX(left[x], right[x]); \
}

static void
maxpair_buffer(VipsArithmetic *arithmetic,
VipsPel *out, VipsPel **in, int width)
Expand Down Expand Up @@ -102,12 +112,12 @@ maxpair_buffer(VipsArithmetic *arithmetic,

case VIPS_FORMAT_FLOAT:
case VIPS_FORMAT_COMPLEX:
LOOP(float);
FLOOP(float);
break;

case VIPS_FORMAT_DOUBLE:
case VIPS_FORMAT_DPCOMPLEX:
LOOP(double);
FLOOP(double);
break;

default:
Expand Down
14 changes: 12 additions & 2 deletions libvips/arithmetic/minpair.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,16 @@ G_DEFINE_TYPE(VipsMinpair, vips_minpair, VIPS_TYPE_BINARY);
q[x] = VIPS_MIN(left[x], right[x]); \
}

#define FLOOP(TYPE) \
{ \
TYPE *restrict left = (TYPE *) in[0]; \
TYPE *restrict right = (TYPE *) in[1]; \
TYPE *restrict q = (TYPE *) out; \
\
for (int x = 0; x < sz; x++) \
q[x] = VIPS_FMIN(left[x], right[x]); \
}

static void
minpair_buffer(VipsArithmetic *arithmetic,
VipsPel *out, VipsPel **in, int width)
Expand Down Expand Up @@ -102,12 +112,12 @@ minpair_buffer(VipsArithmetic *arithmetic,

case VIPS_FORMAT_FLOAT:
case VIPS_FORMAT_COMPLEX:
LOOP(float);
FLOOP(float);
break;

case VIPS_FORMAT_DOUBLE:
case VIPS_FORMAT_DPCOMPLEX:
LOOP(double);
FLOOP(double);
break;

default:
Expand Down
3 changes: 0 additions & 3 deletions libvips/foreign/ppmsave.c
Original file line number Diff line number Diff line change
Expand Up @@ -411,9 +411,6 @@ vips_foreign_save_ppm_build(VipsObject *object)
!vips_image_get_double(image, "pfm-scale", &scale))
;

if (vips_amiMSBfirst())
scale *= -1;

/* Need to be locale independent.
*/
g_ascii_dtostr(buf, G_ASCII_DTOSTR_BUF_SIZE, scale);
Expand Down

0 comments on commit e8c1ba5

Please sign in to comment.