diff options
author | Alon Levy <alevy@redhat.com> | 2012-07-16 11:36:44 +0300 |
---|---|---|
committer | Alon Levy <alevy@redhat.com> | 2012-07-22 11:58:36 +0300 |
commit | d4780374041e6bb6322e23725bf7937aaa2238b7 (patch) | |
tree | 9537dc8f4deb5c084653deed7b749daeea9e3367 /server/red_common.h | |
parent | acdb67b4d2986ed428d12ac002ef20bef739efa6 (diff) | |
download | spice-d4780374041e6bb6322e23725bf7937aaa2238b7.tar.gz spice-d4780374041e6bb6322e23725bf7937aaa2238b7.tar.xz spice-d4780374041e6bb6322e23725bf7937aaa2238b7.zip |
server: factor out bitmap_fmt_is_rgb
Diffstat (limited to 'server/red_common.h')
-rw-r--r-- | server/red_common.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/server/red_common.h b/server/red_common.h index cb7bf716..b52a7d13 100644 --- a/server/red_common.h +++ b/server/red_common.h @@ -35,4 +35,16 @@ enum { STREAM_VIDEO_FILTER }; +static inline int bitmap_fmt_is_rgb(uint8_t fmt) +{ + static const int BITMAP_FMT_IS_RGB[SPICE_BITMAP_FMT_ENUM_END] = + {0, 0, 0, 0, 0, 0, 1, 1, 1, 1}; + + if (fmt >= SPICE_BITMAP_FMT_ENUM_END) { + spice_warning("fmt >= SPICE_BITMAP_FMT_ENUM_END"); + return 0; + } + return BITMAP_FMT_IS_RGB[fmt]; +} + #endif |