mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-12-18 08:56:45 -05:00
vulkan: Add pixel-formats to query format properties
We need a database of pixel format properties to remove hardcoded magic numbers. This commit creates a simple function to query the bytes per pixel for common RGBA formats. This should be promoted to or superseeded by a common spa namespaced version.
This commit is contained in:
parent
49b67742c6
commit
c3327742cc
6 changed files with 57 additions and 3 deletions
12
spa/plugins/vulkan/pixel-formats.h
Normal file
12
spa/plugins/vulkan/pixel-formats.h
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
/* Spa */
|
||||
/* SPDX-FileCopyrightText: Copyright © 2023 columbarius */
|
||||
/* SPDX-License-Identifier: MIT */
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
struct pixel_format_info {
|
||||
uint32_t bpp; // bytes per pixel
|
||||
};
|
||||
|
||||
bool get_pixel_format_info(uint32_t format, struct pixel_format_info *info);
|
||||
Loading…
Add table
Add a link
Reference in a new issue