1 /* 2 delaboratory - color correction utility 3 Copyright (C) 2011 Jacek Poplawski 4 5 This program is free software: you can redistribute it and/or modify 6 it under the terms of the GNU General Public License as published by 7 the Free Software Foundation, either version 3 of the License, or 8 (at your option) any later version. 9 10 This program is distributed in the hope that it will be useful, 11 but WITHOUT ANY WARRANTY; without even the implied warranty of 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 GNU General Public License for more details. 14 15 You should have received a copy of the GNU General Public License 16 along with this program. If not, see <http://www.gnu.org/licenses/>. 17 */ 18 19 #include "blur_type.h" 20 getBlurTypeName(deBlurType type)21std::string getBlurTypeName(deBlurType type) 22 { 23 switch (type) 24 { 25 case deBoxBlur: 26 return "box"; 27 case deGaussianBlur: 28 return "gaussian"; 29 case deSurfaceBlur: 30 return "surface"; 31 default: 32 return "unknown"; 33 } 34 } 35 blurTypeFromString(const std::string & s)36deBlurType blurTypeFromString(const std::string& s) 37 { 38 if (s == "box") 39 { 40 return deBoxBlur; 41 } 42 if (s == "gaussian") 43 { 44 return deGaussianBlur; 45 } 46 if (s == "surface") 47 { 48 return deSurfaceBlur; 49 } 50 51 return deBlurInvalid; 52 } 53 getSupportedBlurTypes(std::vector<deBlurType> & result)54void getSupportedBlurTypes(std::vector<deBlurType>& result) 55 { 56 result.push_back(deBoxBlur); 57 result.push_back(deGaussianBlur); 58 result.push_back(deSurfaceBlur); 59 } 60 getSupportedBlurTypes()61std::vector<std::string> getSupportedBlurTypes() 62 { 63 std::vector<std::string> result; 64 result.push_back("box"); 65 result.push_back("gaussian"); 66 result.push_back("surface"); 67 return result; 68 } 69