• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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,
44 																 const vk::VkDevice				device,
45 																 vk::Allocator&					allocator,
46 																 const vk::VkImageCreateInfo&	imageCreateInfo,
47 																 const vk::MemoryRequirement	requirement);
get(void) const48 	const vk::VkImage&					get						(void) const { return *m_image;			}
operator *(void) const49 	const vk::VkImage&					operator*				(void) const { return get();			}
getAllocations(void) const50 	const std::vector<AllocationSp>&	getAllocations			(void) const { return m_allocations;	}
51 
52 private:
53 	const vk::Unique<vk::VkImage>		m_image;
54 	std::vector<AllocationSp>			m_allocations;
55 
56 	// "deleted"
57 										YCbCrImageWithMemory	(const YCbCrImageWithMemory&);
58 	YCbCrImageWithMemory&				operator=				(const YCbCrImageWithMemory&);
59 };
60 
61 } // vk
62 
63 #endif // _VKYCBCRIMAGEWITHMEMORY_HPP
64