\hypertarget{class_ogre_1_1_bitwise}{}\doxysection{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$>$}

\doxysubsection*{Static Public Member Functions}
\begin{DoxyCompactItemize}
\item 
static \mbox{\hyperlink{_ogre_platform_8h_a6cbacd9965b6b575077a96dbf96cb23c}{O\+G\+R\+E\+\_\+\+F\+O\+R\+C\+E\+\_\+\+I\+N\+L\+I\+NE}} \mbox{\hyperlink{namespace_ogre_aa8263b218e7d187ad5ef03a73a6ad7fd}{uint16}} \mbox{\hyperlink{class_ogre_1_1_bitwise_a8e8c70a9058d8b11d3787a6c98cb3f3f}{bswap16}} (\mbox{\hyperlink{namespace_ogre_aa8263b218e7d187ad5ef03a73a6ad7fd}{uint16}} arg)
\begin{DoxyCompactList}\small\item\em Returns value with reversed bytes order. \end{DoxyCompactList}\item 
static \mbox{\hyperlink{_ogre_platform_8h_a6cbacd9965b6b575077a96dbf96cb23c}{O\+G\+R\+E\+\_\+\+F\+O\+R\+C\+E\+\_\+\+I\+N\+L\+I\+NE}} \mbox{\hyperlink{namespace_ogre_adf2a0cf2e77143b5ee1d38a75e289545}{uint32}} \mbox{\hyperlink{class_ogre_1_1_bitwise_a70486a366a7b31916afb626e8b68018d}{bswap32}} (\mbox{\hyperlink{namespace_ogre_adf2a0cf2e77143b5ee1d38a75e289545}{uint32}} arg)
\begin{DoxyCompactList}\small\item\em Returns value with reversed bytes order. \end{DoxyCompactList}\item 
static \mbox{\hyperlink{_ogre_platform_8h_a6cbacd9965b6b575077a96dbf96cb23c}{O\+G\+R\+E\+\_\+\+F\+O\+R\+C\+E\+\_\+\+I\+N\+L\+I\+NE}} \mbox{\hyperlink{namespace_ogre_a7e1487b57f16a1479302d1896c6f4445}{uint64}} \mbox{\hyperlink{class_ogre_1_1_bitwise_a24be32e70565fada41b0c89184fdd58e}{bswap64}} (\mbox{\hyperlink{namespace_ogre_a7e1487b57f16a1479302d1896c6f4445}{uint64}} arg)
\begin{DoxyCompactList}\small\item\em Returns value with reversed bytes order. \end{DoxyCompactList}\item 
static void \mbox{\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 \mbox{\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 \mbox{\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 \mbox{\hyperlink{_ogre_platform_8h_a6cbacd9965b6b575077a96dbf96cb23c}{O\+G\+R\+E\+\_\+\+F\+O\+R\+C\+E\+\_\+\+I\+N\+L\+I\+NE}} \mbox{\hyperlink{namespace_ogre_adf2a0cf2e77143b5ee1d38a75e289545}{uint32}} \mbox{\hyperlink{class_ogre_1_1_bitwise_a252f77ee338fa56f0161487fe7a5a23b}{first\+P\+O2\+From}} (\mbox{\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 \mbox{\hyperlink{class_ogre_1_1_bitwise_aa59b3726641c31b63aa3e203559ca3bd}{fixed\+To\+Fixed}} (\mbox{\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 \mbox{\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 \mbox{\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 \mbox{\hyperlink{namespace_ogre_aa8263b218e7d187ad5ef03a73a6ad7fd}{uint16}} \mbox{\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 \mbox{\hyperlink{namespace_ogre_aa8263b218e7d187ad5ef03a73a6ad7fd}{uint16}} \mbox{\hyperlink{class_ogre_1_1_bitwise_ad98268f6e1288301c0471e345e98cd1e}{float\+To\+HalfI}} (\mbox{\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 \mbox{\hyperlink{_ogre_platform_8h_a6cbacd9965b6b575077a96dbf96cb23c}{O\+G\+R\+E\+\_\+\+F\+O\+R\+C\+E\+\_\+\+I\+N\+L\+I\+NE}} unsigned int \mbox{\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 \mbox{\hyperlink{class_ogre_1_1_bitwise_abb3cbaa74865420859ba7b1061f8d3f3}{half\+To\+Float}} (\mbox{\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 \mbox{\hyperlink{namespace_ogre_adf2a0cf2e77143b5ee1d38a75e289545}{uint32}} \mbox{\hyperlink{class_ogre_1_1_bitwise_a7ccd62b11c082f76d4972e27896c6028}{half\+To\+FloatI}} (\mbox{\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 \mbox{\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 \mbox{\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 \mbox{\hyperlink{_ogre_platform_8h_a6cbacd9965b6b575077a96dbf96cb23c}{O\+G\+R\+E\+\_\+\+F\+O\+R\+C\+E\+\_\+\+I\+N\+L\+I\+NE}} bool \mbox{\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 \mbox{\hyperlink{_ogre_platform_8h_a6cbacd9965b6b575077a96dbf96cb23c}{O\+G\+R\+E\+\_\+\+F\+O\+R\+C\+E\+\_\+\+I\+N\+L\+I\+NE}} unsigned int \mbox{\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}


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

\doxysubsection{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}}
\doxysubsubsection{\texorpdfstring{bswap16()}{bswap16()}}
{\footnotesize\ttfamily static \mbox{\hyperlink{_ogre_platform_8h_a6cbacd9965b6b575077a96dbf96cb23c}{O\+G\+R\+E\+\_\+\+F\+O\+R\+C\+E\+\_\+\+I\+N\+L\+I\+NE}} \mbox{\hyperlink{namespace_ogre_aa8263b218e7d187ad5ef03a73a6ad7fd}{uint16}} Ogre\+::\+Bitwise\+::bswap16 (\begin{DoxyParamCaption}\item[{\mbox{\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}}
\doxysubsubsection{\texorpdfstring{bswap32()}{bswap32()}}
{\footnotesize\ttfamily static \mbox{\hyperlink{_ogre_platform_8h_a6cbacd9965b6b575077a96dbf96cb23c}{O\+G\+R\+E\+\_\+\+F\+O\+R\+C\+E\+\_\+\+I\+N\+L\+I\+NE}} \mbox{\hyperlink{namespace_ogre_adf2a0cf2e77143b5ee1d38a75e289545}{uint32}} Ogre\+::\+Bitwise\+::bswap32 (\begin{DoxyParamCaption}\item[{\mbox{\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}}
\doxysubsubsection{\texorpdfstring{bswap64()}{bswap64()}}
{\footnotesize\ttfamily static \mbox{\hyperlink{_ogre_platform_8h_a6cbacd9965b6b575077a96dbf96cb23c}{O\+G\+R\+E\+\_\+\+F\+O\+R\+C\+E\+\_\+\+I\+N\+L\+I\+NE}} \mbox{\hyperlink{namespace_ogre_a7e1487b57f16a1479302d1896c6f4445}{uint64}} Ogre\+::\+Bitwise\+::bswap64 (\begin{DoxyParamCaption}\item[{\mbox{\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}!bswapBuffer@{bswapBuffer}}
\index{bswapBuffer@{bswapBuffer}!Ogre::Bitwise@{Ogre::Bitwise}}
\doxysubsubsection{\texorpdfstring{bswapBuffer()}{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}!bswapChunks@{bswapChunks}}
\index{bswapChunks@{bswapChunks}!Ogre::Bitwise@{Ogre::Bitwise}}
\doxysubsubsection{\texorpdfstring{bswapChunks()}{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}!mostSignificantBitSet@{mostSignificantBitSet}}
\index{mostSignificantBitSet@{mostSignificantBitSet}!Ogre::Bitwise@{Ogre::Bitwise}}
\doxysubsubsection{\texorpdfstring{mostSignificantBitSet()}{mostSignificantBitSet()}}
{\footnotesize\ttfamily static \mbox{\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}!firstPO2From@{firstPO2From}}
\index{firstPO2From@{firstPO2From}!Ogre::Bitwise@{Ogre::Bitwise}}
\doxysubsubsection{\texorpdfstring{firstPO2From()}{firstPO2From()}}
{\footnotesize\ttfamily static \mbox{\hyperlink{_ogre_platform_8h_a6cbacd9965b6b575077a96dbf96cb23c}{O\+G\+R\+E\+\_\+\+F\+O\+R\+C\+E\+\_\+\+I\+N\+L\+I\+NE}} \mbox{\hyperlink{namespace_ogre_adf2a0cf2e77143b5ee1d38a75e289545}{uint32}} Ogre\+::\+Bitwise\+::first\+P\+O2\+From (\begin{DoxyParamCaption}\item[{\mbox{\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}!isPO2@{isPO2}}
\index{isPO2@{isPO2}!Ogre::Bitwise@{Ogre::Bitwise}}
\doxysubsubsection{\texorpdfstring{isPO2()}{isPO2()}}
{\footnotesize\ttfamily template$<$typename T $>$ \\
static \mbox{\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}!getBitShift@{getBitShift}}
\index{getBitShift@{getBitShift}!Ogre::Bitwise@{Ogre::Bitwise}}
\doxysubsubsection{\texorpdfstring{getBitShift()}{getBitShift()}}
{\footnotesize\ttfamily template$<$typename T $>$ \\
static \mbox{\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}!convertBitPattern@{convertBitPattern}}
\index{convertBitPattern@{convertBitPattern}!Ogre::Bitwise@{Ogre::Bitwise}}
\doxysubsubsection{\texorpdfstring{convertBitPattern()}{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}!fixedToFixed@{fixedToFixed}}
\index{fixedToFixed@{fixedToFixed}!Ogre::Bitwise@{Ogre::Bitwise}}
\doxysubsubsection{\texorpdfstring{fixedToFixed()}{fixedToFixed()}}
{\footnotesize\ttfamily static unsigned int Ogre\+::\+Bitwise\+::fixed\+To\+Fixed (\begin{DoxyParamCaption}\item[{\mbox{\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}!floatToFixed@{floatToFixed}}
\index{floatToFixed@{floatToFixed}!Ogre::Bitwise@{Ogre::Bitwise}}
\doxysubsubsection{\texorpdfstring{floatToFixed()}{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}!fixedToFloat@{fixedToFloat}}
\index{fixedToFloat@{fixedToFloat}!Ogre::Bitwise@{Ogre::Bitwise}}
\doxysubsubsection{\texorpdfstring{fixedToFloat()}{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}!intWrite@{intWrite}}
\index{intWrite@{intWrite}!Ogre::Bitwise@{Ogre::Bitwise}}
\doxysubsubsection{\texorpdfstring{intWrite()}{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}!intRead@{intRead}}
\index{intRead@{intRead}!Ogre::Bitwise@{Ogre::Bitwise}}
\doxysubsubsection{\texorpdfstring{intRead()}{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}!floatToHalf@{floatToHalf}}
\index{floatToHalf@{floatToHalf}!Ogre::Bitwise@{Ogre::Bitwise}}
\doxysubsubsection{\texorpdfstring{floatToHalf()}{floatToHalf()}}
{\footnotesize\ttfamily static \mbox{\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}!floatToHalfI@{floatToHalfI}}
\index{floatToHalfI@{floatToHalfI}!Ogre::Bitwise@{Ogre::Bitwise}}
\doxysubsubsection{\texorpdfstring{floatToHalfI()}{floatToHalfI()}}
{\footnotesize\ttfamily static \mbox{\hyperlink{namespace_ogre_aa8263b218e7d187ad5ef03a73a6ad7fd}{uint16}} Ogre\+::\+Bitwise\+::float\+To\+HalfI (\begin{DoxyParamCaption}\item[{\mbox{\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}!halfToFloat@{halfToFloat}}
\index{halfToFloat@{halfToFloat}!Ogre::Bitwise@{Ogre::Bitwise}}
\doxysubsubsection{\texorpdfstring{halfToFloat()}{halfToFloat()}}
{\footnotesize\ttfamily static float Ogre\+::\+Bitwise\+::half\+To\+Float (\begin{DoxyParamCaption}\item[{\mbox{\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}!halfToFloatI@{halfToFloatI}}
\index{halfToFloatI@{halfToFloatI}!Ogre::Bitwise@{Ogre::Bitwise}}
\doxysubsubsection{\texorpdfstring{halfToFloatI()}{halfToFloatI()}}
{\footnotesize\ttfamily static \mbox{\hyperlink{namespace_ogre_adf2a0cf2e77143b5ee1d38a75e289545}{uint32}} Ogre\+::\+Bitwise\+::half\+To\+FloatI (\begin{DoxyParamCaption}\item[{\mbox{\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 
\mbox{\hyperlink{_ogre_bitwise_8h}{Ogre\+Bitwise.\+h}}\end{DoxyCompactItemize}
