MythTV master
mythcombobuffervulkan.cpp
Go to the documentation of this file.
1// MythTV
3
5 : m_width(Width),
6 m_height(Height)
7{
8}
9
10const void* MythComboBufferVulkan::Data(void) const
11{
12 return &m_data.back();
13}
14
16{
17 m_data.pop_back();
18}
19
20void MythComboBufferVulkan::PushData(const QMatrix4x4 &Transform, const QRect Source,
21 const QRect Destination, int Alpha)
22{
23 m_data.push_back({});
24 VulkanComboBuffer* data = &m_data.back();
25 data->color[0] = data->color[1] = data->color[2] = 1.0F;
26
27 float width = std::min(static_cast<float>(Source.width()), m_width);
28 float height = std::min(static_cast<float>(Source.height()), m_height);
29
30 // Transform
31 memcpy(&data->transform[0], Transform.constData(), sizeof(float) * 16);
32
33 // Position/destination
34 data->position[0] = Destination.x();
35 data->position[1] = Destination.y();
36 data->position[2] = data->position[0] + width;
37 data->position[3] = data->position[1] + height;
38
39 // Texture coordinates
40 data->texcoords[0] = Source.left() / m_width;
41 data->texcoords[1] = Source.top() / m_height;
42 data->texcoords[2] = (Source.left() + width) / m_width;
43 data->texcoords[3] = (Source.top() + height) / m_height;
44
45 // Alpha/color
46 data->color[3] = Alpha / 255.0F;
47}
const void * Data(void) const
void PushData(const QMatrix4x4 &Transform, QRect Source, QRect Destination, int Alpha)
std::vector< VulkanComboBuffer > m_data
MythComboBufferVulkan(float Width, float Height)
static void Transform(SIMI *Simi, F_PT xo, F_PT yo, F_PT *x, F_PT *y)
Definition: ifs.cpp:274