MCPcopy Create free account
hub / github.com/AstroImageJ/astroimagej / getBitDepth

Method getBitDepth

ij/src/main/java/ij/ImagePlus.java:1485–1507  ·  view source on GitHub ↗

Returns the bit depth, 8, 16, 24 (RGB) or 32, or 0 if the bit depth is unknown. RGB images actually use 32 bits per pixel.

()

Source from the content-addressed store, hash-verified

1483 /** Returns the bit depth, 8, 16, 24 (RGB) or 32, or 0 if the bit depth
1484 is unknown. RGB images actually use 32 bits per pixel. */
1485 public int getBitDepth() {
1486 ImageProcessor ip2 = ip;
1487 if (ip2==null) {
1488 int bitDepth = 0;
1489 switch (imageType) {
1490 case GRAY8: bitDepth=typeSet?8:0; break;
1491 case COLOR_256: bitDepth=8; break;
1492 case GRAY16: bitDepth=16; break;
1493 case GRAY32: bitDepth=32; break;
1494 case COLOR_RGB: bitDepth=24; break;
1495 }
1496 return bitDepth;
1497 }
1498 if (ip2 instanceof ByteProcessor)
1499 return 8;
1500 else if (ip2 instanceof ShortProcessor)
1501 return 16;
1502 else if (ip2 instanceof ColorProcessor)
1503 return 24;
1504 else if (ip2 instanceof FloatProcessor)
1505 return 32;
1506 return 0;
1507 }
1508
1509 /** Returns the number of bytes per pixel. */
1510 public int getBytesPerPixel() {

Callers 15

showMethod · 0.95
setStackMethod · 0.95
getStatisticsMethod · 0.95
revertMethod · 0.95
flattenStackMethod · 0.95
plotHistogramMethod · 0.95
toStringMethod · 0.95
createImageMethod · 0.95
getProcessorMethod · 0.95
setColorMethod · 0.95
changeValuesMethod · 0.95
getHistogramMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected