From b6211d4839debbdfd31128a92381f36c4fdae23c Mon Sep 17 00:00:00 2001
From: Vipin Thomas <vipin.thomas@stud.th-deg.de>
Date: Sat, 5 Jun 2021 12:30:56 +0000
Subject: [PATCH] Update pixel.cpp

---
 pixel.cpp | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/pixel.cpp b/pixel.cpp
index 3f61c96..53c8a24 100644
--- a/pixel.cpp
+++ b/pixel.cpp
@@ -7,6 +7,9 @@ using namespace std;
 typedef ap_axis<32,0,0,0> pkt_t;
 static int count_streams = 0;
 
+int toAscii(int number) {
+   return '0' + number;
+}
 
 void pixel(
 		ap_int<32> position1,
@@ -26,9 +29,8 @@ void pixel(
 
 	pkt_t pkt=din.read();
 
-	
-	if((position1+3*count_streams*w) < position2 || (position2-3*count_streams*w) > position1){
-		pkt.data -= 1;
+	if(count_streams > 3 * (position - 1) && count_streams < 3 * (position2)){
+		pkt.data=toAscii(pkt.data)
 	}
 	
 	count_streams++;
@@ -38,9 +40,11 @@ void pixel(
 	}
 
 	// pending: have to make count=0 when TLAST signal is active -  for w not in the range of 0 to n(size of the array)
-
+	//(count_streams==(position1+3*count_streams*w))&&((position1+3*count_streams*w) < position2) || (count_streams2==(position1
+	//+3*count_streams*w)) && ((position2-3*count_streams*w) > position1)
 
 	dout.write(pkt);
 
 }
 
+
-- 
GitLab