Merge pull request #1947 from kleisauke/clip-scrgb

Switch VIPS_FCLIP to VIPS_CLIP in vips_scRGB2{BW,sRGB}
This commit is contained in:
John Cupitt 2020-12-29 14:36:41 +00:00 committed by GitHub
commit 7a33be716b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -113,7 +113,7 @@ vips_scRGB2BW_line_16( unsigned short * restrict q, float * restrict p,
q += 1;
for( j = 0; j < extra_bands; j++ )
q[j] = VIPS_FCLIP( 0, p[j] * 256.0, USHRT_MAX );
q[j] = VIPS_CLIP( 0, (int) (p[j] * 256.0), USHRT_MAX );
p += extra_bands;
q += extra_bands;
}

View File

@ -140,7 +140,7 @@ vips_scRGB2sRGB_line_16( unsigned short * restrict q, float * restrict p,
q += 3;
for( j = 0; j < extra_bands; j++ )
q[j] = VIPS_FCLIP( 0, p[j] * 256.0, USHRT_MAX );
q[j] = VIPS_CLIP( 0, (int) (p[j] * 256.0), USHRT_MAX );
p += extra_bands;
q += extra_bands;
}