Faker C++
Toggle main menu visibility
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
9
namespace
faker::image
10
{
11
enum class
ImageCategory
12
{
13
Animals
,
14
Business
,
15
Cats
,
16
City
,
17
Food
,
18
Nightlife
,
19
Fashion
,
20
People
,
21
Nature
,
22
Sports
,
23
Technics
,
24
Transport
25
};
26
39
FAKER_CXX_EXPORT std::string
imageUrl
(
unsigned
width = 640,
unsigned
height = 480);
40
56
FAKER_CXX_EXPORT std::string
urlLoremFlickr
(
unsigned
width = 640,
unsigned
height = 480,
57
std::optional<ImageCategory> category = std::nullopt);
58
76
FAKER_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
89
FAKER_CXX_EXPORT std::string
githubAvatarUrl
();
90
100
FAKER_CXX_EXPORT std::string
dimensions
();
101
111
FAKER_CXX_EXPORT std::string_view
type
();
112
127
FAKER_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
}
faker::color
Definition
color.h:11
faker::image
Definition
image.h:10
faker::image::dimensions
FAKER_CXX_EXPORT std::string dimensions()
Generates a random image dimensions.
faker::image::urlLoremFlickr
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::image::githubAvatarUrl
FAKER_CXX_EXPORT std::string githubAvatarUrl()
Generates a random avatar from GitHub.
faker::image::imageUrl
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::image::type
FAKER_CXX_EXPORT std::string_view type()
Generates a random type of image.
faker::image::urlPicsumPhotos
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::image::dataUri
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.
faker::image::ImageCategory
ImageCategory
Definition
image.h:12
faker::image::ImageCategory::Food
@ Food
Definition
image.h:17
faker::image::ImageCategory::Technics
@ Technics
Definition
image.h:23
faker::image::ImageCategory::Animals
@ Animals
Definition
image.h:13
faker::image::ImageCategory::City
@ City
Definition
image.h:16
faker::image::ImageCategory::Cats
@ Cats
Definition
image.h:15
faker::image::ImageCategory::People
@ People
Definition
image.h:20
faker::image::ImageCategory::Sports
@ Sports
Definition
image.h:22
faker::image::ImageCategory::Fashion
@ Fashion
Definition
image.h:19
faker::image::ImageCategory::Nature
@ Nature
Definition
image.h:21
faker::image::ImageCategory::Business
@ Business
Definition
image.h:14
faker::image::ImageCategory::Nightlife
@ Nightlife
Definition
image.h:18
faker::image::ImageCategory::Transport
@ Transport
Definition
image.h:24
include
faker-cxx
image.h
Generated by
1.17.0