aboutsummaryrefslogtreecommitdiff
path: root/nxcomp/Unpack.cpp
diff options
context:
space:
mode:
authorReinhard Tartler <siretart@tauware.de>2011-11-13 09:27:53 +0100
committerReinhard Tartler <siretart@tauware.de>2011-11-13 09:27:53 +0100
commit477961678194817aaf1aaf3602f1c91d288a539d (patch)
treed66356753053a34f93b4f6059631e0f6c4eb298c /nxcomp/Unpack.cpp
parent799bf672a3588f205bd18ef39d9908069e0cd6d5 (diff)
downloadnx-libs-477961678194817aaf1aaf3602f1c91d288a539d.tar.gz
nx-libs-477961678194817aaf1aaf3602f1c91d288a539d.tar.bz2
nx-libs-477961678194817aaf1aaf3602f1c91d288a539d.zip
Imported nxcomp-3.4.0-6.tar.gznxcomp/3.4.0-6
Summary: Imported nxcomp-3.4.0-6.tar.gz Keywords: Imported nxcomp-3.4.0-6.tar.gz into Git repository
Diffstat (limited to 'nxcomp/Unpack.cpp')
-rw-r--r--nxcomp/Unpack.cpp76
1 files changed, 73 insertions, 3 deletions
diff --git a/nxcomp/Unpack.cpp b/nxcomp/Unpack.cpp
index 03c898f87..5fc494465 100644
--- a/nxcomp/Unpack.cpp
+++ b/nxcomp/Unpack.cpp
@@ -1,6 +1,6 @@
/**************************************************************************/
/* */
-/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */
+/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* */
/* NXCOMP, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
@@ -32,6 +32,72 @@ z_stream unpackStream;
static int unpackInitialized;
+int Unpack8To8(const T_colormask *colormask, const unsigned char *data,
+ unsigned char *out, unsigned char *end);
+
+int Unpack8To8(T_colormap *colormap, const unsigned char *data,
+ unsigned char *out, unsigned char *end);
+
+int Unpack8To16(const T_colormask *colormask, const unsigned char *data,
+ unsigned char *out, unsigned char *end);
+
+int Unpack8To16(T_colormap *colormap, const unsigned char *data,
+ unsigned char *out, unsigned char *end);
+
+int Unpack8To24(const T_colormask *colormask, const unsigned char *data,
+ unsigned char *out, unsigned char *end);
+
+int Unpack8To24(T_colormap *colormap, const unsigned char *data,
+ unsigned char *out, unsigned char *end);
+
+int Unpack8To32(const T_colormask *colormask, const unsigned char *data,
+ unsigned char *out, unsigned char *end);
+
+int Unpack8To32(T_colormap *colormap, const unsigned char *data,
+ unsigned char *out, unsigned char *end);
+
+int Unpack15To16(const unsigned char *data, unsigned char *out,
+ unsigned char *end);
+
+int Unpack15To24(const unsigned char *data, unsigned char *out,
+ unsigned char *end);
+
+int Unpack15To32(const unsigned char *data, unsigned char *out,
+ unsigned char *end);
+
+int Unpack16To16(const T_colormask *colormask, const unsigned char *data,
+ unsigned char *out, unsigned char *end);
+
+int Unpack16To16(const unsigned char *data, unsigned char *out,
+ unsigned char *end, int imageByteOrder);
+
+int Unpack16To24(const T_colormask *colormask, const unsigned char *data,
+ unsigned char *out, unsigned char *end);
+
+int Unpack16To24(const unsigned char *data, unsigned char *out,
+ unsigned char *end, int imageByteOrder);
+
+int Unpack16To32(const T_colormask *colormask, const unsigned char *data,
+ unsigned char *out, unsigned char *end);
+
+int Unpack16To32(const unsigned char *data, unsigned char *out,
+ unsigned char *end, int imageByteOrder);
+
+int Unpack24To24(const T_colormask *colormask, const unsigned char *data,
+ unsigned char *out, unsigned char *end);
+
+int Unpack24To24(const unsigned char *data, unsigned char *out,
+ unsigned char *end);
+
+int Unpack24To32(const T_colormask *colormask, const unsigned char *data,
+ unsigned char *out, unsigned char *end);
+
+int Unpack24To32(const unsigned char *data, unsigned char *out, unsigned char *end);
+
+int Unpack32To32(const T_colormask *colormask, const unsigned int *data,
+ unsigned int *out, unsigned int *end);
+
+
void UnpackInit()
{
if (unpackInitialized == 0)
@@ -540,11 +606,15 @@ int Unpack24To24(const T_colormask *colormask, const unsigned char *data,
{
while (out < end)
{
- if (data[0] == data[1] == data[2] == 0x00)
+ if (data[0] == 0x00 &&
+ data[1] == 0x00 &&
+ data[2] == 0x00)
{
out[0] = out[1] = out[2] = 0x00;
}
- else if (data[0] == data[1] == data[2] == 0xff)
+ else if (data[0] == 0xff &&
+ data[1] == 0xff &&
+ data[2] == 0xff)
{
out[0] = out[1] = out[2] = 0xff;
}