Merge remote-tracking branch 'origin/master' into colour
This commit is contained in:
commit
59513b6869
@ -482,11 +482,11 @@ AC_ARG_WITH([openslide],
|
|||||||
AS_HELP_STRING([--without-openslide], [build without OpenSlide (default: test)]))
|
AS_HELP_STRING([--without-openslide], [build without OpenSlide (default: test)]))
|
||||||
|
|
||||||
if test x"$with_openslide" != x"no"; then
|
if test x"$with_openslide" != x"no"; then
|
||||||
PKG_CHECK_MODULES(OPENSLIDE, openslide >= 3.2.5,
|
PKG_CHECK_MODULES(OPENSLIDE, openslide >= 3.3.0,
|
||||||
[AC_DEFINE(HAVE_OPENSLIDE,1,[define if you have OpenSlide >= 3.2.5 installed.])
|
[AC_DEFINE(HAVE_OPENSLIDE,1,[define if you have OpenSlide >= 3.3.0 installed.])
|
||||||
with_openslide=yes
|
with_openslide=yes
|
||||||
PACKAGES_USED="$PACKAGES_USED openslide"],
|
PACKAGES_USED="$PACKAGES_USED openslide"],
|
||||||
[AC_MSG_WARN([OpenSlide >= 3.2.5 not found; disabling virtual slide support])
|
[AC_MSG_WARN([OpenSlide >= 3.3.0 not found; disabling virtual slide support])
|
||||||
with_openslide=no
|
with_openslide=no
|
||||||
])
|
])
|
||||||
fi
|
fi
|
||||||
@ -748,7 +748,7 @@ accelerate loops with orc: $with_orc
|
|||||||
ICC profile support with lcms: $with_lcms
|
ICC profile support with lcms: $with_lcms
|
||||||
file import with OpenEXR: $with_OpenEXR
|
file import with OpenEXR: $with_OpenEXR
|
||||||
file import with OpenSlide: $with_openslide
|
file import with OpenSlide: $with_openslide
|
||||||
(requires openslide-3.2.5 or later)
|
(requires openslide-3.3.0 or later)
|
||||||
file import with matio: $with_matio
|
file import with matio: $with_matio
|
||||||
file import with cfitsio: $with_cfitsio
|
file import with cfitsio: $with_cfitsio
|
||||||
text rendering with pangoft2: $with_pangoft2
|
text rendering with pangoft2: $with_pangoft2
|
||||||
|
@ -4,6 +4,8 @@
|
|||||||
* - just a stub
|
* - just a stub
|
||||||
* 11/4/12
|
* 11/4/12
|
||||||
* - support :level,associated in filenames
|
* - support :level,associated in filenames
|
||||||
|
* 20/9/12
|
||||||
|
* - add Leica filename suffix
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -93,6 +95,7 @@ im_openslide2vips( const char *name, IMAGE *out )
|
|||||||
static const char *openslide_suffs[] = {
|
static const char *openslide_suffs[] = {
|
||||||
".svs", /* Aperio */
|
".svs", /* Aperio */
|
||||||
".vms", ".vmu", ".ndpi", /* Hamamatsu */
|
".vms", ".vmu", ".ndpi", /* Hamamatsu */
|
||||||
|
".scn", /* Leica */
|
||||||
".mrxs", /* MIRAX */
|
".mrxs", /* MIRAX */
|
||||||
".tif", /* Trestle */
|
".tif", /* Trestle */
|
||||||
NULL
|
NULL
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
*
|
*
|
||||||
* Benjamin Gilbert
|
* Benjamin Gilbert
|
||||||
*
|
*
|
||||||
* Copyright (c) 2011 Carnegie Mellon University
|
* Copyright (c) 2011-2012 Carnegie Mellon University
|
||||||
*
|
*
|
||||||
* 26/11/11
|
* 26/11/11
|
||||||
* - initial version
|
* - initial version
|
||||||
@ -31,6 +31,9 @@
|
|||||||
* - small cleanups
|
* - small cleanups
|
||||||
* 11/4/12
|
* 11/4/12
|
||||||
* - fail if both level and associated image are specified
|
* - fail if both level and associated image are specified
|
||||||
|
* 20/9/12
|
||||||
|
* - update openslide_open error handling for 3.3.0 semantics
|
||||||
|
* - switch from deprecated _layer_ functions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -108,6 +111,9 @@ vips__openslide_isslide( const char *filename )
|
|||||||
*/
|
*/
|
||||||
vendor = openslide_get_property_value( osr,
|
vendor = openslide_get_property_value( osr,
|
||||||
OPENSLIDE_PROPERTY_NAME_VENDOR );
|
OPENSLIDE_PROPERTY_NAME_VENDOR );
|
||||||
|
|
||||||
|
/* vendor will be NULL if osr is in error state.
|
||||||
|
*/
|
||||||
if( vendor &&
|
if( vendor &&
|
||||||
strcmp( vendor, "generic-tiff" ) != 0 )
|
strcmp( vendor, "generic-tiff" ) != 0 )
|
||||||
ok = 1;
|
ok = 1;
|
||||||
@ -148,6 +154,7 @@ readslide_new( const char *filename, VipsImage *out,
|
|||||||
{
|
{
|
||||||
ReadSlide *rslide;
|
ReadSlide *rslide;
|
||||||
int64_t w, h;
|
int64_t w, h;
|
||||||
|
const char *error;
|
||||||
const char *background;
|
const char *background;
|
||||||
const char * const *properties;
|
const char * const *properties;
|
||||||
|
|
||||||
@ -169,12 +176,19 @@ readslide_new( const char *filename, VipsImage *out,
|
|||||||
rslide->osr = openslide_open( filename );
|
rslide->osr = openslide_open( filename );
|
||||||
if( rslide->osr == NULL ) {
|
if( rslide->osr == NULL ) {
|
||||||
vips_error( "openslide2vips",
|
vips_error( "openslide2vips",
|
||||||
"%s", _( "failure opening slide" ) );
|
"%s", _( "unsupported slide format" ) );
|
||||||
|
return( NULL );
|
||||||
|
}
|
||||||
|
|
||||||
|
error = openslide_get_error( rslide->osr );
|
||||||
|
if( error ) {
|
||||||
|
vips_error( "openslide2vips",
|
||||||
|
_( "opening slide: %s" ), error );
|
||||||
return( NULL );
|
return( NULL );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( level < 0 ||
|
if( level < 0 ||
|
||||||
level >= openslide_get_layer_count( rslide->osr ) ) {
|
level >= openslide_get_level_count( rslide->osr ) ) {
|
||||||
vips_error( "openslide2vips",
|
vips_error( "openslide2vips",
|
||||||
"%s", _( "invalid slide level" ) );
|
"%s", _( "invalid slide level" ) );
|
||||||
return( NULL );
|
return( NULL );
|
||||||
@ -192,9 +206,9 @@ readslide_new( const char *filename, VipsImage *out,
|
|||||||
vips_demand_hint( out, VIPS_DEMAND_STYLE_THINSTRIP, NULL );
|
vips_demand_hint( out, VIPS_DEMAND_STYLE_THINSTRIP, NULL );
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
openslide_get_layer_dimensions( rslide->osr,
|
openslide_get_level_dimensions( rslide->osr,
|
||||||
level, &w, &h );
|
level, &w, &h );
|
||||||
rslide->downsample = openslide_get_layer_downsample(
|
rslide->downsample = openslide_get_level_downsample(
|
||||||
rslide->osr, level );
|
rslide->osr, level );
|
||||||
vips_image_set_int( out, "slide-level", level );
|
vips_image_set_int( out, "slide-level", level );
|
||||||
vips_demand_hint( out, VIPS_DEMAND_STYLE_SMALLTILE, NULL );
|
vips_demand_hint( out, VIPS_DEMAND_STYLE_SMALLTILE, NULL );
|
||||||
|
@ -6,6 +6,9 @@
|
|||||||
* - convert "layer" to "level" where externally visible
|
* - convert "layer" to "level" where externally visible
|
||||||
* 11/4/12
|
* 11/4/12
|
||||||
* - convert remaining uses of "layer" to "level"
|
* - convert remaining uses of "layer" to "level"
|
||||||
|
* 20/9/12
|
||||||
|
* - add Leica filename suffix
|
||||||
|
* - drop glib log handler (unneeded with >= 3.3.0)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -131,16 +134,10 @@ vips_foreign_load_openslide_load( VipsForeignLoad *load )
|
|||||||
return( 0 );
|
return( 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
vips_foreign_load_openslide_error_handler( const char *domain,
|
|
||||||
GLogLevelFlags level, const char *message, void *data )
|
|
||||||
{
|
|
||||||
vips_error( "openslide", "%s", message );
|
|
||||||
}
|
|
||||||
|
|
||||||
static const char *vips_foreign_openslide_suffs[] = {
|
static const char *vips_foreign_openslide_suffs[] = {
|
||||||
".svs", /* Aperio */
|
".svs", /* Aperio */
|
||||||
".vms", ".vmu", ".ndpi", /* Hamamatsu */
|
".vms", ".vmu", ".ndpi", /* Hamamatsu */
|
||||||
|
".scn", /* Leica */
|
||||||
".mrxs", /* MIRAX */
|
".mrxs", /* MIRAX */
|
||||||
".tif", /* Trestle */
|
".tif", /* Trestle */
|
||||||
NULL
|
NULL
|
||||||
@ -194,12 +191,6 @@ vips_foreign_load_openslide_class_init( VipsForeignLoadOpenslideClass *class )
|
|||||||
VIPS_ARGUMENT_OPTIONAL_INPUT,
|
VIPS_ARGUMENT_OPTIONAL_INPUT,
|
||||||
G_STRUCT_OFFSET( VipsForeignLoadOpenslide, associated ),
|
G_STRUCT_OFFSET( VipsForeignLoadOpenslide, associated ),
|
||||||
NULL );
|
NULL );
|
||||||
|
|
||||||
/* Catch just openslide errors.
|
|
||||||
*/
|
|
||||||
g_log_set_handler( "Openslide",
|
|
||||||
G_LOG_LEVEL_CRITICAL | G_LOG_LEVEL_WARNING,
|
|
||||||
vips_foreign_load_openslide_error_handler, NULL );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
Loading…
Reference in New Issue
Block a user