Changeset 29355
- Timestamp:
- Oct 7, 2010, 8:29:45 PM (16 years ago)
- Location:
- branches/eam_branches/ipp-20100823/psLib/src
- Files:
-
- 3 edited
-
jpeg/psImageJpeg.c (modified) (4 diffs)
-
jpeg/psImageJpeg.h (modified) (1 diff)
-
pslib.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20100823/psLib/src/jpeg/psImageJpeg.c
r29309 r29355 49 49 psImageJpegOptions *psImageJpegOptionsAlloc(void) 50 50 { 51 51 52 psImageJpegOptions *options = psAlloc(sizeof(psImageJpegOptions)); 52 53 psMemSetDeallocator(options, (psFreeFunc)imageJpegOptionsFree); … … 194 195 } 195 196 197 bool sprint_double (char *string, double value) { 198 199 int Nexp = fabs(log10(fabs(value))); 200 201 if (Nexp > 3) { 202 sprintf (string, "%.1e", value); 203 } else { 204 sprintf (string, "%.1f", value); 205 } 206 return true; 207 } 208 196 209 // XXX need to update bDraw APIs to pass in/out structure and avoid the local static 197 bool psImageJpeg(const psImageJpegOptions *options, const psImage *image, bDrawBuffer*bdbuf, const char *filename)210 bool psImageJpeg(const psImageJpegOptions *options, const psImage *image, void *bdbuf, const char *filename) 198 211 { 199 212 PS_ASSERT_PTR_NON_NULL(options, false); … … 327 340 SetRotFont ("helvetica", 8); 328 341 bDrawSetBuffer(labels); 329 sprint f (string, "%g", options->min);342 sprint_double (string, options->min); 330 343 bDrawRotText(2, 2, string, 2, 0.0); 331 sprint f (string, "%g", options->max);344 sprint_double (string, options->max); 332 345 bDrawRotText(dx - 2, 2, string, 0, 0.0); 333 sprint f (string, "%g", 0.5*(options->min + options->max));346 sprint_double (string, 0.5*(options->min + options->max)); 334 347 bDrawRotText(0.5*dx, 2, string, 1, 0.0); 335 348 psImageJpegOverlayDraw(jpegImage, labels, 0, offset); … … 338 351 if (bdbuf) { 339 352 offset = (options->showScale == PS_JPEG_SHOWSCALE_TOP) ? PS_JPEG_COLORPAD + PS_JPEG_LABELPAD : 0; 340 psImageJpegOverlayDraw(jpegImage, bdbuf, 0, offset);353 psImageJpegOverlayDraw(jpegImage, (bDrawBuffer *) bdbuf, 0, offset); 341 354 } 342 355 -
branches/eam_branches/ipp-20100823/psLib/src/jpeg/psImageJpeg.h
r29309 r29355 53 53 bool psImageJpeg(const psImageJpegOptions *options, // Color map 54 54 const psImage *image, // Image to write 55 bDrawBuffer*bdbuf,55 void *bdbuf, 56 56 const char *filename // Filename of JPEG 57 57 ); 58 58 59 bDrawBuffer *psImageJpegOverlayInit (const psImage *image);59 // bDrawBuffer *psImageJpegOverlayInit (const psImage *image); 60 60 61 61 /// @} -
branches/eam_branches/ipp-20100823/psLib/src/pslib.h
r29309 r29355 17 17 #define PS_LIB_H 18 18 19 #include <kapa.h>20 19 #include "pslib_strict.h" 21 20
Note:
See TracChangeset
for help on using the changeset viewer.
