public static HDRExposure scaleTo( HDRExposure exp, int width, int height ) {
		if( !aspectRatioPreserved(exp.width, exp.height, width, height) ) {
			throw new UnsupportedOperationException("Cannot change aspect ratio");
		}
		
		double scale = width / exp.width;
		if( scale == 0 ) {
			return new HDRExposure(0, 0);
		} else if( scale < 1 ) {
			double ratio = exp.width / width;
			if( (int)ratio != ratio ) {
				throw new UnsupportedOperationException("Cannot scale down by non-integer ratio "+scale);
			}
			return scaleDown( exp, (int)ratio );
		} else {
			int iScale = (int)scale;
			if( iScale != scale ) {
				throw new UnsupportedOperationException("Cannot scale by non-integer "+scale);
			}
			while( iScale > 0 && (iScale & 1) == 0) {
				exp = scaleUp(exp);
				iScale >>= 1;
			}
			if( iScale != 1 ) {
				throw new UnsupportedOperationException("Cannot scale by non-power-of-2 "+scale);
			}
			return exp;
		}
	}