\hypertarget{class_ogre_1_1_bitwise}{}\section{Ogre\+:\+:Bitwise Class Reference}
\label{class_ogre_1_1_bitwise}\index{Ogre\+::\+Bitwise@{Ogre\+::\+Bitwise}}


Class for manipulating bit patterns.  




{\ttfamily \#include $<$Ogre\+Bitwise.\+h$>$}

\subsection*{Static Public Member Functions}
\begin{DoxyCompactItemize}
\item 
static \hyperlink{_ogre_platform_8h_a6cbacd9965b6b575077a96dbf96cb23c}{O\+G\+R\+E\+\_\+\+F\+O\+R\+C\+E\+\_\+\+I\+N\+L\+I\+NE} \hyperlink{namespace_ogre_aa8263b218e7d187ad5ef03a73a6ad7fd}{uint16} \hyperlink{class_ogre_1_1_bitwise_a8e8c70a9058d8b11d3787a6c98cb3f3f}{bswap16} (\hyperlink{namespace_ogre_aa8263b218e7d187ad5ef03a73a6ad7fd}{uint16} arg)
\begin{DoxyCompactList}\small\item\em Returns value with reversed bytes order. \end{DoxyCompactList}\item 
static \hyperlink{_ogre_platform_8h_a6cbacd9965b6b575077a96dbf96cb23c}{O\+G\+R\+E\+\_\+\+F\+O\+R\+C\+E\+\_\+\+I\+N\+L\+I\+NE} \hyperlink{namespace_ogre_adf2a0cf2e77143b5ee1d38a75e289545}{uint32} \hyperlink{class_ogre_1_1_bitwise_a70486a366a7b31916afb626e8b68018d}{bswap32} (\hyperlink{namespace_ogre_adf2a0cf2e77143b5ee1d38a75e289545}{uint32} arg)
\begin{DoxyCompactList}\small\item\em Returns value with reversed bytes order. \end{DoxyCompactList}\item 
static \hyperlink{_ogre_platform_8h_a6cbacd9965b6b575077a96dbf96cb23c}{O\+G\+R\+E\+\_\+\+F\+O\+R\+C\+E\+\_\+\+I\+N\+L\+I\+NE} \hyperlink{namespace_ogre_a7e1487b57f16a1479302d1896c6f4445}{uint64} \hyperlink{class_ogre_1_1_bitwise_a24be32e70565fada41b0c89184fdd58e}{bswap64} (\hyperlink{namespace_ogre_a7e1487b57f16a1479302d1896c6f4445}{uint64} arg)
\begin{DoxyCompactList}\small\item\em Returns value with reversed bytes order. \end{DoxyCompactList}\item 
static void \hyperlink{class_ogre_1_1_bitwise_a26be444ef54cc196d29f801635352e59}{bswap\+Buffer} (void $\ast$p\+Data, size\+\_\+t size)
\begin{DoxyCompactList}\small\item\em Reverses byte order of buffer. \end{DoxyCompactList}\item 
static void \hyperlink{class_ogre_1_1_bitwise_ad1df153ede686f618fe227ea7c244127}{bswap\+Chunks} (void $\ast$p\+Data, size\+\_\+t size, size\+\_\+t count)
\begin{DoxyCompactList}\small\item\em Reverses byte order of chunks in buffer, where \textquotesingle{}size\textquotesingle{} is size of one chunk. \end{DoxyCompactList}\item 
{\footnotesize template$<$typename SrcT , typename DestT $>$ }\\static DestT \hyperlink{class_ogre_1_1_bitwise_a65c7e2d0a2b2278e58450bb9d289e148}{convert\+Bit\+Pattern} (SrcT src\+Value, SrcT src\+Bit\+Mask, DestT dest\+Bit\+Mask)
\begin{DoxyCompactList}\small\item\em Takes a value with a given src bit mask, and produces another value with a desired bit mask. \end{DoxyCompactList}\item 
static \hyperlink{_ogre_platform_8h_a6cbacd9965b6b575077a96dbf96cb23c}{O\+G\+R\+E\+\_\+\+F\+O\+R\+C\+E\+\_\+\+I\+N\+L\+I\+NE} \hyperlink{namespace_ogre_adf2a0cf2e77143b5ee1d38a75e289545}{uint32} \hyperlink{class_ogre_1_1_bitwise_a252f77ee338fa56f0161487fe7a5a23b}{first\+P\+O2\+From} (\hyperlink{namespace_ogre_adf2a0cf2e77143b5ee1d38a75e289545}{uint32} n)
\begin{DoxyCompactList}\small\item\em Returns the closest power-\/of-\/two number greater or equal to value. \end{DoxyCompactList}\item 
static unsigned int \hyperlink{class_ogre_1_1_bitwise_aa59b3726641c31b63aa3e203559ca3bd}{fixed\+To\+Fixed} (\hyperlink{namespace_ogre_adf2a0cf2e77143b5ee1d38a75e289545}{uint32} value, unsigned int n, unsigned int p)
\begin{DoxyCompactList}\small\item\em Convert N bit colour channel value to P bits. \end{DoxyCompactList}\item 
static float \hyperlink{class_ogre_1_1_bitwise_a48006ba79d6f8c690e3131c7b4e441bf}{fixed\+To\+Float} (unsigned value, unsigned int bits)
\begin{DoxyCompactList}\small\item\em Fixed point to float. \end{DoxyCompactList}\item 
static unsigned int \hyperlink{class_ogre_1_1_bitwise_ad3f4d30ecc1aa5ea112a38e63a47b9c8}{float\+To\+Fixed} (const float value, const unsigned int bits)
\begin{DoxyCompactList}\small\item\em Convert floating point colour channel value between 0.\+0 and 1.\+0 (otherwise clamped) to integer of a certain number of bits. \end{DoxyCompactList}\item 
static \hyperlink{namespace_ogre_aa8263b218e7d187ad5ef03a73a6ad7fd}{uint16} \hyperlink{class_ogre_1_1_bitwise_aa02a9c5a117baf2da38ad562c2130681}{float\+To\+Half} (float i)
\begin{DoxyCompactList}\small\item\em Convert a float32 to a float16 (N\+V\+\_\+half\+\_\+float) Courtesy of Open\+E\+XR. \end{DoxyCompactList}\item 
static \hyperlink{namespace_ogre_aa8263b218e7d187ad5ef03a73a6ad7fd}{uint16} \hyperlink{class_ogre_1_1_bitwise_ad98268f6e1288301c0471e345e98cd1e}{float\+To\+HalfI} (\hyperlink{namespace_ogre_adf2a0cf2e77143b5ee1d38a75e289545}{uint32} i)
\begin{DoxyCompactList}\small\item\em Converts float in uint32 format to a a half in uint16 format. \end{DoxyCompactList}\item 
{\footnotesize template$<$typename T $>$ }\\static \hyperlink{_ogre_platform_8h_a6cbacd9965b6b575077a96dbf96cb23c}{O\+G\+R\+E\+\_\+\+F\+O\+R\+C\+E\+\_\+\+I\+N\+L\+I\+NE} unsigned int \hyperlink{class_ogre_1_1_bitwise_adeaa730393732afd86fda47203c023c5}{get\+Bit\+Shift} (T mask)
\begin{DoxyCompactList}\small\item\em Returns the number of bits a pattern must be shifted right by to remove right-\/hand zeros. \end{DoxyCompactList}\item 
static float \hyperlink{class_ogre_1_1_bitwise_abb3cbaa74865420859ba7b1061f8d3f3}{half\+To\+Float} (\hyperlink{namespace_ogre_aa8263b218e7d187ad5ef03a73a6ad7fd}{uint16} y)
\begin{DoxyCompactList}\small\item\em Convert a float16 (N\+V\+\_\+half\+\_\+float) to a float32 Courtesy of Open\+E\+XR. \end{DoxyCompactList}\item 
static \hyperlink{namespace_ogre_adf2a0cf2e77143b5ee1d38a75e289545}{uint32} \hyperlink{class_ogre_1_1_bitwise_a7ccd62b11c082f76d4972e27896c6028}{half\+To\+FloatI} (\hyperlink{namespace_ogre_aa8263b218e7d187ad5ef03a73a6ad7fd}{uint16} y)
\begin{DoxyCompactList}\small\item\em Converts a half in uint16 format to a float in uint32 format. \end{DoxyCompactList}\item 
static unsigned int \hyperlink{class_ogre_1_1_bitwise_ad0fcaa2e4f445d1e9c1fb69291061dec}{int\+Read} (const void $\ast$src, int n)
\begin{DoxyCompactList}\small\item\em Read a n$\ast$8 bits integer value to memory in native endian. \end{DoxyCompactList}\item 
static void \hyperlink{class_ogre_1_1_bitwise_afa88e9d32bbc468ac3ee803ee4228ca1}{int\+Write} (void $\ast$dest, const int n, const unsigned int value)
\begin{DoxyCompactList}\small\item\em Write a n$\ast$8 bits integer value to memory in native endian. \end{DoxyCompactList}\item 
{\footnotesize template$<$typename T $>$ }\\static \hyperlink{_ogre_platform_8h_a6cbacd9965b6b575077a96dbf96cb23c}{O\+G\+R\+E\+\_\+\+F\+O\+R\+C\+E\+\_\+\+I\+N\+L\+I\+NE} bool \hyperlink{class_ogre_1_1_bitwise_af55c6a0e713a63a957ffd8523193503b}{is\+P\+O2} (T n)
\begin{DoxyCompactList}\small\item\em Determines whether the number is power-\/of-\/two or not. \end{DoxyCompactList}\item 
static \hyperlink{_ogre_platform_8h_a6cbacd9965b6b575077a96dbf96cb23c}{O\+G\+R\+E\+\_\+\+F\+O\+R\+C\+E\+\_\+\+I\+N\+L\+I\+NE} unsigned int \hyperlink{class_ogre_1_1_bitwise_a335fd2a24d35d808c6cdbe2c283e5a43}{most\+Significant\+Bit\+Set} (unsigned int value)
\begin{DoxyCompactList}\small\item\em Returns the most significant bit set in a value. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
Class for manipulating bit patterns. 

\subsection{Member Function Documentation}
\mbox{\Hypertarget{class_ogre_1_1_bitwise_a8e8c70a9058d8b11d3787a6c98cb3f3f}\label{class_ogre_1_1_bitwise_a8e8c70a9058d8b11d3787a6c98cb3f3f}} 
\index{Ogre\+::\+Bitwise@{Ogre\+::\+Bitwise}!bswap16@{bswap16}}
\index{bswap16@{bswap16}!Ogre\+::\+Bitwise@{Ogre\+::\+Bitwise}}
\subsubsection{\texorpdfstring{bswap16()}{bswap16()}}
{\footnotesize\ttfamily static \hyperlink{_ogre_platform_8h_a6cbacd9965b6b575077a96dbf96cb23c}{O\+G\+R\+E\+\_\+\+F\+O\+R\+C\+E\+\_\+\+I\+N\+L\+I\+NE} \hyperlink{namespace_ogre_aa8263b218e7d187ad5ef03a73a6ad7fd}{uint16} Ogre\+::\+Bitwise\+::bswap16 (\begin{DoxyParamCaption}\item[{\hyperlink{namespace_ogre_aa8263b218e7d187ad5ef03a73a6ad7fd}{uint16}}]{arg }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



Returns value with reversed bytes order. 

\mbox{\Hypertarget{class_ogre_1_1_bitwise_a70486a366a7b31916afb626e8b68018d}\label{class_ogre_1_1_bitwise_a70486a366a7b31916afb626e8b68018d}} 
\index{Ogre\+::\+Bitwise@{Ogre\+::\+Bitwise}!bswap32@{bswap32}}
\index{bswap32@{bswap32}!Ogre\+::\+Bitwise@{Ogre\+::\+Bitwise}}
\subsubsection{\texorpdfstring{bswap32()}{bswap32()}}
{\footnotesize\ttfamily static \hyperlink{_ogre_platform_8h_a6cbacd9965b6b575077a96dbf96cb23c}{O\+G\+R\+E\+\_\+\+F\+O\+R\+C\+E\+\_\+\+I\+N\+L\+I\+NE} \hyperlink{namespace_ogre_adf2a0cf2e77143b5ee1d38a75e289545}{uint32} Ogre\+::\+Bitwise\+::bswap32 (\begin{DoxyParamCaption}\item[{\hyperlink{namespace_ogre_adf2a0cf2e77143b5ee1d38a75e289545}{uint32}}]{arg }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



Returns value with reversed bytes order. 



Referenced by bswap64().

\mbox{\Hypertarget{class_ogre_1_1_bitwise_a24be32e70565fada41b0c89184fdd58e}\label{class_ogre_1_1_bitwise_a24be32e70565fada41b0c89184fdd58e}} 
\index{Ogre\+::\+Bitwise@{Ogre\+::\+Bitwise}!bswap64@{bswap64}}
\index{bswap64@{bswap64}!Ogre\+::\+Bitwise@{Ogre\+::\+Bitwise}}
\subsubsection{\texorpdfstring{bswap64()}{bswap64()}}
{\footnotesize\ttfamily static \hyperlink{_ogre_platform_8h_a6cbacd9965b6b575077a96dbf96cb23c}{O\+G\+R\+E\+\_\+\+F\+O\+R\+C\+E\+\_\+\+I\+N\+L\+I\+NE} \hyperlink{namespace_ogre_a7e1487b57f16a1479302d1896c6f4445}{uint64} Ogre\+::\+Bitwise\+::bswap64 (\begin{DoxyParamCaption}\item[{\hyperlink{namespace_ogre_a7e1487b57f16a1479302d1896c6f4445}{uint64}}]{arg }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



Returns value with reversed bytes order. 



References bswap32().

\mbox{\Hypertarget{class_ogre_1_1_bitwise_a26be444ef54cc196d29f801635352e59}\label{class_ogre_1_1_bitwise_a26be444ef54cc196d29f801635352e59}} 
\index{Ogre\+::\+Bitwise@{Ogre\+::\+Bitwise}!bswap\+Buffer@{bswap\+Buffer}}
\index{bswap\+Buffer@{bswap\+Buffer}!Ogre\+::\+Bitwise@{Ogre\+::\+Bitwise}}
\subsubsection{\texorpdfstring{bswap\+Buffer()}{bswapBuffer()}}
{\footnotesize\ttfamily static void Ogre\+::\+Bitwise\+::bswap\+Buffer (\begin{DoxyParamCaption}\item[{void $\ast$}]{p\+Data,  }\item[{size\+\_\+t}]{size }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



Reverses byte order of buffer. 

Use bswap16/32/64 instead if possible. \mbox{\Hypertarget{class_ogre_1_1_bitwise_ad1df153ede686f618fe227ea7c244127}\label{class_ogre_1_1_bitwise_ad1df153ede686f618fe227ea7c244127}} 
\index{Ogre\+::\+Bitwise@{Ogre\+::\+Bitwise}!bswap\+Chunks@{bswap\+Chunks}}
\index{bswap\+Chunks@{bswap\+Chunks}!Ogre\+::\+Bitwise@{Ogre\+::\+Bitwise}}
\subsubsection{\texorpdfstring{bswap\+Chunks()}{bswapChunks()}}
{\footnotesize\ttfamily static void Ogre\+::\+Bitwise\+::bswap\+Chunks (\begin{DoxyParamCaption}\item[{void $\ast$}]{p\+Data,  }\item[{size\+\_\+t}]{size,  }\item[{size\+\_\+t}]{count }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



Reverses byte order of chunks in buffer, where \textquotesingle{}size\textquotesingle{} is size of one chunk. 

\mbox{\Hypertarget{class_ogre_1_1_bitwise_a335fd2a24d35d808c6cdbe2c283e5a43}\label{class_ogre_1_1_bitwise_a335fd2a24d35d808c6cdbe2c283e5a43}} 
\index{Ogre\+::\+Bitwise@{Ogre\+::\+Bitwise}!most\+Significant\+Bit\+Set@{most\+Significant\+Bit\+Set}}
\index{most\+Significant\+Bit\+Set@{most\+Significant\+Bit\+Set}!Ogre\+::\+Bitwise@{Ogre\+::\+Bitwise}}
\subsubsection{\texorpdfstring{most\+Significant\+Bit\+Set()}{mostSignificantBitSet()}}
{\footnotesize\ttfamily static \hyperlink{_ogre_platform_8h_a6cbacd9965b6b575077a96dbf96cb23c}{O\+G\+R\+E\+\_\+\+F\+O\+R\+C\+E\+\_\+\+I\+N\+L\+I\+NE} unsigned int Ogre\+::\+Bitwise\+::most\+Significant\+Bit\+Set (\begin{DoxyParamCaption}\item[{unsigned int}]{value }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



Returns the most significant bit set in a value. 

\mbox{\Hypertarget{class_ogre_1_1_bitwise_a252f77ee338fa56f0161487fe7a5a23b}\label{class_ogre_1_1_bitwise_a252f77ee338fa56f0161487fe7a5a23b}} 
\index{Ogre\+::\+Bitwise@{Ogre\+::\+Bitwise}!first\+P\+O2\+From@{first\+P\+O2\+From}}
\index{first\+P\+O2\+From@{first\+P\+O2\+From}!Ogre\+::\+Bitwise@{Ogre\+::\+Bitwise}}
\subsubsection{\texorpdfstring{first\+P\+O2\+From()}{firstPO2From()}}
{\footnotesize\ttfamily static \hyperlink{_ogre_platform_8h_a6cbacd9965b6b575077a96dbf96cb23c}{O\+G\+R\+E\+\_\+\+F\+O\+R\+C\+E\+\_\+\+I\+N\+L\+I\+NE} \hyperlink{namespace_ogre_adf2a0cf2e77143b5ee1d38a75e289545}{uint32} Ogre\+::\+Bitwise\+::first\+P\+O2\+From (\begin{DoxyParamCaption}\item[{\hyperlink{namespace_ogre_adf2a0cf2e77143b5ee1d38a75e289545}{uint32}}]{n }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



Returns the closest power-\/of-\/two number greater or equal to value. 

\begin{DoxyNote}{Note}
0 and 1 are powers of two, so first\+P\+O2\+From(0)==0 and first\+P\+O2\+From(1)==1. 
\end{DoxyNote}
\mbox{\Hypertarget{class_ogre_1_1_bitwise_af55c6a0e713a63a957ffd8523193503b}\label{class_ogre_1_1_bitwise_af55c6a0e713a63a957ffd8523193503b}} 
\index{Ogre\+::\+Bitwise@{Ogre\+::\+Bitwise}!is\+P\+O2@{is\+P\+O2}}
\index{is\+P\+O2@{is\+P\+O2}!Ogre\+::\+Bitwise@{Ogre\+::\+Bitwise}}
\subsubsection{\texorpdfstring{is\+P\+O2()}{isPO2()}}
{\footnotesize\ttfamily template$<$typename T $>$ \\
static \hyperlink{_ogre_platform_8h_a6cbacd9965b6b575077a96dbf96cb23c}{O\+G\+R\+E\+\_\+\+F\+O\+R\+C\+E\+\_\+\+I\+N\+L\+I\+NE} bool Ogre\+::\+Bitwise\+::is\+P\+O2 (\begin{DoxyParamCaption}\item[{T}]{n }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



Determines whether the number is power-\/of-\/two or not. 

\begin{DoxyNote}{Note}
0 and 1 are tread as power of two. 
\end{DoxyNote}
\mbox{\Hypertarget{class_ogre_1_1_bitwise_adeaa730393732afd86fda47203c023c5}\label{class_ogre_1_1_bitwise_adeaa730393732afd86fda47203c023c5}} 
\index{Ogre\+::\+Bitwise@{Ogre\+::\+Bitwise}!get\+Bit\+Shift@{get\+Bit\+Shift}}
\index{get\+Bit\+Shift@{get\+Bit\+Shift}!Ogre\+::\+Bitwise@{Ogre\+::\+Bitwise}}
\subsubsection{\texorpdfstring{get\+Bit\+Shift()}{getBitShift()}}
{\footnotesize\ttfamily template$<$typename T $>$ \\
static \hyperlink{_ogre_platform_8h_a6cbacd9965b6b575077a96dbf96cb23c}{O\+G\+R\+E\+\_\+\+F\+O\+R\+C\+E\+\_\+\+I\+N\+L\+I\+NE} unsigned int Ogre\+::\+Bitwise\+::get\+Bit\+Shift (\begin{DoxyParamCaption}\item[{T}]{mask }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



Returns the number of bits a pattern must be shifted right by to remove right-\/hand zeros. 



Referenced by convert\+Bit\+Pattern().

\mbox{\Hypertarget{class_ogre_1_1_bitwise_a65c7e2d0a2b2278e58450bb9d289e148}\label{class_ogre_1_1_bitwise_a65c7e2d0a2b2278e58450bb9d289e148}} 
\index{Ogre\+::\+Bitwise@{Ogre\+::\+Bitwise}!convert\+Bit\+Pattern@{convert\+Bit\+Pattern}}
\index{convert\+Bit\+Pattern@{convert\+Bit\+Pattern}!Ogre\+::\+Bitwise@{Ogre\+::\+Bitwise}}
\subsubsection{\texorpdfstring{convert\+Bit\+Pattern()}{convertBitPattern()}}
{\footnotesize\ttfamily template$<$typename SrcT , typename DestT $>$ \\
static DestT Ogre\+::\+Bitwise\+::convert\+Bit\+Pattern (\begin{DoxyParamCaption}\item[{SrcT}]{src\+Value,  }\item[{SrcT}]{src\+Bit\+Mask,  }\item[{DestT}]{dest\+Bit\+Mask }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



Takes a value with a given src bit mask, and produces another value with a desired bit mask. 

\begin{DoxyRemark}{Remarks}
This routine is useful for colour conversion. 
\end{DoxyRemark}


References get\+Bit\+Shift().

\mbox{\Hypertarget{class_ogre_1_1_bitwise_aa59b3726641c31b63aa3e203559ca3bd}\label{class_ogre_1_1_bitwise_aa59b3726641c31b63aa3e203559ca3bd}} 
\index{Ogre\+::\+Bitwise@{Ogre\+::\+Bitwise}!fixed\+To\+Fixed@{fixed\+To\+Fixed}}
\index{fixed\+To\+Fixed@{fixed\+To\+Fixed}!Ogre\+::\+Bitwise@{Ogre\+::\+Bitwise}}
\subsubsection{\texorpdfstring{fixed\+To\+Fixed()}{fixedToFixed()}}
{\footnotesize\ttfamily static unsigned int Ogre\+::\+Bitwise\+::fixed\+To\+Fixed (\begin{DoxyParamCaption}\item[{\hyperlink{namespace_ogre_adf2a0cf2e77143b5ee1d38a75e289545}{uint32}}]{value,  }\item[{unsigned int}]{n,  }\item[{unsigned int}]{p }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



Convert N bit colour channel value to P bits. 

It fills P bits with the bit pattern repeated. (this is /((1$<$$<$n)-\/1) in fixed point) \mbox{\Hypertarget{class_ogre_1_1_bitwise_ad3f4d30ecc1aa5ea112a38e63a47b9c8}\label{class_ogre_1_1_bitwise_ad3f4d30ecc1aa5ea112a38e63a47b9c8}} 
\index{Ogre\+::\+Bitwise@{Ogre\+::\+Bitwise}!float\+To\+Fixed@{float\+To\+Fixed}}
\index{float\+To\+Fixed@{float\+To\+Fixed}!Ogre\+::\+Bitwise@{Ogre\+::\+Bitwise}}
\subsubsection{\texorpdfstring{float\+To\+Fixed()}{floatToFixed()}}
{\footnotesize\ttfamily static unsigned int Ogre\+::\+Bitwise\+::float\+To\+Fixed (\begin{DoxyParamCaption}\item[{const float}]{value,  }\item[{const unsigned int}]{bits }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



Convert floating point colour channel value between 0.\+0 and 1.\+0 (otherwise clamped) to integer of a certain number of bits. 

Works for any value of bits between 0 and 31. \mbox{\Hypertarget{class_ogre_1_1_bitwise_a48006ba79d6f8c690e3131c7b4e441bf}\label{class_ogre_1_1_bitwise_a48006ba79d6f8c690e3131c7b4e441bf}} 
\index{Ogre\+::\+Bitwise@{Ogre\+::\+Bitwise}!fixed\+To\+Float@{fixed\+To\+Float}}
\index{fixed\+To\+Float@{fixed\+To\+Float}!Ogre\+::\+Bitwise@{Ogre\+::\+Bitwise}}
\subsubsection{\texorpdfstring{fixed\+To\+Float()}{fixedToFloat()}}
{\footnotesize\ttfamily static float Ogre\+::\+Bitwise\+::fixed\+To\+Float (\begin{DoxyParamCaption}\item[{unsigned}]{value,  }\item[{unsigned int}]{bits }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



Fixed point to float. 

\mbox{\Hypertarget{class_ogre_1_1_bitwise_afa88e9d32bbc468ac3ee803ee4228ca1}\label{class_ogre_1_1_bitwise_afa88e9d32bbc468ac3ee803ee4228ca1}} 
\index{Ogre\+::\+Bitwise@{Ogre\+::\+Bitwise}!int\+Write@{int\+Write}}
\index{int\+Write@{int\+Write}!Ogre\+::\+Bitwise@{Ogre\+::\+Bitwise}}
\subsubsection{\texorpdfstring{int\+Write()}{intWrite()}}
{\footnotesize\ttfamily static void Ogre\+::\+Bitwise\+::int\+Write (\begin{DoxyParamCaption}\item[{void $\ast$}]{dest,  }\item[{const int}]{n,  }\item[{const unsigned int}]{value }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



Write a n$\ast$8 bits integer value to memory in native endian. 

\mbox{\Hypertarget{class_ogre_1_1_bitwise_ad0fcaa2e4f445d1e9c1fb69291061dec}\label{class_ogre_1_1_bitwise_ad0fcaa2e4f445d1e9c1fb69291061dec}} 
\index{Ogre\+::\+Bitwise@{Ogre\+::\+Bitwise}!int\+Read@{int\+Read}}
\index{int\+Read@{int\+Read}!Ogre\+::\+Bitwise@{Ogre\+::\+Bitwise}}
\subsubsection{\texorpdfstring{int\+Read()}{intRead()}}
{\footnotesize\ttfamily static unsigned int Ogre\+::\+Bitwise\+::int\+Read (\begin{DoxyParamCaption}\item[{const void $\ast$}]{src,  }\item[{int}]{n }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



Read a n$\ast$8 bits integer value to memory in native endian. 

\mbox{\Hypertarget{class_ogre_1_1_bitwise_aa02a9c5a117baf2da38ad562c2130681}\label{class_ogre_1_1_bitwise_aa02a9c5a117baf2da38ad562c2130681}} 
\index{Ogre\+::\+Bitwise@{Ogre\+::\+Bitwise}!float\+To\+Half@{float\+To\+Half}}
\index{float\+To\+Half@{float\+To\+Half}!Ogre\+::\+Bitwise@{Ogre\+::\+Bitwise}}
\subsubsection{\texorpdfstring{float\+To\+Half()}{floatToHalf()}}
{\footnotesize\ttfamily static \hyperlink{namespace_ogre_aa8263b218e7d187ad5ef03a73a6ad7fd}{uint16} Ogre\+::\+Bitwise\+::float\+To\+Half (\begin{DoxyParamCaption}\item[{float}]{i }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



Convert a float32 to a float16 (N\+V\+\_\+half\+\_\+float) Courtesy of Open\+E\+XR. 



References float\+To\+Half\+I().

\mbox{\Hypertarget{class_ogre_1_1_bitwise_ad98268f6e1288301c0471e345e98cd1e}\label{class_ogre_1_1_bitwise_ad98268f6e1288301c0471e345e98cd1e}} 
\index{Ogre\+::\+Bitwise@{Ogre\+::\+Bitwise}!float\+To\+HalfI@{float\+To\+HalfI}}
\index{float\+To\+HalfI@{float\+To\+HalfI}!Ogre\+::\+Bitwise@{Ogre\+::\+Bitwise}}
\subsubsection{\texorpdfstring{float\+To\+Half\+I()}{floatToHalfI()}}
{\footnotesize\ttfamily static \hyperlink{namespace_ogre_aa8263b218e7d187ad5ef03a73a6ad7fd}{uint16} Ogre\+::\+Bitwise\+::float\+To\+HalfI (\begin{DoxyParamCaption}\item[{\hyperlink{namespace_ogre_adf2a0cf2e77143b5ee1d38a75e289545}{uint32}}]{i }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



Converts float in uint32 format to a a half in uint16 format. 



Referenced by float\+To\+Half().

\mbox{\Hypertarget{class_ogre_1_1_bitwise_abb3cbaa74865420859ba7b1061f8d3f3}\label{class_ogre_1_1_bitwise_abb3cbaa74865420859ba7b1061f8d3f3}} 
\index{Ogre\+::\+Bitwise@{Ogre\+::\+Bitwise}!half\+To\+Float@{half\+To\+Float}}
\index{half\+To\+Float@{half\+To\+Float}!Ogre\+::\+Bitwise@{Ogre\+::\+Bitwise}}
\subsubsection{\texorpdfstring{half\+To\+Float()}{halfToFloat()}}
{\footnotesize\ttfamily static float Ogre\+::\+Bitwise\+::half\+To\+Float (\begin{DoxyParamCaption}\item[{\hyperlink{namespace_ogre_aa8263b218e7d187ad5ef03a73a6ad7fd}{uint16}}]{y }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



Convert a float16 (N\+V\+\_\+half\+\_\+float) to a float32 Courtesy of Open\+E\+XR. 



References half\+To\+Float\+I().

\mbox{\Hypertarget{class_ogre_1_1_bitwise_a7ccd62b11c082f76d4972e27896c6028}\label{class_ogre_1_1_bitwise_a7ccd62b11c082f76d4972e27896c6028}} 
\index{Ogre\+::\+Bitwise@{Ogre\+::\+Bitwise}!half\+To\+FloatI@{half\+To\+FloatI}}
\index{half\+To\+FloatI@{half\+To\+FloatI}!Ogre\+::\+Bitwise@{Ogre\+::\+Bitwise}}
\subsubsection{\texorpdfstring{half\+To\+Float\+I()}{halfToFloatI()}}
{\footnotesize\ttfamily static \hyperlink{namespace_ogre_adf2a0cf2e77143b5ee1d38a75e289545}{uint32} Ogre\+::\+Bitwise\+::half\+To\+FloatI (\begin{DoxyParamCaption}\item[{\hyperlink{namespace_ogre_aa8263b218e7d187ad5ef03a73a6ad7fd}{uint16}}]{y }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



Converts a half in uint16 format to a float in uint32 format. 



Referenced by half\+To\+Float().



The documentation for this class was generated from the following file\+:\begin{DoxyCompactItemize}
\item 
\hyperlink{_ogre_bitwise_8h}{Ogre\+Bitwise.\+h}\end{DoxyCompactItemize}
