Add more trapezoid support

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1324 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo 2008-11-28 13:57:20 +00:00
parent 5638ac274f
commit 604c94dce8
5 changed files with 214 additions and 1 deletions

View File

@ -286,6 +286,26 @@ EXTERN void nxbe_fill(FAR struct nxbe_window_s *wnd,
FAR const struct nxgl_rect_s *rect,
nxgl_mxpixel_t color[CONFIG_NX_NPLANES]);
/****************************************************************************
* Name: nxbe_filltrapezoid
*
* Description:
* Fill the specified rectangle in the window with the specified color
*
* Input Parameters:
* wnd - The window structure reference
* rect - The location to be filled
* col - The color to use in the fill
*
* Return:
* None
*
****************************************************************************/
EXTERN void nxbe_filltrapezoid(FAR struct nxbe_window_s *wnd,
FAR const struct nxgl_trapezoid_s *trap,
nxgl_mxpixel_t color[CONFIG_NX_NPLANES]);
/****************************************************************************
* Name: nxbe_move
*

View File

@ -54,7 +54,8 @@ RCOPY2_CSRCS = nxglib_copyrectangle_8bpp.c nxglib_copyrectangle_16bpp.c \
RECT_CSRCS = nxglib_rectcopy.c nxglib_rectoffset.c nxglib_vectoradd.c \
nxglib_rectintersect.c nxglib_nonintersecting.c \
nxglib_rectoverlap.c nxglib_nullrect.c
TRAP_CSRCS = nxglib_runoffset.c nxglib_trapoffset.c
TRAP_CSRCS = nxglib_runoffset.c nxglib_runcopy.c \
nxglib_trapoffset.c nxglib_trapcopy.c
NXGLIB_CSRCS = nxglib_rgb2yuv.c nxglib_yuv2rgb.c \
$(RFILL1_CSRCS) $(RFILL2_CSRCS) $(TFILL1_CSRCS) $(TFILL2_CSRCS) \
$(RMOVE1_CSRCS) $(RMOVE2_CSRCS) $(RCOPY1_CSRCS) $(RCOPY2_CSRCS) \

View File

@ -0,0 +1,84 @@
/****************************************************************************
* graphics/nxglib/nxsglib_runcopy.c
*
* Copyright (C) 2008 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* 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.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
#include <nuttx/fb.h>
#include <nuttx/nxglib.h>
/****************************************************************************
* Pre-Processor Definitions
****************************************************************************/
/****************************************************************************
* Private Types
****************************************************************************/
/****************************************************************************
* Private Data
****************************************************************************/
/****************************************************************************
* Public Data
****************************************************************************/
/****************************************************************************
* Private Functions
****************************************************************************/
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: nxgl_runcopy
*
* Description:
* This is essentially memcpy for runs. We don't do structure assignments
* because some compilers are not good at that.
*
****************************************************************************/
void nxgl_runcopy(FAR struct nxgl_run_s *dest, FAR const struct nxgl_run_s *src)
{
dest->x1 = src->x1;
dest->x2 = src->x2;
dest->y = src->y;
}

View File

@ -0,0 +1,84 @@
/****************************************************************************
* graphics/nxglib/nxsglib_trapcopy.c
*
* Copyright (C) 2008 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* 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.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
#include <nuttx/fb.h>
#include <nuttx/nxglib.h>
/****************************************************************************
* Pre-Processor Definitions
****************************************************************************/
/****************************************************************************
* Private Types
****************************************************************************/
/****************************************************************************
* Private Data
****************************************************************************/
/****************************************************************************
* Public Data
****************************************************************************/
/****************************************************************************
* Private Functions
****************************************************************************/
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: nxgl_trapcopy
*
* Description:
* This is essentially memcpy for trapezoids. We don't do structure
* assignments because some compilers are not good at that.
*
****************************************************************************/
void nxgl_trapcopy(FAR struct nxgl_trapezoid_s *dest,
FAR const struct nxgl_trapezoid_s *src)
{
nxgl_runcopy(&dest->top, &src->top);
nxgl_runcopy(&dest->bot, &src->bot);
}

View File

@ -410,6 +410,18 @@ EXTERN void nxgl_runoffset(FAR struct nxgl_run_s *dest,
FAR const struct nxgl_run_s *src,
nxgl_coord_t dx, nxgl_coord_t dy);
/****************************************************************************
* Name: nxgl_runcopy
*
* Description:
* This is essentially memcpy for runs. We don't do structure assignments
* because some compilers are not good at that.
*
****************************************************************************/
EXTERN void nxgl_runcopy(FAR struct nxgl_run_s *dest,
FAR const struct nxgl_run_s *src);
/****************************************************************************
* Name: nxgl_trapoffset
*
@ -422,6 +434,18 @@ EXTERN void nxgl_trapoffset(FAR struct nxgl_trapezoid_s *dest,
FAR const struct nxgl_trapezoid_s *src,
nxgl_coord_t dx, nxgl_coord_t dy);
/****************************************************************************
* Name: nxgl_trapcopy
*
* Description:
* This is essentially memcpy for trapezoids. We don't do structure
* assignments because some compilers are not good at that.
*
****************************************************************************/
EXTERN void nxgl_trapcopy(FAR struct nxgl_trapezoid_s *dest,
FAR const struct nxgl_trapezoid_s *src);
#undef EXTERN
#if defined(__cplusplus)
}