From 5c3fcf63da350cbc5511d44c5e8226829c38f666 Mon Sep 17 00:00:00 2001
From: Vladislav Vlasuk <vladislav.vlasuk@th-koeln.de>
Date: Thu, 8 Dec 2022 17:37:28 +0100
Subject: [PATCH] lesbarkeit

---
 camera_boards.h            |  4 ++--
 examples/stream/stream.ino | 14 +++++++-------
 thk_EspCamDriver.cpp       |  3 +++
 3 files changed, 12 insertions(+), 9 deletions(-)

diff --git a/camera_boards.h b/camera_boards.h
index d5ec674..67a63fa 100644
--- a/camera_boards.h
+++ b/camera_boards.h
@@ -5,8 +5,8 @@
 #include "esp_camera.h"
 // Bitte um eigenes Board erweitern (falls nicht schon vorhanden!)
 // Unterstützte Boards:
-//      * Waveshare ESP32ONE
-//      *
+//      * waveshare_esp32_one
+//      * m5stackv2_psram_esp32
 //      *
 //      *
 
diff --git a/examples/stream/stream.ino b/examples/stream/stream.ino
index 08b2595..c86ea5b 100644
--- a/examples/stream/stream.ino
+++ b/examples/stream/stream.ino
@@ -8,7 +8,7 @@ thk_EspCamDriver camera(waveshare_esp32_one,    // #1 ESP32 Board (verfügbare B
                         FRAMESIZE_96X96,        // #2 Auflösung (siehe camera_boards.h)
                         PIXFORMAT_GRAYSCALE,    // #3 Bildformat (siehe camera_boards.h)
                         &image);                // #4 esp_image_t objekt, wo das Bild gesichert wird
-
+// PIXFORMAT_GRAYSCALE ermöglicht nur FRAMESIZE_96X96 oder FRAMESIZE_240X240
 void setup()
 {
     Serial.begin(115200);
@@ -21,12 +21,12 @@ void loop()
 {
     // Bild auslesen
     camera.take_picture(&image);
-    Serial.println(image.width);
-    Serial.println(image.height);
-    for(int pixel = 0; pixel < (image.width*image.height);pixel++){
-        Serial.print(image.buf[pixel]);
-        if(pixel%100 == 0)Serial.println(" ");
-    }
+    Serial.printf("width %i, height: %i, len:%i\n",image.width,image.height,image.width*image.height);
+    Serial.println("image buffer >>\n");
+    /*for(int pixel = 0; pixel < (image.width*image.height);pixel++){
+        Serial.print(image.buf[pixel]);Serial.print(" ");
+        if((pixel+1)%50 == 0)Serial.println(" !! ");
+    }*/
     // Speicher freigeben
     camera.free_buffer(&image);
 
diff --git a/thk_EspCamDriver.cpp b/thk_EspCamDriver.cpp
index 3ab6a8a..7e43d48 100644
--- a/thk_EspCamDriver.cpp
+++ b/thk_EspCamDriver.cpp
@@ -1,6 +1,8 @@
 #include "Arduino.h"
 #include "thk_EspCamDriver.h"
 
+enum resformat {f_96x96_grayscale, f_240x240_grayscale};
+
 thk_EspCamDriver::thk_EspCamDriver(espboard_t board, esp_image_t *img)
     : image(img), board(board)
 {
@@ -19,6 +21,7 @@ thk_EspCamDriver::thk_EspCamDriver(espboard_t board, framesize_t s, pixformat_t
   set_pixelformat(f);
 };
 
+
 // Erzeugt eine Konfiguration basierend auf Klassenattributen
 // Muss vor dem Auslesen der Kamera erfolgen!
 void thk_EspCamDriver::create_config()
-- 
GitLab