Changeset 5683
- Timestamp:
- 10/13/08 16:29:16 (5 weeks ago)
- Location:
- trunk/SRC/org/openmicroscopy/shoola/env/rnd
- Files:
-
- 2 modified
-
RenderingControl.java (modified) (1 diff)
-
RenderingControlProxy.java (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/SRC/org/openmicroscopy/shoola/env/rnd/RenderingControl.java
r5657 r5683 33 33 34 34 //Application-internal dependencies 35 import omero.model.Pixels;36 35 import omero.romio.PlaneDef; 37 36 import org.openmicroscopy.shoola.env.data.DSOutOfServiceException; 38 37 import org.openmicroscopy.shoola.env.data.model.ChannelMetadata; 39 40 38 import pojos.PixelsData; 41 39 -
trunk/SRC/org/openmicroscopy/shoola/env/rnd/RenderingControlProxy.java
r5682 r5683 120 120 private int cacheSize; 121 121 122 /** The size of the image. */ 123 private int imageSize; 124 122 125 /** 123 126 * Helper method to handle exceptions thrown by the connection library. … … 198 201 private void invalidateCache() 199 202 { 200 if (cacheID >= 0) {203 if (cacheID >= 0) 201 204 context.getCacheService().clearCache(cacheID); 202 }203 205 } 204 206 … … 235 237 } 236 238 */ 237 if (pDef.slice == omero.romio.XY.value) 239 if (pDef.slice == omero.romio.XY.value) { 238 240 cacheID = context.getCacheService().createCache( 239 CacheService.IN_MEMORY); 241 CacheService.IN_MEMORY, cacheSize/imageSize); 242 } 243 240 244 } 241 245 … … 396 400 397 401 byte[] values = servant.renderCompressed(pDef); 402 imageSize = values.length; 398 403 initializeCache(pDef); 399 404 cache(pDef, values); … … 441 446 break; 442 447 } 448 imageSize = 3*buf.length; 443 449 initializeCache(pDef); 444 450 img = Factory.createImage(buf, 32, sizeX1, sizeX2); … … 551 557 models = servant.getAvailableModels(); 552 558 cacheID = -1; 553 559 imageSize = 1; 554 560 this.compression = compression; 555 561 if (rndDef == null) { … … 689 695 * Resets the size of the cache. 690 696 * 691 * @param size The size of the cache.697 * @param size The size, in bytes, of the cache. 692 698 */ 693 699 void setCacheSize(int size) 694 700 { 695 context.getCacheService().setCacheSize(cacheID, size); 701 if (imageSize == 0) imageSize = 1; 702 context.getCacheService().setCacheSize(cacheID, size/imageSize); 696 703 } 697 704 … … 1460 1467 { 1461 1468 List<Integer> active = new ArrayList<Integer>(); 1462 for (int i = 0; i < getPixelsDimensionsC(); i++) {1469 for (int i = 0; i < getPixelsDimensionsC(); i++) 1463 1470 if (isActive(i)) active.add(new Integer(i)); 1464 }1465 1471 return active; 1466 1472 }
