Lluvia
utils.h
Go to the documentation of this file.
1 
8 #ifndef LLUVIA_CORE_UTILS_H_
9 #define LLUVIA_CORE_UTILS_H_
10 
12 #include "lluvia/core/types.h"
14 
15 #include <array>
16 #include <cmath>
17 #include <cstdint>
18 #include <memory>
19 #include <string>
20 #include <type_traits>
21 #include <vector>
22 
23 namespace ll {
24 
25 class Image;
26 class ImageDescriptor;
27 class ImageView;
28 class ImageViewDescriptor;
29 class Memory;
30 class Session;
31 
42 std::string toBase64(const void* ptr, const size_t size);
43 
55 std::vector<uint8_t> fromBase64(const std::string& code);
56 
67 std::shared_ptr<ll::Image> createAndInitImage(
68  std::shared_ptr<ll::Session>& session,
69  std::shared_ptr<ll::Memory>& memory,
70  const ll::ImageDescriptor& desc,
71  const ll::ImageLayout initialLayout = ll::ImageLayout::General);
72 
84 std::shared_ptr<ll::ImageView> createAndInitImageView(
85  std::shared_ptr<ll::Session>& session,
86  std::shared_ptr<ll::Memory>& memory,
87  const ll::ImageDescriptor& imgDescriptor,
88  const ll::ImageViewDescriptor& viewDescriptor,
89  const ll::ImageLayout initialLayout = ll::ImageLayout::General);
90 
91 } // namespace ll
92 
93 #endif // LLUVIA_CORE_UTILS_H_
ImageLayout enum.
Stores all relevant information for creating ll::Image objects.
Definition: ImageDescriptor.h:189
Descriptor for ll::ImageView objects.
Definition: ImageViewDescriptor.h:41
Definition: Buffer.h:28
ImageLayout
Definition: ImageLayout.h:16
std::shared_ptr< ll::ImageView > createAndInitImageView(std::shared_ptr< ll::Session > &session, std::shared_ptr< ll::Memory > &memory, const ll::ImageDescriptor &imgDescriptor, const ll::ImageViewDescriptor &viewDescriptor, const ll::ImageLayout initialLayout=ll::ImageLayout::General)
Creates and initialize a ll::ImageView object.
std::vector< uint8_t > fromBase64(const std::string &code)
Converts a std::string with base-64 characters to binary.
std::string toBase64(const void *ptr, const size_t size)
Converts a binary array to base-64 string.
std::shared_ptr< ll::Image > createAndInitImage(std::shared_ptr< ll::Session > &session, std::shared_ptr< ll::Memory > &memory, const ll::ImageDescriptor &desc, const ll::ImageLayout initialLayout=ll::ImageLayout::General)
Creates and initialize a ll::Image object.
Common types.