SAMV71 Xplained Ultra Software Package 1.5

lcd_draw.h

Go to the documentation of this file.
00001 /* ---------------------------------------------------------------------------- */
00002 /*                  Atmel Microcontroller Software Support                      */
00003 /*                       SAM Software Package License                           */
00004 /* ---------------------------------------------------------------------------- */
00005 /* Copyright (c) 2015, Atmel Corporation                                        */
00006 /*                                                                              */
00007 /* All rights reserved.                                                         */
00008 /*                                                                              */
00009 /* Redistribution and use in source and binary forms, with or without           */
00010 /* modification, are permitted provided that the following condition is met:    */
00011 /*                                                                              */
00012 /* - Redistributions of source code must retain the above copyright notice,     */
00013 /* this list of conditions and the disclaimer below.                            */
00014 /*                                                                              */
00015 /* Atmel's name may not be used to endorse or promote products derived from     */
00016 /* this software without specific prior written permission.                     */
00017 /*                                                                              */
00018 /* DISCLAIMER:  THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR   */
00019 /* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */
00020 /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE   */
00021 /* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT,      */
00022 /* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */
00023 /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,  */
00024 /* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF    */
00025 /* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING         */
00026 /* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */
00027 /* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.                           */
00028 /* ---------------------------------------------------------------------------- */
00029 
00030 /**
00031  * \file
00032  *
00033  * Interface for draw function on LCD.
00034  *
00035  */
00036 
00037 #ifndef DRAW_H
00038 #define DRAW_H
00039 
00040 /*----------------------------------------------------------------------------
00041  *        Headers
00042  *----------------------------------------------------------------------------*/
00043 #include "board.h"
00044 #include <stdint.h>
00045 #include "lcd_gimp_image.h"
00046 
00047 /*----------------------------------------------------------------------------
00048  *        Definitions
00049  *----------------------------------------------------------------------------*/
00050 
00051 /** Horizontal direction line definition */
00052 #define DIRECTION_HLINE   0
00053 /** Vertical direction line definition */
00054 #define DIRECTION_VLINE   1
00055 
00056 typedef struct _rect {
00057     uint32_t x;
00058     uint32_t y;
00059     uint32_t width;
00060     uint32_t height;
00061 } rect;
00062 
00063 COMPILER_PACK_SET(1)
00064 typedef struct _rgb {
00065     uint8_t b;
00066     uint8_t g;
00067     uint8_t r;
00068 } sBGR;
00069 COMPILER_PACK_RESET()
00070 
00071 /*----------------------------------------------------------------------------
00072  *        Exported functions
00073  *----------------------------------------------------------------------------*/
00074 extern void LCDD_SetUpdateWindowSize(rect rc);
00075 
00076 extern void LCDD_UpdateWindow(void);
00077 
00078 extern void LCDD_UpdatePartialWindow(uint8_t *pbuf, uint32_t size);
00079 
00080 extern void LCDD_DrawRectangleWithFill(
00081         uint16_t *pbuf,
00082         uint32_t dwX,
00083         uint32_t dwY,
00084         uint32_t dwWidth,
00085         uint32_t dwHeight,
00086         uint32_t dwColor);
00087 
00088 extern uint32_t LCDD_DrawCircle(
00089         uint16_t *pbuf,
00090         uint32_t x,
00091         uint32_t y,
00092         uint32_t r,
00093         uint32_t color);
00094 
00095 extern uint32_t LCD_DrawFilledCircle(
00096         uint16_t *pbuf,
00097         uint32_t dwX,
00098         uint32_t dwY,
00099         uint32_t dwRadius,
00100         uint32_t color);
00101 
00102 extern void LCDD_DrawString(
00103         uint16_t *pbuf,
00104         uint32_t x,
00105         uint32_t y,
00106         const uint8_t *pString,
00107         uint32_t color);
00108 
00109 extern void LCDD_GetStringSize(
00110         const uint8_t *pString,
00111         uint32_t *pWidth,
00112         uint32_t *pHeight);
00113 
00114 extern void LCDD_BitBlt(
00115         uint16_t *pbuf,
00116         uint32_t dst_x,
00117         uint32_t dst_y,
00118         uint32_t dst_w,
00119         uint32_t dst_h,
00120         const LcdColor_t *src,
00121         uint32_t src_x,
00122         uint32_t src_y,
00123         uint32_t src_w,
00124         uint32_t src_h);
00125 
00126 extern void LCDD_BitBltAlphaBlend(uint16_t *pbuf,
00127                                   uint32_t dst_x,
00128                                   uint32_t dst_y,
00129                                   uint32_t dst_w,
00130                                   uint32_t dst_h,
00131                                   const LcdColor_t *src,
00132                                   uint32_t src_x,
00133                                   uint32_t src_y,
00134                                   uint32_t src_w,
00135                                   uint32_t src_h,
00136                                   uint32_t alpha);
00137 extern void LCDD_DrawImage(
00138     uint16_t *pbuf,
00139     uint32_t dwX,
00140     uint32_t dwY,
00141     const LcdColor_t *pImage,
00142     uint32_t dwWidth,
00143     uint32_t dwHeight);
00144 
00145 extern void LCDD_DrawPixel(
00146     uint16_t *pbuf,
00147     uint32_t x,
00148     uint32_t y,
00149     uint32_t color);
00150 
00151 extern void LCDD_DrawLine(
00152     uint16_t *pbuf,
00153     uint32_t dwX1,
00154     uint32_t dwY1,
00155     uint32_t dwX2,
00156     uint32_t dwY2,
00157     uint32_t color);
00158 
00159 extern uint32_t LCDD_DrawLineBresenham(
00160     uint16_t *pbuf,
00161     uint32_t dwX1,
00162     uint32_t dwY1,
00163     uint32_t dwX2,
00164     uint32_t dwY2,
00165     uint32_t color);
00166 
00167 extern void LCDD_DrawRectangle(
00168     uint16_t *pbuf,
00169     uint32_t x,
00170     uint32_t y,
00171     uint32_t width,
00172     uint32_t height,
00173     uint32_t color);
00174 
00175 extern void LCDD_SetCavasBuffer(
00176     void *pBuffer,
00177     uint32_t wBufferSize);
00178 
00179 extern void LCDD_DrawStraightLine(
00180     uint16_t *pbuf,
00181     uint32_t dwX1,
00182     uint32_t dwY1,
00183     uint32_t dwX2,
00184     uint32_t dwY2 ,
00185     uint32_t color);
00186 #endif /* #ifndef DRAW_H */
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines