Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Dec 20th, 2010  |  syntax: None  |  size: 1.03 KB  |  views: 104  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. how to add new image sdecoder.
  2.  
  3. 1. create a directory which name is your image decoder name and put source files
  4.  to the directory. e.g. bmp.
  5. const struct image_decoder image_decoder and IMGDEC_HEADER need to be defined in
  6.  your souce file.
  7. check imageviewer.h for the detail of struct image_decoder.
  8.  
  9. 2. add the directory name to SUBDIR in this directory.
  10. if your decoder is supported by particular targets, surround it with #if directive.
  11. e.g. if the decoder supports color LCD targets only,
  12. #if HAVE_LCD_COLOR
  13. bmp
  14. #endif
  15.  
  16. 3. append appropriate entry to enum image_type in image_decoder.h, decoder_names
  17.  and ext_list in image_decoder.c
  18.  
  19. 4. add entry to the apps/plugins/viewers.config. e.g. bmp,viewer/imageviewer
  20. if your decoder is supported by particular targets, surround it with #if directive.
  21. e.g. if the decoder supports color LCD targets only,
  22. #if HAVE_LCD_COLOR
  23. bmp,viewer/imageviewer
  24. #endif
  25.  
  26. notes:
  27. if you need to use greylib functions to draw image, add the functions to
  28.  struct imgdec_api just like gray_bitmap_part.
clone this paste RAW Paste Data