diff options
author | Teruaki Kawashima <teru@rockbox.org> | 2011-01-16 12:45:11 +0000 |
---|---|---|
committer | Teruaki Kawashima <teru@rockbox.org> | 2011-01-16 12:45:11 +0000 |
commit | 62207228f717d0eb29aca5d1fbc155f151d6814e (patch) | |
tree | 551cc0ec6f34c3f289439e34b91e16c9ad89e85d /apps/plugins/imageviewer/imageviewer.h | |
parent | 5c09844d54c7adba80fd261e83a4c895d007a576 (diff) | |
download | rockbox-62207228f717d0eb29aca5d1fbc155f151d6814e.tar.gz rockbox-62207228f717d0eb29aca5d1fbc155f151d6814e.zip |
image viewer: add quick guide describing how to add image decoder. also improve comments.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29066 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/imageviewer/imageviewer.h')
-rw-r--r-- | apps/plugins/imageviewer/imageviewer.h | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/apps/plugins/imageviewer/imageviewer.h b/apps/plugins/imageviewer/imageviewer.h index 504ef2bb3a..f35c1c7e6d 100644 --- a/apps/plugins/imageviewer/imageviewer.h +++ b/apps/plugins/imageviewer/imageviewer.h | |||
@@ -469,19 +469,24 @@ struct imgdec_api { | |||
469 | 469 | ||
470 | /* functions need to be implemented in each image decoders. */ | 470 | /* functions need to be implemented in each image decoders. */ |
471 | struct image_decoder { | 471 | struct image_decoder { |
472 | /* if unscaled image can be always displayed when there isn't enough memory | 472 | /* set true if unscaled image can be always displayed even when there isn't |
473 | * for resized image. e.g. when using native format to store image. */ | 473 | * enough memory for resized image. e.g. when using native format to store |
474 | * image. */ | ||
474 | const bool unscaled_avail; | 475 | const bool unscaled_avail; |
475 | 476 | ||
476 | /* return needed size of buffer to store downscaled image by ds */ | 477 | /* return needed size of buffer to store downscaled image by ds. |
478 | * this is used to calculate min downscale. */ | ||
477 | int (*img_mem)(int ds); | 479 | int (*img_mem)(int ds); |
478 | /* load image from filename. set width and height of info properly. also, set | 480 | /* load image from filename. use the passed buffer to store loaded, decoded |
479 | * buf_size to remaining size of buf after load image. it is used to caluclate | 481 | * or resized image later, so save it to local variables if needed. |
480 | * min downscale. */ | 482 | * set width and height of info properly. also, set buf_size to remaining |
483 | * size of buf after load image. it is used to calculate min downscale. | ||
484 | * return PLUGIN_ERROR for error. ui will skip to next image. */ | ||
481 | int (*load_image)(char *filename, struct image_info *info, | 485 | int (*load_image)(char *filename, struct image_info *info, |
482 | unsigned char *buf, ssize_t *buf_size); | 486 | unsigned char *buf, ssize_t *buf_size); |
483 | /* downscale loaded image by ds. note that buf to store reszied image is not | 487 | /* downscale loaded image by ds. use the buffer passed to load_image to |
484 | * provided. return PLUGIN_ERROR for error. ui will skip to next image. */ | 488 | * reszie image and/or store resized image. |
489 | * return PLUGIN_ERROR for error. ui will skip to next image. */ | ||
485 | int (*get_image)(struct image_info *info, int ds); | 490 | int (*get_image)(struct image_info *info, int ds); |
486 | /* draw part of image */ | 491 | /* draw part of image */ |
487 | void (*draw_image_rect)(struct image_info *info, | 492 | void (*draw_image_rect)(struct image_info *info, |