* @throws jjil.core.Error if the input is not a Gray8Image or is not a power of two in width and
* height.
*/
public void push(Image im) throws jjil.core.Error {
if (!(im instanceof Gray8Image)) {
throw new Error(
Error.PACKAGE.ALGORITHM,
ErrorCodes.IMAGE_NOT_GRAY8IMAGE,
im.toString(),
null,
null);
}
int nWidth = im.getWidth();
int nHeight = im.getHeight();
if ((nWidth & (nWidth-1)) != 0) {
throw new Error(
Error.PACKAGE.ALGORITHM,
ErrorCodes.FFT_SIZE_NOT_POWER_OF_2,
im.toString(),
null,
null);
}
if ((nHeight & (nHeight-1)) != 0) {
throw new Error(
Error.PACKAGE.ALGORITHM,
ErrorCodes.FFT_SIZE_NOT_POWER_OF_2,
im.toString(),
null,
null);