From 2e473b97d4e61a7fff0b67bba1cbecf567d3d4a5 Mon Sep 17 00:00:00 2001 From: micha-bbg Date: Fri, 23 Dec 2011 06:10:00 +0000 Subject: [PATCH] * Pictureviewer: Supported image formats - Added function to determine the supported image formats - Is required by moviebrowser.cpp (display screenshot) git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-beta@1988 e54a6e83-5905-42d5-8d5c-058d10e6a962 --- src/driver/pictureviewer/pictureviewer.cpp | 20 ++++++++++++++++++++ src/driver/pictureviewer/pictureviewer.h | 2 ++ 2 files changed, 22 insertions(+) diff --git a/src/driver/pictureviewer/pictureviewer.cpp b/src/driver/pictureviewer/pictureviewer.cpp index aa82ca729..83e678220 100644 --- a/src/driver/pictureviewer/pictureviewer.cpp +++ b/src/driver/pictureviewer/pictureviewer.cpp @@ -52,6 +52,26 @@ void CPictureViewer::add_format (int (*picsize) (const char *, int *, int *, int fh_root = fhn; } +void CPictureViewer::getSupportedImageFormats(std::vector& exts) +{ +#ifdef FBV_SUPPORT_PNG + exts.push_back(".png"); +#endif +#ifdef FBV_SUPPORT_GIF + exts.push_back(".gif"); +#endif +#ifdef FBV_SUPPORT_JPEG + exts.push_back(".jpg"); + exts.push_back(".jpeg"); +#endif +#ifdef FBV_SUPPORT_BMP + exts.push_back(".bmp"); +#endif +#ifdef FBV_SUPPORT_CRW + exts.push_back(".crw"); +#endif +} + void CPictureViewer::init_handlers (void) { #ifdef FBV_SUPPORT_PNG diff --git a/src/driver/pictureviewer/pictureviewer.h b/src/driver/pictureviewer/pictureviewer.h index d6f3e9aee..bd7c8f295 100644 --- a/src/driver/pictureviewer/pictureviewer.h +++ b/src/driver/pictureviewer/pictureviewer.h @@ -27,6 +27,7 @@ */ #include +#include #include /* printf */ #include /* gettimeofday */ #include "driver/framebuffer.h" @@ -71,6 +72,7 @@ class CPictureViewer unsigned char * Resize(unsigned char *orgin, int ox, int oy, int dx, int dy, ScalingMode type, unsigned char * dst = NULL); unsigned char * ResizeA(unsigned char *orgin, int ox, int oy, int dx, int dy); void rescaleImageDimensions(int *width, int *height, const int max_width, const int max_height, bool upscale=false); + void getSupportedImageFormats(std::vector& erw); private: CFormathandler *fh_root;