A high-performance general-purpose compute library

- Main Page
- Tutorials
- Release Notes
- Examples

Functions
rgb2hsv
ArrayFire Functions | ArrayFire Functions by Category » Image Processing » Colorspace conversions

## Functions
AFAPI array | rgb2hsv (const array &in)
| C++ Interface for converting RGB to HSV.
AFAPI af_err | af_rgb2hsv (af_array *out, const af_array in)
| C Interface for converting RGB to HSV.

## Detailed Description

RGB to HSV colorspace converter

RGB (Red, Green, Blue) is the most common format used in computer imaging. RGB stores individual values for red, green and blue, and hence the 3 values per pixel. A combination of these three values produces the gamut of unique colors.

HSV (Hue, Saturation, Value), also known as HSB (hue, saturation, brightness), is often used by artists because it is more natural to think about a color in terms of hue and saturation than in terms of additive or subtractive color components (as in RGB). HSV is a transformation of RGB colorspace; its components and colorimetry are relative to the RGB colorspace from which it was derived. Like RGB, HSV also uses 3 values per pixel.

## Function Documentation

## ◆ af_rgb2hsv()

AFAPI af_err af_rgb2hsv | ( | af_array * | out,
|  | const af_array | in )

C Interface for converting RGB to HSV.

Parameters

  [out] | out | is an array in the HSV color space
  [in] | in | is an array in the RGB color space

Returns
  AF_SUCCESS if the color transformation is successful, otherwise an appropriate error code is returned.

Note
  `in` must be three dimensional

## ◆ rgb2hsv()

AFAPI array rgb2hsv | ( | const array & | in | ) |

C++ Interface for converting RGB to HSV.

Parameters

  [in] | in | is an array in the RGB colorspace

Returns
  array in HSV colorspace

Note
  `in` must be three dimensional