- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files
- Directories
- Examples

- File List
- File Members

Functions | Variables

# qrgb.h File Reference

`#include <QtCore/qglobal.h>`

Go to the source code of this file.

## Functions
Q_GUI_EXPORT_INLINE int | qRed (QRgb rgb)
Q_GUI_EXPORT_INLINE int | qGreen (QRgb rgb)
Q_GUI_EXPORT_INLINE int | qBlue (QRgb rgb)
Q_GUI_EXPORT_INLINE int | qAlpha (QRgb rgb)
Q_GUI_EXPORT_INLINE QRgb | qRgb (int r, int g, int b)
Q_GUI_EXPORT_INLINE QRgb | qRgba (int r, int g, int b, int a)
Q_GUI_EXPORT_INLINE int | qGray (int r, int g, int b)
Q_GUI_EXPORT_INLINE int | qGray (QRgb rgb)
Q_GUI_EXPORT_INLINE bool | qIsGray (QRgb rgb)
## Variables
QT_BEGIN_HEADER QT_BEGIN_NAMESPACE typedef unsigned int | QRgb
const QRgb | RGB_MASK = 0x00ffffff

## Function Documentation

Q_GUI_EXPORT_INLINE int qRed | ( | QRgb | rgb | ) |

Search for all occurrences

Definition at line 57 of file qrgb.h.

    { return ((rgb >> 16) & 0xff); }

Q_GUI_EXPORT_INLINE int qGreen | ( | QRgb | rgb | ) |

Search for all occurrences

Definition at line 60 of file qrgb.h.

    { return ((rgb >> 8) & 0xff); }

Q_GUI_EXPORT_INLINE int qBlue | ( | QRgb | rgb | ) |

Search for all occurrences

Definition at line 63 of file qrgb.h.

    { return (rgb & 0xff); }

Q_GUI_EXPORT_INLINE int qAlpha | ( | QRgb | rgb | ) |

Search for all occurrences

Definition at line 66 of file qrgb.h.

    { return rgb >> 24; }

Q_GUI_EXPORT_INLINE QRgb qRgb | ( | int | r,
|  | int | g,
|  | int | b
| ) |  |

Search for all occurrences

Definition at line 69 of file qrgb.h.

    { return (0xffu << 24) | ((r & 0xff) << 16) | ((g & 0xff) << 8) | (b & 0xff); }

Q_GUI_EXPORT_INLINE QRgb qRgba | ( | int | r,
|  | int | g,
|  | int | b,
|  | int | a
| ) |  |

Search for all occurrences

Definition at line 72 of file qrgb.h.

    { return ((a & 0xff) << 24) | ((r & 0xff) << 16) | ((g & 0xff) << 8) | (b & 0xff); }

Q_GUI_EXPORT_INLINE int qGray | ( | int | r,
|  | int | g,
|  | int | b
| ) |  |

Search for all occurrences

Definition at line 75 of file qrgb.h.

    { return (r*11+g*16+b*5)/32; }

Q_GUI_EXPORT_INLINE int qGray | ( | QRgb | rgb | ) |

Search for all occurrences

Definition at line 78 of file qrgb.h.

    { return qGray(qRed(rgb), qGreen(rgb), qBlue(rgb)); }

Q_GUI_EXPORT_INLINE bool qIsGray | ( | QRgb | rgb | ) |

Search for all occurrences

Definition at line 81 of file qrgb.h.

    { return qRed(rgb) == qGreen(rgb) && qRed(rgb) == qBlue(rgb); }

## Variable Documentation

QT_BEGIN_HEADER QT_BEGIN_NAMESPACE typedef unsigned int QRgb

Search for all occurrences

Definition at line 53 of file qrgb.h.

const QRgb RGB_MASK = 0x00ffffff

Search for all occurrences

Definition at line 55 of file qrgb.h.