use of org.geotoolkit.display2d.style.CachedExternal in project geotoolkit by Geomatys.
the class StyleCacheTest method externalCacheTest.
@Test
public void externalCacheTest() throws Exception {
final ExternalGraphic ext = SF.externalGraphic("/org/geotoolkit/display2d/sample.svg", "image/svg");
CachedExternal cached = CachedExternal.cache(ext);
assertFalse(cached.isStatic());
assertEquals(VisibilityState.VISIBLE, cached.isStaticVisible());
assertTrue(cached.isVisible(null));
BufferedImage buffer = cached.getImage(Float.NaN, 1, null);
assertNotNull(buffer);
assertEquals(buffer.getWidth(), 12);
assertEquals(buffer.getHeight(), 12);
buffer = cached.getImage(null, 1, null);
assertEquals(buffer.getWidth(), 12);
assertEquals(buffer.getHeight(), 12);
buffer = cached.getImage(24f, 1, null);
assertEquals(buffer.getWidth(), 24);
assertEquals(buffer.getHeight(), 24);
}
Aggregations