Lugdunum  0.1.0
ImageView.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include <cstdint>
4 #include <memory>
5 
7 
8 namespace lug {
9 namespace Graphics {
10 namespace Vulkan {
11 namespace API {
12 
13 class Device;
14 class Image;
15 
16 namespace Builder {
17 
18 class ImageView {
19 public:
20  ImageView(const API::Device& device, const API::Image& image);
21 
22  ImageView(const ImageView&) = delete;
23  ImageView(ImageView&&) = delete;
24 
25  ImageView& operator=(const ImageView&) = delete;
26  ImageView& operator=(ImageView&&) = delete;
27 
28  ~ImageView() = default;
29 
30  // Setters
31  void setFormat(VkFormat format);
32  void setViewType(VkImageViewType viewType);
33  void setAspectFlags(VkImageAspectFlags aspectFlags);
34  void setLayerCount(uint32_t layerCount);
35  void setLevelCount(uint32_t levelCount);
36 
37  // Build methods
38  bool build(API::ImageView& instance, VkResult* returnResult = nullptr);
39  std::unique_ptr<API::ImageView> build(VkResult* returnResult = nullptr);
40 
41 private:
43 
45  VkFormat _format{VK_FORMAT_UNDEFINED};
46  VkImageViewType _viewType{VK_IMAGE_VIEW_TYPE_2D};
47  VkImageAspectFlags _aspectFlags{VK_IMAGE_ASPECT_COLOR_BIT};
48  uint32_t _layerCount{1};
49  uint32_t _levelCount{1};
50 };
51 
53 
54 } // Builder
55 } // API
56 } // Vulkan
57 } // Graphics
58 } // lug
void setAspectFlags(VkImageAspectFlags aspectFlags)
Definition: ImageView.inl:9
bool build(API::ImageView &instance, VkResult *returnResult=nullptr)
Definition: ImageView.cpp:14
void setViewType(VkImageViewType viewType)
Definition: ImageView.inl:5
ImageView(const API::Device &device, const API::Image &image)
Definition: ImageView.cpp:12
ImageView & operator=(const ImageView &)=delete