Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MAP_HEIGHT & renderJPEG problem #3

Open
reaper7 opened this issue Jan 6, 2017 · 3 comments
Open

MAP_HEIGHT & renderJPEG problem #3

reaper7 opened this issue Jan 6, 2017 · 3 comments

Comments

@reaper7
Copy link

reaper7 commented Jan 6, 2017

I have a problem with drawing map on display.
As You see, display show additional 320x8 block below map as a 20 copies of last read block from jpeg (marked with a red block):
map1

The same map (link from serial terminal) downloaded on pc do not contain "boxboxbox..." block.

For me, MAP_HEIGHT = 200 is a not good choice, because when You add a litle debug to renderJPEG:

  Serial.print("Width     :"); Serial.println(JpegDec.width);
  Serial.print("Height    :"); Serial.println(JpegDec.height);
  Serial.print("Components:"); Serial.println(JpegDec.comps);
  Serial.print("MCU / row :"); Serial.println(JpegDec.MCUSPerRow);
  Serial.print("MCU / col :"); Serial.println(JpegDec.MCUSPerCol);
  Serial.print("Scan type :"); Serial.println(JpegDec.scanType);
  Serial.print("MCU width :"); Serial.println(JpegDec.MCUWidth);
  Serial.print("MCU height:"); Serial.println(JpegDec.MCUHeight);

then You see that MCUWidth & MCUHeight are a square blocks 16x16.
When with width, in this case, everything is fine, because 320 / 16 = 20,
with map height we have problem because 200 / 16 = 12.5
...so, renderJPEG still draw inside:

while (count--) {tft_->pushColor(*pImg++);}

last reading from jpeg block on display (320x8) for completion to 16, although jpeg ends.

Best choice for map height is 192 or 208
and/or some mod a renderJPEG procedure...

@squix78
Copy link
Collaborator

squix78 commented Jan 6, 2017

Thank you for the analysis! I have seen this as well but didn't have time to look into it. We'll have to see if 204 still have enough space for the detail information...

@reaper7
Copy link
Author

reaper7 commented Jan 6, 2017

192 or 208 :)
map height 192 is ok and more place for infos
👍

@Bodmer
Copy link

Bodmer commented Jan 23, 2017

The simple rendering method assumed an integer number of MCU blocks for width and height of image.

For arbitrary sizes you can use the example code here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants