cauqleuir madre

Dependencies:   SDFileSystem mbed TFTLCD

Revision:
57:ed9db2bcd1bf
Parent:
56:51410b4b1078
diff -r 51410b4b1078 -r ed9db2bcd1bf imaginator.cpp
--- a/imaginator.cpp	Sat Feb 02 18:54:33 2013 +0000
+++ b/imaginator.cpp	Sat Feb 02 20:03:24 2013 +0000
@@ -17,7 +17,7 @@
     *offset=*offset+bytes;
     fread((char*)buffer,1,bytes,fp);
     fclose(fp); 
-     
+     return;
 }
 void colorCompute(unsigned char*buffer, int* colorBuffer,int sizeOfBuffer)
 {
@@ -27,9 +27,41 @@
         colorBuffer[j]=RGB((buffer[i+2]),(buffer[i+1]),(buffer[i]));
         j++;
     }
+    return;
 }
 void pickUpLine(unsigned char*buffer, int* colorBuffer,int sizeOfBuffer,int sizeOfLine,const char *path, unsigned int *absPtr)
 {
     superSd(buffer,absPtr,sizeOfBuffer,path);
     colorCompute(buffer,colorBuffer,sizeOfBuffer);
+    return;
+}
+void drawLine(int* color,int y)
+{
+    HX8340S_LCD lcd(p9, p14, p13, p11);
+    DigitalOut scr(p9);
+    scr=0;
+    int k=0;
+    for(int j=y;j<(16+y);j++)
+    {    
+        for(int i=0;i<220;i++)
+        {
+            lcd.DrawPixel(i,j,color[k]);
+            k++;
+        }
+    }
+    scr=1;
+    return;
+}
+void bmpFromSDToScreen(const char* path)
+{
+    unsigned char rawbytes[14080];
+    int color[3520];
+    unsigned int absPtr=54;
+    superDisplay();
+    for(int i=0;i<176;i=i+16)
+    {
+        pickUpLine(rawbytes,color,14080,3520,path,&absPtr);
+        drawLine(color,i);
+    }
+    return;
 }
\ No newline at end of file