Я создаю приложение для фильтра фотографий (например, Instagram, Camera + и многие другие..), главный экран - это UIImageView
, представляющий изображение для пользователя, и нижняя панель с некоторыми фильтрами и другими параметрами.
Один из вариантов - размытие, где пользователь может использовать свои пальцы, чтобы ущипнуть или переместить круг, который представляет часть размытия (радиус и положение) - все пиксели вне этого круга будут размыты,
Когда пользователь прикасается к экрану, я хочу добавить полупрозрачный слой над моим изображением, представляющий размытую часть, с полностью прозрачным кружком, представляющим часть без размытия.
Итак, мой вопрос: как добавить этот слой? Я полагаю, мне нужно использовать какой-то вид над моим представлением изображения и использовать какую-то маску, чтобы получить форму круга? Я бы очень признателен за хороший совет.
Еще одна вещь
Мне нужен круг, который не будет стричь прямо, но у вас будет какой-то градиент. что-то вроде Instagram:
И что очень важно, чтобы получить этот эффект с хорошей производительностью, мне удастся получить этот эффект с помощью drawRect:
, но производительность была очень плохой для старых устройств (iphone 4, iPod)