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
This commit is contained in:
patacongo
2011-10-22 18:13:04 +00:00
parent 6c6c0ba3d9
commit dbf37c6315
24 changed files with 1354 additions and 79 deletions
+29
View File
@@ -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
+34 -3
View File
@@ -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.
*
@@ -280,11 +280,42 @@ EXTERN void nxgl_fillrectangle_32bpp(FAR NX_PLANEINFOTYPE *pinfo,
FAR const struct nxgl_rect_s *rect,
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.
*
****************************************************************************/
+51 -1
View File
@@ -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
@@ -220,6 +220,31 @@ EXTERN int nxtk_lower(NXTKWINDOW hfwnd);
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
*
@@ -416,6 +441,31 @@ EXTERN int nxtk_closetoolbar(NXTKWINDOW hfwnd);
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
*