1 /* 2 / gGraph.h 3 / 4 / public gGraph declarations 5 / 6 / version 1.0, 2010 July 20 7 / 8 / Author: Sandro Furieri a.furieri@lqt.it 9 / 10 / Copyright (C) 2010 Alessandro Furieri 11 / 12 / This program is free software: you can redistribute it and/or modify 13 / it under the terms of the GNU Lesser General Public License as published by 14 / the Free Software Foundation, either version 3 of the License, or 15 / (at your option) any later version. 16 / 17 / This program is distributed in the hope that it will be useful, 18 / but WITHOUT ANY WARRANTY; without even the implied warranty of 19 / MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 / GNU Lesser General Public License for more details. 21 / 22 / You should have received a copy of the GNU Lesser General Public License 23 / along with this program. If not, see <http://www.gnu.org/licenses/>. 24 / 25 */ 26 27 #ifdef _WIN32 28 #ifdef DLL_EXPORT 29 #define GGRAPH_DECLARE __declspec(dllexport) 30 #else 31 #define GGRAPH_DECLARE extern 32 #endif 33 #else 34 #define GGRAPH_DECLARE __attribute__ ((visibility("default"))) 35 #endif 36 37 #ifndef _GGRAPH_H 38 #define _GGRAPH_H 39 40 #ifdef __cplusplus 41 extern "C" 42 { 43 #endif 44 45 #define GGRAPH_COLORSPACE_UNKNOWN -1000 46 #define GGRAPH_COLORSPACE_MONOCHROME 1001 47 #define GGRAPH_COLORSPACE_PALETTE 1002 48 #define GGRAPH_COLORSPACE_GRAYSCALE 1003 49 #define GGRAPH_COLORSPACE_TRUECOLOR 1004 50 #define GGRAPH_COLORSPACE_TRUECOLOR_ALPHA 1005 51 #define GGRAPH_COLORSPACE_GRID 1006 52 53 #define GGRAPH_SAMPLE_UNKNOWN -1500 54 #define GGRAPH_SAMPLE_UINT 1501 55 #define GGRAPH_SAMPLE_INT 1502 56 #define GGRAPH_SAMPLE_FLOAT 1503 57 58 #define GGRAPH_TIFF_DEFAULT -1001 59 60 #define GGRAPH_TIFF_LAYOUT_STRIPS 2001 61 #define GGRAPH_TIFF_LAYOUT_TILES 2002 62 63 #define GGRAPH_TIFF_COMPRESSION_UNKNOWN -3000 64 #define GGRAPH_TIFF_COMPRESSION_NONE 3001 65 #define GGRAPH_TIFF_COMPRESSION_CCITTFAX3 3002 66 #define GGRAPH_TIFF_COMPRESSION_CCITTFAX4 3003 67 #define GGRAPH_TIFF_COMPRESSION_LZW 3004 68 #define GGRAPH_TIFF_COMPRESSION_DEFLATE 3005 69 #define GGRAPH_TIFF_COMPRESSION_JPEG 3006 70 71 #define GGRAPH_IMAGE_UNKNOWN -4000 72 #define GGRAPH_IMAGE_GIF 4001 73 #define GGRAPH_IMAGE_PNG 4002 74 #define GGRAPH_IMAGE_JPEG 4003 75 #define GGRAPH_IMAGE_TIFF 4004 76 #define GGRAPH_IMAGE_GEOTIFF 4005 77 #define GGRAPH_IMAGE_HGT 4006 78 #define GGRAPH_IMAGE_BIN_HDR 4007 79 #define GGRAPH_IMAGE_FLT_HDR 4008 80 #define GGRAPH_IMAGE_DEM_HDR 4009 81 #define GGRAPH_IMAGE_ASCII_GRID 4010 82 83 #define GGRAPH_PENSTYLE_SOLID 5001 84 #define GGRAPH_PENSTYLE_DOT 5002 85 #define GGRAPH_PENSTYLE_LONG_DASH 5003 86 #define GGRAPH_PENSTYLE_SHORT_DASH 5004 87 #define GGRAPH_PENSTYLE_DOT_DASH 5005 88 89 #define GGRAPH_FONTSTYLE_NORMAL 5101 90 #define GGRAPH_FONTSTYLE_ITALIC 5102 91 92 #define GGRAPH_FONTWEIGHT_NORMAL 5201 93 #define GGRAPH_FONTWEIGHT_BOLD 5202 94 95 #define GGRAPH_CLEAR_PATH 5100 96 #define GGRAPH_PRESERVE_PATH 5101 97 98 99 #define GGRAPH_OK 0 100 #define GGRAPH_ERROR -1 101 #define GGRAPH_INVALID_IMAGE -2 102 #define GGRAPH_INSUFFICIENT_MEMORY -3 103 #define GGRAPH_FILE_OPEN_ERROR -4 104 #define GGRAPH_FILE_READ_ERROR -5 105 #define GGRAPH_FILE_WRITE_ERROR -6 106 #define GGRAPH_GIF_CODEC_ERROR -7 107 #define GGRAPH_PNG_CODEC_ERROR -8 108 #define GGRAPH_JPEG_CODEC_ERROR -9 109 #define GGRAPH_TIFF_CODEC_ERROR -10 110 #define GGRAPH_GEOTIFF_CODEC_ERROR -11 111 #define GGRAPH_HGT_CODEC_ERROR -12 112 #define GGRAPH_BIN_CODEC_ERROR -13 113 #define GGRAPH_FLT_CODEC_ERROR -14 114 #define GGRAPH_DEM_CODEC_ERROR -15 115 #define GGRAPH_ASCII_CODEC_ERROR -16 116 #define GGRAPH_UNSUPPORTED_TIFF_LAYOUT -17 117 #define GGRAPH_MISSING_GEO_DEFS -18 118 #define GGRAPH_INVALID_COLOR_RULE -19 119 #define GGRAPH_INVALID_COLOR_MAP -20 120 #define GGRAPH_INVALID_SHADED_RELIEF_3ROWS -21 121 #define GGRAPH_INVALID_PAINT_CONTEXT -22 122 #define GGRAPH_INVALID_PAINT_BITMAP -23 123 #define GGRAPH_INVALID_PAINT_BRUSH -24 124 #define GGRAPH_INVALID_PAINT_FONT -25 125 #define GGRAPH_INVALID_SVG -26 126 127 #define GGRAPH_TRUE -1 128 #define GGRAPH_FALSE -2 129 130 typedef struct gaia_graphics_landsat_recalibration 131 { 132 /* a struct used for Landsat Radiometric Recalibration */ 133 double sun_distance; /* Earth-Sun distance (in AU) */ 134 double sun_elevation; /* Sun elevation (in degrees) */ 135 /* RED band params (#3) */ 136 double lmin_red; /* LMIN (from metafile) */ 137 double lmax_red; /* LMAX (from metafile) */ 138 double qcalmin_red; /* QCALMIN (from metafile) */ 139 double qcalmax_red; /* QCALMAX (from metafile) */ 140 int is_gain_low_red; /* GAIN LOW (1=yes 0=no) (from metafile) */ 141 double spectral_irradiance_red; /* SPECTRAL IRRADIANCE constant */ 142 double low_gain_factor_red; /* LOW GAIN multiplicator */ 143 double high_gain_factor_red; /* HIGH GAIN multiplicator */ 144 unsigned char recalibration_min_red; /* color recalibration MIN DN [0-255] */ 145 unsigned char recalibration_max_red; /* color recalibration MAX DN [0-255] */ 146 /* GREEN band params (#2) */ 147 double lmin_green; /* same as RED band */ 148 double lmax_green; 149 double qcalmin_green; 150 double qcalmax_green; 151 int is_gain_low_green; 152 double spectral_irradiance_green; 153 double low_gain_factor_green; 154 double high_gain_factor_green; 155 unsigned char recalibration_min_green; 156 unsigned char recalibration_max_green; 157 /* BLUE band params (#1) */ 158 double lmin_blue; /* same as RED band */ 159 double lmax_blue; 160 double qcalmin_blue; 161 double qcalmax_blue; 162 int is_gain_low_blue; 163 double spectral_irradiance_blue; 164 double low_gain_factor_blue; 165 double high_gain_factor_blue; 166 unsigned char recalibration_min_blue; 167 unsigned char recalibration_max_blue; 168 /* PANCHRO band params (#8) */ 169 double lmin_panchro; /* same as RED band */ 170 double lmax_panchro; 171 double qcalmin_panchro; 172 double qcalmax_panchro; 173 int is_gain_low_panchro; 174 double spectral_irradiance_panchro; 175 double low_gain_factor_panchro; 176 double high_gain_factor_panchro; 177 unsigned char recalibration_min_panchro; 178 unsigned char recalibration_max_panchro; 179 } gGraphLandsatRecalibration; 180 typedef gGraphLandsatRecalibration *gGraphLandsatRecalibrationPtr; 181 182 GGRAPH_DECLARE int gGraphCreateContext (int width, int height, 183 const void **context); 184 GGRAPH_DECLARE int gGraphDestroyContext (const void *context); 185 GGRAPH_DECLARE int gGraphCreateSvgContext (const char *path, int width, 186 int height, 187 const void **context); 188 GGRAPH_DECLARE int gGraphDestroySvgContext (const void *context); 189 GGRAPH_DECLARE int gGraphCreatePdfContext (const char *path, int page_width, 190 int page_height, int width, 191 int height, 192 const void **context); 193 GGRAPH_DECLARE int gGraphDestroyPdfContext (const void *context); 194 GGRAPH_DECLARE int gGraphSetPen (const void *context, unsigned char red, 195 unsigned char green, unsigned char blue, 196 unsigned char alpha, double width, 197 int style); 198 GGRAPH_DECLARE int gGraphSetBrush (const void *context, unsigned char red, 199 unsigned char green, unsigned char blue, 200 unsigned char alpha); 201 GGRAPH_DECLARE int gGraphSetLinearGradientBrush (const void *context, 202 double x, double y, 203 double width, 204 double height, 205 unsigned char red1, 206 unsigned char green1, 207 unsigned char blue1, 208 unsigned char alpha1, 209 unsigned char red2, 210 unsigned char green2, 211 unsigned char blue2, 212 unsigned char alpha2); 213 GGRAPH_DECLARE int gGraphSetPatternBrush (const void *context, 214 const void *brush); 215 GGRAPH_DECLARE int gGraphSetFont (const void *context, const void *font); 216 GGRAPH_DECLARE int gGraphFillPath (const void *context, int preserve); 217 GGRAPH_DECLARE int gGraphStrokePath (const void *context, int preserve); 218 GGRAPH_DECLARE int gGraphMoveToPoint (const void *context, double x, 219 double y); 220 GGRAPH_DECLARE int gGraphAddLineToPath (const void *context, double x, 221 double y); 222 GGRAPH_DECLARE int gGraphCloseSubpath (const void *context); 223 GGRAPH_DECLARE int gGraphStrokeLine (const void *context, double x0, 224 double y0, double x1, double y1); 225 GGRAPH_DECLARE int gGraphDrawEllipse (const void *context, double x, 226 double y, double width, 227 double height); 228 GGRAPH_DECLARE int gGraphDrawRectangle (const void *context, double x, 229 double y, double width, 230 double height); 231 GGRAPH_DECLARE int gGraphDrawRoundedRectangle (const void *context, 232 double x, double y, 233 double width, double height, 234 double radius); 235 GGRAPH_DECLARE int gGraphDrawCircleSector (const void *context, 236 double center_x, double center_y, 237 double radius, double from_angle, 238 double to_angle); 239 GGRAPH_DECLARE int gGraphGetTextExtent (const void *context, 240 const char *text, double *pre_x, 241 double *pre_y, double *width, 242 double *height, double *post_x, 243 double *post_y); 244 GGRAPH_DECLARE int gGraphDrawText (const void *context, const char *text, 245 double x, double y, double angle); 246 GGRAPH_DECLARE int gGraphGetContextRgbArray (const void *context, 247 unsigned char **rgbArray); 248 GGRAPH_DECLARE int gGraphGetContextAlphaArray (const void *context, 249 unsigned char **alphaArray); 250 GGRAPH_DECLARE int gGraphDrawBitmap (const void *context, 251 const void *bitmap, int x, int y); 252 GGRAPH_DECLARE int gGraphCreateBitmap (unsigned char *rgbaArray, int width, 253 int height, const void **bitmap); 254 GGRAPH_DECLARE int gGraphDestroyBitmap (const void *bitmap); 255 GGRAPH_DECLARE int gGraphCreateBrush (unsigned char *rgbaArray, int width, 256 int height, const void **brush); 257 GGRAPH_DECLARE int gGraphDestroyBrush (const void *brush); 258 GGRAPH_DECLARE int gGraphCreateFont (double size, int style, int weight, 259 const void **font); 260 GGRAPH_DECLARE int gGraphDestroyFont (const void *font); 261 GGRAPH_DECLARE int gGraphFontSetColor (const void *font, unsigned char red, 262 unsigned char green, 263 unsigned char blue, 264 unsigned char alpha); 265 GGRAPH_DECLARE int gGraphFontSetOutline (const void *font, double width); 266 267 /* 268 / image access methods 269 */ 270 GGRAPH_DECLARE const void *gGraphCreateRgbImage (int width, int height); 271 GGRAPH_DECLARE const void *gGraphCreateRgbImageFromBitmap (unsigned char 272 *bitmap, 273 int width, 274 int height); 275 GGRAPH_DECLARE const void *gGraphCreateRgbaImage (int width, int height); 276 GGRAPH_DECLARE const void *gGraphCreateGrayscaleImage (int width, 277 int height); 278 GGRAPH_DECLARE const void *gGraphCreatePaletteImage (int width, int height); 279 GGRAPH_DECLARE const void *gGraphCreateMonochromeImage (int width, 280 int height); 281 GGRAPH_DECLARE const void *gGraphCreateGridInt16Image (int width, 282 int height); 283 GGRAPH_DECLARE const void *gGraphCreateGridUInt16Image (int width, 284 int height); 285 GGRAPH_DECLARE const void *gGraphCreateGridInt32Image (int width, 286 int height); 287 GGRAPH_DECLARE const void *gGraphCreateGridUInt32Image (int width, 288 int height); 289 GGRAPH_DECLARE const void *gGraphCreateGridFloatImage (int width, 290 int height); 291 GGRAPH_DECLARE const void *gGraphCreateGridDoubleImage (int width, 292 int height); 293 GGRAPH_DECLARE int gGraphImageBackgroundFill (const void *img, 294 unsigned char red, 295 unsigned char green, 296 unsigned char blue, 297 unsigned char alpha); 298 GGRAPH_DECLARE int gGraphImageSetTransparentColor (const void *img, 299 unsigned char red, 300 unsigned char green, 301 unsigned char blue); 302 GGRAPH_DECLARE int gGraphImageGetTransparentColor (const void *img, 303 unsigned char *red, 304 unsigned char *green, 305 unsigned char *blue); 306 GGRAPH_DECLARE int gGraphGridBackgroundFill (const void *img, 307 double no_data_value); 308 GGRAPH_DECLARE int gGraphImageSetNoDataValue (const void *img, 309 double no_data_vale); 310 GGRAPH_DECLARE int gGraphImageGetNoDataValue (const void *img, 311 double *no_data_value); 312 GGRAPH_DECLARE void gGraphDestroyImage (const void *img); 313 GGRAPH_DECLARE void gGraphDestroyImageInfos (const void *img); 314 GGRAPH_DECLARE int gGraphGetImageDims (const void *img, int *width, 315 int *height); 316 GGRAPH_DECLARE int gGraphGetImageInfos (const void *img, int *width, 317 int *height, int *colorspace, 318 int *max_palette, 319 int *bits_per_sample, 320 int *samples_per_pixel, 321 int *sample_format, int *tile_width, 322 int *tile_height, 323 int *rows_per_strip, 324 int *compression, 325 double *no_data_value, 326 double *min_value, 327 double *max_value, int *scale_1_2, 328 int *scale_1_4, int *scale_1_8); 329 GGRAPH_DECLARE int gGraphGetImageSize (const void *img, int *size); 330 GGRAPH_DECLARE int gGraphImageColorSpaceOptimize (const void *img); 331 GGRAPH_DECLARE int gGraphImageResampleAsRgb (const void *img); 332 GGRAPH_DECLARE int gGraphImageResampleAsMonochrome (const void *img); 333 GGRAPH_DECLARE int gGraphImageResampleAsPalette (const void *img, 334 int num_colors); 335 GGRAPH_DECLARE int gGraphImageResampleAsGrayscale (const void *img); 336 GGRAPH_DECLARE int gGraphImageResampleAsPhotographic (const void *img); 337 GGRAPH_DECLARE int gGraphImageResampleAsGridInt16 (const void *img); 338 GGRAPH_DECLARE int gGraphImageResampleAsGridUInt16 (const void *img); 339 GGRAPH_DECLARE int gGraphImageResampleAsGridInt32 (const void *img); 340 GGRAPH_DECLARE int gGraphImageResampleAsGridUInt32 (const void *img); 341 GGRAPH_DECLARE int gGraphImageResampleAsGridFloat (const void *img); 342 GGRAPH_DECLARE int gGraphImageResampleAsGridDouble (const void *img); 343 GGRAPH_DECLARE int gGraphImageTransparentResample (const void *img); 344 GGRAPH_DECLARE int gGraphImageGuessFormat (const void *mem_buf, 345 int mem_buf_size); 346 GGRAPH_DECLARE int gGraphFileImageGuessFormat (const char *path, int *type); 347 348 /* 349 / the following methods return a copy of the internal image buffer 350 / PLEASE NOTE: you are responsible to free() the returned memory block 351 */ 352 GGRAPH_DECLARE int gGraphImageBufferReferenceRGB (const void *img, 353 unsigned char **buffer); 354 GGRAPH_DECLARE int gGraphImageBufferReferenceRGBA (const void *img, 355 unsigned char **buffer); 356 GGRAPH_DECLARE int gGraphImageBufferReferenceARGB (const void *img, 357 unsigned char **buffer); 358 GGRAPH_DECLARE int gGraphImageBufferReferenceBGR (const void *img, 359 unsigned char **buffer); 360 GGRAPH_DECLARE int gGraphImageBufferReferenceBGRA (const void *img, 361 unsigned char **buffer); 362 363 /* 364 / image resizing / image subsetting 365 */ 366 GGRAPH_DECLARE int gGraphImageResizeNormal (const void *orig, 367 const void **dest, int width, 368 int height); 369 GGRAPH_DECLARE int gGraphImageResizeHighQuality (const void *orig, 370 const void **dest, 371 int width, int height); 372 GGRAPH_DECLARE int gGraphImageResizeToResolution (const void *orig, 373 const void **dest, 374 double pixel_x_size, 375 double pixel_y_size, 376 int *width, int *height); 377 GGRAPH_DECLARE int gGraphImageSubSet (const void *orig, const void **dest, 378 int upper_left_x, int upper_left_y, 379 int width, int height); 380 381 /* 382 / utility functions handling image georeferencing 383 */ 384 GGRAPH_DECLARE int gGraphGetWorldFilePath (const char *main_path, 385 char *world_file_path); 386 387 GGRAPH_DECLARE int gGraphCheckHgtPath (const char *path, int *lat, 388 int *lon); 389 GGRAPH_DECLARE int gGraphCheckBinPath (const char *path, char *hdr_path, 390 int dont_test); 391 GGRAPH_DECLARE int gGraphCheckFltPath (const char *path, char *hdr_path, 392 int dont_test); 393 GGRAPH_DECLARE int gGraphCheckDemPath (const char *path, char *hdr_path, 394 int dont_test); 395 GGRAPH_DECLARE int gGraphCheckAscPath (const char *path); 396 397 GGRAPH_DECLARE int gGraphImageIsGeoRef (const void *img); 398 GGRAPH_DECLARE int gGraphImageSetGeoRef (const void *img, int srid, 399 const char *srs_name, 400 const char *proj4text, 401 double upper_left_x, 402 double upper_left_y, 403 double pixel_x_size, 404 double pixel_y_size); 405 GGRAPH_DECLARE int gGraphImageGetGeoRef (const void *img, int *srid, 406 char *srs_name, 407 char *proj4text, 408 double *upper_left_x, 409 double *upper_left_y, 410 double *pixel_x_size, 411 double *pixel_y_size); 412 GGRAPH_DECLARE int gGraphImageInfosGetGeoRef (const void *img, 413 int *srid, 414 char *srs_name, 415 char *proj4text, 416 double *upper_left_x, 417 double *upper_left_y, 418 double *pixel_x_size, 419 double *pixel_y_size); 420 GGRAPH_DECLARE int gGraphReadWorldFile (const char *path, 421 double *upper_left_x, 422 double *upper_left_y, 423 double *pixel_x_size, 424 double *pixel_y_size); 425 426 /* 427 / utility functions returning an image 428 */ 429 GGRAPH_DECLARE int gGraphImageFromFile (const char *path, int image_type, 430 const void **image_handle, 431 int scale); 432 GGRAPH_DECLARE int gGraphImageFromMemBuf (const void *mem_buf, 433 int mem_buf_size, int image_type, 434 const void **image_handle, 435 int scale); 436 437 /* 438 / utility functions returning image infos 439 */ 440 GGRAPH_DECLARE int gGraphImageInfosFromHgtFile (const char *path, 441 int lat, int lon, 442 const void **infos_handle); 443 GGRAPH_DECLARE int gGraphImageInfosFromBinFile (const char *path, 444 const char *hdr_path, 445 const void **infos_handle); 446 GGRAPH_DECLARE int gGraphImageInfosFromFltFile (const char *path, 447 const char *hdr_path, 448 const void **infos_handle); 449 GGRAPH_DECLARE int gGraphImageInfosFromDemFile (const char *path, 450 const char *hdr_path, 451 const void **infos_handle); 452 GGRAPH_DECLARE int gGraphImageInfosFromAscFile (const char *path, 453 const void **infos_handle); 454 GGRAPH_DECLARE int gGraphImageInfosFromFile (const char *path, 455 int image_type, 456 const void **infos_handle); 457 GGRAPH_DECLARE int gGraphImageInfosFromMemBuf (const void *mem_buf, 458 int mem_buf_size, 459 int image_type, 460 const void **infos_handle); 461 462 /* 463 / utility functions generating a file from an image 464 */ 465 GGRAPH_DECLARE int gGraphImageToJpegFile (const void *img, const char *path, 466 int quality); 467 GGRAPH_DECLARE int gGraphImageToPngFile (const void *img, const char *path, 468 int compression_level, 469 int quantization_factor, 470 int interlaced); 471 GGRAPH_DECLARE int gGraphImageToGifFile (const void *img, const char *path); 472 473 /* 474 / utility functions generating a memory buffer from an image 475 */ 476 GGRAPH_DECLARE int gGraphImageToJpegMemBuf (const void *img, void **mem_buf, 477 int *mem_buf_size, 478 int jpeg_quality); 479 GGRAPH_DECLARE int gGraphImageToPngMemBuf (const void *img, void **mem_buf, 480 int *mem_buf_size, 481 int compression_level, 482 int quantization_factor, 483 int interlaced, 484 int is_transparent); 485 GGRAPH_DECLARE int gGraphImageToGifMemBuf (const void *img, void **mem_buf, 486 int *mem_buf_size, 487 int is_transparent); 488 489 /* 490 / utility functions handling Adam7 and Monochrome encoding 491 */ 492 GGRAPH_DECLARE int gGraphImageToAdam7 (const void *img, void *mem_bufs[7], 493 int mem_buf_sizes[7], void **palette, 494 int *palette_size); 495 GGRAPH_DECLARE int gGraphImageFromAdam7 (void *mem_bufs[7], 496 int mem_buf_sizes[7], 497 void *palette, int palette_size, 498 const void **image_handle, 499 int scale); 500 GGRAPH_DECLARE int gGraphImageToMonochrome (const void *img, void **mem_buf, 501 int *mem_buf_size); 502 GGRAPH_DECLARE int gGraphImageFromMonochrome (const void *mem_buf, 503 int mem_buf_size, 504 const void **image_handle); 505 506 /* 507 / functions for RAW image handling 508 */ 509 GGRAPH_DECLARE int gGraphImageFromRawMemBuf (const void *mem_buf, 510 int mem_buf_size, 511 const void **image_handle); 512 GGRAPH_DECLARE int gGraphIsRawImage (const void *mem_buf, int mem_buf_size); 513 514 /* 515 / methods accessing a file-based Image by Strips 516 */ 517 GGRAPH_DECLARE int gGraphImageFromHgtFileByStrips (const char *path, 518 int lat, int lon, 519 const void 520 **strip_handle); 521 GGRAPH_DECLARE int gGraphImageFromBinFileByStrips (const char *path, 522 const char *hdr_path, 523 const void 524 **strip_handle); 525 GGRAPH_DECLARE int gGraphImageFromFltFileByStrips (const char *path, 526 const char *hdr_path, 527 const void 528 **strip_handle); 529 GGRAPH_DECLARE int gGraphImageFromDemFileByStrips (const char *path, 530 const char *hdr_path, 531 const void 532 **strip_handle); 533 GGRAPH_DECLARE int gGraphImageFromAscFileByStrips (const char *path, 534 const void 535 **strip_handle); 536 GGRAPH_DECLARE int gGraphImageFromFileByStrips (const char *path, 537 int image_type, 538 const void **strip_handle); 539 GGRAPH_DECLARE int gGraphReadNextStrip (const void *strip_handle, 540 int *progress); 541 542 GGRAPH_DECLARE int gGraphImageToJpegFileByStrips (const void **strip_handle, 543 const char *path, 544 int width, int height, 545 int color_model, 546 int quality); 547 GGRAPH_DECLARE int gGraphImageToPngFileByStrips (const void **strip_handle, 548 const char *path, 549 int width, int height, 550 int color_model, 551 int bits_per_sample, 552 int num_palette, 553 unsigned char *red, 554 unsigned char *green, 555 unsigned char *blue, 556 int compression_level, 557 int quantization_factor); 558 GGRAPH_DECLARE int gGraphImageToTiffFileByStrips (const void **strip_handle, 559 const char *path, 560 int width, int height, 561 int color_model, 562 int is_tiled, 563 int tile_width, 564 int tile_height, 565 int rows_per_strip, 566 int bits_per_sample, 567 int sample_format, 568 int num_palette, 569 unsigned char *red, 570 unsigned char *green, 571 unsigned char *blue, 572 int compression); 573 GGRAPH_DECLARE int gGraphImageToGeoTiffFileByStrips (const void 574 **strip_handle, 575 const char *path, 576 int width, int height, 577 int color_model, 578 int is_tiled, 579 int tile_width, 580 int tile_height, 581 int rows_per_strip, 582 int bits_per_sample, 583 int sample_format, 584 int num_palette, 585 unsigned char *red, 586 unsigned char *green, 587 unsigned char *blue, 588 int compression, 589 int srid, 590 const char *srs_name, 591 const char *proj4text, 592 double upper_left_x, 593 double upper_left_y, 594 double pixel_x_size, 595 double pixel_y_size); 596 GGRAPH_DECLARE int gGraphImageToBinHdrFileByStrips (const void 597 **strip_handle, 598 const char *path, 599 int width, int height, 600 int bits_per_sample, 601 double upper_left_x, 602 double upper_left_y, 603 double pixel_x_size, 604 double pixel_y_size, 605 double no_data_value); 606 GGRAPH_DECLARE int gGraphImageToFltHdrFileByStrips (const void 607 **strip_handle, 608 const char *path, 609 int width, int height, 610 int bits_per_sample, 611 double upper_left_x, 612 double upper_left_y, 613 double pixel_x_size, 614 double pixel_y_size, 615 double no_data_value); 616 GGRAPH_DECLARE int gGraphImageToAscFileByStrips (const void **strip_handle, 617 const char *path, 618 int width, int height, 619 int sample, 620 int bits_per_sample, 621 double upper_left_x, 622 double upper_left_y, 623 double pixel_x_size, 624 double pixel_y_size, 625 double no_data_value); 626 GGRAPH_DECLARE int gGraphWriteNextStrip (const void *strip_handle, 627 int *progress); 628 GGRAPH_DECLARE int gGraphWriteBinHeader (const char *hdr_path, 629 const void *strip_handle); 630 GGRAPH_DECLARE int gGraphWriteFltHeader (const char *hdr_path, 631 const void *strip_handle); 632 633 GGRAPH_DECLARE int gGraphStripImageClonePalette (const void *strip_handle, 634 int *color_model, 635 int *num_palette, 636 unsigned char *red, 637 unsigned char *green, 638 unsigned char *blue); 639 GGRAPH_DECLARE int gGraphStripImageAllocPixels (const void *strip_handle, 640 int rows_per_block); 641 GGRAPH_DECLARE int gGraphStripImageEOF (const void *strip_handle); 642 GGRAPH_DECLARE int gGraphStripImageCopyPixels (const void *in_strip_handle, 643 const void 644 *out_strip_handle); 645 GGRAPH_DECLARE int gGraphStripImageRenderGridPixels (const void 646 *in_strip_handle, 647 const void 648 *out_strip_handle, 649 const void 650 *color_map_handle, 651 int num_threads); 652 GGRAPH_DECLARE int gGraphStripImageSubSetPixels (const void 653 *in_strip_handle, 654 const void 655 *out_strip_handle, 656 int start_from, int row); 657 GGRAPH_DECLARE int gGraphStripImageGetNextRow (const void *in_strip_handle, 658 int *next_row); 659 GGRAPH_DECLARE int gGraphStripIsFull (const void *in_strip_handle); 660 GGRAPH_DECLARE int gGraphGetStripImageMinMaxValue (const void 661 *in_strip_handle, 662 double *min_value, 663 double *max_value, 664 double no_data_value); 665 666 GGRAPH_DECLARE int gGraphStripImageRewind (const void *in_strip_handle); 667 GGRAPH_DECLARE int gGraphStripImageGetCurrentRows (const void 668 *in_strip_handle, 669 int *rows); 670 GGRAPH_DECLARE int gGraphStripImageSetCurrentRows (const void 671 *in_strip_handle, 672 int rows); 673 GGRAPH_DECLARE int gGraphStripImageGetPixelRGB (const void *in_strip_handle, 674 int col, int row, 675 unsigned char *red, 676 unsigned char *green, 677 unsigned char *blue); 678 GGRAPH_DECLARE int gGraphStripImageSetPixelRGB (const void *in_strip_handle, 679 int col, int row, 680 unsigned char red, 681 unsigned char green, 682 unsigned char blue); 683 684 GGRAPH_DECLARE int gGraphCountColors (const char *path, int image_type, 685 int rows_per_block); 686 GGRAPH_DECLARE void gGraphSmartPrintf (double value, char *buf); 687 688 GGRAPH_DECLARE int gGraphColorRuleFromFile (const char *path, 689 const void **color_rule); 690 GGRAPH_DECLARE int gGraphColorRuleFromMemBuf (char *buf, 691 const void **color_rule); 692 GGRAPH_DECLARE void gGraphDestroyColorRule (const void *color_rule); 693 GGRAPH_DECLARE int gGraphIsColorRuleRelative (const void *color_rule, 694 int *relative); 695 GGRAPH_DECLARE int gGraphCreateColorMapAbsolute (const void *color_rule, 696 unsigned char 697 background_red, 698 unsigned char 699 background_green, 700 unsigned char 701 background_blue, 702 const void **color_map); 703 GGRAPH_DECLARE int gGraphCreateColorMapRelative (const void *color_rule, 704 double min, double max, 705 unsigned char 706 background_red, 707 unsigned char 708 background_green, 709 unsigned char 710 background_blue, 711 const void **color_map); 712 GGRAPH_DECLARE void gGraphDestroyColorMap (const void *color_map); 713 714 GGRAPH_DECLARE int gGraphCreateShadedReliefTripleRow (int width, 715 unsigned char 716 background_red, 717 unsigned char 718 background_green, 719 unsigned char 720 background_blue, 721 double no_data, 722 const void 723 *color_map_handle, 724 unsigned char 725 mono_red, 726 unsigned char 727 mono_green, 728 unsigned char 729 mono_blue, 730 double z_factor, 731 double scale_factor, 732 double azimuth, 733 double altitude, 734 const void 735 **triple_row_handle); 736 GGRAPH_DECLARE void gGraphDestroyShadedReliefTripleRow (const void 737 *triple_row_handle); 738 739 GGRAPH_DECLARE int gGraphShadedReliefRenderPixels (const void 740 *triple_row_handle, 741 int num_threads, 742 int *out_row_ready); 743 GGRAPH_DECLARE int gGraphStripImageGetShadedReliefScanline (const void 744 *in_img_handle, 745 int row_index, 746 const void 747 *triple_row_handle); 748 GGRAPH_DECLARE int gGraphStripImageSetShadedReliefScanline (const void 749 *triple_row_handle, 750 const void 751 *out_img_handle, 752 int row_index); 753 GGRAPH_DECLARE int gGraphLandsatRGB (const void *img_red, 754 const void *img_green, 755 const void *img_blue, 756 const void *img_rgb, int width, 757 int num_rows, 758 gGraphLandsatRecalibrationPtr params, 759 int num_threads); 760 GGRAPH_DECLARE int gGraphLandsatBW (const void *img_in, const void *img_out, 761 int width, int num_rows, 762 gGraphLandsatRecalibrationPtr params, 763 int num_threads); 764 GGRAPH_DECLARE int gGraphGetLandsatSceneExtent (const void *img_in, 765 int base_row, double *top_x, 766 double *top_y, 767 double *bottom_x, 768 double *bottom_y, 769 double *left_x, 770 double *left_y, 771 double *right_x, 772 double *right_y); 773 GGRAPH_DECLARE int gGraphLandsatMergePixels (const void *img_in, 774 int base_row, 775 const void *img_out); 776 GGRAPH_DECLARE int gGraphOutputPixelsToStripImage (const void *img_in, 777 const void *img_out, 778 int in_row, int out_row); 779 GGRAPH_DECLARE int gGraphInputPixelsFromStripImage (const void *img_in, 780 const void *img_out, 781 int in_col); 782 GGRAPH_DECLARE int gGraphGeoMergePixels (const void *img_in, 783 const void *img_out); 784 GGRAPH_DECLARE int gGraphImageFromStripImage (const void *img_in, 785 int color_space, 786 int sample_format, 787 int bits_per_sample, 788 int samples_per_pixel, 789 int start_line, 790 const void **img_out); 791 792 /* SVG images */ 793 GGRAPH_DECLARE int gGraphCreateSVG (const unsigned char *svg_document, 794 int svg_bytes, void **svg_handle); 795 GGRAPH_DECLARE int gGraphGetSVGDims (void *svg_handle, double *width, 796 double *height); 797 GGRAPH_DECLARE int gGraphImageFromSVG (void *handle, double size, 798 const void **img_out); 799 GGRAPH_DECLARE int gGraphFreeSVG (void *sgv_handle); 800 801 #ifdef __cplusplus 802 } 803 #endif 804 805 #endif /* _GGRAPH_H */ 806