Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7195 in orxonox.OLD for trunk/src/lib/util/color.cc


Ignore:
Timestamp:
Mar 7, 2006, 11:12:31 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: performance issues

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/util/color.cc

    r5494 r7195  
    1717
    1818#include "color.h"
    19 #include "vector.h"
     19#include <stdio.h>
    2020
    2121using namespace std;
    2222
    2323
    24 
    25 
    26 #include <stdio.h>
    27 
    2824/**
    29  * transforms from RGB to HSVtoRGB
    30  * @param RGB the RGB-color [0-1]
     25 * @brief transforms from RGB to HSVtoRGB
     26 * @param RGB: the RGB-color [0-1]
    3127 * @returns HSV: with values (h[0-360(degree)],s[0,1],v[0,1])
    3228 */
    3329Vector Color::RGBtoHSV(const Vector& RGB)
     30{
     31  Vector HSV;
     32  RGBtoHSV(RGB, HSV);
     33  return HSV;
     34}
     35
     36/**
     37 * @brief transforms from RGB to HSVtoRGB
     38 * @param RGB: the RGB-color [0-1]
     39 * @param HSV: with values (h[0-360(degree)],s[0,1],v[0,1])
     40 */
     41void Color::RGBtoHSV(const Vector& RGB, Vector& HSV)
    3442{
    3543  float r = RGB.x;
     
    7078      h += 360.0;
    7179  }
    72   return Vector(h, s, v);
     80  HSV = Vector(h, s, v);
    7381}
    7482
    7583/**
    76  * converts a Color from HSV to RGBtoHSV
     84 * @brief converts a Color from HSV to RGBtoHSV
    7785 * @param HSV: Vector with values (h[0-360(degree)],s[0,1],v[0,1])
    7886 * @returns RGB: Vector [0-1]
    7987 */
    8088Vector Color::HSVtoRGB(const Vector& HSV)
     89{
     90  Vector RGB;
     91  HSVtoRGB(HSV, RGB);
     92  return RGB;
     93}
     94
     95/**
     96 * @brief converts a Color from HSV to RGBtoHSV
     97 * @param HSV: Vector with values (h[0-360(degree)],s[0,1],v[0,1])
     98 * @param RGB: Vector [0-1]
     99 */
     100void Color::HSVtoRGB(const Vector& HSV, Vector& RGB)
    81101{
    82102  float h = HSV.x;
     
    141161    }
    142162  }
    143   return Vector(r,g,b);
     163  RGB = Vector(r,g,b);
    144164}
    145165
Note: See TracChangeset for help on using the changeset viewer.