Skip to content

Commit

Permalink
Merge pull request #5827 from rgozim/update_thumbnail_loading
Browse files Browse the repository at this point in the history
Updates to ThumbnailLoader and ThumbnailService
  • Loading branch information
joshmoore authored Sep 4, 2018
2 parents 43e8afd + 9c4b34e commit d1b488e
Show file tree
Hide file tree
Showing 11 changed files with 612 additions and 474 deletions.
32 changes: 31 additions & 1 deletion components/blitz/resources/omero/api/ThumbnailStore.ice
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ module omero {
* in the on-disk cache it will be returned directly,
* otherwise it will be created as in
* {@link #getThumbnailDirect}, placed in the on-disk
* cache and returned.
* cache and returned. If the thumbnail is missing, a clock will
* be returned to signify that the thumbnail is yet to be generated.
*
* @param sizeX the X-axis width of the thumbnail.
* <code>null</code> specifies the default size
Expand All @@ -112,6 +113,35 @@ module omero {
*/
idempotent Ice::ByteSeq getThumbnail(omero::RInt sizeX, omero::RInt sizeY) throws ServerError;

/**
* Retrieves a thumbnail for a pixels set using a given set of
* rendering settings (RenderingDef). If the thumbnail exists
* in the on-disk cache it will be returned directly,
* otherwise it will be created as in
* {@link #getThumbnailDirect}, placed in the on-disk
* cache and returned. If the thumbnail is still to be generated, an empty array will
* be returned.
*
* @param sizeX the X-axis width of the thumbnail.
* <code>null</code> specifies the default size
* of 48.
* @param sizeY the Y-axis width of the thumbnail.
* <code>null</code> specifies the default size
* of 48.
* @throws ApiUsageException
* if:
* <ul>
* <li><code>sizeX</code> > pixels.sizeX</li>
* <li><code>sizeX</code> is negative</li>
* <li><code>sizeY</code> > pixels.sizeY</li>
* <li><code>sizeY</code> is negative</li>
* <li>{@link #setPixelsId} has not yet been called</li>
* </ul>
* @return a JPEG thumbnail byte buffer
* @see #getThumbnailDirect
*/
idempotent Ice::ByteSeq getThumbnailWithoutDefault(omero::RInt sizeX, omero::RInt sizeY) throws ServerError;

/**
* Retrieves a number of thumbnails for pixels sets using
* given sets of rendering settings (RenderingDef). If the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import omero.api.AMD_ThumbnailStore_createThumbnailsByLongestSideSet;
import omero.api.AMD_ThumbnailStore_getRenderingDefId;
import omero.api.AMD_ThumbnailStore_getThumbnail;
import omero.api.AMD_ThumbnailStore_getThumbnailWithoutDefault;
import omero.api.AMD_ThumbnailStore_getThumbnailByLongestSide;
import omero.api.AMD_ThumbnailStore_getThumbnailByLongestSideDirect;
import omero.api.AMD_ThumbnailStore_getThumbnailByLongestSideSet;
Expand Down Expand Up @@ -126,6 +127,12 @@ public void getThumbnail_async(AMD_ThumbnailStore_getThumbnail __cb,

}

public void getThumbnailWithoutDefault_async(AMD_ThumbnailStore_getThumbnailWithoutDefault __cb,
RInt sizeX, RInt sizeY, Current __current) throws ServerError {
callInvokerOnRawArgs(__cb, __current, sizeX, sizeY);

}

public void resetDefaults_async(AMD_ThumbnailStore_resetDefaults __cb,
Current __current) throws ServerError {
callInvokerOnRawArgs(__cb, __current);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,11 @@ public long getRenderingDefId() {
return -1;
}

@Override
public byte[] getThumbnailWithoutDefault(Integer arg0, Integer arg1) {
return null;
}

}

//
Expand Down
29 changes: 29 additions & 0 deletions components/common/src/ome/api/ThumbnailStore.java
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,35 @@ public interface ThumbnailStore extends StatefulServiceInterface {
* @see #getThumbnailDirect(Integer, Integer)
*/
public byte[] getThumbnail(Integer sizeX, Integer sizeY);

/**
* Retrieves a thumbnail for a pixels set using a given set of
* rendering settings (RenderingDef). If the thumbnail exists
* in the on-disk cache it will be returned directly,
* otherwise it will be created as in
* {@link #getThumbnailDirect}, placed in the on-disk
* cache and returned. If the thumbnail is still to be generated, an empty array will
* be returned.
*
* @param sizeX the X-axis width of the thumbnail.
* <code>null</code> specifies the default size
* of 48.
* @param sizeY the Y-axis width of the thumbnail.
* <code>null</code> specifies the default size
* of 48.
* @throws ApiUsageException
* if:
* <ul>
* <li><code>sizeX</code> > pixels.sizeX</li>
* <li><code>sizeX</code> is negative</li>
* <li><code>sizeY</code> > pixels.sizeY</li>
* <li><code>sizeY</code> is negative</li>
* <li>{@link #setPixelsId} has not yet been called</li>
* </ul>
* @return a JPEG thumbnail byte buffer
* @see #getThumbnailDirect
*/
public byte[] getThumbnailWithoutDefault(Integer sizeX, Integer sizeY);

/**
* Retrieves a number of thumbnails for pixels sets using given sets of
Expand Down
Loading

0 comments on commit d1b488e

Please sign in to comment.