Check out the Pastebin Gadgets Shop. We have thousands of fun, geeky & affordable gadgets on sale :-)Want more features on Pastebin? Sign Up, it's FREE!


By: a guest on Dec 20th, 2010  |  syntax: None  |  size: 1.51 KB  |  views: 124  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print  |  QR code  |  clone
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. how to add new image sdecoder.
  3. 1. create a directory which name is your image decoder's name and put source files
  4.  under the directory.
  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.
  9. 2. add the directory name to apps/plugins/imageviewer/SUBDIR so that the decoder
  10.  is built.
  11. if the decoder is supported by particular targets, surround it with #if directive.
  12. e.g. if the decoder supports color LCD targets only,
  13. #if HAVE_LCD_COLOR
  14. bmp
  15. #endif
  17. 3. append appropriate entry to enum image_type in image_decoder.h, decoder_names
  18.  and ext_list in image_decoder.c so that the imageviewer plugin can recognize
  19.  the decoder.
  20. if the decoder is supported by particular targets, surround them with same #if
  21.  directive in SUBDIR.
  23. 4. add entry to apps/plugins/viewers.config
  24.  (in format: file_extension,viewer/imageviewer) so that the file with specified
  25.  file extension will be opened by image viewer plugin.
  26. if the decoder is supported by particular targets, surround it with same #if
  27.  directive in SUBDIR.
  29. 5. add entry to apps/plugins/CATEGORIES (in format: decoder_name,viewer) so
  30.  that the build file is copied to viewers direcotry.
  31. you don't need to surround this with #if directive.
  34. notes:
  35. if you need to use greylib functions to draw image, add the functions to
  36.  struct imgdec_api just like gray_bitmap_part as GREY_INFO_STRUCT is declared in
  37.  imageviewer and is not available from the decoder.
clone this paste RAW Paste Data