Nonlinear optics in titanium dioxide: from bulk to integrated optical devices