[codec,color] Add from string method for PIXEL_FORMAT

* Add FreeRDPGetColorFromatFromName to get a PIXEL_FORMAT from a given
  string.
* Add a unit test to ensure FreeRDPGetColorFromatFromName and
  FreeRDPGetColorFormatName work as expected
This commit is contained in:
Armin Novak
2025-09-30 12:46:12 +02:00
parent e3ae9c472b
commit 4aceae4666
4 changed files with 145 additions and 68 deletions

View File

@@ -134,6 +134,15 @@ typedef struct gdi_palette gdiPalette;
#endif
FREERDP_API const char* FreeRDPGetColorFormatName(UINT32 format);
/** @brief convert a string to a \ref PIXEL_FORMAT
*
* @param name The string representing the format
*
* @return the \ref PIXEL_FORMAT value or \b 0 for failure
* @since version 3.18.0
*/
FREERDP_API uint32_t FreeRDPGetColorFromatFromName(const char* name);
/***
*
* Converts a pixel color in internal representation to its red, green, blue