X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Fimage%2Fimage.cpp;h=a03b01e24a32f952160ddec93e3fe777b238a3a2;hb=7246d2b6051dce6f9c17a848cf79d526861ba5c0;hp=260b12a00d7b521ef49c9409ea6283e7ac2713dd;hpb=f78d434c81a83b428ae2e24af862d5f2702c34f9;p=casparcg diff --git a/modules/image/image.cpp b/modules/image/image.cpp index 260b12a00..a03b01e24 100644 --- a/modules/image/image.cpp +++ b/modules/image/image.cpp @@ -1,49 +1,83 @@ -/* -* Copyright (c) 2011 Sveriges Television AB -* -* This file is part of CasparCG (www.casparcg.com). -* -* CasparCG is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* CasparCG is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with CasparCG. If not, see . -* -* Author: Robert Nagy, ronag89@gmail.com -*/ - -#include "image.h" - -#include "producer/image_producer.h" -#include "producer/image_scroll_producer.h" -#include "consumer/image_consumer.h" - -#include -#include - -#include - -#include - -namespace caspar { namespace image { - -void init() -{ - core::register_producer_factory(create_scroll_producer); - core::register_producer_factory(create_producer); - core::register_consumer_factory([](const std::vector& params){return create_consumer(params);}); -} - -std::string get_version() -{ - return std::string(FreeImage_GetVersion()); -} - -}} \ No newline at end of file +/* +* Copyright (c) 2011 Sveriges Television AB +* +* This file is part of CasparCG (www.casparcg.com). +* +* CasparCG is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* CasparCG is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with CasparCG. If not, see . +* +* Author: Robert Nagy, ronag89@gmail.com +*/ + +#include "image.h" + +#include "producer/image_producer.h" +#include "producer/image_scroll_producer.h" +#include "consumer/image_consumer.h" + +#include +#include +#include +#include +#include +#include + +#include + +#include + +#include + +namespace caspar { namespace image { + +std::wstring version() +{ + return u16(FreeImage_GetVersion()); +} + +void init(core::module_dependencies dependencies) +{ + FreeImage_Initialise(); + dependencies.producer_registry->register_producer_factory(L"Image Scroll Producer", create_scroll_producer, describe_scroll_producer); + dependencies.producer_registry->register_producer_factory(L"Image Producer", create_producer, describe_producer); + dependencies.producer_registry->register_thumbnail_producer(create_thumbnail); + dependencies.consumer_registry->register_consumer_factory(L"Image Consumer", create_consumer, describe_consumer); + dependencies.media_info_repo->register_extractor([](const std::wstring& file, const std::wstring& extension, core::media_info& info) + { + if (extension == L".TGA" + || extension == L".COL" + || extension == L".PNG" + || extension == L".JPEG" + || extension == L".JPG" + || extension == L".GIF" + || extension == L".BMP") + { + info.clip_type = L"STILL"; + + return true; + } + + return false; + }); + dependencies.system_info_provider_repo->register_system_info_provider([](boost::property_tree::wptree& info) + { + info.add(L"system.freeimage", version()); + }); +} + +void uninit() +{ + FreeImage_DeInitialise(); +} + +}}