<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html> <html lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <!-- qcolormap.qdoc --> <title>QColormap Class | Qt Widgets 5.12.2</title> <link rel="stylesheet" type="text/css" href="style/offline-simple.css" /> <script type="text/javascript"> document.getElementsByTagName("link").item(0).setAttribute("href", "style/offline.css"); // loading style sheet breaks anchors that were jumped to before // so force jumping to anchor again setTimeout(function() { var anchor = location.hash; // need to jump to different anchor first (e.g. none) location.hash = "#"; setTimeout(function() { location.hash = anchor; }, 0); }, 0); </script> </head> <body> <div class="header" id="qtdocheader"> <div class="main"> <div class="main-rounded"> <div class="navigationbar"> <table><tr> <td >Qt 5.12</td><td ><a href="qtwidgets-index.html">Qt Widgets</a></td><td ><a href="qtwidgets-module.html">C++ Classes</a></td><td >QColormap</td></tr></table><table class="buildversion"><tr> <td id="buildversion" width="100%" align="right"><a href="qtwidgets-index.html">Qt 5.12.2 Reference Documentation</a></td> </tr></table> </div> </div> <div class="content"> <div class="line"> <div class="content mainContent"> <div class="sidebar"> <div class="toc"> <h3><a name="toc">Contents</a></h3> <ul> <li class="level1"><a href="#public-types">Public Types</a></li> <li class="level1"><a href="#public-functions">Public Functions</a></li> <li class="level1"><a href="#static-public-members">Static Public Members</a></li> <li class="level1"><a href="#details">Detailed Description</a></li> </ul> </div> <div class="sidebar-content" id="sidebar-content"></div></div> <h1 class="title">QColormap Class</h1> <!-- $$$QColormap-brief --> <p>The <a href="qcolormap.html">QColormap</a> class maps device independent QColors to device dependent pixel values. <a href="#details">More...</a></p> <!-- @@@QColormap --> <div class="table"><table class="alignedsummary"> <tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign"> <span class="preprocessor">#include <QColormap></span> </td></tr><tr><td class="memItemLeft rightAlign topAlign"> qmake:</td><td class="memItemRight bottomAlign"> QT += widgets</td></tr></table></div><ul> <li><a href="qcolormap-members.html">List of all members, including inherited members</a></li> </ul> <a name="public-types"></a> <h2 id="public-types">Public Types</h2> <div class="table"><table class="alignedsummary"> <tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qcolormap.html#Mode-enum">Mode</a></b> { Direct, Indexed, Gray }</td></tr> </table></div> <a name="public-functions"></a> <h2 id="public-functions">Public Functions</h2> <div class="table"><table class="alignedsummary"> <tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qcolormap.html#QColormap">QColormap</a></b>(const QColormap &<i>colormap</i>)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qcolormap.html#dtor.QColormap">~QColormap</a></b>()</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> const QColor </td><td class="memItemRight bottomAlign"><b><a href="qcolormap.html#colorAt">colorAt</a></b>(uint <i>pixel</i>) const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> const QVector<QColor> </td><td class="memItemRight bottomAlign"><b><a href="qcolormap.html#colormap">colormap</a></b>() const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qcolormap.html#depth">depth</a></b>() const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QColormap::Mode </td><td class="memItemRight bottomAlign"><b><a href="qcolormap.html#mode">mode</a></b>() const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> uint </td><td class="memItemRight bottomAlign"><b><a href="qcolormap.html#pixel">pixel</a></b>(const QColor &<i>color</i>) const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qcolormap.html#size">size</a></b>() const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QColormap &</td><td class="memItemRight bottomAlign"><b><a href="qcolormap.html#operator-eq">operator=</a></b>(const QColormap &<i>colormap</i>)</td></tr> </table></div> <a name="static-public-members"></a> <h2 id="static-public-members">Static Public Members</h2> <div class="table"><table class="alignedsummary"> <tr><td class="memItemLeft rightAlign topAlign"> QColormap </td><td class="memItemRight bottomAlign"><b><a href="qcolormap.html#instance">instance</a></b>(int <i>screen</i> = -1)</td></tr> </table></div> <a name="details"></a> <!-- $$$QColormap-description --> <div class="descr"> <h2 id="details">Detailed Description</h2> <p>The <a href="qcolormap.html">QColormap</a> class maps device independent QColors to device dependent pixel values.</p> </div> <!-- @@@QColormap --> <div class="types"> <h2>Member Type Documentation</h2> <!-- $$$Mode$$$Direct$$$Indexed$$$Gray --> <h3 class="fn" id="Mode-enum"><a name="Mode-enum"></a>enum QColormap::<span class="name">Mode</span></h3> <p>This enum describes how <a href="qcolormap.html">QColormap</a> maps device independent RGB values to device dependent pixel values.</p> <div class="table"><table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr> <tr><td class="topAlign"><code>QColormap::Direct</code></td><td class="topAlign tblval"><code>0</code></td><td class="topAlign">Pixel values are derived directly from the RGB values, also known as "True Color."</td></tr> <tr><td class="topAlign"><code>QColormap::Indexed</code></td><td class="topAlign tblval"><code>1</code></td><td class="topAlign">Pixel values represent indexes into a vector of available colors, i.e. <a href="qcolormap.html">QColormap</a> uses the index of the color that most closely matches an RGB value.</td></tr> <tr><td class="topAlign"><code>QColormap::Gray</code></td><td class="topAlign tblval"><code>2</code></td><td class="topAlign">Similar to <code>Indexed</code>, pixel values represent a vector of available gray tones. <a href="qcolormap.html">QColormap</a> uses the index of the gray tone that most closely matches the computed gray tone of an RGB value.</td></tr> </table></div> <!-- @@@Mode --> </div> <div class="func"> <h2>Member Function Documentation</h2> <!-- $$$QColormap[overload1]$$$QColormapconstQColormap& --> <h3 class="fn" id="QColormap"><a name="QColormap"></a>QColormap::<span class="name">QColormap</span>(const <span class="type"><a href="qcolormap.html#QColormap">QColormap</a></span> &<i>colormap</i>)</h3> <p>Constructs a copy of another <i>colormap</i>.</p> <!-- @@@QColormap --> <!-- $$$~QColormap[overload1]$$$~QColormap --> <h3 class="fn" id="dtor.QColormap"><a name="dtor.QColormap"></a>QColormap::<span class="name">~QColormap</span>()</h3> <p>Destroys the colormap.</p> <!-- @@@~QColormap --> <!-- $$$colorAt[overload1]$$$colorAtuint --> <h3 class="fn" id="colorAt"><a name="colorAt"></a>const <span class="type"><a href="../qtgui/qcolor.html">QColor</a></span> QColormap::<span class="name">colorAt</span>(<span class="type"><a href="../qtcore/qtglobal.html#uint-typedef">uint</a></span> <i>pixel</i>) const</h3> <p>Returns a <a href="../qtgui/qcolor.html">QColor</a> for the <i>pixel</i>.</p> <p><b>See also </b><a href="qcolormap.html#pixel">pixel</a>().</p> <!-- @@@colorAt --> <!-- $$$colormap[overload1]$$$colormap --> <h3 class="fn" id="colormap"><a name="colormap"></a>const <span class="type"><a href="../qtcore/qvector.html">QVector</a></span><<span class="type"><a href="../qtgui/qcolor.html">QColor</a></span>> QColormap::<span class="name">colormap</span>() const</h3> <p>Returns a vector of colors which represents the devices colormap for <code>Indexed</code> and <code>Gray</code> modes. This function returns an empty vector for <code>Direct</code> mode.</p> <p><b>See also </b><a href="qcolormap.html#size">size</a>().</p> <!-- @@@colormap --> <!-- $$$depth[overload1]$$$depth --> <h3 class="fn" id="depth"><a name="depth"></a><span class="type">int</span> QColormap::<span class="name">depth</span>() const</h3> <p>Returns the depth of the device.</p> <p><b>See also </b><a href="qcolormap.html#size">size</a>().</p> <!-- @@@depth --> <!-- $$$instance[overload1]$$$instanceint --> <h3 class="fn" id="instance"><a name="instance"></a><code>[static] </code><span class="type"><a href="qcolormap.html#QColormap">QColormap</a></span> QColormap::<span class="name">instance</span>(<span class="type">int</span> <i>screen</i> = -1)</h3> <p>Returns the colormap for the specified <i>screen</i>. If <i>screen</i> is -1, this function returns the colormap for the default screen.</p> <!-- @@@instance --> <!-- $$$mode[overload1]$$$mode --> <h3 class="fn" id="mode"><a name="mode"></a><span class="type"><a href="qcolormap.html#Mode-enum">QColormap::Mode</a></span> QColormap::<span class="name">mode</span>() const</h3> <p>Returns the mode of this colormap.</p> <p><b>See also </b><a href="qcolormap.html#Mode-enum">QColormap::Mode</a>.</p> <!-- @@@mode --> <!-- $$$pixel[overload1]$$$pixelconstQColor& --> <h3 class="fn" id="pixel"><a name="pixel"></a><span class="type"><a href="../qtcore/qtglobal.html#uint-typedef">uint</a></span> QColormap::<span class="name">pixel</span>(const <span class="type"><a href="../qtgui/qcolor.html">QColor</a></span> &<i>color</i>) const</h3> <p>Returns a device dependent pixel value for the <i>color</i>.</p> <p><b>See also </b><a href="qcolormap.html#colorAt">colorAt</a>().</p> <!-- @@@pixel --> <!-- $$$size[overload1]$$$size --> <h3 class="fn" id="size"><a name="size"></a><span class="type">int</span> QColormap::<span class="name">size</span>() const</h3> <p>Returns the size of the colormap for <code>Indexed</code> and <code>Gray</code> modes; Returns -1 for <code>Direct</code> mode.</p> <p><b>See also </b><a href="qcolormap.html#colormap">colormap</a>().</p> <!-- @@@size --> <!-- $$$operator=[overload1]$$$operator=constQColormap& --> <h3 class="fn" id="operator-eq"><a name="operator-eq"></a><span class="type"><a href="qcolormap.html#QColormap">QColormap</a></span> &QColormap::<span class="name">operator=</span>(const <span class="type"><a href="qcolormap.html#QColormap">QColormap</a></span> &<i>colormap</i>)</h3> <p>Assigns the given <i>colormap</i> to <i>this</i> color map and returns a reference to <i>this</i> color map.</p> <p>This function was introduced in Qt 4.2.</p> <!-- @@@operator= --> </div> </div> </div> </div> </div> </div> <div class="footer"> <p> <acronym title="Copyright">©</acronym> 2019 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners.<br/> The documentation provided herein is licensed under the terms of the <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation License version 1.3</a> as published by the Free Software Foundation.<br/> Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners. </p> </div> </body> </html>