summaryrefslogtreecommitdiff
path: root/apps/graphics
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
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')
-rw-r--r--apps/graphics/tiff/Makefile4
-rw-r--r--apps/graphics/tiff/README.txt15
-rw-r--r--apps/graphics/tiff/tiff_addstrip.c6
-rw-r--r--apps/graphics/tiff/tiff_internal.h8
4 files changed, 24 insertions, 9 deletions
diff --git a/apps/graphics/tiff/Makefile b/apps/graphics/tiff/Makefile
index 9fc762c9c..617717c65 100644
--- a/apps/graphics/tiff/Makefile
+++ b/apps/graphics/tiff/Makefile
@@ -37,10 +37,10 @@
-include $(TOPDIR)/Make.defs
include $(APPDIR)/Make.defs
-# NuttX NX Graphics Example.
+# NuttX TIFF Creation Tool
ASRCS =
-CSRCS = tiff_addstrip.c tiff_finalize.c tiff_initialize.c tiff_utils.c
+CSRCS = tiff_addstrip.c tiff_finalize.c tiff_initialize.c tiff_utils.c
AOBJS = $(ASRCS:.S=$(OBJEXT))
COBJS = $(CSRCS:.c=$(OBJEXT))
diff --git a/apps/graphics/tiff/README.txt b/apps/graphics/tiff/README.txt
new file mode 100644
index 000000000..b414107ff
--- /dev/null
+++ b/apps/graphics/tiff/README.txt
@@ -0,0 +1,15 @@
+README for the TIFF Creation Library
+=====================================
+
+This directory contains a library that can be used to create TIFF image
+files. This file was created for the purpose of supporting screen dumps
+from an LCD. Howeve, the logic is general and could be used for most
+any purpose.
+
+The only usage documentation is in the (rather extensive) comments in
+the file apps/include/tiff.h
+
+Unit Test
+=========
+
+See apps/examples/tiff
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 */
diff --git a/apps/graphics/tiff/tiff_internal.h b/apps/graphics/tiff/tiff_internal.h
index ac14e0ad7..bfc2a0253 100644
--- a/apps/graphics/tiff/tiff_internal.h
+++ b/apps/graphics/tiff/tiff_internal.h
@@ -1,7 +1,7 @@
/****************************************************************************
* apps/graphics/tiff/tiff_internal.h
*
- * Copyright (C) 2010 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2011 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@@ -33,8 +33,8 @@
*
****************************************************************************/
-#ifndef __APPS_GRPHICS_TIFF_TIFF_INTERNAL_H
-#define __APPS_GRPHICS_TIFF_TIFF_INTERNAL_H
+#ifndef __APPS_GRAPHICS_TIFF_TIFF_INTERNAL_H
+#define __APPS_GRAPHICS_TIFF_TIFF_INTERNAL_H
/****************************************************************************
* Included Files
@@ -206,5 +206,5 @@ EXTERN ssize_t tiff_wordalign(int fd, size_t size);
}
#endif
-#endif /* __APPS_GRPHICS_TIFF_TIFF_INTERNAL_H */
+#endif /* __APPS_GRAPHICS_TIFF_TIFF_INTERNAL_H */