From 0a6bb6e614dd073d8e0254308135ac76188d3041 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Mon, 8 Apr 2019 17:14:41 -0600 Subject: [PATCH] grahics/nxglib/nxglib.h: Move internal function prototypes from include/nuttx/nx/nxglib.h to graphics/nxglib/nxglib.h. --- graphics/nxbe/nxbe_configure.c | 1 + graphics/nxglib/nxglib.h | 461 +++++++++++++++++++++++++++++++++ include/nuttx/nx/nxbe.h | 1 - include/nuttx/nx/nxglib.h | 391 +--------------------------- 4 files changed, 464 insertions(+), 390 deletions(-) create mode 100644 graphics/nxglib/nxglib.h diff --git a/graphics/nxbe/nxbe_configure.c b/graphics/nxbe/nxbe_configure.c index 0eff716788..33a3616416 100644 --- a/graphics/nxbe/nxbe_configure.c +++ b/graphics/nxbe/nxbe_configure.c @@ -43,6 +43,7 @@ #include #include +#include "nxglib.h" #include "nxbe.h" /**************************************************************************** diff --git a/graphics/nxglib/nxglib.h b/graphics/nxglib/nxglib.h new file mode 100644 index 0000000000..9621d0d6cc --- /dev/null +++ b/graphics/nxglib/nxglib.h @@ -0,0 +1,461 @@ +/**************************************************************************** + * graphics/nxglib/nx/nxglib.h + * + * Copyright (C) 2008-2011, 2019 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************/ + +#ifndef __GRAPHICS_NXGLIB_NXBLIC_H +#define __GRAPHICS_NXGLIB_NXBLIC_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include + +/**************************************************************************** + * Public Data + ****************************************************************************/ + +#undef EXTERN +#if defined(__cplusplus) +# define EXTERN extern "C" +extern "C" +{ +#else +# define EXTERN extern +#endif + +/**************************************************************************** + * Public Function Prototypes + ****************************************************************************/ + +/* Rasterizers **************************************************************/ + +/**************************************************************************** + * Name: nxgl_setpixel_*bpp / pwfb_setpixel_*bpp + * + * Description: + * 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. + * + ****************************************************************************/ + +struct nxbe_window_s; /* Forward reference. See include/nuttx/nx/nxbe.h */ + +/* For direct access to graphics device memory */ + +void nxgl_setpixel_1bpp(FAR NX_PLANEINFOTYPE *pinfo, + FAR const struct nxgl_point_s *pos, uint8_t color); +void nxgl_setpixel_2bpp(FAR NX_PLANEINFOTYPE *pinfo, + FAR const struct nxgl_point_s *pos, uint8_t color); +void nxgl_setpixel_4bpp(FAR NX_PLANEINFOTYPE *pinfo, + FAR const struct nxgl_point_s *pos, uint8_t color); +void nxgl_setpixel_8bpp(FAR NX_PLANEINFOTYPE *pinfo, + FAR const struct nxgl_point_s *pos, uint8_t color); +void nxgl_setpixel_16bpp(FAR NX_PLANEINFOTYPE *pinfo, + FAR const struct nxgl_point_s *pos, uint16_t color); +void nxgl_setpixel_24bpp(FAR NX_PLANEINFOTYPE *pinfo, + FAR const struct nxgl_point_s *pos, uint32_t color); +void nxgl_setpixel_32bpp(FAR NX_PLANEINFOTYPE *pinfo, + FAR const struct nxgl_point_s *pos, uint32_t color); + +#ifdef CONFIG_NX_RAMBACKED +/* For access to per-window framebuffer memory */ + +void pwfb_setpixel_1bpp(FAR struct nxbe_window_s *bwnd, + FAR const struct nxgl_point_s *pos, uint8_t color); +void pwfb_setpixel_2bpp(FAR struct nxbe_window_s *bwnd, + FAR const struct nxgl_point_s *pos, uint8_t color); +void pwfb_setpixel_4bpp(FAR struct nxbe_window_s *bwnd, + FAR const struct nxgl_point_s *pos, uint8_t color); +void pwfb_setpixel_8bpp(FAR struct nxbe_window_s *bwnd, + FAR const struct nxgl_point_s *pos, uint8_t color); +void pwfb_setpixel_16bpp(FAR struct nxbe_window_s *bwnd, + FAR const struct nxgl_point_s *pos, uint16_t color); +void pwfb_setpixel_24bpp(FAR struct nxbe_window_s *bwnd, + FAR const struct nxgl_point_s *pos, uint32_t color); +void pwfb_setpixel_32bpp(FAR struct nxbe_window_s *bwnd, + FAR const struct nxgl_point_s *pos, uint32_t color); +#endif + +/**************************************************************************** + * Name: nxgl_fillrectangle_*bpp / pwfb_fillrectangle_*bpp + * + * Description: + * Fill a rectangle region in the graphics memory with a fixed color + * + ****************************************************************************/ + +/* For direct access to graphics device memory */ + +void nxgl_fillrectangle_1bpp(FAR NX_PLANEINFOTYPE *pinfo, + FAR const struct nxgl_rect_s *rect, + uint8_t color); +void nxgl_fillrectangle_2bpp(FAR NX_PLANEINFOTYPE *pinfo, + FAR const struct nxgl_rect_s *rect, + uint8_t color); +void nxgl_fillrectangle_4bpp(FAR NX_PLANEINFOTYPE *pinfo, + FAR const struct nxgl_rect_s *rect, + uint8_t color); +void nxgl_fillrectangle_8bpp(FAR NX_PLANEINFOTYPE *pinfo, + FAR const struct nxgl_rect_s *rect, + uint8_t color); +void nxgl_fillrectangle_16bpp(FAR NX_PLANEINFOTYPE *pinfo, + FAR const struct nxgl_rect_s *rect, + uint16_t color); +void nxgl_fillrectangle_24bpp(FAR NX_PLANEINFOTYPE *pinfo, + FAR const struct nxgl_rect_s *rect, + uint32_t color); +void nxgl_fillrectangle_32bpp(FAR NX_PLANEINFOTYPE *pinfo, + FAR const struct nxgl_rect_s *rect, + uint32_t color); + +#ifdef CONFIG_NX_RAMBACKED +/* For access to per-window framebuffer memory */ + +void pwfb_fillrectangle_1bpp(FAR struct nxbe_window_s *bwnd, + FAR const struct nxgl_rect_s *rect, + uint8_t color); +void pwfb_fillrectangle_2bpp(FAR struct nxbe_window_s *bwnd, + FAR const struct nxgl_rect_s *rect, + uint8_t color); +void pwfb_fillrectangle_4bpp(FAR struct nxbe_window_s *bwnd, + FAR const struct nxgl_rect_s *rect, + uint8_t color); +void pwfb_fillrectangle_8bpp(FAR struct nxbe_window_s *bwnd, + FAR const struct nxgl_rect_s *rect, + uint8_t color); +void pwfb_fillrectangle_16bpp(FAR struct nxbe_window_s *bwnd, + FAR const struct nxgl_rect_s *rect, + uint16_t color); +void pwfb_fillrectangle_24bpp(FAR struct nxbe_window_s *bwnd, + FAR const struct nxgl_rect_s *rect, + uint32_t color); +void pwfb_fillrectangle_32bpp(FAR struct nxbe_window_s *bwnd, + FAR const struct nxgl_rect_s *rect, + uint32_t color); +#endif + +/**************************************************************************** + * Name: nxgl_getrectangle_*bpp / pwfb_getrectangle_*bpp + * + * Description: + * Fetch a rectangular region from graphics memory. The source is + * expressed as a rectangle. + * + ****************************************************************************/ + +/* For direct access to graphics device memory */ + +void nxgl_getrectangle_1bpp(FAR NX_PLANEINFOTYPE *pinfo, + FAR const struct nxgl_rect_s *rect, + FAR void *dest, unsigned int deststride); +void nxgl_getrectangle_2bpp(FAR NX_PLANEINFOTYPE *pinfo, + FAR const struct nxgl_rect_s *rect, + FAR void *dest, unsigned int deststride); +void nxgl_getrectangle_4bpp(FAR NX_PLANEINFOTYPE *pinfo, + FAR const struct nxgl_rect_s *rect, + FAR void *dest, unsigned int deststride); +void nxgl_getrectangle_8bpp(FAR NX_PLANEINFOTYPE *pinfo, + FAR const struct nxgl_rect_s *rect, + FAR void *dest, unsigned int deststride); +void nxgl_getrectangle_16bpp(FAR NX_PLANEINFOTYPE *pinfo, + FAR const struct nxgl_rect_s *rect, + FAR void *dest, unsigned int deststride); +void nxgl_getrectangle_24bpp(FAR NX_PLANEINFOTYPE *pinfo, + FAR const struct nxgl_rect_s *rect, + FAR void *dest, unsigned int deststride); +void nxgl_getrectangle_32bpp(FAR NX_PLANEINFOTYPE *pinfo, + FAR const struct nxgl_rect_s *rect, + FAR void *dest, unsigned int deststride); + +#ifdef CONFIG_NX_RAMBACKED +/* For access to per-window framebuffer memory */ + +void pwfb_getrectangle_1bpp(FAR struct nxbe_window_s *bwnd, + FAR const struct nxgl_rect_s *rect, + FAR void *dest, unsigned int deststride); +void pwfb_getrectangle_2bpp(FAR struct nxbe_window_s *bwnd, + FAR const struct nxgl_rect_s *rect, + FAR void *dest, unsigned int deststride); +void pwfb_getrectangle_4bpp(FAR struct nxbe_window_s *bwnd, + FAR const struct nxgl_rect_s *rect, + FAR void *dest, unsigned int deststride); +void pwfb_getrectangle_8bpp(FAR struct nxbe_window_s *bwnd, + FAR const struct nxgl_rect_s *rect, + FAR void *dest, unsigned int deststride); +void pwfb_getrectangle_16bpp(FAR struct nxbe_window_s *bwnd, + FAR const struct nxgl_rect_s *rect, + FAR void *dest, unsigned int deststride); +void pwfb_getrectangle_24bpp(FAR struct nxbe_window_s *bwnd, + FAR const struct nxgl_rect_s *rect, + FAR void *dest, unsigned int deststride); +void pwfb_getrectangle_32bpp(FAR struct nxbe_window_s *bwnd, + FAR const struct nxgl_rect_s *rect, + FAR void *dest, unsigned int deststride); +#endif + +/**************************************************************************** + * Name: nxglib_filltrapezoid_*bpp / pwfb_filltrapezoid_*bpp + * + * Description: + * Fill a trapezoidal region in the graphics memory with a fixed color. + * Clip the trapezoid to lie within a bounding box. This is useful for + * drawing complex shapes that can be broken into a set of trapezoids. + * + ****************************************************************************/ + +/* For direct access to graphics device memory */ + +void nxgl_filltrapezoid_1bpp(FAR NX_PLANEINFOTYPE *pinfo, + FAR const struct nxgl_trapezoid_s *trap, + FAR const struct nxgl_rect_s *bounds, + uint8_t color); +void nxgl_filltrapezoid_2bpp(FAR NX_PLANEINFOTYPE *pinfo, + FAR const struct nxgl_trapezoid_s *trap, + FAR const struct nxgl_rect_s *bounds, + uint8_t color); +void nxgl_filltrapezoid_4bpp(FAR NX_PLANEINFOTYPE *pinfo, + FAR const struct nxgl_trapezoid_s *trap, + FAR const struct nxgl_rect_s *bounds, + uint8_t color); +void nxgl_filltrapezoid_8bpp(FAR NX_PLANEINFOTYPE *pinfo, + FAR const struct nxgl_trapezoid_s *trap, + FAR const struct nxgl_rect_s *bounds, + uint8_t color); +void nxgl_filltrapezoid_16bpp(FAR NX_PLANEINFOTYPE *pinfo, + FAR const struct nxgl_trapezoid_s *trap, + FAR const struct nxgl_rect_s *bounds, + uint16_t color); +void nxgl_filltrapezoid_24bpp(FAR NX_PLANEINFOTYPE *pinfo, + FAR const struct nxgl_trapezoid_s *trap, + FAR const struct nxgl_rect_s *bounds, + uint32_t color); +void nxgl_filltrapezoid_32bpp(FAR NX_PLANEINFOTYPE *pinfo, + FAR const struct nxgl_trapezoid_s *trap, + FAR const struct nxgl_rect_s *bounds, + uint32_t color); + +#ifdef CONFIG_NX_RAMBACKED +/* For access to per-window framebuffer memory */ + +void pwfb_filltrapezoid_1bpp(FAR struct nxbe_window_s *bwnd, + FAR const struct nxgl_trapezoid_s *trap, + FAR const struct nxgl_rect_s *bounds, + uint8_t color); +void pwfb_filltrapezoid_2bpp(FAR struct nxbe_window_s *bwnd, + FAR const struct nxgl_trapezoid_s *trap, + FAR const struct nxgl_rect_s *bounds, + uint8_t color); +void pwfb_filltrapezoid_4bpp(FAR struct nxbe_window_s *bwnd, + FAR const struct nxgl_trapezoid_s *trap, + FAR const struct nxgl_rect_s *bounds, + uint8_t color); +void pwfb_filltrapezoid_8bpp(FAR struct nxbe_window_s *bwnd, + FAR const struct nxgl_trapezoid_s *trap, + FAR const struct nxgl_rect_s *bounds, + uint8_t color); +void pwfb_filltrapezoid_16bpp(FAR struct nxbe_window_s *bwnd, + FAR const struct nxgl_trapezoid_s *trap, + FAR const struct nxgl_rect_s *bounds, + uint16_t color); +void pwfb_filltrapezoid_24bpp(FAR struct nxbe_window_s *bwnd, + FAR const struct nxgl_trapezoid_s *trap, + FAR const struct nxgl_rect_s *bounds, + uint32_t color); +void pwfb_filltrapezoid_32bpp(FAR struct nxbe_window_s *bwnd, + FAR const struct nxgl_trapezoid_s *trap, + FAR const struct nxgl_rect_s *bounds, + uint32_t color); +#endif + +/**************************************************************************** + * Name: nxgl_moverectangle_*bpp / pwfb_moverectangle_*bpp + * + * Description: + * Move a rectangular region from location to another in the + * framebuffer/LCD memory. The source is expressed as a rectangle; the + * destination position is expressed as a point corresponding to the + * translation of the upper, left-hand corner. + * + ****************************************************************************/ + +/* For direct access to graphics device memory */ + +void nxgl_moverectangle_1bpp(FAR NX_PLANEINFOTYPE *pinfo, + FAR const struct nxgl_rect_s *rect, + FAR struct nxgl_point_s *offset); +void nxgl_moverectangle_2bpp(FAR NX_PLANEINFOTYPE *pinfo, + FAR const struct nxgl_rect_s *rect, + FAR struct nxgl_point_s *offset); +void nxgl_moverectangle_4bpp(FAR NX_PLANEINFOTYPE *pinfo, + FAR const struct nxgl_rect_s *rect, + FAR struct nxgl_point_s *offset); +void nxgl_moverectangle_8bpp(FAR NX_PLANEINFOTYPE *pinfo, + FAR const struct nxgl_rect_s *rect, + FAR struct nxgl_point_s *offset); +void nxgl_moverectangle_16bpp(FAR NX_PLANEINFOTYPE *pinfo, + FAR const struct nxgl_rect_s *rect, + FAR struct nxgl_point_s *offset); +void nxgl_moverectangle_24bpp(FAR NX_PLANEINFOTYPE *pinfo, + FAR const struct nxgl_rect_s *rect, + FAR struct nxgl_point_s *offset); +void nxgl_moverectangle_32bpp(FAR NX_PLANEINFOTYPE *pinfo, + FAR const struct nxgl_rect_s *rect, + FAR struct nxgl_point_s *offset); + +#ifdef CONFIG_NX_RAMBACKED +/* For access to per-window framebuffer memory */ + +void pwfb_moverectangle_1bpp(FAR struct nxbe_window_s *bwnd, + FAR const struct nxgl_rect_s *rect, + FAR struct nxgl_point_s *offset); +void pwfb_moverectangle_2bpp(FAR struct nxbe_window_s *bwnd, + FAR const struct nxgl_rect_s *rect, + FAR struct nxgl_point_s *offset); +void pwfb_moverectangle_4bpp(FAR struct nxbe_window_s *bwnd, + FAR const struct nxgl_rect_s *rect, + FAR struct nxgl_point_s *offset); +void pwfb_moverectangle_8bpp(FAR struct nxbe_window_s *bwnd, + FAR const struct nxgl_rect_s *rect, + FAR struct nxgl_point_s *offset); +void pwfb_moverectangle_16bpp(FAR struct nxbe_window_s *bwnd, + FAR const struct nxgl_rect_s *rect, + FAR struct nxgl_point_s *offset); +void pwfb_moverectangle_24bpp(FAR struct nxbe_window_s *bwnd, + FAR const struct nxgl_rect_s *rect, + FAR struct nxgl_point_s *offset); +void pwfb_moverectangle_32bpp(FAR struct nxbe_window_s *bwnd, + FAR const struct nxgl_rect_s *rect, + FAR struct nxgl_point_s *offset); +#endif + +/**************************************************************************** + * Name: nxgl_copyrectangle_*bpp / pwfb_copyrectangle_*bpp + * + * Description: + * Copy a rectangular bitmap image into the specific position in the + * graphics memory. + * + ****************************************************************************/ + +/* For direct access to graphics device memory */ + +void nxgl_copyrectangle_1bpp(FAR NX_PLANEINFOTYPE *pinfo, + FAR const struct nxgl_rect_s *dest, + FAR const void *src, + FAR const struct nxgl_point_s *origin, + unsigned int srcstride); +void nxgl_copyrectangle_2bpp(FAR NX_PLANEINFOTYPE *pinfo, + FAR const struct nxgl_rect_s *dest, + FAR const void *src, + FAR const struct nxgl_point_s *origin, + unsigned int srcstride); +void nxgl_copyrectangle_4bpp(FAR NX_PLANEINFOTYPE *pinfo, + FAR const struct nxgl_rect_s *dest, + FAR const void *src, + FAR const struct nxgl_point_s *origin, + unsigned int srcstride); +void nxgl_copyrectangle_8bpp(FAR NX_PLANEINFOTYPE *pinfo, + FAR const struct nxgl_rect_s *dest, + FAR const void *src, + FAR const struct nxgl_point_s *origin, + unsigned int srcstride); +void nxgl_copyrectangle_16bpp(FAR NX_PLANEINFOTYPE *pinfo, + FAR const struct nxgl_rect_s *dest, + FAR const void *src, + FAR const struct nxgl_point_s *origin, + unsigned int srcstride); +void nxgl_copyrectangle_24bpp(FAR NX_PLANEINFOTYPE *pinfo, + FAR const struct nxgl_rect_s *dest, + FAR const void *src, + FAR const struct nxgl_point_s *origin, + unsigned int srcstride); +void nxgl_copyrectangle_32bpp(FAR NX_PLANEINFOTYPE *pinfo, + FAR const struct nxgl_rect_s *dest, + FAR const void *src, + FAR const struct nxgl_point_s *origin, + unsigned int srcstride); + +#ifdef CONFIG_NX_RAMBACKED +/* For access to per-window framebuffer memory */ + +void pwfb_copyrectangle_1bpp(FAR struct nxbe_window_s *bwnd, + FAR const struct nxgl_rect_s *dest, + FAR const void *src, + FAR const struct nxgl_point_s *origin, + unsigned int srcstride); +void pwfb_copyrectangle_2bpp(FAR struct nxbe_window_s *bwnd, + FAR const struct nxgl_rect_s *dest, + FAR const void *src, + FAR const struct nxgl_point_s *origin, + unsigned int srcstride); +void pwfb_copyrectangle_4bpp(FAR struct nxbe_window_s *bwnd, + FAR const struct nxgl_rect_s *dest, + FAR const void *src, + FAR const struct nxgl_point_s *origin, + unsigned int srcstride); +void pwfb_copyrectangle_8bpp(FAR struct nxbe_window_s *bwnd, + FAR const struct nxgl_rect_s *dest, + FAR const void *src, + FAR const struct nxgl_point_s *origin, + unsigned int srcstride); +void pwfb_copyrectangle_16bpp(FAR struct nxbe_window_s *bwnd, + FAR const struct nxgl_rect_s *dest, + FAR const void *src, + FAR const struct nxgl_point_s *origin, + unsigned int srcstride); +void pwfb_copyrectangle_24bpp(FAR struct nxbe_window_s *bwnd, + FAR const struct nxgl_rect_s *dest, + FAR const void *src, + FAR const struct nxgl_point_s *origin, + unsigned int srcstride); +void pwfb_copyrectangle_32bpp(FAR struct nxbe_window_s *bwnd, + FAR const struct nxgl_rect_s *dest, + FAR const void *src, + FAR const struct nxgl_point_s *origin, + unsigned int srcstride); +#endif + +#undef EXTERN +#if defined(__cplusplus) +} +#endif + +#endif /* __GRAPHICS_NXGLIB_NXBLIC_H */ diff --git a/include/nuttx/nx/nxbe.h b/include/nuttx/nx/nxbe.h index 244fb51352..0b30cbdadc 100644 --- a/include/nuttx/nx/nxbe.h +++ b/include/nuttx/nx/nxbe.h @@ -199,4 +199,3 @@ extern "C" #endif #endif /* __INCLUDE_NUTTX_NX_NXBE_H */ - diff --git a/include/nuttx/nx/nxglib.h b/include/nuttx/nx/nxglib.h index feb9b20e30..9be448de49 100644 --- a/include/nuttx/nx/nxglib.h +++ b/include/nuttx/nx/nxglib.h @@ -1,7 +1,7 @@ /**************************************************************************** * include/nuttx/nx/nxglib.h * - * Copyright (C) 2008-2011 Gregory Nutt. All rights reserved. + * Copyright (C) 2008-2011, 2019 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -146,394 +146,7 @@ void nxgl_rgb2yuv(uint8_t r, uint8_t g, uint8_t b, void nxgl_yuv2rgb(uint8_t y, uint8_t u, uint8_t v, uint8_t *r, uint8_t *g, uint8_t *b); -/* Rasterizers **************************************************************/ - -/**************************************************************************** - * Name: nxgl_setpixel_*bpp / pwfb_setpixel_*bpp - * - * Description: - * 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. - * - ****************************************************************************/ - -struct nxbe_window_s; /* Forward reference. See include/nuttx/nx/nxbe.h */ - -/* For direct access to graphics device memory */ - -void nxgl_setpixel_1bpp(FAR NX_PLANEINFOTYPE *pinfo, - FAR const struct nxgl_point_s *pos, uint8_t color); -void nxgl_setpixel_2bpp(FAR NX_PLANEINFOTYPE *pinfo, - FAR const struct nxgl_point_s *pos, uint8_t color); -void nxgl_setpixel_4bpp(FAR NX_PLANEINFOTYPE *pinfo, - FAR const struct nxgl_point_s *pos, uint8_t color); -void nxgl_setpixel_8bpp(FAR NX_PLANEINFOTYPE *pinfo, - FAR const struct nxgl_point_s *pos, uint8_t color); -void nxgl_setpixel_16bpp(FAR NX_PLANEINFOTYPE *pinfo, - FAR const struct nxgl_point_s *pos, uint16_t color); -void nxgl_setpixel_24bpp(FAR NX_PLANEINFOTYPE *pinfo, - FAR const struct nxgl_point_s *pos, uint32_t color); -void nxgl_setpixel_32bpp(FAR NX_PLANEINFOTYPE *pinfo, - FAR const struct nxgl_point_s *pos, uint32_t color); - -#ifdef CONFIG_NX_RAMBACKED -/* For access to per-window framebuffer memory */ - -void pwfb_setpixel_1bpp(FAR struct nxbe_window_s *bwnd, - FAR const struct nxgl_point_s *pos, uint8_t color); -void pwfb_setpixel_2bpp(FAR struct nxbe_window_s *bwnd, - FAR const struct nxgl_point_s *pos, uint8_t color); -void pwfb_setpixel_4bpp(FAR struct nxbe_window_s *bwnd, - FAR const struct nxgl_point_s *pos, uint8_t color); -void pwfb_setpixel_8bpp(FAR struct nxbe_window_s *bwnd, - FAR const struct nxgl_point_s *pos, uint8_t color); -void pwfb_setpixel_16bpp(FAR struct nxbe_window_s *bwnd, - FAR const struct nxgl_point_s *pos, uint16_t color); -void pwfb_setpixel_24bpp(FAR struct nxbe_window_s *bwnd, - FAR const struct nxgl_point_s *pos, uint32_t color); -void pwfb_setpixel_32bpp(FAR struct nxbe_window_s *bwnd, - FAR const struct nxgl_point_s *pos, uint32_t color); -#endif - -/**************************************************************************** - * Name: nxgl_fillrectangle_*bpp / pwfb_fillrectangle_*bpp - * - * Description: - * Fill a rectangle region in the graphics memory with a fixed color - * - ****************************************************************************/ - -/* For direct access to graphics device memory */ - -void nxgl_fillrectangle_1bpp(FAR NX_PLANEINFOTYPE *pinfo, - FAR const struct nxgl_rect_s *rect, - uint8_t color); -void nxgl_fillrectangle_2bpp(FAR NX_PLANEINFOTYPE *pinfo, - FAR const struct nxgl_rect_s *rect, - uint8_t color); -void nxgl_fillrectangle_4bpp(FAR NX_PLANEINFOTYPE *pinfo, - FAR const struct nxgl_rect_s *rect, - uint8_t color); -void nxgl_fillrectangle_8bpp(FAR NX_PLANEINFOTYPE *pinfo, - FAR const struct nxgl_rect_s *rect, - uint8_t color); -void nxgl_fillrectangle_16bpp(FAR NX_PLANEINFOTYPE *pinfo, - FAR const struct nxgl_rect_s *rect, - uint16_t color); -void nxgl_fillrectangle_24bpp(FAR NX_PLANEINFOTYPE *pinfo, - FAR const struct nxgl_rect_s *rect, - uint32_t color); -void nxgl_fillrectangle_32bpp(FAR NX_PLANEINFOTYPE *pinfo, - FAR const struct nxgl_rect_s *rect, - uint32_t color); - -#ifdef CONFIG_NX_RAMBACKED -/* For access to per-window framebuffer memory */ - -void pwfb_fillrectangle_1bpp(FAR struct nxbe_window_s *bwnd, - FAR const struct nxgl_rect_s *rect, - uint8_t color); -void pwfb_fillrectangle_2bpp(FAR struct nxbe_window_s *bwnd, - FAR const struct nxgl_rect_s *rect, - uint8_t color); -void pwfb_fillrectangle_4bpp(FAR struct nxbe_window_s *bwnd, - FAR const struct nxgl_rect_s *rect, - uint8_t color); -void pwfb_fillrectangle_8bpp(FAR struct nxbe_window_s *bwnd, - FAR const struct nxgl_rect_s *rect, - uint8_t color); -void pwfb_fillrectangle_16bpp(FAR struct nxbe_window_s *bwnd, - FAR const struct nxgl_rect_s *rect, - uint16_t color); -void pwfb_fillrectangle_24bpp(FAR struct nxbe_window_s *bwnd, - FAR const struct nxgl_rect_s *rect, - uint32_t color); -void pwfb_fillrectangle_32bpp(FAR struct nxbe_window_s *bwnd, - FAR const struct nxgl_rect_s *rect, - uint32_t color); -#endif - -/**************************************************************************** - * Name: nxgl_getrectangle_*bpp / pwfb_getrectangle_*bpp - * - * Description: - * Fetch a rectangular region from graphics memory. The source is - * expressed as a rectangle. - * - ****************************************************************************/ - -/* For direct access to graphics device memory */ - -void nxgl_getrectangle_1bpp(FAR NX_PLANEINFOTYPE *pinfo, - FAR const struct nxgl_rect_s *rect, - FAR void *dest, unsigned int deststride); -void nxgl_getrectangle_2bpp(FAR NX_PLANEINFOTYPE *pinfo, - FAR const struct nxgl_rect_s *rect, - FAR void *dest, unsigned int deststride); -void nxgl_getrectangle_4bpp(FAR NX_PLANEINFOTYPE *pinfo, - FAR const struct nxgl_rect_s *rect, - FAR void *dest, unsigned int deststride); -void nxgl_getrectangle_8bpp(FAR NX_PLANEINFOTYPE *pinfo, - FAR const struct nxgl_rect_s *rect, - FAR void *dest, unsigned int deststride); -void nxgl_getrectangle_16bpp(FAR NX_PLANEINFOTYPE *pinfo, - FAR const struct nxgl_rect_s *rect, - FAR void *dest, unsigned int deststride); -void nxgl_getrectangle_24bpp(FAR NX_PLANEINFOTYPE *pinfo, - FAR const struct nxgl_rect_s *rect, - FAR void *dest, unsigned int deststride); -void nxgl_getrectangle_32bpp(FAR NX_PLANEINFOTYPE *pinfo, - FAR const struct nxgl_rect_s *rect, - FAR void *dest, unsigned int deststride); - -#ifdef CONFIG_NX_RAMBACKED -/* For access to per-window framebuffer memory */ - -void pwfb_getrectangle_1bpp(FAR struct nxbe_window_s *bwnd, - FAR const struct nxgl_rect_s *rect, - FAR void *dest, unsigned int deststride); -void pwfb_getrectangle_2bpp(FAR struct nxbe_window_s *bwnd, - FAR const struct nxgl_rect_s *rect, - FAR void *dest, unsigned int deststride); -void pwfb_getrectangle_4bpp(FAR struct nxbe_window_s *bwnd, - FAR const struct nxgl_rect_s *rect, - FAR void *dest, unsigned int deststride); -void pwfb_getrectangle_8bpp(FAR struct nxbe_window_s *bwnd, - FAR const struct nxgl_rect_s *rect, - FAR void *dest, unsigned int deststride); -void pwfb_getrectangle_16bpp(FAR struct nxbe_window_s *bwnd, - FAR const struct nxgl_rect_s *rect, - FAR void *dest, unsigned int deststride); -void pwfb_getrectangle_24bpp(FAR struct nxbe_window_s *bwnd, - FAR const struct nxgl_rect_s *rect, - FAR void *dest, unsigned int deststride); -void pwfb_getrectangle_32bpp(FAR struct nxbe_window_s *bwnd, - FAR const struct nxgl_rect_s *rect, - FAR void *dest, unsigned int deststride); -#endif - -/**************************************************************************** - * Name: nxglib_filltrapezoid_*bpp / pwfb_filltrapezoid_*bpp - * - * Description: - * Fill a trapezoidal region in the graphics memory with a fixed color. - * Clip the trapezoid to lie within a bounding box. This is useful for - * drawing complex shapes that can be broken into a set of trapezoids. - * - ****************************************************************************/ - -/* For direct access to graphics device memory */ - -void nxgl_filltrapezoid_1bpp(FAR NX_PLANEINFOTYPE *pinfo, - FAR const struct nxgl_trapezoid_s *trap, - FAR const struct nxgl_rect_s *bounds, - uint8_t color); -void nxgl_filltrapezoid_2bpp(FAR NX_PLANEINFOTYPE *pinfo, - FAR const struct nxgl_trapezoid_s *trap, - FAR const struct nxgl_rect_s *bounds, - uint8_t color); -void nxgl_filltrapezoid_4bpp(FAR NX_PLANEINFOTYPE *pinfo, - FAR const struct nxgl_trapezoid_s *trap, - FAR const struct nxgl_rect_s *bounds, - uint8_t color); -void nxgl_filltrapezoid_8bpp(FAR NX_PLANEINFOTYPE *pinfo, - FAR const struct nxgl_trapezoid_s *trap, - FAR const struct nxgl_rect_s *bounds, - uint8_t color); -void nxgl_filltrapezoid_16bpp(FAR NX_PLANEINFOTYPE *pinfo, - FAR const struct nxgl_trapezoid_s *trap, - FAR const struct nxgl_rect_s *bounds, - uint16_t color); -void nxgl_filltrapezoid_24bpp(FAR NX_PLANEINFOTYPE *pinfo, - FAR const struct nxgl_trapezoid_s *trap, - FAR const struct nxgl_rect_s *bounds, - uint32_t color); -void nxgl_filltrapezoid_32bpp(FAR NX_PLANEINFOTYPE *pinfo, - FAR const struct nxgl_trapezoid_s *trap, - FAR const struct nxgl_rect_s *bounds, - uint32_t color); - -#ifdef CONFIG_NX_RAMBACKED -/* For access to per-window framebuffer memory */ - -void pwfb_filltrapezoid_1bpp(FAR struct nxbe_window_s *bwnd, - FAR const struct nxgl_trapezoid_s *trap, - FAR const struct nxgl_rect_s *bounds, - uint8_t color); -void pwfb_filltrapezoid_2bpp(FAR struct nxbe_window_s *bwnd, - FAR const struct nxgl_trapezoid_s *trap, - FAR const struct nxgl_rect_s *bounds, - uint8_t color); -void pwfb_filltrapezoid_4bpp(FAR struct nxbe_window_s *bwnd, - FAR const struct nxgl_trapezoid_s *trap, - FAR const struct nxgl_rect_s *bounds, - uint8_t color); -void pwfb_filltrapezoid_8bpp(FAR struct nxbe_window_s *bwnd, - FAR const struct nxgl_trapezoid_s *trap, - FAR const struct nxgl_rect_s *bounds, - uint8_t color); -void pwfb_filltrapezoid_16bpp(FAR struct nxbe_window_s *bwnd, - FAR const struct nxgl_trapezoid_s *trap, - FAR const struct nxgl_rect_s *bounds, - uint16_t color); -void pwfb_filltrapezoid_24bpp(FAR struct nxbe_window_s *bwnd, - FAR const struct nxgl_trapezoid_s *trap, - FAR const struct nxgl_rect_s *bounds, - uint32_t color); -void pwfb_filltrapezoid_32bpp(FAR struct nxbe_window_s *bwnd, - FAR const struct nxgl_trapezoid_s *trap, - FAR const struct nxgl_rect_s *bounds, - uint32_t color); -#endif - -/**************************************************************************** - * Name: nxgl_moverectangle_*bpp / pwfb_moverectangle_*bpp - * - * Description: - * Move a rectangular region from location to another in the - * framebuffer/LCD memory. The source is expressed as a rectangle; the - * destination position is expressed as a point corresponding to the - * translation of the upper, left-hand corner. - * - ****************************************************************************/ - -/* For direct access to graphics device memory */ - -void nxgl_moverectangle_1bpp(FAR NX_PLANEINFOTYPE *pinfo, - FAR const struct nxgl_rect_s *rect, - FAR struct nxgl_point_s *offset); -void nxgl_moverectangle_2bpp(FAR NX_PLANEINFOTYPE *pinfo, - FAR const struct nxgl_rect_s *rect, - FAR struct nxgl_point_s *offset); -void nxgl_moverectangle_4bpp(FAR NX_PLANEINFOTYPE *pinfo, - FAR const struct nxgl_rect_s *rect, - FAR struct nxgl_point_s *offset); -void nxgl_moverectangle_8bpp(FAR NX_PLANEINFOTYPE *pinfo, - FAR const struct nxgl_rect_s *rect, - FAR struct nxgl_point_s *offset); -void nxgl_moverectangle_16bpp(FAR NX_PLANEINFOTYPE *pinfo, - FAR const struct nxgl_rect_s *rect, - FAR struct nxgl_point_s *offset); -void nxgl_moverectangle_24bpp(FAR NX_PLANEINFOTYPE *pinfo, - FAR const struct nxgl_rect_s *rect, - FAR struct nxgl_point_s *offset); -void nxgl_moverectangle_32bpp(FAR NX_PLANEINFOTYPE *pinfo, - FAR const struct nxgl_rect_s *rect, - FAR struct nxgl_point_s *offset); - -#ifdef CONFIG_NX_RAMBACKED -/* For access to per-window framebuffer memory */ - -void pwfb_moverectangle_1bpp(FAR struct nxbe_window_s *bwnd, - FAR const struct nxgl_rect_s *rect, - FAR struct nxgl_point_s *offset); -void pwfb_moverectangle_2bpp(FAR struct nxbe_window_s *bwnd, - FAR const struct nxgl_rect_s *rect, - FAR struct nxgl_point_s *offset); -void pwfb_moverectangle_4bpp(FAR struct nxbe_window_s *bwnd, - FAR const struct nxgl_rect_s *rect, - FAR struct nxgl_point_s *offset); -void pwfb_moverectangle_8bpp(FAR struct nxbe_window_s *bwnd, - FAR const struct nxgl_rect_s *rect, - FAR struct nxgl_point_s *offset); -void pwfb_moverectangle_16bpp(FAR struct nxbe_window_s *bwnd, - FAR const struct nxgl_rect_s *rect, - FAR struct nxgl_point_s *offset); -void pwfb_moverectangle_24bpp(FAR struct nxbe_window_s *bwnd, - FAR const struct nxgl_rect_s *rect, - FAR struct nxgl_point_s *offset); -void pwfb_moverectangle_32bpp(FAR struct nxbe_window_s *bwnd, - FAR const struct nxgl_rect_s *rect, - FAR struct nxgl_point_s *offset); -#endif - -/**************************************************************************** - * Name: nxgl_copyrectangle_*bpp / pwfb_copyrectangle_*bpp - * - * Description: - * Copy a rectangular bitmap image into the specific position in the - * graphics memory. - * - ****************************************************************************/ - -/* For direct access to graphics device memory */ - -void nxgl_copyrectangle_1bpp(FAR NX_PLANEINFOTYPE *pinfo, - FAR const struct nxgl_rect_s *dest, - FAR const void *src, - FAR const struct nxgl_point_s *origin, - unsigned int srcstride); -void nxgl_copyrectangle_2bpp(FAR NX_PLANEINFOTYPE *pinfo, - FAR const struct nxgl_rect_s *dest, - FAR const void *src, - FAR const struct nxgl_point_s *origin, - unsigned int srcstride); -void nxgl_copyrectangle_4bpp(FAR NX_PLANEINFOTYPE *pinfo, - FAR const struct nxgl_rect_s *dest, - FAR const void *src, - FAR const struct nxgl_point_s *origin, - unsigned int srcstride); -void nxgl_copyrectangle_8bpp(FAR NX_PLANEINFOTYPE *pinfo, - FAR const struct nxgl_rect_s *dest, - FAR const void *src, - FAR const struct nxgl_point_s *origin, - unsigned int srcstride); -void nxgl_copyrectangle_16bpp(FAR NX_PLANEINFOTYPE *pinfo, - FAR const struct nxgl_rect_s *dest, - FAR const void *src, - FAR const struct nxgl_point_s *origin, - unsigned int srcstride); -void nxgl_copyrectangle_24bpp(FAR NX_PLANEINFOTYPE *pinfo, - FAR const struct nxgl_rect_s *dest, - FAR const void *src, - FAR const struct nxgl_point_s *origin, - unsigned int srcstride); -void nxgl_copyrectangle_32bpp(FAR NX_PLANEINFOTYPE *pinfo, - FAR const struct nxgl_rect_s *dest, - FAR const void *src, - FAR const struct nxgl_point_s *origin, - unsigned int srcstride); - -#ifdef CONFIG_NX_RAMBACKED -/* For access to per-window framebuffer memory */ - -void pwfb_copyrectangle_1bpp(FAR struct nxbe_window_s *bwnd, - FAR const struct nxgl_rect_s *dest, - FAR const void *src, - FAR const struct nxgl_point_s *origin, - unsigned int srcstride); -void pwfb_copyrectangle_2bpp(FAR struct nxbe_window_s *bwnd, - FAR const struct nxgl_rect_s *dest, - FAR const void *src, - FAR const struct nxgl_point_s *origin, - unsigned int srcstride); -void pwfb_copyrectangle_4bpp(FAR struct nxbe_window_s *bwnd, - FAR const struct nxgl_rect_s *dest, - FAR const void *src, - FAR const struct nxgl_point_s *origin, - unsigned int srcstride); -void pwfb_copyrectangle_8bpp(FAR struct nxbe_window_s *bwnd, - FAR const struct nxgl_rect_s *dest, - FAR const void *src, - FAR const struct nxgl_point_s *origin, - unsigned int srcstride); -void pwfb_copyrectangle_16bpp(FAR struct nxbe_window_s *bwnd, - FAR const struct nxgl_rect_s *dest, - FAR const void *src, - FAR const struct nxgl_point_s *origin, - unsigned int srcstride); -void pwfb_copyrectangle_24bpp(FAR struct nxbe_window_s *bwnd, - FAR const struct nxgl_rect_s *dest, - FAR const void *src, - FAR const struct nxgl_point_s *origin, - unsigned int srcstride); -void pwfb_copyrectangle_32bpp(FAR struct nxbe_window_s *bwnd, - FAR const struct nxgl_rect_s *dest, - FAR const void *src, - FAR const struct nxgl_point_s *origin, - unsigned int srcstride); -#endif +/* Geometry utilities *******************************************************/ /**************************************************************************** * Name: nxgl_rectcopy