Changeset 5621
- Timestamp:
- 09/19/08 18:18:25 (2 months ago)
- Location:
- trunk/SRC/org/openmicroscopy/shoola
- Files:
-
- 2 modified
-
agents/metadata/browser/Browser.java (modified) (1 diff)
-
env/rnd/RenderingControlProxy.java (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/SRC/org/openmicroscopy/shoola/agents/metadata/browser/Browser.java
r5620 r5621 32 32 33 33 //Application-internal dependencies 34 import org.openmicroscopy.shoola.env.data.util.StructuredDataResults;35 34 import org.openmicroscopy.shoola.util.ui.component.ObservableComponent; 36 35 -
trunk/SRC/org/openmicroscopy/shoola/env/rnd/RenderingControlProxy.java
r5619 r5621 51 51 import omeis.providers.re.RenderingEngine; 52 52 import omeis.providers.re.data.PlaneDef; 53 54 53 import org.openmicroscopy.shoola.env.cache.CacheService; 55 54 import org.openmicroscopy.shoola.env.config.Registry; … … 207 206 private void eraseCache() 208 207 { 209 /*210 if (xyCache == null) return;211 invalidateCache();212 xyCache = null;213 CachingService.eraseXYCache(pixs.getId());214 */215 208 invalidateCache(); 216 209 context.getCacheService().removeCache(cacheID); … … 271 264 } 272 265 266 /** 267 * Returns if <code>true</code> if one of the channels is of the specified 268 * color, <code>false</code> otherwise. 269 * 270 * @param red The red component in the range [0, 255] in the default sRGB 271 * space. 272 * @param green The green component in the range [0, 255] in the default 273 * sRGB space. 274 * @param blue The blue component in the range [0, 255] in the default sRGB 275 * space. 276 * @return See above. 277 */ 278 private boolean isRightColor(int red, int green, int blue) 279 { 280 for (int i = 0; i < getPixelsDimensionsC(); i++) { 281 if (isActive(i)) { 282 if (isRightChannelColor(i, red, green, blue)) 283 return true; 284 } 285 } 286 return false; 287 } 288 289 /** 290 * Returns if <code>true</code> if the channel is of the specified 291 * color, <code>false</code> otherwise. 292 * 293 * @param index The index of the channel. 294 * @param red The red component in the range [0, 255] in the default sRGB 295 * space. 296 * @param green The green component in the range [0, 255] in the default 297 * sRGB space. 298 * @param blue The blue component in the range [0, 255] in the default sRGB 299 * space. 300 * @return See above. 301 */ 302 private boolean isRightChannelColor(int index, int red, int green, int blue) 303 { 304 int[] rgba = rndDef.getChannel(index).getRGBA(); 305 return (rgba[0] == red && rgba[1] == green && rgba[2] == blue); 306 } 307 273 308 /** Initializes the cached rendering settings to speed up process. */ 274 309 private void initialize() … … 1064 1099 * @see RenderingControl#hasActiveChannelBlue() 1065 1100 */ 1066 public boolean hasActiveChannelBlue() 1067 { 1068 int[] rgba; 1069 for (int i = 0; i < getPixelsDimensionsC(); i++) { 1070 if (isActive(i)) { 1071 rgba = rndDef.getChannel(i).getRGBA(); 1072 if (rgba[0] == 0 && rgba[1] == 0 && rgba[2] == 255) 1073 return true; 1074 } 1075 } 1076 return false; 1077 } 1101 public boolean hasActiveChannelBlue() { return isRightColor(0, 0, 255); } 1078 1102 1079 1103 /** … … 1081 1105 * @see RenderingControl#hasActiveChannelGreen() 1082 1106 */ 1083 public boolean hasActiveChannelGreen() 1084 { 1085 int[] rgba; 1086 for (int i = 0; i < getPixelsDimensionsC(); i++) { 1087 if (isActive(i)) { 1088 rgba = rndDef.getChannel(i).getRGBA(); 1089 if (rgba[0] == 0 && rgba[1] == 255 && rgba[2] == 0) 1090 return true; 1091 } 1092 } 1093 return false; 1094 } 1095 1107 public boolean hasActiveChannelGreen() { return isRightColor(0, 255, 0); } 1108 1096 1109 /** 1097 1110 * Implemented as specified by {@link RenderingControl}. 1098 1111 * @see RenderingControl#hasActiveChannelRed() 1099 1112 */ 1100 public boolean hasActiveChannelRed() 1101 { 1102 int[] rgba; 1103 for (int i = 0; i < getPixelsDimensionsC(); i++) { 1104 if (isActive(i)) { 1105 rgba = rndDef.getChannel(i).getRGBA(); 1106 if (rgba[0] == 255 && rgba[1] == 0 && rgba[2] == 0) 1107 return true; 1108 } 1109 } 1110 return false; 1111 } 1113 public boolean hasActiveChannelRed() { return isRightColor(255, 0, 0); } 1112 1114 1113 1115 /** … … 1118 1120 { 1119 1121 if (index < 0 || index > getPixelsDimensionsC()) return false; 1120 int[] rgba = rndDef.getChannel(index).getRGBA(); 1121 return (rgba[0] == 255 && rgba[1] == 0 && rgba[2] == 0); 1122 return isRightChannelColor(index, 255, 0, 0); 1122 1123 } 1123 1124 … … 1129 1130 { 1130 1131 if (index < 0 || index > getPixelsDimensionsC()) return false; 1131 int[] rgba = rndDef.getChannel(index).getRGBA(); 1132 return (rgba[0] == 0 && rgba[1] == 0 && rgba[2] == 255); 1132 return isRightChannelColor(index, 0, 0, 255); 1133 1133 } 1134 1134 … … 1140 1140 { 1141 1141 if (index < 0 || index > getPixelsDimensionsC()) return false; 1142 int[] rgba = rndDef.getChannel(index).getRGBA(); 1143 return (rgba[0] == 0 && rgba[1] == 255 && rgba[2] == 0); 1142 return isRightChannelColor(index, 0, 255, 0); 1144 1143 } 1145 1144 … … 1238 1237 { 1239 1238 if (pixels == null) return false; 1239 DataServicesFactory.isSessionAlive(context); 1240 1240 if (getPixelsDimensionsC() != pixels.getSizeC().intValue()) 1241 1241 return false; … … 1345 1345 setActive(j.next(), true); 1346 1346 BufferedImage img; 1347 1348 1349 1347 1350 1348 if (isCompressed()) 1351 1349 img = renderProjectedCompressed(startZ, endZ, stepping, type);
