Adding photo-editing functionalities
There are multiple operations that we can enable for the user to edit and modify their images: we can allow them to crop, resize, and rotate the image, as well as adjust the brightness and contrast, apply filters, or add text overlays.
As part of this chapter, we are going to implement two operations: a black-and-white filter and a text overlay.
Adding filters
Creating filters over an existing image is as easy as modifying the values of the bitmap that contains the image. There are several well-known filters, such as sepia, vintage, and black and white. As an example, we are going to implement the black and white filter, like so:
@Composable fun BlackAndWhiteFilter( imageUri: Uri, modifier: Modifier = Modifier ) { var isBlackAndWhiteEnabled by remember { mutableStateOf(false) } val localContext = LocalContext.current...