summaryrefslogtreecommitdiff
path: root/apps/graphics/tiff/tiff_addstrip.c
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2011-09-22 14:53:15 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2011-09-22 14:53:15 +0000
commit742308f3e3646dd27ef9679ba2ae8756a2a64f7c (patch)
tree6e8f4d279b8c647b3e5f8f9974352cbe177d7b6a /apps/graphics/tiff/tiff_addstrip.c
parent4a6bae6e0114f9856d6b31228faf9cc14144f1f2 (diff)
downloadnuttx-742308f3e3646dd27ef9679ba2ae8756a2a64f7c.tar.gz
nuttx-742308f3e3646dd27ef9679ba2ae8756a2a64f7c.tar.bz2
nuttx-742308f3e3646dd27ef9679ba2ae8756a2a64f7c.zip
Add TIFF unit test
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3969 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'apps/graphics/tiff/tiff_addstrip.c')
-rw-r--r--apps/graphics/tiff/tiff_addstrip.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/apps/graphics/tiff/tiff_addstrip.c b/apps/graphics/tiff/tiff_addstrip.c
index 929a3a70e..165eec5ae 100644
--- a/apps/graphics/tiff/tiff_addstrip.c
+++ b/apps/graphics/tiff/tiff_addstrip.c
@@ -113,9 +113,9 @@ int tiff_convstrip(FAR struct tiff_info_s *info, FAR const uint8_t *strip)
/* Convert RGB565 to RGB888 */
rgb565 = *src++;
- *dest++ = (rgb565 >> 11);
- *dest++ = (rgb565 >> 5) & 0x3f;
- *dest++ = rgb565 & 0x1f;
+ *dest++ = (rgb565 >> (11-3)) & 0xf8; /* Move bits 11-15 to 3-7 */
+ *dest++ = (rgb565 >> ( 5-2)) & 0xfc; /* Move bits 5-10 to 2-7 */
+ *dest++ = (rgb565 << ( 3)) & 0xf8; /* Move bits 0- 4 to 3-7 */
/* Update the byte count */