Skip to content

Commit

Permalink
Fix typo and clarify method comment
Browse files Browse the repository at this point in the history
  • Loading branch information
dominikl committed Nov 26, 2024
1 parent fe4388c commit 2becc06
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/main/java/omero/gateway/facility/RenderFacility.java
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ public RenderingEnginePrx getRenderingEngine(SecurityContext ctx, long imageId,
}

/**
* Checks if an image is an RGB(A) image.
* Tries to determine if an image is an RGB(A) image.
* (Note: This does not necessarily give the same results as Bioformats isRGB()!)
*
* @param ctx The security context.
* @param imageId The image ID
Expand All @@ -86,12 +87,12 @@ public RenderingEnginePrx getRenderingEngine(SecurityContext ctx, long imageId,
public boolean isRGB(SecurityContext ctx, long imageId) throws DSOutOfServiceException, DSAccessException {
try {
ImageData img = gateway.getFacility(LoadFacility.class).getImage(ctx, imageId);
int nChannles = img.getDefaultPixels().getSizeC();
if (nChannles < 3 || nChannles > 4)
int nChannels = img.getDefaultPixels().getSizeC();
if (nChannels < 3 || nChannels > 4)
return false;
boolean r = false, g = false, b = false;
RenderingEnginePrx re = getRenderingEngine(ctx, imageId, true);
for (int i=0; i<nChannles; i++) {
for (int i=0; i<nChannels; i++) {
int[] ch = re.getRGBA(i);
if (!r && ch[0] == 255 && ch[1] == 0 && ch[2] == 0)
r = true;
Expand Down

0 comments on commit 2becc06

Please sign in to comment.