We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hey guys! I've made a Program that basically emulates a 256x192 (monochrome)screen in processing. The byte-array, in which i store the pixel-data, has 6kb. (8pixel per byte, to a total of 6144bytes). 1 drawing cycle of the screen (if every pixel is a 1==white) takes the Program around 6 seconds.
So my question is, is there a faster way of drawing a byte to the screen than my approach?
Code of the drawing "algorithm":
for (int I=0; I<6144; I++){
int x,y = I/32;
for(int X=0; X<32; X++) {
x = X*8;
// checks if the bit is == 1 and then draws the point
if ( (DataIn[I] & 0x01) > 0) point(x,y);
if ( (DataIn[I] & 0x02) > 0) point(x+1,y);
if ( (DataIn[I] & 0x04) > 0) point(x+2,y);
if ( (DataIn[I] & 0x08) > 0) point(x+3,y);
if ( (DataIn[I] & 0x10) > 0) point(x+4,y);
if ( (DataIn[I] & 0x20) > 0) point(x+5,y);
if ( (DataIn[I] & 0x40) > 0) point(x+6,y);
if ( (DataIn[I] & 0x80) > 0) point(x+7,y);
}
}
also sorry about my bad english
Answers
using pixels[] instead of point?
thanks alot! the whole display takes now ~2ms to render
glad you got it to work but i made a big error in my previous code