2 * Copyright (c) 2011 Sveriges Television AB <info@casparcg.com>
4 * This file is part of CasparCG (www.casparcg.com).
6 * CasparCG is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
11 * CasparCG is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with CasparCG. If not, see <http://www.gnu.org/licenses/>.
19 * Author: Robert Nagy, ronag89@gmail.com
24 #include "producer/image_producer.h"
25 #include "producer/image_scroll_producer.h"
26 #include "consumer/image_consumer.h"
27 #include "util/image_loader.h"
29 #include <core/producer/frame_producer.h>
30 #include <core/consumer/frame_consumer.h>
31 #include <core/producer/media_info/media_info.h>
32 #include <core/producer/media_info/media_info_repository.h>
33 #include <core/frame/draw_frame.h>
34 #include <core/system_info_provider.h>
36 #include <common/utf.h>
38 #include <boost/property_tree/ptree.hpp>
39 #include <boost/algorithm/string/case_conv.hpp>
41 #include <FreeImage.h>
43 namespace caspar { namespace image {
45 std::wstring version()
47 return u16(FreeImage_GetVersion());
50 void init(core::module_dependencies dependencies)
52 FreeImage_Initialise();
53 dependencies.producer_registry->register_producer_factory(L"Image Scroll Producer", create_scroll_producer, describe_scroll_producer);
54 dependencies.producer_registry->register_producer_factory(L"Image Producer", create_producer, describe_producer);
55 dependencies.producer_registry->register_thumbnail_producer(create_thumbnail);
56 dependencies.consumer_registry->register_consumer_factory(L"Image Consumer", create_consumer, describe_consumer);
57 dependencies.media_info_repo->register_extractor([](const std::wstring& file, const std::wstring& extension, core::media_info& info)
59 if (supported_extensions().find(boost::to_lower_copy(extension)) != supported_extensions().end())
61 info.clip_type = L"STILL";
68 dependencies.system_info_provider_repo->register_system_info_provider([](boost::property_tree::wptree& info)
70 info.add(L"system.freeimage", version());
76 FreeImage_DeInitialise();