[Spice-devel] [PATCH] add image type for RGBA bitmaps that were compressed by a combination of JPEG (RGB) and LZ (alpha channel).

Yonit Halperin yhalperi at redhat.com
Sun Jun 20 07:18:33 PDT 2010


---
 spice/draw.h  |   12 ++++++++++++
 spice/enums.h |    5 +++++
 2 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/spice/draw.h b/spice/draw.h
index 874681d..e6fab5c 100644
--- a/spice/draw.h
+++ b/spice/draw.h
@@ -193,6 +193,18 @@ typedef struct SPICE_ATTR_PACKED SpiceZlibGlzRGBImage {
     SpiceZlibGlzRGBData zlib_glz;
 } SpiceZlibGlzRGBImage;
 
+typedef struct SPICE_ATTR_PACKED SpiceJPEGAlphaData {
+    uint8_t flags;
+    uint32_t jpeg_size;
+    uint32_t data_size;
+    uint8_t data[0];
+} SpiceJPEGAlphaData;
+
+typedef struct SPICE_ATTR_PACKED SpiceJPEGAlphaImage {
+    SpiceImageDescriptor descriptor;
+    SpiceJPEGAlphaData jpeg_alpha;
+} SpiceJPEGAlphaImage;
+
 typedef struct SPICE_ATTR_PACKED SpiceOpaque {
     SPICE_ADDRESS src_bitmap;
     SpiceRect src_area;
diff --git a/spice/enums.h b/spice/enums.h
index 4dfda1f..cae1675 100644
--- a/spice/enums.h
+++ b/spice/enums.h
@@ -130,6 +130,7 @@ enum SpiceImageType {
     SPICE_IMAGE_TYPE_JPEG,
     SPICE_IMAGE_TYPE_FROM_CACHE_LOSSLESS,
     SPICE_IMAGE_TYPE_ZLIB_GLZ_RGB,
+    SPICE_IMAGE_TYPE_JPEG_ALPHA,
 
     SPICE_IMAGE_TYPE_ENUM_END
 };
@@ -165,6 +166,10 @@ enum SpiceBitmapFlags {
     SPICE_BITMAP_FLAGS_MASK = 0x7
 };
 
+enum SpiceJpegAlphaFlags {
+    SPICE_JPEG_ALPHA_TOP_DOWN = (1 << 0),
+};
+
 enum SpiceImageScaleMode {
     SPICE_IMAGE_SCALE_MODE_INTERPOLATE,
     SPICE_IMAGE_SCALE_MODE_NEAREST,
-- 
1.6.6.1



More information about the Spice-devel mailing list