|
From: Foster B. <fos...@us...> - 2006-02-27 20:42:13
|
Update of /cvsroot/adobe-source/sandbox/adobe-source/adobe/test/gil_io_factory In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8667/adobe/test/gil_io_factory Added Files: Jamfile.v2 main.cpp test.tga Log Message: image_t (icons and pictures) support for Mac and Win32, along with a GIL image factory and a (sample) Targa file format importing module for that factory. Also added alert.adm/eve as a sample for the icon support. Added the notion of a working directory to the modal dialog interface to reference external resources. Also added an alert API that leverages modal_dialog_interface. Other misc. bug fixes and changes. --- NEW FILE: Jamfile.v2 --- # Jamfile for building the GIL test app for the targa extension project adobe/targa ; run main.cpp ../../gil/extension/targa/targa.cpp ../../..//asl_dev ../../..//boost_filesystem : #args : ./test.tga : #requirements ; --- NEW FILE: test.tga --- (This appears to be a binary file; contents omitted.) --- NEW FILE: main.cpp --- /* Copyright 2005-2006 Adobe Systems Incorporated Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt or a copy at http://opensource.adobe.com/licenses.html) */ /*************************************************************************************************/ #include <adobe/gil/extension/io_factory/io_factory.hpp> #include <adobe/gil/extension/targa/targa.hpp> #include <adobe/gil/core/image.hpp> #include <boost/filesystem/path.hpp> #include <boost/filesystem/convenience.hpp> #include <boost/filesystem/operations.hpp> #include <boost/filesystem/fstream.hpp> #include <iostream> #include <cassert> /*************************************************************************************************/ int main(int argc, char* argv[]) try { GIL::image_factory_t factory; boost::filesystem::path test_src(argc > 1 ? argv[1] : "", boost::filesystem::native); adobe::static_name_t targa_tag("targa"); GIL::any_image image; assert (boost::filesystem::exists(test_src)); boost::filesystem::filebuf filebuf; filebuf.open(test_src, std::ios_base::in | std::ios_base::binary); factory.register_format(GIL::image_format_t(targa_tag, GIL::targa_t())); assert (factory.is_registered(targa_tag)); assert (factory.read(image, filebuf) == targa_tag); #if 0 // no file format writing at this time GIL::any_view view(GIL::view(image)); factory.write(view, filebuf); #endif factory.unregister_format(targa_tag); assert (!factory.is_registered(targa_tag)); return 0; } catch (const std::exception& doh) { std::cerr << "Exception: " << doh.what() << std::endl; return 1; } catch (...) { std::cerr << "Exception: Unknown" << std::endl; return 1; } |