Project: SWT
Bug 103603 ImageData getPixel operation
Reported: 2005-07-12 22:54:57 | Status: resolved fixed

The method "int getPixel(int x, int y)" of ImageData has several "if"s in a row, depending on the depth. Even if smart (the ones doing image processing) users should not be using "getPixel" repeateadly, it's a shame that is does not use a switch statement, which is bound to be mush faster. Since it is not even an "if/elsif", and the method starts with one, images of depth 8 or more, which are very common for digital photography end up iterating over all the depth before arriving at the desired depth.

Files changed in fix:
bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/graphics/ImageData.java