[devel] Made FIXED and FLOATING options consistent in the APIs they enable

and disable.  Corrected scripts/options.awk to handle both command line
options and options specified in the .dfa files.
This commit is contained in:
Glenn Randers-Pehrson
2010-06-25 21:45:31 -05:00
parent a81c59a960
commit a272d8fe3d
11 changed files with 131 additions and 94 deletions

View File

@@ -141,6 +141,7 @@ png_set_gAMA(png_structp png_ptr, png_infop info_ptr, double file_gamma)
png_warning(png_ptr, "Setting gamma = 0");
}
#endif
#ifdef PNG_FIXED_POINT_SUPPORTED
void PNGAPI
png_set_gAMA_fixed(png_structp png_ptr, png_infop info_ptr, png_fixed_point
int_gamma)
@@ -172,15 +173,14 @@ png_set_gAMA_fixed(png_structp png_ptr, png_infop info_ptr, png_fixed_point
#ifdef PNG_FLOATING_POINT_SUPPORTED
info_ptr->gamma = (float)(png_gamma/100000.);
#endif
#ifdef PNG_FIXED_POINT_SUPPORTED
info_ptr->int_gamma = png_gamma;
#endif
info_ptr->valid |= PNG_INFO_gAMA;
if (png_gamma == 0)
png_warning(png_ptr, "Setting gamma = 0");
}
#endif
#endif
#ifdef PNG_hIST_SUPPORTED
void PNGAPI
@@ -368,7 +368,7 @@ png_set_pCAL(png_structp png_ptr, png_infop info_ptr,
}
#endif
#if defined(PNG_READ_sCAL_SUPPORTED) || defined(PNG_WRITE_sCAL_SUPPORTED)
#ifdef PNG_sCAL_SUPPORTED
#ifdef PNG_FLOATING_POINT_SUPPORTED
void PNGAPI
png_set_sCAL(png_structp png_ptr, png_infop info_ptr,
@@ -385,7 +385,7 @@ png_set_sCAL(png_structp png_ptr, png_infop info_ptr,
info_ptr->valid |= PNG_INFO_sCAL;
}
#else
#endif
#ifdef PNG_FIXED_POINT_SUPPORTED
void PNGAPI
png_set_sCAL_s(png_structp png_ptr, png_infop info_ptr,
@@ -440,7 +440,6 @@ png_set_sCAL_s(png_structp png_ptr, png_infop info_ptr,
}
#endif
#endif
#endif
#ifdef PNG_pHYs_SUPPORTED
void PNGAPI
@@ -558,13 +557,13 @@ png_set_sRGB_gAMA_and_cHRM(png_structp png_ptr, png_infop info_ptr,
png_set_sRGB(png_ptr, info_ptr, intent);
#ifdef PNG_gAMA_SUPPORTED
#ifdef PNG_FLOATING_POINT_SUPPORTED
file_gamma = (float).45455;
png_set_gAMA(png_ptr, info_ptr, file_gamma);
#endif
#ifdef PNG_FIXED_POINT_SUPPORTED
int_file_gamma = 45455L;
png_set_gAMA_fixed(png_ptr, info_ptr, int_file_gamma);
#else
/* Floating point must be set! */
file_gamma = (float).45455;
png_set_gAMA(png_ptr, info_ptr, file_gamma);
#endif
#endif