![]() |
Faker C++
|
Enumerations | |
| enum class | ImageCategory { Animals , Business , Cats , City , Food , Nightlife , Fashion , People , Nature , Sports , Technics , Transport } |
Functions | |
| 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 | 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 | 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 | githubAvatarUrl () |
| Generates a random avatar from GitHub. | |
| FAKER_CXX_EXPORT std::string | dimensions () |
| Generates a random image dimensions. | |
| FAKER_CXX_EXPORT std::string_view | type () |
| Generates a random type of image. | |
| 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. | |
|
strong |
| FAKER_CXX_EXPORT std::string faker::image::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.
| width | The width of the image. Defaults to a random number between 1 and 3999. |
| height | The height of the image. Defaults to a random number between 1 and 3999. |
| color | The color of the image. Must be a color supported by svg. |
| type | The type of the image to return. Consisting of the file extension and the used encoding. |
| FAKER_CXX_EXPORT std::string faker::image::dimensions | ( | ) |
Generates a random image dimensions.
| FAKER_CXX_EXPORT std::string faker::image::githubAvatarUrl | ( | ) |
Generates a random avatar from GitHub.
| FAKER_CXX_EXPORT std::string faker::image::imageUrl | ( | unsigned | width = 640, |
| unsigned | height = 480 ) |
Generates a random image url with `https://loremflickr.com/` or "https://picsum.photos".
| width | The width of the image. Defaults to `640`. |
| height | The height of the image. Defaults to `480`. |
| FAKER_CXX_EXPORT std::string_view faker::image::type | ( | ) |
| FAKER_CXX_EXPORT std::string faker::image::urlLoremFlickr | ( | unsigned | width = 640, |
| unsigned | height = 480, | ||
| std::optional< ImageCategory > | category = std::nullopt ) |
Generates a real image url with `https://loremflickr.com/`.
| width | The width of the image. Defaults to `640`. |
| height | The height of the image. Defaults to `480`. |
| category | The optional category of generated real image. |
| FAKER_CXX_EXPORT std::string faker::image::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" .
| width | The width of the image. Defaults to `640`. |
| height | The height of the image. Defaults to `480`. |
| greyscale | The optional greyscale filter. True for apply or false for disabled |
| blur | The optional blur effect between 1 and 10 |