Faker C++
Loading...
Searching...
No Matches
image.h
Go to the documentation of this file.
1#pragma once
2
3#include <optional>
4#include <string>
5#include <string_view>
6
7#include "faker-cxx/export.h"
8
9namespace faker::image
10{
26
39FAKER_CXX_EXPORT std::string imageUrl(unsigned width = 640, unsigned height = 480);
40
56FAKER_CXX_EXPORT std::string urlLoremFlickr(unsigned width = 640, unsigned height = 480,
57 std::optional<ImageCategory> category = std::nullopt);
58
76FAKER_CXX_EXPORT std::string urlPicsumPhotos(unsigned width = 640, unsigned height = 480,
77 std::optional<bool> greyscale = std::nullopt,
78 std::optional<int> blur = std::nullopt);
79
89FAKER_CXX_EXPORT std::string githubAvatarUrl();
90
100FAKER_CXX_EXPORT std::string dimensions();
101
111FAKER_CXX_EXPORT std::string_view type();
112
127FAKER_CXX_EXPORT std::string dataUri(unsigned width = 200, unsigned height = 200, const std::string& color = "000000",
128 const std::string& type = "svg-uri");
129
130}
Definition color.h:11
Definition image.h:10
FAKER_CXX_EXPORT std::string dimensions()
Generates a random image dimensions.
FAKER_CXX_EXPORT std::string urlLoremFlickr(unsigned width=640, unsigned height=480, std::optional< ImageCategory > category=std::nullopt)
Generates a real image url with `https://loremflickr.com/`.
FAKER_CXX_EXPORT std::string githubAvatarUrl()
Generates a random avatar from GitHub.
FAKER_CXX_EXPORT std::string imageUrl(unsigned width=640, unsigned height=480)
Generates a random image url with `https://loremflickr.com/` or "https://picsum.photos".
FAKER_CXX_EXPORT std::string_view type()
Generates a random type of image.
FAKER_CXX_EXPORT std::string urlPicsumPhotos(unsigned width=640, unsigned height=480, std::optional< bool > greyscale=std::nullopt, std::optional< int > blur=std::nullopt)
Generates a real image url with "https://picsum.photos" .
FAKER_CXX_EXPORT std::string dataUri(unsigned width=200, unsigned height=200, const std::string &color="000000", const std::string &type="svg-uri")
Generates a random data uri containing an URL-encoded SVG image or a Base64-encoded SVG image.
ImageCategory
Definition image.h:12
@ Food
Definition image.h:17
@ Technics
Definition image.h:23
@ Animals
Definition image.h:13
@ City
Definition image.h:16
@ Cats
Definition image.h:15
@ People
Definition image.h:20
@ Sports
Definition image.h:22
@ Fashion
Definition image.h:19
@ Nature
Definition image.h:21
@ Business
Definition image.h:14
@ Nightlife
Definition image.h:18
@ Transport
Definition image.h:24