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"
28 #include <core/producer/frame_producer.h>
29 #include <core/consumer/frame_consumer.h>
30 #include <core/producer/media_info/media_info.h>
31 #include <core/producer/media_info/media_info_repository.h>
33 #include <common/utf.h>
35 #include <FreeImage.h>
37 namespace caspar { namespace image {
39 void init(const spl::shared_ptr<core::media_info_repository>& repo)
41 FreeImage_Initialise();
42 core::register_producer_factory(create_scroll_producer);
43 core::register_producer_factory(create_producer);
44 core::register_thumbnail_producer_factory(create_thumbnail_producer);
45 core::register_consumer_factory([](const std::vector<std::wstring>& params){return create_consumer(params);});
46 repo->register_extractor([](const std::wstring& file, const std::wstring& extension, core::media_info& info)
48 if (extension == L".TGA"
49 || extension == L".COL"
50 || extension == L".PNG"
51 || extension == L".JPEG"
52 || extension == L".JPG"
53 || extension == L".GIF"
54 || extension == L".BMP")
56 info.clip_type = L"STILL";
67 FreeImage_DeInitialise();
71 std::wstring version()
73 return u16(FreeImage_GetVersion());