Advertisement
Guest User

Untitled

a guest
Dec 20th, 2010
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.51 KB | None | 0 0
  1. how to add new image sdecoder.
  2.  
  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.
  8.  
  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
  16.  
  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.
  22.  
  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.
  28.  
  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.
  32.  
  33.  
  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.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement