image/svg+xml
Brteve's API for EveApps
Version 0.0.1
The reference document for common folder of EveApps project.
 
Loading...
Searching...
No Matches
Image.h File Reference

Image helper functions. More...

Go to the source code of this file.

Data Structures

struct  Img
 

Typedefs

typedef struct Img Img_t
 

Functions

int Image_Setup_Rotate (float angle, uint32_t rootx, uint32_t rooty)
 
int Image_Draw (EVE_HalContext *phost, Img_t *image)
 
int Image_Draw_From_RAM_G (EVE_HalContext *phost, uint32_t address, uint32_t x, uint32_t y, uint32_t w, uint32_t h, uint16_t bitmapLayout, uint32_t extFormat, uint8_t tag)
 
int Image_Draw_From_Flash (EVE_HalContext *phost, uint32_t address, uint32_t x, uint32_t y, uint32_t w, uint32_t h, uint16_t bitmapLayout, uint32_t extFormat, uint8_t tag)
 
int Image_Copy_To_RamG_And_Draw_Image (EVE_HalContext *phost, Img_t *image, uint32_t isRestart)
 
int Image_Copy_To_RamG (EVE_HalContext *phost, Img_t *image, uint32_t isRestart)
 

Detailed Description

Image helper functions.

Author
Tuan Nguyen tuan..nosp@m.nguy.nosp@m.en@br.nosp@m.tchi.nosp@m.p.com
Date
2019

MIT License

Copyright (c) [2019] [Bridgetek Pte Ltd (BRTChip)]

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Definition in file Image.h.

Typedef Documentation

◆ Img_t

typedef struct Img Img_t

Function Documentation

◆ Image_Copy_To_RamG()

int Image_Copy_To_RamG ( EVE_HalContext phost,
Img_t image,
uint32_t  isRestart 
)

Definition at line 180 of file Image.c.

180 {
181 static uint32_t ramgAddr = RAM_G;
182
183 if (isRestart == 1) {
184 ramgAddr = 0;
185 }
186
187 image->isFlash = 0;
188 image->addressRamg = ramgAddr;
189
190 EVE_CoCmd_flashRead(phost, ramgAddr, image->addressFlash, image->size);
191
192 ramgAddr += image->size;
193
194 return 1;
195}
static void EVE_CoCmd_flashRead(EVE_HalContext *phost, uint32_t dest, uint32_t src, uint32_t num)
Read from Flash to RAM_G. Call EVE_Cmd_waitFlush to wait for completion.
Definition EVE_CoCmd.h:679
#define RAM_G
Definition EVE_GpuDefs.h:77
unsigned int uint32_t
uint8_t isFlash
Definition Image.h:47
uint32_t size
Definition Image.h:39
uint32_t addressFlash
Definition Image.h:37
uint32_t addressRamg
Definition Image.h:38

◆ Image_Copy_To_RamG_And_Draw_Image()

int Image_Copy_To_RamG_And_Draw_Image ( EVE_HalContext phost,
Img_t image,
uint32_t  isRestart 
)

Definition at line 197 of file Image.c.

197 {
198 static uint32_t ramgAddr = RAM_G;
199
200 if (isRestart == 1) {
201 ramgAddr = 0;
202 }
203
204 image->isFlash = 0;
205 image->addressRamg = ramgAddr;
206
207 EVE_CoCmd_flashRead(phost, ramgAddr, image->addressFlash, image->size);
208 Image_Draw(phost, image);
209
210 ramgAddr += image->size;
211
212 return 1;
213}
int Image_Draw(EVE_HalContext *phost, Img_t *image)
Definition Image.c:215

◆ Image_Draw()

int Image_Draw ( EVE_HalContext phost,
Img_t image 
)

Definition at line 215 of file Image.c.

215 {
217 setupBitmap(phost, image);
218 if (misRotate) {
219 rotateBitmap(phost, image);
220 misRotate = 0;
221 }
222 drawBitmap(phost, image);
223
225
226 return 1;
227}
#define SAVE_CONTEXT()
#define RESTORE_CONTEXT()
#define App_WrCoCmd_Buffer(phost, cmd)
Definition Gpu_Hal.h:437
static void setupBitmap(EVE_HalContext *phost, Img_t *image)
Definition Image.c:101
static int misRotate
Definition Image.c:43
static void rotateBitmap(EVE_HalContext *phost, Img_t *image)
Definition Image.c:138
static void drawBitmap(EVE_HalContext *phost, Img_t *image)
Definition Image.c:161

◆ Image_Draw_From_Flash()

int Image_Draw_From_Flash ( EVE_HalContext phost,
uint32_t  address,
uint32_t  x,
uint32_t  y,
uint32_t  w,
uint32_t  h,
uint16_t  bitmapLayout,
uint32_t  extFormat,
uint8_t  tag 
)

Definition at line 244 of file Image.c.

245 {
246 Img_t image;
247 image.isFlash = 1;
248 image.addressFlash = address;
249 image.bitmapLayout = bitmapLayout;
250 image.extFormat = extFormat;
251 image.x = x;
252 image.y = y;
253 image.w = w;
254 image.h = h;
255 image.index = 0;
256 image.tag = tag;
257 return Image_Draw(phost, &image);
258}
Definition Image.h:35
uint32_t w
Definition Image.h:42
uint16_t extFormat
Definition Image.h:45
uint16_t bitmapLayout
Definition Image.h:44
uint8_t tag
Definition Image.h:46
uint32_t x
Definition Image.h:40
uint32_t index
Definition Image.h:36
uint32_t h
Definition Image.h:43
uint32_t y
Definition Image.h:41

◆ Image_Draw_From_RAM_G()

int Image_Draw_From_RAM_G ( EVE_HalContext phost,
uint32_t  address,
uint32_t  x,
uint32_t  y,
uint32_t  w,
uint32_t  h,
uint16_t  bitmapLayout,
uint32_t  extFormat,
uint8_t  tag 
)

Definition at line 229 of file Image.c.

230 {
231 Img_t image;
232 image.isFlash = 0;
233 image.addressRamg = address;
234 image.bitmapLayout = bitmapLayout;
235 image.extFormat = extFormat;
236 image.x = x;
237 image.y = y;
238 image.h = h;
239 image.w = w;
240 image.index = 0;
241 image.tag = tag;
242 return Image_Draw(phost, &image);
243}

◆ Image_Setup_Rotate()

int Image_Setup_Rotate ( float  angle,
uint32_t  rootx,
uint32_t  rooty 
)

Definition at line 171 of file Image.c.

171 {
172 misRotate = 1;
173 mangle = angle;
174 mrootx = rootx;
175 mrooty = rooty;
176
177 return 1;
178}
static uint32_t mrooty
Definition Image.c:42
static uint32_t mrootx
Definition Image.c:41
static float mangle
Status stores.
Definition Image.c:40