xref: /aosp_15_r20/external/deqp/external/vulkancts/framework/vulkan/vkYCbCrImageWithMemory.hpp (revision 35238bce31c2a825756842865a792f8cf7f89930)
1 #ifndef _VKYCBCRIMAGEWITHMEMORY_HPP
2 #define _VKYCBCRIMAGEWITHMEMORY_HPP
3 /*-------------------------------------------------------------------------
4  * Vulkan CTS Framework
5  * --------------------
6  *
7  * Copyright (c) 2017 The Khronos Group Inc.
8  * Copyright (c) 2017 Samsung Electronics Co., Ltd.
9  *
10  * Licensed under the Apache License, Version 2.0 (the "License");
11  * you may not use this file except in compliance with the License.
12  * You may obtain a copy of the License at
13  *
14  *      http://www.apache.org/licenses/LICENSE-2.0
15  *
16  * Unless required by applicable law or agreed to in writing, software
17  * distributed under the License is distributed on an "AS IS" BASIS,
18  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19  * See the License for the specific language governing permissions and
20  * limitations under the License.
21  *
22  *//*!
23  * \file
24  * \brief YCbCr Image backed with memory
25  *//*--------------------------------------------------------------------*/
26 
27 #include "vkDefs.hpp"
28 #include "vkMemUtil.hpp"
29 #include "vkRef.hpp"
30 #include "vkRefUtil.hpp"
31 #include "deSharedPtr.hpp"
32 
33 #include <vector>
34 
35 namespace vk
36 {
37 
38 typedef de::SharedPtr<Allocation> AllocationSp;
39 
40 class YCbCrImageWithMemory
41 {
42 public:
43     YCbCrImageWithMemory(const vk::DeviceInterface &vk, const vk::VkDevice device, vk::Allocator &allocator,
44                          const vk::VkImageCreateInfo &imageCreateInfo, const vk::MemoryRequirement requirement);
get(void) const45     const vk::VkImage &get(void) const
46     {
47         return *m_image;
48     }
operator *(void) const49     const vk::VkImage &operator*(void) const
50     {
51         return get();
52     }
getAllocations(void) const53     const std::vector<AllocationSp> &getAllocations(void) const
54     {
55         return m_allocations;
56     }
57 
58 private:
59     const vk::Unique<vk::VkImage> m_image;
60     std::vector<AllocationSp> m_allocations;
61 
62     // "deleted"
63     YCbCrImageWithMemory(const YCbCrImageWithMemory &);
64     YCbCrImageWithMemory &operator=(const YCbCrImageWithMemory &);
65 };
66 
67 } // namespace vk
68 
69 #endif // _VKYCBCRIMAGEWITHMEMORY_HPP
70