-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added support for working with arrays and improved boundary checking
- Loading branch information
Showing
5 changed files
with
301 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
# SpeeduinoGL | ||
A work in progress library with basic graphical functions optimised for arm cortex m7. Tested on GIGA R1, with rasterization writing to registers between two lines, and basic shapes (triangles, circles and quadrilaterals).Support for processing arrays instead of pixels one by one is in progress. | ||
A work in progress library with graphical functions optimised for arm cortex m7. Tested on GIGA R1, with rasterization writing to registers between two lines, and basic shapes (triangles, circles and quadrilaterals), but also transfer of one image to another with zoom shift and rotate transformations. Support for better examples, documentation, a whole display function fill and small changes to drawing function are in progress. The camera trasnfer takes about 30ms at 5x zoom, and while its slower at lower zoomes than each display pixel reading a camera ones, it progressively gets faster. |
76 changes: 76 additions & 0 deletions
76
examples/CameraToDisplaySquares/CameraToDisplaySquares.ino
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
#include <algorithm> | ||
#include "SpeeduinoGL.h" | ||
#include "arducam_dvp.h" | ||
#include "Arduino_H7_Video.h" | ||
#include "dsi.h" | ||
#include "SDRAM.h" | ||
|
||
|
||
float ShiftH = -100; | ||
float ShiftV = -400; | ||
float zoom = 5; | ||
float rotationRad = 0.3; | ||
|
||
|
||
|
||
|
||
Rectangle sq1 = { | ||
{ 0, 0 }, | ||
{ 0, 480 }, | ||
{ 800, 0 }, | ||
{ 800, 480 } | ||
}; | ||
|
||
uint16_t* DisplayFrameBuffer = (uint16_t*)SDRAM_START_ADDRESS; | ||
FrameBuffer fb(1613300736); | ||
|
||
#include "OV7670/ov767x.h" | ||
// OV7670 ov767x; | ||
OV7675 ov767x; | ||
Camera cam(ov767x); | ||
#define IMAGE_MODE CAMERA_RGB565 | ||
|
||
Arduino_H7_Video Display(800, 480, GigaDisplayShield); | ||
|
||
|
||
|
||
void setup() { | ||
// put your setup code here, to run once: | ||
|
||
if (!cam.begin(CAMERA_R320x240, IMAGE_MODE, 30)) { | ||
} | ||
SDRAM.begin(); | ||
Display.begin(); | ||
|
||
|
||
|
||
dsi_lcdClear(0); | ||
dsi_drawCurrentFrameBuffer(); | ||
dsi_lcdClear(0); | ||
dsi_drawCurrentFrameBuffer(); | ||
|
||
|
||
FillRectangle(sq1, 0xFF00); | ||
|
||
|
||
} | ||
|
||
void loop() { | ||
// put your main code here, to run repeatedly: | ||
|
||
cam.grabFrame(fb, 3000); | ||
|
||
long t1 = micros(); | ||
|
||
TransferSquares(ShiftH, ShiftV, zoom, rotationRad); | ||
|
||
|
||
Serial.println(micros() - t1); | ||
|
||
dsi_lcdDrawImage((void *)DisplayFrameBuffer, (void *)dsi_getCurrentFrameBuffer(), 480, 800, DMA2D_INPUT_RGB565); | ||
dsi_drawCurrentFrameBuffer(); | ||
|
||
} | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
name=SpeeduinoGL | ||
version=0.0.2 | ||
version=0.0.4 | ||
author=Benjamin Gombala | ||
maintainer=Benjamin Gombala [email protected] Bexin | ||
sentence=A library with basic graphical functions optimised for arm cortex m7. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters