// Declared in the module. constexpr int kThumbnailSizes[] = {480, 576, 720}; // Returns thumbnails of various sizes for the given image. std::vector<Image> GetThumbnails(const Image& image) { std::vector<Image> thumbnails; for (const int size : kThumbnailSizes) { thumbnails.push_back(ResizeImage(image, size)); } return thumbnails; }
std::vector<Image> GetThumbnails(const Image& image, absl::Span<const int> sizes) { std::vector<Image> thumbnails; for (const int size : sizes) { thumbnails.push_back(ResizeImage(image, size)); } return thumbnails; }
// Declared in the public header. inline constexpr int kDefaultThumbnailSizes[] = {480, 576, 720}; // Default argument allows the function to be used without specifying a size. std::vector<Image> GetThumbnails(const Image& image, absl::Span<const int> sizes = kDefaultThumbnailSizes);