// This file is part of libigl, a simple c++ geometry processing library. // // Copyright (C) 2013 Alec Jacobson // // This Source Code Form is subject to the terms of the Mozilla Public License // v. 2.0. If a copy of the MPL was not distributed with this file, You can // obtain one at http://mozilla.org/MPL/2.0/. #include "rgb_to_hsv.h" template IGL_INLINE void igl::rgb_to_hsv(const R * rgb, H * hsv) { // http://en.literateprograms.org/RGB_to_HSV_color_space_conversion_%28C%29 R rgb_max = 0.0; R rgb_min = 1.0; rgb_max = (rgb[0]>rgb_max?rgb[0]:rgb_max); rgb_max = (rgb[1]>rgb_max?rgb[1]:rgb_max); rgb_max = (rgb[2]>rgb_max?rgb[2]:rgb_max); rgb_min = (rgb[0]rgb_max?rgb_n[0]:rgb_max); rgb_max = (rgb_n[1]>rgb_max?rgb_n[1]:rgb_max); rgb_max = (rgb_n[2]>rgb_max?rgb_n[2]:rgb_max); rgb_min = 1; rgb_min = (rgb_n[0]rgb_max?rgb_n[0]:rgb_max); rgb_max = (rgb_n[1]>rgb_max?rgb_n[1]:rgb_max); rgb_max = (rgb_n[2]>rgb_max?rgb_n[2]:rgb_max); rgb_min = 1; rgb_min = (rgb_n[0](float const*, double*); template void igl::rgb_to_hsv(double const*, double*); #endif