at.ac.sbg.cosy.soccerbot.recognition
Class HSVColor

java.lang.Object
  extended by at.ac.sbg.cosy.soccerbot.recognition.HSVColor

public class HSVColor
extends java.lang.Object

Library for HSV Color conversion / information extraction

Author:
Peter Wild

Constructor Summary
HSVColor()
           
 
Method Summary
static int get_H(int color)
          Extracts the hue channel value out of an hsv int value
static int get_S(int color)
          Extracts the saturation channel value out of an hsv int value
static int get_V(int color)
          Extracts the value channel value out of an hsv int value
static int hsv(int h, int s, int v)
          Creates an hsv format representation of three hue, saturation, value channel values hue within 0x00 - 0xFFFF, all others within 0x00 - 0xFF.
static int hsv2rgb(int hsv)
          Converts hsv values into rgb values (lossy transformation) alpha channel is not used (set to 255).
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HSVColor

public HSVColor()
Method Detail

get_H

public static int get_H(int color)
Extracts the hue channel value out of an hsv int value

Parameters:
color - int-color value in 32-bit hsv format (0xHHHHSSVV)
Returns:
hue value

get_S

public static int get_S(int color)
Extracts the saturation channel value out of an hsv int value

Parameters:
color - int-color value in 32-bit hsv format (0xHHHHSSVV)
Returns:
saturation value

get_V

public static int get_V(int color)
Extracts the value channel value out of an hsv int value

Parameters:
color - int-color value in 32-bit hsv format (0xHHHHSSVV)
Returns:
brightness (value) value

hsv

public static int hsv(int h,
                      int s,
                      int v)
Creates an hsv format representation of three hue, saturation, value channel values hue within 0x00 - 0xFFFF, all others within 0x00 - 0xFF. Converts (h 0xFFFF, s 0xFF, v 0xFF -> hsv 0xFFFFFFFF).

Parameters:
h - hue value in 0x00 - 0xFFFF
s - saturation value in 0x00 - 0xFF
v - brightness (value) value in 0x00 - 0xFF
Returns:
hsv 32-bit format (0xAARRGGBB) representation

hsv2rgb

public static int hsv2rgb(int hsv)
Converts hsv values into rgb values (lossy transformation) alpha channel is not used (set to 255).

Parameters:
hsv - hsv 32-bit format (0xHHHHSSVV) representation
Returns:
argb 32-bit format (0xAARRGGBB) representation of according hsv