OpenSlide
openslide.h
Go to the documentation of this file.
1 /*
2  * OpenSlide, a library for reading whole slide image files
3  *
4  * Copyright (c) 2007-2012 Carnegie Mellon University
5  * All rights reserved.
6  *
7  * OpenSlide is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU Lesser General Public License as
9  * published by the Free Software Foundation, version 2.1.
10  *
11  * OpenSlide is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with OpenSlide. If not, see
18  * <http://www.gnu.org/licenses/>.
19  *
20  */
21 
30 #ifndef OPENSLIDE_OPENSLIDE_H_
31 #define OPENSLIDE_OPENSLIDE_H_
32 
33 #include <openslide-features.h>
34 
35 #include <stdio.h>
36 #include <stdint.h>
37 
38 #ifdef __cplusplus
39 extern "C" {
40 #endif
41 
45 typedef struct _openslide openslide_t;
46 
47 
53 
66 OPENSLIDE_PUBLIC()
67 bool openslide_can_open(const char *filename);
68 
69 
80 OPENSLIDE_PUBLIC()
81 openslide_t *openslide_open(const char *filename);
82 
83 
91 OPENSLIDE_PUBLIC()
93 
94 
104 OPENSLIDE_PUBLIC()
105 void openslide_get_level0_dimensions(openslide_t *osr, int64_t *w, int64_t *h);
106 
107 
119 OPENSLIDE_PUBLIC()
120 void openslide_get_level_dimensions(openslide_t *osr, int32_t level,
121  int64_t *w, int64_t *h);
122 
123 
133 OPENSLIDE_PUBLIC()
134 double openslide_get_level_downsample(openslide_t *osr, int32_t level);
135 
136 
145 OPENSLIDE_PUBLIC()
147  double downsample);
148 
166 OPENSLIDE_PUBLIC()
168  uint32_t *dest,
169  int64_t x, int64_t y,
170  int32_t level,
171  int64_t w, int64_t h);
172 
173 
181 OPENSLIDE_PUBLIC()
182 void openslide_close(openslide_t *osr);
184 
226 OPENSLIDE_PUBLIC()
227 const char *openslide_get_error(openslide_t *osr);
229 
235 
239 #define OPENSLIDE_PROPERTY_NAME_COMMENT "openslide.comment"
240 
244 #define OPENSLIDE_PROPERTY_NAME_VENDOR "openslide.vendor"
245 
249 #define OPENSLIDE_PROPERTY_NAME_QUICKHASH1 "openslide.quickhash-1"
250 
257 #define OPENSLIDE_PROPERTY_NAME_BACKGROUND_COLOR "openslide.background-color"
258 
264 #define OPENSLIDE_PROPERTY_NAME_OBJECTIVE_POWER "openslide.objective-power"
265 
272 #define OPENSLIDE_PROPERTY_NAME_MPP_X "openslide.mpp-x"
273 
280 #define OPENSLIDE_PROPERTY_NAME_MPP_Y "openslide.mpp-y"
281 
282 
288 
301 OPENSLIDE_PUBLIC()
302 const char * const *openslide_get_property_names(openslide_t *osr);
303 
304 
319 OPENSLIDE_PUBLIC()
320 const char *openslide_get_property_value(openslide_t *osr, const char *name);
321 
323 
329 
344 OPENSLIDE_PUBLIC()
345 const char * const *openslide_get_associated_image_names(openslide_t *osr);
346 
360 OPENSLIDE_PUBLIC()
362  const char *name,
363  int64_t *w, int64_t *h);
364 
365 
381 OPENSLIDE_PUBLIC()
383  const char *name,
384  uint32_t *dest);
386 
392 
399 OPENSLIDE_PUBLIC()
400 const char *openslide_get_version(void);
401 
403 
412 
420 OPENSLIDE_PUBLIC()
421 OPENSLIDE_DEPRECATED_FOR(openslide_get_level_count)
423 
424 
434 OPENSLIDE_PUBLIC()
435 OPENSLIDE_DEPRECATED_FOR(openslide_get_level0_dimensions)
436 void openslide_get_layer0_dimensions(openslide_t *osr, int64_t *w, int64_t *h);
437 
438 
450 OPENSLIDE_PUBLIC()
451 OPENSLIDE_DEPRECATED_FOR(openslide_get_level_dimensions)
452 void openslide_get_layer_dimensions(openslide_t *osr, int32_t level,
453  int64_t *w, int64_t *h);
454 
455 
465 OPENSLIDE_PUBLIC()
466 OPENSLIDE_DEPRECATED_FOR(openslide_get_level_downsample)
467 double openslide_get_layer_downsample(openslide_t *osr, int32_t level);
468 
469 
478 OPENSLIDE_PUBLIC()
479 OPENSLIDE_DEPRECATED_FOR(openslide_get_best_level_for_downsample)
481  double downsample);
482 
492 OPENSLIDE_PUBLIC()
494 const char *openslide_get_comment(openslide_t *osr);
495 
497 
498 // these are meant to throw compile- and link-time errors,
499 // since the functions they replace were never implemented
500 int _openslide_give_prefetch_hint_UNIMPLEMENTED(void);
501 void _openslide_cancel_prefetch_hint_UNIMPLEMENTED(void);
502 #define openslide_give_prefetch_hint(osr, x, y, level, w, h) \
503  _openslide_give_prefetch_hint_UNIMPLEMENTED(-1);
504 #define openslide_cancel_prefetch_hint(osr, prefetch_id) \
505  _openslide_cancel_prefetch_hint_UNIMPLEMENTED(-1)
506 
515 #ifdef __cplusplus
516 }
517 #endif
518 
519 #endif