summaryrefslogtreecommitdiff
path: root/apps/graphics
diff options
context:
space:
mode:
Diffstat (limited to 'apps/graphics')
-rw-r--r--apps/graphics/Makefile2
-rw-r--r--apps/graphics/screenshot/Makefile2
-rw-r--r--apps/graphics/screenshot/screenshot_main.c36
-rw-r--r--apps/graphics/tiff/Makefile2
-rw-r--r--apps/graphics/tiff/tiff_addstrip.c2
-rw-r--r--apps/graphics/tiff/tiff_finalize.c8
-rw-r--r--apps/graphics/tiff/tiff_initialize.c16
-rw-r--r--apps/graphics/tiff/tiff_utils.c6
8 files changed, 37 insertions, 37 deletions
diff --git a/apps/graphics/Makefile b/apps/graphics/Makefile
index 20f54c517..52d42c563 100644
--- a/apps/graphics/Makefile
+++ b/apps/graphics/Makefile
@@ -41,7 +41,7 @@ SUBDIRS = tiff screenshot
# Sub-directories that might need context setup
-CNTXTDIRS =
+CNTXTDIRS =
all: nothing
.PHONY: nothing context depend clean distclean
diff --git a/apps/graphics/screenshot/Makefile b/apps/graphics/screenshot/Makefile
index 04bc48d05..08a6f351f 100644
--- a/apps/graphics/screenshot/Makefile
+++ b/apps/graphics/screenshot/Makefile
@@ -72,7 +72,7 @@ STACKSIZE = 4096
# Common build
-VPATH =
+VPATH =
all: .built
.PHONY: clean depend distclean
diff --git a/apps/graphics/screenshot/screenshot_main.c b/apps/graphics/screenshot/screenshot_main.c
index 04f4e9281..c058081a7 100644
--- a/apps/graphics/screenshot/screenshot_main.c
+++ b/apps/graphics/screenshot/screenshot_main.c
@@ -88,17 +88,17 @@ static void replace_extension(FAR const char *filename, FAR const char *newext,
{
FAR char *p = strrchr(filename, '.');
int len = strlen(filename);
-
+
if (p != NULL)
{
len = p - filename;
}
-
+
if (len > size)
{
len = size - strlen(newext);
}
-
+
strncpy(dest, filename, size);
strncpy(dest + len, newext, size - len);
}
@@ -133,25 +133,25 @@ int save_screenshot(FAR const char *filename)
replace_extension(filename, ".tm2", tempf2, sizeof(tempf2));
/* Connect to NX server */
-
+
server = nx_connect();
if (!server)
{
perror("nx_connect");
return 1;
}
-
+
/* Wait for "connected" event */
-
+
if (nx_eventhandler(server) < 0)
{
perror("nx_eventhandler");
nx_disconnect(server);
return 1;
}
-
+
/* Open invisible dummy window for communication */
-
+
window = nx_openwindow(server, &cb, NULL);
if (!window)
{
@@ -159,9 +159,9 @@ int save_screenshot(FAR const char *filename)
nx_disconnect(server);
return 1;
}
-
+
nx_setsize(window, &size);
-
+
/* Configure the TIFF structure */
memset(&info, 0, sizeof(struct tiff_info_s));
@@ -174,7 +174,7 @@ int save_screenshot(FAR const char *filename)
info.imgheight = size.h;
info.iobuffer = (uint8_t *)malloc(300);
info.iosize = 300;
-
+
/* Initialize the TIFF library */
ret = tiff_initialize(&info);
@@ -187,12 +187,12 @@ int save_screenshot(FAR const char *filename)
/* Add each strip to the TIFF file */
strip = malloc(size.w * 3);
-
+
for (int y = 0; y < size.h; y++)
{
struct nxgl_rect_s rect = {{0, y}, {size.w - 1, y}};
nx_getrectangle(window, &rect, 0, strip, 0);
-
+
ret = tiff_addstrip(&info, strip);
if (ret < 0)
{
@@ -200,9 +200,9 @@ int save_screenshot(FAR const char *filename)
break;
}
}
-
+
free(strip);
-
+
/* Then finalize the TIFF file */
ret = tiff_finalize(&info);
@@ -210,11 +210,11 @@ int save_screenshot(FAR const char *filename)
{
printf("tiff_finalize() failed: %d\n", ret);
}
-
+
free(info.iobuffer);
nx_closewindow(window);
nx_disconnect(server);
-
+
return 0;
}
@@ -233,6 +233,6 @@ int screenshot_main(int argc, char *argv[])
fprintf(stderr, "Usage: screenshot file.tif\n");
return 1;
}
-
+
return save_screenshot(argv[1]);
}
diff --git a/apps/graphics/tiff/Makefile b/apps/graphics/tiff/Makefile
index b5f6c5b73..8eff3a0cd 100644
--- a/apps/graphics/tiff/Makefile
+++ b/apps/graphics/tiff/Makefile
@@ -62,7 +62,7 @@ ROOTDEPPATH = --dep-path .
# Common build
-VPATH =
+VPATH =
all: .built
.PHONY: context clean depend distclean
diff --git a/apps/graphics/tiff/tiff_addstrip.c b/apps/graphics/tiff/tiff_addstrip.c
index 7b5c4fb8f..2abd25120 100644
--- a/apps/graphics/tiff/tiff_addstrip.c
+++ b/apps/graphics/tiff/tiff_addstrip.c
@@ -216,7 +216,7 @@ int tiff_addstrip(FAR struct tiff_info_s *info, FAR const uint8_t *strip)
/* Increment the size of tmp2file. */
info->tmp2size += info->bps;
-
+
/* Pad tmpfile2 as necessary achieve word alignment */
newsize = tiff_wordalign(info->tmp2fd, info->tmp2size);
diff --git a/apps/graphics/tiff/tiff_finalize.c b/apps/graphics/tiff/tiff_finalize.c
index abae79b63..d2c6b9c19 100644
--- a/apps/graphics/tiff/tiff_finalize.c
+++ b/apps/graphics/tiff/tiff_finalize.c
@@ -97,7 +97,7 @@ static int tiff_readifdentry(int fd, off_t offset,
{
return -errno;
}
-
+
/* Then read the IFD entry. Anything returned by tiff_read other than the
* size of the IFD entry would be an error.
*/
@@ -179,8 +179,8 @@ static void tiff_cleanup(FAR struct tiff_info_s *info)
/* And remove the temporary files */
- (void)unlink(info->tmpfile1);
- (void)unlink(info->tmpfile2);
+ (void)unlink(info->tmpfile1);
+ (void)unlink(info->tmpfile2);
}
/****************************************************************************
@@ -434,6 +434,6 @@ void tiff_abort(FAR struct tiff_info_s *info)
/* But then delete the output file as well */
- (void)unlink(info->outfile);
+ (void)unlink(info->outfile);
}
diff --git a/apps/graphics/tiff/tiff_initialize.c b/apps/graphics/tiff/tiff_initialize.c
index ddd5fc29d..2d6f66a50 100644
--- a/apps/graphics/tiff/tiff_initialize.c
+++ b/apps/graphics/tiff/tiff_initialize.c
@@ -58,7 +58,7 @@
*
* Offset Description Contents/Notes
* Header: 0 Byte Order "II" or "MM"
- * 2 Magic Number 42
+ * 2 Magic Number 42
* 4 1st IFD offset 10
* 8 [2 bytes padding]
* IFD: 10 Number of Directory Entries 13
@@ -110,7 +110,7 @@
/* Greyscale Images have one additional IFD entry: BitsPerSample (4 or 8)
*
* Header: 0 Byte Order "II" or "MM"
- * 2 Magic Number 42
+ * 2 Magic Number 42
* 4 1st IFD offset 10
* 8 [2 bytes padding]
* IFD: 10 Number of Directory Entries 14
@@ -156,7 +156,7 @@
* SamplesPerPixel (3):
*
* Header: 0 Byte Order "II" or "MM"
- * 2 Magic Number 42
+ * 2 Magic Number 42
* 4 1st IFD offset 10
* 8 [2 bytes padding]
* IFD: 10 Number of Directory Entries 15
@@ -397,7 +397,7 @@ static int tiff_putifdentry16(FAR struct tiff_info_s *info, uint16_t tag,
* Get the DateTime string
*
* Input Parameters:
- *
+ *
*
* Returned Value:
* Zero (OK) on success. A negated errno value on failure.
@@ -526,7 +526,7 @@ int tiff_initialize(FAR struct tiff_info_s *info)
/* Write the TIFF header data to the outfile:
*
* Header: 0 Byte Order "II" or "MM"
- * 2 Magic Number 42
+ * 2 Magic Number 42
* 4 1st IFD offset 10
* 8 [2 bytes padding]
*/
@@ -793,11 +793,11 @@ int tiff_initialize(FAR struct tiff_info_s *info)
tiff_offset(offset, 4);
/* Now we begin the value section of the file */
-
+
tiff_checkoffs(offset, info->filefmt->valoffset);
/* Write the XResolution and YResolution data:
- *
+ *
* Bi-level Images: Offset 172 Count, Hard-coded to 300/1
* Offset 180 Count, Hard-coded to 300/1
* Greyscale: Offset 184 Count, Hard-coded to 300/1
@@ -857,7 +857,7 @@ int tiff_initialize(FAR struct tiff_info_s *info)
* Greyscale: Offset 200, Hard-coded "NuttX"
* RGB: Offset 220, Hard-coded "NuttX"
*/
-
+
tiff_checkoffs(offset, info->filefmt->swoffset);
ret = tiff_putstring(info->outfd, TIFF_SOFTWARE_STRING, TIFF_SOFTWARE_STRLEN);
if (ret < 0)
diff --git a/apps/graphics/tiff/tiff_utils.c b/apps/graphics/tiff/tiff_utils.c
index 33886d796..499be096d 100644
--- a/apps/graphics/tiff/tiff_utils.c
+++ b/apps/graphics/tiff/tiff_utils.c
@@ -286,7 +286,7 @@ int tiff_write(int fd, FAR const void *buffer, size_t count)
int tiff_putint16(int fd, uint16_t value)
{
uint8_t bytes[2];
-
+
/* Write the two bytes to the output file */
tiff_put16(bytes, value);
@@ -311,7 +311,7 @@ int tiff_putint16(int fd, uint16_t value)
int tiff_putint32(int fd, uint32_t value)
{
uint8_t bytes[4];
-
+
/* Write the four bytes to the output file */
tiff_put32(bytes, value);
@@ -375,7 +375,7 @@ ssize_t tiff_wordalign(int fd, size_t size)
{
return (ssize_t)ret;
}
- size += nbytes;
+ size += nbytes;
}
return size;
}