summaryrefslogtreecommitdiffstats
path: root/common/lz_common.h
diff options
context:
space:
mode:
authorYonit Halperin <yhalperi@redhat.com>2010-06-20 17:18:56 +0300
committerAlexander Larsson <alexl@redhat.com>2010-06-21 15:18:26 +0200
commit537280f183d3a35e8dee8a20238c71e7440cb28c (patch)
treefdec86a392b8cde474b8e1b5c85f03bb6caf441e /common/lz_common.h
parent25bb38f643af6f0015df369a22176275b6ebfae0 (diff)
downloadspice-537280f183d3a35e8dee8a20238c71e7440cb28c.tar.gz
spice-537280f183d3a35e8dee8a20238c71e7440cb28c.tar.xz
spice-537280f183d3a35e8dee8a20238c71e7440cb28c.zip
Lossy compression of RGBA images (on WAN connection)
The RGB channels are compressed using JPEG. The alpha channel is compressed using LZ.
Diffstat (limited to 'common/lz_common.h')
-rw-r--r--common/lz_common.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/common/lz_common.h b/common/lz_common.h
index d5019fd3..34276afb 100644
--- a/common/lz_common.h
+++ b/common/lz_common.h
@@ -39,17 +39,18 @@ typedef enum {
LZ_IMAGE_TYPE_RGB16,
LZ_IMAGE_TYPE_RGB24,
LZ_IMAGE_TYPE_RGB32,
- LZ_IMAGE_TYPE_RGBA
+ LZ_IMAGE_TYPE_RGBA,
+ LZ_IMAGE_TYPE_XXXA
} LzImageType;
#define LZ_IMAGE_TYPE_MASK 0x0f
#define LZ_IMAGE_TYPE_LOG 4 // number of bits required for coding the image type
/* access to the arrays is based on the image types */
-static const int IS_IMAGE_TYPE_PLT[] = {0, 1, 1, 1, 1, 1, 0, 0, 0, 0};
-static const int IS_IMAGE_TYPE_RGB[] = {0, 0, 0, 0, 0, 0, 1, 1, 1, 1};
+static const int IS_IMAGE_TYPE_PLT[] = {0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0};
+static const int IS_IMAGE_TYPE_RGB[] = {0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1};
static const int PLT_PIXELS_PER_BYTE[] = {0, 8, 8, 2, 2, 1};
-static const int RGB_BYTES_PER_PIXEL[] = {0, 1, 1, 1, 1, 1, 2, 3, 4, 4};
+static const int RGB_BYTES_PER_PIXEL[] = {0, 1, 1, 1, 1, 1, 2, 3, 4, 4, 4};
#define LZ_MAGIC (*(uint32_t *)"LZ ")