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 #include <stdbool.h>
38 
39 #ifdef __cplusplus
40 extern "C" {
41 #endif
42 
46 typedef struct _openslide openslide_t;
47 
48 
54 
67 OPENSLIDE_PUBLIC()
68 bool openslide_can_open(const char *filename);
69 
70 
81 OPENSLIDE_PUBLIC()
82 openslide_t *openslide_open(const char *filename);
83 
84 
92 OPENSLIDE_PUBLIC()
94 
95 
105 OPENSLIDE_PUBLIC()
106 void openslide_get_level0_dimensions(openslide_t *osr, int64_t *w, int64_t *h);
107 
108 
120 OPENSLIDE_PUBLIC()
121 void openslide_get_level_dimensions(openslide_t *osr, int32_t level,
122  int64_t *w, int64_t *h);
123 
124 
134 OPENSLIDE_PUBLIC()
135 double openslide_get_level_downsample(openslide_t *osr, int32_t level);
136 
137 
146 OPENSLIDE_PUBLIC()
148  double downsample);
149 
167 OPENSLIDE_PUBLIC()
169  uint32_t *dest,
170  int64_t x, int64_t y,
171  int32_t level,
172  int64_t w, int64_t h);
173 
174 
182 OPENSLIDE_PUBLIC()
183 void openslide_close(openslide_t *osr);
185 
227 OPENSLIDE_PUBLIC()
228 const char *openslide_get_error(openslide_t *osr);
230 
236 
240 #define OPENSLIDE_PROPERTY_NAME_COMMENT "openslide.comment"
241 
245 #define OPENSLIDE_PROPERTY_NAME_VENDOR "openslide.vendor"
246 
250 #define OPENSLIDE_PROPERTY_NAME_QUICKHASH1 "openslide.quickhash-1"
251 
258 #define OPENSLIDE_PROPERTY_NAME_BACKGROUND_COLOR "openslide.background-color"
259 
265 #define OPENSLIDE_PROPERTY_NAME_OBJECTIVE_POWER "openslide.objective-power"
266 
273 #define OPENSLIDE_PROPERTY_NAME_MPP_X "openslide.mpp-x"
274 
281 #define OPENSLIDE_PROPERTY_NAME_MPP_Y "openslide.mpp-y"
282 
283 
289 
302 OPENSLIDE_PUBLIC()
303 const char * const *openslide_get_property_names(openslide_t *osr);
304 
305 
320 OPENSLIDE_PUBLIC()
321 const char *openslide_get_property_value(openslide_t *osr, const char *name);
322 
324 
330 
345 OPENSLIDE_PUBLIC()
346 const char * const *openslide_get_associated_image_names(openslide_t *osr);
347 
361 OPENSLIDE_PUBLIC()
363  const char *name,
364  int64_t *w, int64_t *h);
365 
366 
382 OPENSLIDE_PUBLIC()
384  const char *name,
385  uint32_t *dest);
387 
393 
400 OPENSLIDE_PUBLIC()
401 const char *openslide_get_version(void);
402 
404 
413 
421 OPENSLIDE_PUBLIC()
422 OPENSLIDE_DEPRECATED_FOR(openslide_get_level_count)
424 
425 
435 OPENSLIDE_PUBLIC()
436 OPENSLIDE_DEPRECATED_FOR(openslide_get_level0_dimensions)
437 void openslide_get_layer0_dimensions(openslide_t *osr, int64_t *w, int64_t *h);
438 
439 
451 OPENSLIDE_PUBLIC()
452 OPENSLIDE_DEPRECATED_FOR(openslide_get_level_dimensions)
453 void openslide_get_layer_dimensions(openslide_t *osr, int32_t level,
454  int64_t *w, int64_t *h);
455 
456 
466 OPENSLIDE_PUBLIC()
467 OPENSLIDE_DEPRECATED_FOR(openslide_get_level_downsample)
468 double openslide_get_layer_downsample(openslide_t *osr, int32_t level);
469 
470 
479 OPENSLIDE_PUBLIC()
480 OPENSLIDE_DEPRECATED_FOR(openslide_get_best_level_for_downsample)
482  double downsample);
483 
493 OPENSLIDE_PUBLIC()
495 const char *openslide_get_comment(openslide_t *osr);
496 
498 
499 // these are meant to throw compile- and link-time errors,
500 // since the functions they replace were never implemented
501 int _openslide_give_prefetch_hint_UNIMPLEMENTED(void);
502 void _openslide_cancel_prefetch_hint_UNIMPLEMENTED(void);
503 #define openslide_give_prefetch_hint(osr, x, y, level, w, h) \
504  _openslide_give_prefetch_hint_UNIMPLEMENTED(-1);
505 #define openslide_cancel_prefetch_hint(osr, prefetch_id) \
506  _openslide_cancel_prefetch_hint_UNIMPLEMENTED(-1)
507 
516 #ifdef __cplusplus
517 }
518 #endif
519 
520 #endif