summaryrefslogtreecommitdiff
path: root/nuttx/include
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2011-10-22 18:13:04 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2011-10-22 18:13:04 +0000
commita4df531ddd6b2998171d9d80eca58e24207eb4df (patch)
treefaa14896f032e6f7ce36d7ceee45d0b913ee7ba9 /nuttx/include
parent16afd5674368ca9e20ca420d34ffad99a60e6c5e (diff)
downloadpx4-nuttx-a4df531ddd6b2998171d9d80eca58e24207eb4df.tar.gz
px4-nuttx-a4df531ddd6b2998171d9d80eca58e24207eb4df.tar.bz2
px4-nuttx-a4df531ddd6b2998171d9d80eca58e24207eb4df.zip
Add logic to read from graphics memory
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4057 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/include')
-rw-r--r--nuttx/include/nuttx/nx/nx.h29
-rw-r--r--nuttx/include/nuttx/nx/nxglib.h37
-rw-r--r--nuttx/include/nuttx/nx/nxtk.h52
3 files changed, 114 insertions, 4 deletions
diff --git a/nuttx/include/nuttx/nx/nx.h b/nuttx/include/nuttx/nx/nx.h
index d582256fb..a4e9f5baf 100644
--- a/nuttx/include/nuttx/nx/nx.h
+++ b/nuttx/include/nuttx/nx/nx.h
@@ -613,6 +613,35 @@ EXTERN int nx_setpixel(NXWINDOW hwnd, FAR const struct nxgl_point_s *pos,
EXTERN int nx_fill(NXWINDOW hwnd, FAR const struct nxgl_rect_s *rect,
nxgl_mxpixel_t color[CONFIG_NX_NPLANES]);
+/****************************************************************************
+ * Name: nx_getrectangle
+ *
+ * Description:
+ * Get the raw contents of graphic memory within a rectangular region. NOTE:
+ * Since raw graphic memory is returned, the returned memory content may be
+ * the memory of windows above this one and may not necessarily belong to
+ * this window unless you assure that this is the top window.
+ *
+ * Input Parameters:
+ * wnd - The window structure reference
+ * rect - The location to be copied
+ * plane - Specifies the color plane to get from.
+ * dest - The location to copy the memory region
+ * deststride - The width, in bytes, the the dest memory
+ *
+ * Input Parameters:
+ * hwnd - The window handle
+ * rect - The location to be filled
+ * color - The color to use in the fill
+ *
+ * Return:
+ * OK on success; ERROR on failure with errno set appropriately
+ *
+ ****************************************************************************/
+
+EXTERN void nx_getrectangle(NXWINDOW hwnd, FAR const struct nxgl_rect_s *rect,
+ unsigned int plane, FAR uint8_t *dest,
+ unsigned int deststride);
/****************************************************************************
* Name: nx_filltrapezoid
diff --git a/nuttx/include/nuttx/nx/nxglib.h b/nuttx/include/nuttx/nx/nxglib.h
index bf54b9029..d94d6fe76 100644
--- a/nuttx/include/nuttx/nx/nxglib.h
+++ b/nuttx/include/nuttx/nx/nxglib.h
@@ -222,7 +222,7 @@ EXTERN void nxgl_yuv2rgb(uint8_t y, uint8_t u, uint8_t v,
* Name: nxgl_setpixel_*bpp
*
* Descripton:
- * Draw a single pixel in graphics memory memory at the given position and
+ * Draw a single pixel in graphics memory at the given position and
* with the given color. This is equivalent to nxgl_fillrectangle_*bpp()
* with a 1x1 rectangle but is more efficient.
*
@@ -281,10 +281,41 @@ EXTERN void nxgl_fillrectangle_32bpp(FAR NX_PLANEINFOTYPE *pinfo,
uint32_t color);
/****************************************************************************
+ * Name: nxgl_getrectangle_*bpp
+ *
+ * Descripton:
+ * Fetch a rectangular region from graphics memory. The source is
+ * expressed as a rectangle.
+ *
+ ****************************************************************************/
+
+EXTERN void nxgl_getrectangle_1bpp(FAR struct fb_planeinfo_s *pinfo,
+ FAR const struct nxgl_rect_s *rect,
+ FAR void *dest, unsigned int deststride);
+EXTERN void nxgl_getrectangle_2bpp(FAR struct fb_planeinfo_s *pinfo,
+ FAR const struct nxgl_rect_s *rect,
+ FAR void *dest, unsigned int deststride);
+EXTERN void nxgl_getrectangle_4bpp(FAR struct fb_planeinfo_s *pinfo,
+ FAR const struct nxgl_rect_s *rect,
+ FAR void *dest, unsigned int deststride);
+EXTERN void nxgl_getrectangle_8bpp(FAR struct fb_planeinfo_s *pinfo,
+ FAR const struct nxgl_rect_s *rect,
+ FAR void *dest, unsigned int deststride);
+EXTERN void nxgl_getrectangle_16bpp(FAR struct fb_planeinfo_s *pinfo,
+ FAR const struct nxgl_rect_s *rect,
+ FAR void *dest, unsigned int deststride);
+EXTERN void nxgl_getrectangle_24bpp(FAR struct fb_planeinfo_s *pinfo,
+ FAR const struct nxgl_rect_s *rect,
+ FAR void *dest, unsigned int deststride);
+EXTERN void nxgl_getrectangle_32bpp(FAR struct fb_planeinfo_s *pinfo,
+ FAR const struct nxgl_rect_s *rect,
+ FAR void *dest, unsigned int deststride);
+
+/****************************************************************************
* Name: nxglib_filltrapezoid_*bpp
*
* Descripton:
- * Fill a trapezoidal region in the framebuffer memory with a fixed color.
+ * Fill a trapezoidal region in the graphics memory with a fixed color.
* Clip the trapezoid to lie within a boundng box. This is useful for
* drawing complex shapes that can be broken into a set of trapezoids.
*
@@ -357,7 +388,7 @@ EXTERN void nxgl_moverectangle_32bpp(FAR NX_PLANEINFOTYPE *pinfo,
*
* Descripton:
* Copy a rectangular bitmap image into the specific position in the
- * framebuffer memory.
+ * graphics memory.
*
****************************************************************************/
diff --git a/nuttx/include/nuttx/nx/nxtk.h b/nuttx/include/nuttx/nx/nxtk.h
index 107d8677c..c2f6c270d 100644
--- a/nuttx/include/nuttx/nx/nxtk.h
+++ b/nuttx/include/nuttx/nx/nxtk.h
@@ -2,7 +2,7 @@
* include/nuttx/nx/nxtk.h
*
* Copyright (C) 2008-2011 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
+ * Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -221,6 +221,31 @@ EXTERN int nxtk_fillwindow(NXTKWINDOW hfwnd, FAR const struct nxgl_rect_s *rect,
nxgl_mxpixel_t color[CONFIG_NX_NPLANES]);
/****************************************************************************
+ * Name: nxtk_getwindow
+ *
+ * Description:
+ * Get the raw contents of graphic memory within a rectangular region. NOTE:
+ * Since raw graphic memory is returned, the returned memory content may be
+ * the memory of windows above this one and may not necessarily belong to
+ * this window unless you assure that this is the top window.
+ *
+ * Input Parameters:
+ * wnd - The window structure reference
+ * rect - The location to be copied
+ * plane - Specifies the color plane to get from.
+ * dest - The location to copy the memory region
+ * deststride - The width, in bytes, the the dest memory
+ *
+ * Return:
+ * OK on success; ERROR on failure with errno set appropriately
+ *
+ ****************************************************************************/
+
+EXTERN void nxtk_getwindow(NXTKWINDOW hfwnd, FAR const struct nxgl_rect_s *rect,
+ unsigned int plane, FAR uint8_t *dest,
+ unsigned int deststride);
+
+/****************************************************************************
* Name: nxtk_filltrapwindow
*
* Description:
@@ -417,6 +442,31 @@ EXTERN int nxtk_filltoolbar(NXTKWINDOW hfwnd, FAR const struct nxgl_rect_s *rect
nxgl_mxpixel_t color[CONFIG_NX_NPLANES]);
/****************************************************************************
+ * Name: nxtk_gettoolbar
+ *
+ * Description:
+ * Get the raw contents of graphic memory within a rectangular region. NOTE:
+ * Since raw graphic memory is returned, the returned memory content may be
+ * the memory of windows above this one and may not necessarily belong to
+ * this window unless you assure that this is the top window.
+ *
+ * Input Parameters:
+ * wnd - The window structure reference
+ * rect - The location to be copied
+ * plane - Specifies the color plane to get from.
+ * dest - The location to copy the memory region
+ * deststride - The width, in bytes, the the dest memory
+ *
+ * Return:
+ * OK on success; ERROR on failure with errno set appropriately
+ *
+ ****************************************************************************/
+
+EXTERN void nxtk_gettoolbar(NXTKWINDOW hfwnd, FAR const struct nxgl_rect_s *rect,
+ unsigned int plane, FAR uint8_t *dest,
+ unsigned int deststride);
+
+/****************************************************************************
* Name: nxtk_filltraptoolbar
*
* Description: