#' Mean RGB indices
#'
#' Computes the mean values of RGB-based indices from a RasterBrick or RasterStack object.
#'
#' @param x A RasterBrick or RasterStack object containing RGB indices.
#'
#' @return
#' A tibble (data frame) with a single row where each column represents
#' the mean value of an RGB index computed across all pixels.
#'
#' @details
#' The function calculates the mean of each layer in the input raster object
#' using \code{raster::cellStats}. The output provides a summary of the indices
#' for the entire image.
#'
#' @examples
#' r <- raster::raster(matrix(runif(50*50), 50, 50))
#' g <- raster::raster(matrix(runif(50*50), 50, 50))
#' b <- raster::raster(matrix(runif(50*50), 50, 50))
#' img <- raster::stack(r, g, b)
#' x <- rgb_basic(img)
#'
#' rgb_indices_to_mean(x)
#'
#' @export
rgb_indices_to_mean <- function(x){
  
  vals <- raster::cellStats(x, stat = "mean", na.rm = TRUE)
  
  tibble::as_tibble(as.data.frame(t(vals)))
  
}