honey_the_codewitch

gfx sample

Dec 2nd, 2022
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.04 KB | None | 0 0
  1. for (int y = 0; y <= screen_size.height; y++) {
  2.     if(yy==(screen_size.height/frame_buffer_parts)) {
  3.       yy=0;
  4.       esp_lcd_panel_draw_bitmap(panel_handle, 0, y-(screen_size.height/frame_buffer_parts), screen_size.width, y, frame_buffer.begin());
  5.       if(y==screen_size.height) {
  6.         break;
  7.       }
  8.     }
  9.     posReal = startReal;
  10.     for (int x = 0; x < screen_size.width; x++) {
  11.       a = posReal;
  12.       b = posImag;
  13.       for (n = iterations; n > 0 ; n--) {
  14.         a2 = (a * a) >> res_bits;
  15.         b2 = (b * b) >> res_bits;
  16.         if ((a2 + b2) >= (4 << res_bits))
  17.           break;
  18.         b  = posImag + ((a * b) >> (res_bits - 1));
  19.         a  = posReal + a2 - b2;
  20.       }
  21.       frame_buffer_t::pixel_type px;
  22.       px.native_value =  (n * 29)<<8 | (n * 67);
  23.       frame_buffer.point(point16(x,y%(screen_size.height/frame_buffer_parts)),px);
  24.       posReal += incReal;
  25.     }
  26.     posImag -= incImag;
  27.     ++yy;
  28.   }
  29.   elapsedTime = millis()-startTime;
  30.   Serial.print("Took "); Serial.print(elapsedTime); Serial.println(" ms");
  31.  
Add Comment
Please, Sign In to add comment