Skip to content

Commit

Permalink
Add parameter for high quality rendering and set to true
Browse files Browse the repository at this point in the history
  • Loading branch information
minnerbe committed Oct 7, 2024
1 parent cdfd912 commit 87f152b
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,15 @@ public ByteProcessor render(final long x,
final long y,
final long z,
final ImageProcessorCache ipCache) {

render(x, y, z, ipCache, true);
}

public ByteProcessor render(final long x,
final long y,
final long z,
final ImageProcessorCache ipCache,
final boolean highQuality) {
final String renderParametersUrlString = String.format("%s/z/%d/box/%d,%d,%s",
stackUrl, z, x, y, boxUrlSuffix);
final RenderParameters renderParameters = RenderParameters.loadFromUrl(renderParametersUrlString);
Expand All @@ -53,6 +62,10 @@ public ByteProcessor render(final long x,
if (maxIntensity != null) {
renderParameters.setMaxIntensity(maxIntensity);
}
if (highQuality) {
renderParameters.setBinaryMask(false);
renderParameters.setSkipInterpolation(false);
}

final ByteProcessor renderedProcessor;
if (renderParameters.numberOfTileSpecs() > 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,15 @@ public ShortProcessor render(final long x,
final long y,
final long z,
final ImageProcessorCache ipCache) {

render(x, y, z, ipCache, true);
}

public ShortProcessor render(final long x,
final long y,
final long z,
final ImageProcessorCache ipCache,
final boolean highQuality) {
final String renderParametersUrlString = String.format("%s/z/%d/box/%d,%d,%s",
stackUrl, z, x, y, boxUrlSuffix);
final RenderParameters renderParameters = RenderParameters.loadFromUrl(renderParametersUrlString);
Expand All @@ -53,6 +62,10 @@ public ShortProcessor render(final long x,
if (maxIntensity != null) {
renderParameters.setMaxIntensity(maxIntensity);
}
if (highQuality) {
renderParameters.setBinaryMask(false);
renderParameters.setSkipInterpolation(false);
}

final ShortProcessor renderedProcessor;
if (renderParameters.numberOfTileSpecs() > 0) {
Expand Down

0 comments on commit 87f152b

Please sign in to comment.