\hypertarget{classCPGFImage}{}\section{C\+P\+G\+F\+Image Class Reference}
\label{classCPGFImage}\index{CPGFImage@{CPGFImage}}


P\+GF main class.  




{\ttfamily \#include $<$P\+G\+Fimage.\+h$>$}

\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\mbox{\hyperlink{classCPGFImage_af98838248d4bb5e0b2e89e2cd31b4b71}{C\+P\+G\+F\+Image}} ()
\begin{DoxyCompactList}\small\item\em Standard constructor. \end{DoxyCompactList}\item 
virtual \mbox{\hyperlink{classCPGFImage_a1bdfdce118d4a7c9167154b5ff0bb670}{$\sim$\+C\+P\+G\+F\+Image}} ()
\begin{DoxyCompactList}\small\item\em Destructor. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{classCPGFImage_a4a3e55e2e2d8ddf79506769feb8938ec}{Destroy}} ()
\item 
void \mbox{\hyperlink{classCPGFImage_adbe9092b915a2c5b2361f4db186b991c}{Open}} (\mbox{\hyperlink{classCPGFStream}{C\+P\+G\+F\+Stream}} $\ast$stream)
\item 
bool \mbox{\hyperlink{classCPGFImage_a73a46482fbfc549f8baa485c9b09f67a}{Is\+Open}} () const
\begin{DoxyCompactList}\small\item\em Returns true if the P\+GF has been opened for reading. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{classCPGFImage_a4a1d49cdf9da6934381bb25332d85ccf}{Read}} (int level=0, Callback\+Ptr cb=nullptr, void $\ast$data=nullptr)
\item 
void \mbox{\hyperlink{classCPGFImage_ad25f535f946f5a711576d6b28774cbb9}{Read}} (\mbox{\hyperlink{structPGFRect}{P\+G\+F\+Rect}} \&rect, int level=0, Callback\+Ptr cb=nullptr, void $\ast$data=nullptr)
\item 
void \mbox{\hyperlink{classCPGFImage_a126846c7265783e14da0f4dde6c9346b}{Read\+Preview}} ()
\item 
void \mbox{\hyperlink{classCPGFImage_abf906b469e11800e819db00009255b90}{Reconstruct}} (int level=0)
\item 
void \mbox{\hyperlink{classCPGFImage_a6a79885f55b60739b16fb961efb041ce}{Get\+Bitmap}} (int pitch, U\+I\+N\+T8 $\ast$buff, B\+Y\+TE bpp, int channel\+Map\mbox{[}$\,$\mbox{]}=nullptr, Callback\+Ptr cb=nullptr, void $\ast$data=nullptr) const
\item 
void \mbox{\hyperlink{classCPGFImage_a37c2f9a6b99c0e0b3564433e21f88e9b}{Get\+Y\+UV}} (int pitch, \mbox{\hyperlink{PGFtypes_8h_acb1ee3f52ccfad782dcaa0abd79e5d05}{DataT}} $\ast$buff, B\+Y\+TE bpp, int channel\+Map\mbox{[}$\,$\mbox{]}=nullptr, Callback\+Ptr cb=nullptr, void $\ast$data=nullptr) const
\item 
void \mbox{\hyperlink{classCPGFImage_a3c0895f4738c5222de1920c941a71541}{Import\+Bitmap}} (int pitch, U\+I\+N\+T8 $\ast$buff, B\+Y\+TE bpp, int channel\+Map\mbox{[}$\,$\mbox{]}=nullptr, Callback\+Ptr cb=nullptr, void $\ast$data=nullptr)
\item 
void \mbox{\hyperlink{classCPGFImage_a5685c45a74b14b9f12ee2d81f49718f3}{Import\+Y\+UV}} (int pitch, \mbox{\hyperlink{PGFtypes_8h_acb1ee3f52ccfad782dcaa0abd79e5d05}{DataT}} $\ast$buff, B\+Y\+TE bpp, int channel\+Map\mbox{[}$\,$\mbox{]}=nullptr, Callback\+Ptr cb=nullptr, void $\ast$data=nullptr)
\item 
void \mbox{\hyperlink{classCPGFImage_acd13d233dceaeefce3def7d71ebf4f82}{Write}} (\mbox{\hyperlink{classCPGFStream}{C\+P\+G\+F\+Stream}} $\ast$stream, U\+I\+N\+T32 $\ast$n\+Written\+Bytes=nullptr, Callback\+Ptr cb=nullptr, void $\ast$data=nullptr)
\item 
U\+I\+N\+T32 \mbox{\hyperlink{classCPGFImage_a1d853cd049417f0afc9a868664d7134d}{Write\+Header}} (\mbox{\hyperlink{classCPGFStream}{C\+P\+G\+F\+Stream}} $\ast$stream)
\item 
U\+I\+N\+T32 \mbox{\hyperlink{classCPGFImage_a0f0657eaf1a62ab14c01834e5c7adb07}{Write\+Image}} (\mbox{\hyperlink{classCPGFStream}{C\+P\+G\+F\+Stream}} $\ast$stream, Callback\+Ptr cb=nullptr, void $\ast$data=nullptr)
\item 
U\+I\+N\+T32 \mbox{\hyperlink{classCPGFImage_a9a0ef3ad10c8a14b2b9a8d6153387ffe}{Write}} (int level, Callback\+Ptr cb=nullptr, void $\ast$data=nullptr)
\item 
void \mbox{\hyperlink{classCPGFImage_a3215ac6bee3c5f6bb7e1c4b7fc53a4a2}{Configure\+Encoder}} (bool use\+O\+MP=true, bool favor\+Speed\+Over\+Size=false)
\item 
void \mbox{\hyperlink{classCPGFImage_a46c30bb2dab1bf3c51f150300b2745b5}{Configure\+Decoder}} (bool use\+O\+MP=true, \mbox{\hyperlink{PGFtypes_8h_a0e70eeba0994fafcbfe6cbea3a734096}{Userdata\+Policy}} policy=\mbox{\hyperlink{PGFtypes_8h_a0e70eeba0994fafcbfe6cbea3a734096ad52de87e33912adabcf1e22f05e38227}{U\+P\+\_\+\+Cache\+All}}, U\+I\+N\+T32 prefix\+Size=0)
\item 
void \mbox{\hyperlink{classCPGFImage_a7df11c06be23e14f83c9aa343f1204d0}{Reset\+Stream\+Pos}} (bool start\+Of\+Data)
\item 
void \mbox{\hyperlink{classCPGFImage_a2f470e1cfdb1300338e32f0926588a6c}{Set\+Channel}} (\mbox{\hyperlink{PGFtypes_8h_acb1ee3f52ccfad782dcaa0abd79e5d05}{DataT}} $\ast$channel, int c=0)
\item 
void \mbox{\hyperlink{classCPGFImage_a200790d3be292a19fe8cbdd78ddfc386}{Set\+Header}} (const \mbox{\hyperlink{structPGFHeader}{P\+G\+F\+Header}} \&header, B\+Y\+TE flags=0, const U\+I\+N\+T8 $\ast$user\+Data=0, U\+I\+N\+T32 user\+Data\+Length=0)
\item 
void \mbox{\hyperlink{classCPGFImage_a6a6370e6737d250360cb6431d885a685}{Set\+Max\+Value}} (U\+I\+N\+T32 max\+Value)
\item 
void \mbox{\hyperlink{classCPGFImage_ad5ec0d246d068c55fdea5712f2b1609c}{Set\+Progress\+Mode}} (\mbox{\hyperlink{PGFtypes_8h_a04561479f4f8aa5a0775d8b541a1157e}{Progress\+Mode}} pm)
\item 
void \mbox{\hyperlink{classCPGFImage_abbca597528f7f9bd28ddd95e8f530e24}{Set\+Refresh\+Callback}} (\mbox{\hyperlink{PGFtypes_8h_a80e898ce785fbd6fb0dfcc5903be79c2}{Refresh\+CB}} callback, void $\ast$arg)
\item 
void \mbox{\hyperlink{classCPGFImage_a35b54c9108fa67d99fad592b415b2bf5}{Set\+Color\+Table}} (U\+I\+N\+T32 i\+First\+Color, U\+I\+N\+T32 n\+Colors, const R\+G\+B\+Q\+U\+AD $\ast$prgb\+Colors)
\item 
\mbox{\hyperlink{PGFtypes_8h_acb1ee3f52ccfad782dcaa0abd79e5d05}{DataT}} $\ast$ \mbox{\hyperlink{classCPGFImage_ae4be1897b3b07449b7e77f95a29032f6}{Get\+Channel}} (int c=0)
\item 
void \mbox{\hyperlink{classCPGFImage_af9e57bf57786030eab6ed17df9d9342e}{Get\+Color\+Table}} (U\+I\+N\+T32 i\+First\+Color, U\+I\+N\+T32 n\+Colors, R\+G\+B\+Q\+U\+AD $\ast$prgb\+Colors) const
\item 
const R\+G\+B\+Q\+U\+AD $\ast$ \mbox{\hyperlink{classCPGFImage_aef236343eaa0809a255d1bea58e9bf9d}{Get\+Color\+Table}} () const
\item 
const \mbox{\hyperlink{structPGFHeader}{P\+G\+F\+Header}} $\ast$ \mbox{\hyperlink{classCPGFImage_a485b62ca1f9b649d6ff590fe28657cf3}{Get\+Header}} () const
\item 
U\+I\+N\+T32 \mbox{\hyperlink{classCPGFImage_a205a92be52bd2047ade0398ed4bb2afb}{Get\+Max\+Value}} () const
\item 
U\+I\+N\+T64 \mbox{\hyperlink{classCPGFImage_a216a89fa33c755a379ba243610284b03}{Get\+User\+Data\+Pos}} () const
\item 
const U\+I\+N\+T8 $\ast$ \mbox{\hyperlink{classCPGFImage_aa7c092c2b27df184d7e81bef579e270c}{Get\+User\+Data}} (U\+I\+N\+T32 \&cached\+Size, U\+I\+N\+T32 $\ast$p\+Total\+Size=nullptr) const
\item 
U\+I\+N\+T32 \mbox{\hyperlink{classCPGFImage_acf90fa7c083fba0479ce70200cccf716}{Get\+Encoded\+Header\+Length}} () const
\item 
U\+I\+N\+T32 \mbox{\hyperlink{classCPGFImage_a9d39b7f0067bf5b35b0cd7cbba9a1d4f}{Get\+Encoded\+Level\+Length}} (int level) const
\item 
U\+I\+N\+T32 \mbox{\hyperlink{classCPGFImage_a55a27e09a6bcd1bca6d57335956dc76c}{Read\+Encoded\+Header}} (U\+I\+N\+T8 $\ast$target, U\+I\+N\+T32 target\+Len) const
\item 
U\+I\+N\+T32 \mbox{\hyperlink{classCPGFImage_a570d1d1072cdd3e24b838c066abc8da3}{Read\+Encoded\+Data}} (int level, U\+I\+N\+T8 $\ast$target, U\+I\+N\+T32 target\+Len) const
\item 
U\+I\+N\+T32 \mbox{\hyperlink{classCPGFImage_a3db1d8a7c652f726b7f15fa3fdc7e958}{Channel\+Width}} (int c=0) const
\item 
U\+I\+N\+T32 \mbox{\hyperlink{classCPGFImage_a0e8b083f86199861e78334054c945863}{Channel\+Height}} (int c=0) const
\item 
B\+Y\+TE \mbox{\hyperlink{classCPGFImage_a5f94308750aece503dc6433d1ad89c8a}{Channel\+Depth}} () const
\item 
U\+I\+N\+T32 \mbox{\hyperlink{classCPGFImage_a327590f3bda3700649fbc7c99f8206f2}{Width}} (int level=0) const
\item 
U\+I\+N\+T32 \mbox{\hyperlink{classCPGFImage_aab401a02923fc9161e890602f26c829e}{Height}} (int level=0) const
\item 
B\+Y\+TE \mbox{\hyperlink{classCPGFImage_a4619eb255afd03dabea2b0afbe6e0d94}{Level}} () const
\item 
B\+Y\+TE \mbox{\hyperlink{classCPGFImage_ab3678d05c031dc4cbf5451e7f4f6bdf3}{Levels}} () const
\item 
bool \mbox{\hyperlink{classCPGFImage_a3b6f8f9c75dd377a3cd6bf1e07e68531}{Is\+Fully\+Read}} () const
\begin{DoxyCompactList}\small\item\em Return true if all levels have been read. \end{DoxyCompactList}\item 
B\+Y\+TE \mbox{\hyperlink{classCPGFImage_a6d8ca06237591aae49d7f25278067c63}{Quality}} () const
\item 
B\+Y\+TE \mbox{\hyperlink{classCPGFImage_af712acd16a3b00d55c03e355939086fc}{Channels}} () const
\item 
B\+Y\+TE \mbox{\hyperlink{classCPGFImage_a8c60aabdcf2556e9a425052e7f5b5d30}{Mode}} () const
\item 
B\+Y\+TE \mbox{\hyperlink{classCPGFImage_ace9320cc25d748d77a7dfee759f01caa}{B\+PP}} () const
\item 
bool \mbox{\hyperlink{classCPGFImage_a9db775cf3a36997b55106fbab7284c14}{R\+O\+Iis\+Supported}} () const
\item 
\mbox{\hyperlink{structPGFRect}{P\+G\+F\+Rect}} \mbox{\hyperlink{classCPGFImage_a6e745b509e9bea4ad35f951f37693fc4}{Compute\+Level\+R\+OI}} () const
\item 
B\+Y\+TE \mbox{\hyperlink{classCPGFImage_a6cc4f75843c3c15f573aaa0131649b10}{Used\+Bits\+Per\+Channel}} () const
\item 
B\+Y\+TE \mbox{\hyperlink{classCPGFImage_aa872f5010f55a3bc696706d259b52051}{Version}} () const
\end{DoxyCompactItemize}
\subsection*{Static Public Member Functions}
\begin{DoxyCompactItemize}
\item 
static bool \mbox{\hyperlink{classCPGFImage_a5c32194271d4e115b8f5c7fdfc1670a5}{Import\+Is\+Supported}} (B\+Y\+TE mode)
\item 
static U\+I\+N\+T32 \mbox{\hyperlink{classCPGFImage_ad7e2f885a059a39ca15a47ecb497833b}{Level\+SizeL}} (U\+I\+N\+T32 size, int level)
\item 
static U\+I\+N\+T32 \mbox{\hyperlink{classCPGFImage_a96e7712f6033810f386a23f2faec0037}{Level\+SizeH}} (U\+I\+N\+T32 size, int level)
\item 
static B\+Y\+TE \mbox{\hyperlink{classCPGFImage_a58e8d626654a10486149146c8cd41d11}{Codec\+Major\+Version}} (B\+Y\+TE version=\mbox{\hyperlink{PGFtypes_8h_aba6dadeb0788b7e02ab3c4425c6ef38a}{P\+G\+F\+Version}})
\begin{DoxyCompactList}\small\item\em Return major version. \end{DoxyCompactList}\item 
static B\+Y\+TE \mbox{\hyperlink{classCPGFImage_a368601b5942e4406cdb87120406ff075}{Max\+Channel\+Depth}} (B\+Y\+TE version=\mbox{\hyperlink{PGFtypes_8h_aba6dadeb0788b7e02ab3c4425c6ef38a}{P\+G\+F\+Version}})
\end{DoxyCompactItemize}
\subsection*{Protected Attributes}
\begin{DoxyCompactItemize}
\item 
\mbox{\hyperlink{classCWaveletTransform}{C\+Wavelet\+Transform}} $\ast$ \mbox{\hyperlink{classCPGFImage_ae3901a689b7d1dd46d48b042c3d31d5c}{m\+\_\+wt\+Channel}} \mbox{[}\mbox{\hyperlink{PGFtypes_8h_a94219182f88d4dbed1021ed04db75e41}{Max\+Channels}}\mbox{]}
\begin{DoxyCompactList}\small\item\em wavelet transformed color channels \end{DoxyCompactList}\item 
\mbox{\hyperlink{PGFtypes_8h_acb1ee3f52ccfad782dcaa0abd79e5d05}{DataT}} $\ast$ \mbox{\hyperlink{classCPGFImage_a36f7f20b38a9cb3a9c88032f5f886345}{m\+\_\+channel}} \mbox{[}\mbox{\hyperlink{PGFtypes_8h_a94219182f88d4dbed1021ed04db75e41}{Max\+Channels}}\mbox{]}
\begin{DoxyCompactList}\small\item\em untransformed channels in Y\+UV format \end{DoxyCompactList}\item 
\mbox{\hyperlink{classCDecoder}{C\+Decoder}} $\ast$ \mbox{\hyperlink{classCPGFImage_a1058b29a3d046e171a2fe48168b66d38}{m\+\_\+decoder}}
\begin{DoxyCompactList}\small\item\em P\+GF decoder. \end{DoxyCompactList}\item 
\mbox{\hyperlink{classCEncoder}{C\+Encoder}} $\ast$ \mbox{\hyperlink{classCPGFImage_a6ef048255812525cd56d7b04df5e6731}{m\+\_\+encoder}}
\begin{DoxyCompactList}\small\item\em P\+GF encoder. \end{DoxyCompactList}\item 
U\+I\+N\+T32 $\ast$ \mbox{\hyperlink{classCPGFImage_a1635ef5dca13bd07276d112a72316a73}{m\+\_\+level\+Length}}
\begin{DoxyCompactList}\small\item\em length of each level in bytes; first level starts immediately after this array \end{DoxyCompactList}\item 
U\+I\+N\+T32 \mbox{\hyperlink{classCPGFImage_ab6d97aca28795fae697fdda4b8acd8f9}{m\+\_\+width}} \mbox{[}\mbox{\hyperlink{PGFtypes_8h_a94219182f88d4dbed1021ed04db75e41}{Max\+Channels}}\mbox{]}
\begin{DoxyCompactList}\small\item\em width of each channel at current level \end{DoxyCompactList}\item 
U\+I\+N\+T32 \mbox{\hyperlink{classCPGFImage_a170fd448152303a2d44848a52a8916a0}{m\+\_\+height}} \mbox{[}\mbox{\hyperlink{PGFtypes_8h_a94219182f88d4dbed1021ed04db75e41}{Max\+Channels}}\mbox{]}
\begin{DoxyCompactList}\small\item\em height of each channel at current level \end{DoxyCompactList}\item 
\mbox{\hyperlink{structPGFPreHeader}{P\+G\+F\+Pre\+Header}} \mbox{\hyperlink{classCPGFImage_ad5ed0ec587742ebf46f72be4abde305d}{m\+\_\+pre\+Header}}
\begin{DoxyCompactList}\small\item\em P\+GF pre-\/header. \end{DoxyCompactList}\item 
\mbox{\hyperlink{structPGFHeader}{P\+G\+F\+Header}} \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\+\_\+header}}
\begin{DoxyCompactList}\small\item\em P\+GF file header. \end{DoxyCompactList}\item 
\mbox{\hyperlink{structPGFPostHeader}{P\+G\+F\+Post\+Header}} \mbox{\hyperlink{classCPGFImage_ab8635df22839ffb68bada53e38b9ce73}{m\+\_\+post\+Header}}
\begin{DoxyCompactList}\small\item\em P\+GF post-\/header. \end{DoxyCompactList}\item 
U\+I\+N\+T64 \mbox{\hyperlink{classCPGFImage_acf4ae6e169ddf84e32cf9b57a22800b3}{m\+\_\+user\+Data\+Pos}}
\begin{DoxyCompactList}\small\item\em stream position of user data \end{DoxyCompactList}\item 
int \mbox{\hyperlink{classCPGFImage_a2790b468b6d4841cd34473c4b61d0c7f}{m\+\_\+current\+Level}}
\begin{DoxyCompactList}\small\item\em transform level of current image \end{DoxyCompactList}\item 
U\+I\+N\+T32 \mbox{\hyperlink{classCPGFImage_a18e28eef51d17c3bd0be4d4f758a6a86}{m\+\_\+user\+Data\+Policy}}
\begin{DoxyCompactList}\small\item\em user data (metadata) policy during open \end{DoxyCompactList}\item 
B\+Y\+TE \mbox{\hyperlink{classCPGFImage_a57cc024db6e510f95f3238f448a0fed5}{m\+\_\+quant}}
\begin{DoxyCompactList}\small\item\em quantization parameter \end{DoxyCompactList}\item 
bool \mbox{\hyperlink{classCPGFImage_a9226595ea6b907e4d07301a6ee641b87}{m\+\_\+downsample}}
\begin{DoxyCompactList}\small\item\em chrominance channels are downsampled \end{DoxyCompactList}\item 
bool \mbox{\hyperlink{classCPGFImage_a6925d3950e8f48487205d46de7920d3e}{m\+\_\+favor\+Speed\+Over\+Size}}
\begin{DoxyCompactList}\small\item\em favor encoding speed over compression ratio \end{DoxyCompactList}\item 
bool \mbox{\hyperlink{classCPGFImage_a140110570c6d492b23db50189d3f4d48}{m\+\_\+use\+O\+M\+Pin\+Encoder}}
\begin{DoxyCompactList}\small\item\em use Open MP in encoder \end{DoxyCompactList}\item 
bool \mbox{\hyperlink{classCPGFImage_a01d0752d97900040fa1db7f02d4770cb}{m\+\_\+use\+O\+M\+Pin\+Decoder}}
\begin{DoxyCompactList}\small\item\em use Open MP in decoder \end{DoxyCompactList}\item 
bool \mbox{\hyperlink{classCPGFImage_af6d3fe5a8622634d1d0faf56cde335ef}{m\+\_\+stream\+Reinitialized}}
\begin{DoxyCompactList}\small\item\em stream has been reinitialized \end{DoxyCompactList}\item 
\mbox{\hyperlink{structPGFRect}{P\+G\+F\+Rect}} \mbox{\hyperlink{classCPGFImage_a79627ae9b19c69589eaa2ba7711ddd00}{m\+\_\+roi}}
\begin{DoxyCompactList}\small\item\em region of interest \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Private Member Functions}
\begin{DoxyCompactItemize}
\item 
void \mbox{\hyperlink{classCPGFImage_ab32b4053e41cc205cce45be8045e603b}{Init}} ()
\item 
void \mbox{\hyperlink{classCPGFImage_ad1ac56e997c83c4c7fe8283b70b84b85}{Compute\+Levels}} ()
\item 
bool \mbox{\hyperlink{classCPGFImage_a0f517491e6b64353cd9ba45f8697b865}{Complete\+Header}} ()
\item 
void \mbox{\hyperlink{classCPGFImage_a7a870dea53390ffe1af210069f6b30eb}{Rgb\+To\+Yuv}} (int pitch, U\+I\+N\+T8 $\ast$rgb\+Buff, B\+Y\+TE bpp, int channel\+Map\mbox{[}$\,$\mbox{]}, Callback\+Ptr cb, void $\ast$data)
\item 
void \mbox{\hyperlink{classCPGFImage_a1db75413dfdc6f752088a53de0e6b998}{Downsample}} (int n\+Channel)
\item 
U\+I\+N\+T32 \mbox{\hyperlink{classCPGFImage_a921e1ec08da8ddf6ab4d5657e5610fee}{Update\+Post\+Header\+Size}} ()
\item 
void \mbox{\hyperlink{classCPGFImage_a1075a31893ee4ea2c686f5b471dd3664}{Write\+Level}} ()
\item 
\mbox{\hyperlink{structPGFRect}{P\+G\+F\+Rect}} \mbox{\hyperlink{classCPGFImage_a1a9c711365d0d6188b89262027e60265}{Get\+Aligned\+R\+OI}} (int c=0) const
\item 
void \mbox{\hyperlink{classCPGFImage_a83c737ee649fdc92c55b7a6ffe1153b2}{Set\+R\+OI}} (\mbox{\hyperlink{structPGFRect}{P\+G\+F\+Rect}} rect)
\item 
U\+I\+N\+T8 \mbox{\hyperlink{classCPGFImage_adc3d79612346af8109230039b1077c46}{Clamp4}} (\mbox{\hyperlink{PGFtypes_8h_acb1ee3f52ccfad782dcaa0abd79e5d05}{DataT}} v) const
\item 
U\+I\+N\+T16 \mbox{\hyperlink{classCPGFImage_a15adcf6db4b6c3f60db26c7809b0bd54}{Clamp6}} (\mbox{\hyperlink{PGFtypes_8h_acb1ee3f52ccfad782dcaa0abd79e5d05}{DataT}} v) const
\item 
U\+I\+N\+T8 \mbox{\hyperlink{classCPGFImage_a7748968cec3128d6dbdeb224814ca14a}{Clamp8}} (\mbox{\hyperlink{PGFtypes_8h_acb1ee3f52ccfad782dcaa0abd79e5d05}{DataT}} v) const
\item 
U\+I\+N\+T16 \mbox{\hyperlink{classCPGFImage_a666cd327643276fdd5e8b123fcbc991f}{Clamp16}} (\mbox{\hyperlink{PGFtypes_8h_acb1ee3f52ccfad782dcaa0abd79e5d05}{DataT}} v) const
\item 
U\+I\+N\+T32 \mbox{\hyperlink{classCPGFImage_a075dc79f2453625086a3f1987d692296}{Clamp31}} (\mbox{\hyperlink{PGFtypes_8h_acb1ee3f52ccfad782dcaa0abd79e5d05}{DataT}} v) const
\end{DoxyCompactItemize}
\subsection*{Private Attributes}
\begin{DoxyCompactItemize}
\item 
\mbox{\hyperlink{PGFtypes_8h_a80e898ce785fbd6fb0dfcc5903be79c2}{Refresh\+CB}} \mbox{\hyperlink{classCPGFImage_ac262a389df92493dfca63b2f1f06fe78}{m\+\_\+cb}}
\begin{DoxyCompactList}\small\item\em pointer to refresh callback procedure \end{DoxyCompactList}\item 
void $\ast$ \mbox{\hyperlink{classCPGFImage_a45861a83c95188610063233149187f3c}{m\+\_\+cb\+Arg}}
\begin{DoxyCompactList}\small\item\em refresh callback argument \end{DoxyCompactList}\item 
double \mbox{\hyperlink{classCPGFImage_adc2499451b8f96483a892e53fe5849b1}{m\+\_\+percent}}
\begin{DoxyCompactList}\small\item\em progress \mbox{[}0..1\mbox{]} \end{DoxyCompactList}\item 
\mbox{\hyperlink{PGFtypes_8h_a04561479f4f8aa5a0775d8b541a1157e}{Progress\+Mode}} \mbox{\hyperlink{classCPGFImage_a8b4d6d5ef343f0f428b35c9bf1020569}{m\+\_\+progress\+Mode}}
\begin{DoxyCompactList}\small\item\em progress mode used in Read and Write; P\+M\+\_\+\+Relative is default mode \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
P\+GF main class. 

P\+GF image class is the main class. You always need a P\+GF object for encoding or decoding image data. Decoding\+: \mbox{\hyperlink{classCPGFImage_adbe9092b915a2c5b2361f4db186b991c}{Open()}} \mbox{\hyperlink{classCPGFImage_a4a1d49cdf9da6934381bb25332d85ccf}{Read()}} \mbox{\hyperlink{classCPGFImage_a6a79885f55b60739b16fb961efb041ce}{Get\+Bitmap()}} Encoding\+: \mbox{\hyperlink{classCPGFImage_a200790d3be292a19fe8cbdd78ddfc386}{Set\+Header()}} \mbox{\hyperlink{classCPGFImage_a3c0895f4738c5222de1920c941a71541}{Import\+Bitmap()}} \mbox{\hyperlink{classCPGFImage_acd13d233dceaeefce3def7d71ebf4f82}{Write()}} \begin{DoxyAuthor}{Author}
C. Stamm, R. Spuler 
\end{DoxyAuthor}


Definition at line 53 of file P\+G\+Fimage.\+h.



\subsection{Constructor \& Destructor Documentation}
\mbox{\Hypertarget{classCPGFImage_af98838248d4bb5e0b2e89e2cd31b4b71}\label{classCPGFImage_af98838248d4bb5e0b2e89e2cd31b4b71}} 
\index{CPGFImage@{CPGFImage}!CPGFImage@{CPGFImage}}
\index{CPGFImage@{CPGFImage}!CPGFImage@{CPGFImage}}
\subsubsection{\texorpdfstring{CPGFImage()}{CPGFImage()}}
{\footnotesize\ttfamily C\+P\+G\+F\+Image\+::\+C\+P\+G\+F\+Image (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Standard constructor. 



Definition at line 64 of file P\+G\+Fimage.\+cpp.


\begin{DoxyCode}{0}
\DoxyCodeLine{64                      \{}
\DoxyCodeLine{65         \mbox{\hyperlink{classCPGFImage_ab32b4053e41cc205cce45be8045e603b}{Init}}();}
\DoxyCodeLine{66 \}}

\end{DoxyCode}
\mbox{\Hypertarget{classCPGFImage_a1bdfdce118d4a7c9167154b5ff0bb670}\label{classCPGFImage_a1bdfdce118d4a7c9167154b5ff0bb670}} 
\index{CPGFImage@{CPGFImage}!````~CPGFImage@{$\sim$CPGFImage}}
\index{````~CPGFImage@{$\sim$CPGFImage}!CPGFImage@{CPGFImage}}
\subsubsection{\texorpdfstring{$\sim$CPGFImage()}{~CPGFImage()}}
{\footnotesize\ttfamily C\+P\+G\+F\+Image\+::$\sim$\+C\+P\+G\+F\+Image (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [virtual]}}



Destructor. 



Definition at line 117 of file P\+G\+Fimage.\+cpp.


\begin{DoxyCode}{0}
\DoxyCodeLine{117                       \{}
\DoxyCodeLine{118         \mbox{\hyperlink{classCPGFImage_a2790b468b6d4841cd34473c4b61d0c7f}{m\_currentLevel}} = -100; \textcolor{comment}{// unusual value used as marker in Destroy()}}
\DoxyCodeLine{119         \mbox{\hyperlink{classCPGFImage_a4a3e55e2e2d8ddf79506769feb8938ec}{Destroy}}();}
\DoxyCodeLine{120 \}}

\end{DoxyCode}


\subsection{Member Function Documentation}
\mbox{\Hypertarget{classCPGFImage_ace9320cc25d748d77a7dfee759f01caa}\label{classCPGFImage_ace9320cc25d748d77a7dfee759f01caa}} 
\index{CPGFImage@{CPGFImage}!BPP@{BPP}}
\index{BPP@{BPP}!CPGFImage@{CPGFImage}}
\subsubsection{\texorpdfstring{BPP()}{BPP()}}
{\footnotesize\ttfamily B\+Y\+TE C\+P\+G\+F\+Image\+::\+B\+PP (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}

Return the number of bits per pixel. Valid values can be 1, 8, 12, 16, 24, 32, 48, 64. \begin{DoxyReturn}{Returns}
Number of bits per pixel. 
\end{DoxyReturn}


Definition at line 461 of file P\+G\+Fimage.\+h.


\begin{DoxyCode}{0}
\DoxyCodeLine{461 \{ \textcolor{keywordflow}{return} \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_aedea199e29cd6c404c82ab97c67e46b4}{bpp}}; \}}

\end{DoxyCode}
\mbox{\Hypertarget{classCPGFImage_a5f94308750aece503dc6433d1ad89c8a}\label{classCPGFImage_a5f94308750aece503dc6433d1ad89c8a}} 
\index{CPGFImage@{CPGFImage}!ChannelDepth@{ChannelDepth}}
\index{ChannelDepth@{ChannelDepth}!CPGFImage@{CPGFImage}}
\subsubsection{\texorpdfstring{ChannelDepth()}{ChannelDepth()}}
{\footnotesize\ttfamily B\+Y\+TE C\+P\+G\+F\+Image\+::\+Channel\+Depth (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}

Return bits per channel of the image\textquotesingle{}s encoder. \begin{DoxyReturn}{Returns}
Bits per channel 
\end{DoxyReturn}


Definition at line 406 of file P\+G\+Fimage.\+h.


\begin{DoxyCode}{0}
\DoxyCodeLine{406 \{ \textcolor{keywordflow}{return} \mbox{\hyperlink{classCPGFImage_a368601b5942e4406cdb87120406ff075}{MaxChannelDepth}}(\mbox{\hyperlink{classCPGFImage_ad5ed0ec587742ebf46f72be4abde305d}{m\_preHeader}}.\mbox{\hyperlink{structPGFMagicVersion_aa7ff5e50537cac9dd4c62d4c8982d09d}{version}}); \}}

\end{DoxyCode}
\mbox{\Hypertarget{classCPGFImage_a0e8b083f86199861e78334054c945863}\label{classCPGFImage_a0e8b083f86199861e78334054c945863}} 
\index{CPGFImage@{CPGFImage}!ChannelHeight@{ChannelHeight}}
\index{ChannelHeight@{ChannelHeight}!CPGFImage@{CPGFImage}}
\subsubsection{\texorpdfstring{ChannelHeight()}{ChannelHeight()}}
{\footnotesize\ttfamily U\+I\+N\+T32 C\+P\+G\+F\+Image\+::\+Channel\+Height (\begin{DoxyParamCaption}\item[{int}]{c = {\ttfamily 0} }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}

Return current image height of given channel in pixels. The returned height depends on the levels read so far and on R\+OI. 
\begin{DoxyParams}{Parameters}
{\em c} & A channel index \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
Channel height in pixels 
\end{DoxyReturn}


Definition at line 401 of file P\+G\+Fimage.\+h.


\begin{DoxyCode}{0}
\DoxyCodeLine{401 \{ ASSERT(c >= 0 \&\& c < \mbox{\hyperlink{PGFtypes_8h_a94219182f88d4dbed1021ed04db75e41}{MaxChannels}}); \textcolor{keywordflow}{return} \mbox{\hyperlink{classCPGFImage_a170fd448152303a2d44848a52a8916a0}{m\_height}}[c]; \}}

\end{DoxyCode}
\mbox{\Hypertarget{classCPGFImage_af712acd16a3b00d55c03e355939086fc}\label{classCPGFImage_af712acd16a3b00d55c03e355939086fc}} 
\index{CPGFImage@{CPGFImage}!Channels@{Channels}}
\index{Channels@{Channels}!CPGFImage@{CPGFImage}}
\subsubsection{\texorpdfstring{Channels()}{Channels()}}
{\footnotesize\ttfamily B\+Y\+TE C\+P\+G\+F\+Image\+::\+Channels (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}

Return the number of image channels. An image of type R\+GB contains 3 image channels (B, G, R). \begin{DoxyReturn}{Returns}
Number of image channels 
\end{DoxyReturn}


Definition at line 448 of file P\+G\+Fimage.\+h.


\begin{DoxyCode}{0}
\DoxyCodeLine{448 \{ \textcolor{keywordflow}{return} \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_abda7a5f282421cd7e789da62f657efa0}{channels}}; \}}

\end{DoxyCode}
\mbox{\Hypertarget{classCPGFImage_a3db1d8a7c652f726b7f15fa3fdc7e958}\label{classCPGFImage_a3db1d8a7c652f726b7f15fa3fdc7e958}} 
\index{CPGFImage@{CPGFImage}!ChannelWidth@{ChannelWidth}}
\index{ChannelWidth@{ChannelWidth}!CPGFImage@{CPGFImage}}
\subsubsection{\texorpdfstring{ChannelWidth()}{ChannelWidth()}}
{\footnotesize\ttfamily U\+I\+N\+T32 C\+P\+G\+F\+Image\+::\+Channel\+Width (\begin{DoxyParamCaption}\item[{int}]{c = {\ttfamily 0} }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}

Return current image width of given channel in pixels. The returned width depends on the levels read so far and on R\+OI. 
\begin{DoxyParams}{Parameters}
{\em c} & A channel index \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
Channel width in pixels 
\end{DoxyReturn}


Definition at line 394 of file P\+G\+Fimage.\+h.


\begin{DoxyCode}{0}
\DoxyCodeLine{394 \{ ASSERT(c >= 0 \&\& c < \mbox{\hyperlink{PGFtypes_8h_a94219182f88d4dbed1021ed04db75e41}{MaxChannels}}); \textcolor{keywordflow}{return} \mbox{\hyperlink{classCPGFImage_ab6d97aca28795fae697fdda4b8acd8f9}{m\_width}}[c]; \}}

\end{DoxyCode}
\mbox{\Hypertarget{classCPGFImage_a666cd327643276fdd5e8b123fcbc991f}\label{classCPGFImage_a666cd327643276fdd5e8b123fcbc991f}} 
\index{CPGFImage@{CPGFImage}!Clamp16@{Clamp16}}
\index{Clamp16@{Clamp16}!CPGFImage@{CPGFImage}}
\subsubsection{\texorpdfstring{Clamp16()}{Clamp16()}}
{\footnotesize\ttfamily U\+I\+N\+T16 C\+P\+G\+F\+Image\+::\+Clamp16 (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{PGFtypes_8h_acb1ee3f52ccfad782dcaa0abd79e5d05}{DataT}}}]{v }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [private]}}



Definition at line 573 of file P\+G\+Fimage.\+h.


\begin{DoxyCode}{0}
\DoxyCodeLine{573                                       \{}
\DoxyCodeLine{574                 \textcolor{keywordflow}{if} (v \& 0xFFFF0000) \textcolor{keywordflow}{return} (v < 0) ? (UINT16)0: (UINT16)65535; \textcolor{keywordflow}{else} \textcolor{keywordflow}{return} (UINT16)v;}
\DoxyCodeLine{575         \}       }

\end{DoxyCode}
\mbox{\Hypertarget{classCPGFImage_a075dc79f2453625086a3f1987d692296}\label{classCPGFImage_a075dc79f2453625086a3f1987d692296}} 
\index{CPGFImage@{CPGFImage}!Clamp31@{Clamp31}}
\index{Clamp31@{Clamp31}!CPGFImage@{CPGFImage}}
\subsubsection{\texorpdfstring{Clamp31()}{Clamp31()}}
{\footnotesize\ttfamily U\+I\+N\+T32 C\+P\+G\+F\+Image\+::\+Clamp31 (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{PGFtypes_8h_acb1ee3f52ccfad782dcaa0abd79e5d05}{DataT}}}]{v }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [private]}}



Definition at line 576 of file P\+G\+Fimage.\+h.


\begin{DoxyCode}{0}
\DoxyCodeLine{576                                       \{}
\DoxyCodeLine{577                 \textcolor{keywordflow}{return} (v < 0) ? 0 : (UINT32)v;}
\DoxyCodeLine{578         \}       }

\end{DoxyCode}
\mbox{\Hypertarget{classCPGFImage_adc3d79612346af8109230039b1077c46}\label{classCPGFImage_adc3d79612346af8109230039b1077c46}} 
\index{CPGFImage@{CPGFImage}!Clamp4@{Clamp4}}
\index{Clamp4@{Clamp4}!CPGFImage@{CPGFImage}}
\subsubsection{\texorpdfstring{Clamp4()}{Clamp4()}}
{\footnotesize\ttfamily U\+I\+N\+T8 C\+P\+G\+F\+Image\+::\+Clamp4 (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{PGFtypes_8h_acb1ee3f52ccfad782dcaa0abd79e5d05}{DataT}}}]{v }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [private]}}



Definition at line 563 of file P\+G\+Fimage.\+h.


\begin{DoxyCode}{0}
\DoxyCodeLine{563                                     \{}
\DoxyCodeLine{564                 \textcolor{keywordflow}{if} (v \& 0xFFFFFFF0) \textcolor{keywordflow}{return} (v < 0) ? (UINT8)0: (UINT8)15; \textcolor{keywordflow}{else} \textcolor{keywordflow}{return} (UINT8)v;}
\DoxyCodeLine{565         \}       }

\end{DoxyCode}
\mbox{\Hypertarget{classCPGFImage_a15adcf6db4b6c3f60db26c7809b0bd54}\label{classCPGFImage_a15adcf6db4b6c3f60db26c7809b0bd54}} 
\index{CPGFImage@{CPGFImage}!Clamp6@{Clamp6}}
\index{Clamp6@{Clamp6}!CPGFImage@{CPGFImage}}
\subsubsection{\texorpdfstring{Clamp6()}{Clamp6()}}
{\footnotesize\ttfamily U\+I\+N\+T16 C\+P\+G\+F\+Image\+::\+Clamp6 (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{PGFtypes_8h_acb1ee3f52ccfad782dcaa0abd79e5d05}{DataT}}}]{v }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [private]}}



Definition at line 566 of file P\+G\+Fimage.\+h.


\begin{DoxyCode}{0}
\DoxyCodeLine{566                                      \{}
\DoxyCodeLine{567                 \textcolor{keywordflow}{if} (v \& 0xFFFFFFC0) \textcolor{keywordflow}{return} (v < 0) ? (UINT16)0: (UINT16)63; \textcolor{keywordflow}{else} \textcolor{keywordflow}{return} (UINT16)v;}
\DoxyCodeLine{568         \}       }

\end{DoxyCode}
\mbox{\Hypertarget{classCPGFImage_a7748968cec3128d6dbdeb224814ca14a}\label{classCPGFImage_a7748968cec3128d6dbdeb224814ca14a}} 
\index{CPGFImage@{CPGFImage}!Clamp8@{Clamp8}}
\index{Clamp8@{Clamp8}!CPGFImage@{CPGFImage}}
\subsubsection{\texorpdfstring{Clamp8()}{Clamp8()}}
{\footnotesize\ttfamily U\+I\+N\+T8 C\+P\+G\+F\+Image\+::\+Clamp8 (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{PGFtypes_8h_acb1ee3f52ccfad782dcaa0abd79e5d05}{DataT}}}]{v }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [private]}}



Definition at line 569 of file P\+G\+Fimage.\+h.


\begin{DoxyCode}{0}
\DoxyCodeLine{569                                     \{}
\DoxyCodeLine{570                 \textcolor{comment}{// needs only one test in the normal case}}
\DoxyCodeLine{571                 \textcolor{keywordflow}{if} (v \& 0xFFFFFF00) \textcolor{keywordflow}{return} (v < 0) ? (UINT8)0 : (UINT8)255; \textcolor{keywordflow}{else} \textcolor{keywordflow}{return} (UINT8)v;}
\DoxyCodeLine{572         \}}

\end{DoxyCode}
\mbox{\Hypertarget{classCPGFImage_a58e8d626654a10486149146c8cd41d11}\label{classCPGFImage_a58e8d626654a10486149146c8cd41d11}} 
\index{CPGFImage@{CPGFImage}!CodecMajorVersion@{CodecMajorVersion}}
\index{CodecMajorVersion@{CodecMajorVersion}!CPGFImage@{CPGFImage}}
\subsubsection{\texorpdfstring{CodecMajorVersion()}{CodecMajorVersion()}}
{\footnotesize\ttfamily B\+Y\+TE C\+P\+G\+F\+Image\+::\+Codec\+Major\+Version (\begin{DoxyParamCaption}\item[{B\+Y\+TE}]{version = {\ttfamily \mbox{\hyperlink{PGFtypes_8h_aba6dadeb0788b7e02ab3c4425c6ef38a}{P\+G\+F\+Version}}} }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



Return major version. 

Return codec major version. 
\begin{DoxyParams}{Parameters}
{\em version} & pgf pre-\/header version number \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
P\+GF major of given version 
\end{DoxyReturn}


Definition at line 767 of file P\+G\+Fimage.\+cpp.


\begin{DoxyCode}{0}
\DoxyCodeLine{767                                               \{}
\DoxyCodeLine{768         \textcolor{keywordflow}{if} (version \& \mbox{\hyperlink{PGFtypes_8h_a7ec86ea7c424e6e90984fb8ef0e3ada0}{Version7}}) \textcolor{keywordflow}{return} 7;}
\DoxyCodeLine{769         \textcolor{keywordflow}{if} (version \& \mbox{\hyperlink{PGFtypes_8h_ab75c5e81917cb1ee3ec6396af51aff27}{Version6}}) \textcolor{keywordflow}{return} 6;}
\DoxyCodeLine{770         \textcolor{keywordflow}{if} (version \& \mbox{\hyperlink{PGFtypes_8h_a99612b00f7a591c93702520453567913}{Version5}}) \textcolor{keywordflow}{return} 5;}
\DoxyCodeLine{771         \textcolor{keywordflow}{if} (version \& \mbox{\hyperlink{PGFtypes_8h_aa67f9095ea51d6ffdc580497bc70d6ce}{Version2}}) \textcolor{keywordflow}{return} 2;}
\DoxyCodeLine{772         \textcolor{keywordflow}{return} 1;}
\DoxyCodeLine{773 \}}

\end{DoxyCode}
\mbox{\Hypertarget{classCPGFImage_a0f517491e6b64353cd9ba45f8697b865}\label{classCPGFImage_a0f517491e6b64353cd9ba45f8697b865}} 
\index{CPGFImage@{CPGFImage}!CompleteHeader@{CompleteHeader}}
\index{CompleteHeader@{CompleteHeader}!CPGFImage@{CPGFImage}}
\subsubsection{\texorpdfstring{CompleteHeader()}{CompleteHeader()}}
{\footnotesize\ttfamily bool C\+P\+G\+F\+Image\+::\+Complete\+Header (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



Definition at line 218 of file P\+G\+Fimage.\+cpp.


\begin{DoxyCode}{0}
\DoxyCodeLine{218                                \{}
\DoxyCodeLine{219         \textcolor{comment}{// set current codec version}}
\DoxyCodeLine{220         \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a637699477fb97e62d8cc3c102fac1fbb}{version}} = \mbox{\hyperlink{structPGFVersionNumber}{PGFVersionNumber}}(\mbox{\hyperlink{PGFtypes_8h_adec7594db053d6c7c8c067862d71da5f}{PGFMajorNumber}}, \mbox{\hyperlink{PGFtypes_8h_aa53f29ff00b39013ff71bf521177b9de}{PGFYear}}, \mbox{\hyperlink{PGFtypes_8h_a55d535a2534a87009e7aea0543744e07}{PGFWeek}});}
\DoxyCodeLine{221 }
\DoxyCodeLine{222         \textcolor{keywordflow}{if} (\mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a3ddaf075db8ee812ad688d9ed39e0698}{mode}} == \mbox{\hyperlink{PGFplatform_8h_a797bd5db500e431c26b93c6b4686c257}{ImageModeUnknown}}) \{}
\DoxyCodeLine{223                 \textcolor{comment}{// undefined mode}}
\DoxyCodeLine{224                 \textcolor{keywordflow}{switch}(\mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_aedea199e29cd6c404c82ab97c67e46b4}{bpp}}) \{}
\DoxyCodeLine{225                 \textcolor{keywordflow}{case} 1: \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a3ddaf075db8ee812ad688d9ed39e0698}{mode}} = \mbox{\hyperlink{PGFplatform_8h_a8905b28d0e3b96cf340ed34957738648}{ImageModeBitmap}}; \textcolor{keywordflow}{break};}
\DoxyCodeLine{226                 \textcolor{keywordflow}{case} 8: \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a3ddaf075db8ee812ad688d9ed39e0698}{mode}} = \mbox{\hyperlink{PGFplatform_8h_ac73bfc2f52b9da3083b7087d154c1e2e}{ImageModeGrayScale}}; \textcolor{keywordflow}{break};}
\DoxyCodeLine{227                 \textcolor{keywordflow}{case} 12: \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a3ddaf075db8ee812ad688d9ed39e0698}{mode}} = \mbox{\hyperlink{PGFplatform_8h_a1dbd9112d53e5eea856e65ed1e9c6d50}{ImageModeRGB12}}; \textcolor{keywordflow}{break};}
\DoxyCodeLine{228                 \textcolor{keywordflow}{case} 16: \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a3ddaf075db8ee812ad688d9ed39e0698}{mode}} = \mbox{\hyperlink{PGFplatform_8h_aadaf1bd7eedf80c33287cfd311dbf068}{ImageModeRGB16}}; \textcolor{keywordflow}{break};}
\DoxyCodeLine{229                 \textcolor{keywordflow}{case} 24: \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a3ddaf075db8ee812ad688d9ed39e0698}{mode}} = \mbox{\hyperlink{PGFplatform_8h_a07e2059cc6697336c5484447578264fc}{ImageModeRGBColor}}; \textcolor{keywordflow}{break};}
\DoxyCodeLine{230                 \textcolor{keywordflow}{case} 32: \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a3ddaf075db8ee812ad688d9ed39e0698}{mode}} = \mbox{\hyperlink{PGFplatform_8h_ab7cb460804a8abce27d823d09682c85b}{ImageModeRGBA}}; \textcolor{keywordflow}{break};}
\DoxyCodeLine{231                 \textcolor{keywordflow}{case} 48: \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a3ddaf075db8ee812ad688d9ed39e0698}{mode}} = \mbox{\hyperlink{PGFplatform_8h_ac04b7a3633a0caadba20e20e161239e1}{ImageModeRGB48}}; \textcolor{keywordflow}{break};}
\DoxyCodeLine{232                 \textcolor{keywordflow}{default}: \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a3ddaf075db8ee812ad688d9ed39e0698}{mode}} = \mbox{\hyperlink{PGFplatform_8h_a07e2059cc6697336c5484447578264fc}{ImageModeRGBColor}}; \textcolor{keywordflow}{break};}
\DoxyCodeLine{233                 \}}
\DoxyCodeLine{234         \}}
\DoxyCodeLine{235         \textcolor{keywordflow}{if} (!\mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_aedea199e29cd6c404c82ab97c67e46b4}{bpp}}) \{}
\DoxyCodeLine{236                 \textcolor{comment}{// undefined bpp}}
\DoxyCodeLine{237                 \textcolor{keywordflow}{switch}(\mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a3ddaf075db8ee812ad688d9ed39e0698}{mode}}) \{}
\DoxyCodeLine{238                 \textcolor{keywordflow}{case} \mbox{\hyperlink{PGFplatform_8h_a8905b28d0e3b96cf340ed34957738648}{ImageModeBitmap}}: }
\DoxyCodeLine{239                         \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_aedea199e29cd6c404c82ab97c67e46b4}{bpp}} = 1;}
\DoxyCodeLine{240                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{241                 \textcolor{keywordflow}{case} \mbox{\hyperlink{PGFplatform_8h_af1937c5b38a21ec5e6b3e11851264be2}{ImageModeIndexedColor}}:}
\DoxyCodeLine{242                 \textcolor{keywordflow}{case} \mbox{\hyperlink{PGFplatform_8h_ac73bfc2f52b9da3083b7087d154c1e2e}{ImageModeGrayScale}}:}
\DoxyCodeLine{243                         \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_aedea199e29cd6c404c82ab97c67e46b4}{bpp}} = 8;}
\DoxyCodeLine{244                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{245                 \textcolor{keywordflow}{case} \mbox{\hyperlink{PGFplatform_8h_a1dbd9112d53e5eea856e65ed1e9c6d50}{ImageModeRGB12}}:}
\DoxyCodeLine{246                         \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_aedea199e29cd6c404c82ab97c67e46b4}{bpp}} = 12;}
\DoxyCodeLine{247                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{248                 \textcolor{keywordflow}{case} \mbox{\hyperlink{PGFplatform_8h_aadaf1bd7eedf80c33287cfd311dbf068}{ImageModeRGB16}}:}
\DoxyCodeLine{249                 \textcolor{keywordflow}{case} \mbox{\hyperlink{PGFplatform_8h_aedd00370d778fa28db56e5d4032d4c5c}{ImageModeGray16}}:}
\DoxyCodeLine{250                         \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_aedea199e29cd6c404c82ab97c67e46b4}{bpp}} = 16;}
\DoxyCodeLine{251                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{252                 \textcolor{keywordflow}{case} \mbox{\hyperlink{PGFplatform_8h_a07e2059cc6697336c5484447578264fc}{ImageModeRGBColor}}:}
\DoxyCodeLine{253                 \textcolor{keywordflow}{case} \mbox{\hyperlink{PGFplatform_8h_aa1d93456909be3c716a8c5a30b191c00}{ImageModeLabColor}}:}
\DoxyCodeLine{254                         \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_aedea199e29cd6c404c82ab97c67e46b4}{bpp}} = 24;}
\DoxyCodeLine{255                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{256                 \textcolor{keywordflow}{case} \mbox{\hyperlink{PGFplatform_8h_ab7cb460804a8abce27d823d09682c85b}{ImageModeRGBA}}:}
\DoxyCodeLine{257                 \textcolor{keywordflow}{case} \mbox{\hyperlink{PGFplatform_8h_af50b920dae1922b4eb0bcd82361d880c}{ImageModeCMYKColor}}:}
\DoxyCodeLine{258                 \textcolor{keywordflow}{case} \mbox{\hyperlink{PGFplatform_8h_a205e54791f7ad54d357330bb99cab3b2}{ImageModeGray32}}:}
\DoxyCodeLine{259                         \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_aedea199e29cd6c404c82ab97c67e46b4}{bpp}} = 32;}
\DoxyCodeLine{260                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{261                 \textcolor{keywordflow}{case} \mbox{\hyperlink{PGFplatform_8h_ac04b7a3633a0caadba20e20e161239e1}{ImageModeRGB48}}:}
\DoxyCodeLine{262                 \textcolor{keywordflow}{case} \mbox{\hyperlink{PGFplatform_8h_ae7de617953bf44d768dfd82b62a98db5}{ImageModeLab48}}:}
\DoxyCodeLine{263                         \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_aedea199e29cd6c404c82ab97c67e46b4}{bpp}} = 48;}
\DoxyCodeLine{264                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{265                 \textcolor{keywordflow}{case} \mbox{\hyperlink{PGFplatform_8h_ac250ca543e6f93f370614801122b61f6}{ImageModeCMYK64}}:}
\DoxyCodeLine{266                         \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_aedea199e29cd6c404c82ab97c67e46b4}{bpp}} = 64;}
\DoxyCodeLine{267                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{268                 \textcolor{keywordflow}{default}:}
\DoxyCodeLine{269                         ASSERT(\textcolor{keyword}{false});}
\DoxyCodeLine{270                         \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_aedea199e29cd6c404c82ab97c67e46b4}{bpp}} = 24;}
\DoxyCodeLine{271                 \}}
\DoxyCodeLine{272         \} }
\DoxyCodeLine{273         \textcolor{keywordflow}{if} (\mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a3ddaf075db8ee812ad688d9ed39e0698}{mode}} == \mbox{\hyperlink{PGFplatform_8h_a07e2059cc6697336c5484447578264fc}{ImageModeRGBColor}} \&\& \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_aedea199e29cd6c404c82ab97c67e46b4}{bpp}} == 32) \{}
\DoxyCodeLine{274                 \textcolor{comment}{// change mode}}
\DoxyCodeLine{275                 \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a3ddaf075db8ee812ad688d9ed39e0698}{mode}} = \mbox{\hyperlink{PGFplatform_8h_ab7cb460804a8abce27d823d09682c85b}{ImageModeRGBA}};}
\DoxyCodeLine{276         \}}
\DoxyCodeLine{277         \textcolor{keywordflow}{if} (\mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a3ddaf075db8ee812ad688d9ed39e0698}{mode}} == \mbox{\hyperlink{PGFplatform_8h_a8905b28d0e3b96cf340ed34957738648}{ImageModeBitmap}} \&\& \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_aedea199e29cd6c404c82ab97c67e46b4}{bpp}} != 1) \textcolor{keywordflow}{return} \textcolor{keyword}{false};}
\DoxyCodeLine{278         \textcolor{keywordflow}{if} (\mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a3ddaf075db8ee812ad688d9ed39e0698}{mode}} == \mbox{\hyperlink{PGFplatform_8h_af1937c5b38a21ec5e6b3e11851264be2}{ImageModeIndexedColor}} \&\& \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_aedea199e29cd6c404c82ab97c67e46b4}{bpp}} != 8) \textcolor{keywordflow}{return} \textcolor{keyword}{false};}
\DoxyCodeLine{279         \textcolor{keywordflow}{if} (\mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a3ddaf075db8ee812ad688d9ed39e0698}{mode}} == \mbox{\hyperlink{PGFplatform_8h_ac73bfc2f52b9da3083b7087d154c1e2e}{ImageModeGrayScale}} \&\& \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_aedea199e29cd6c404c82ab97c67e46b4}{bpp}} != 8) \textcolor{keywordflow}{return} \textcolor{keyword}{false};}
\DoxyCodeLine{280         \textcolor{keywordflow}{if} (\mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a3ddaf075db8ee812ad688d9ed39e0698}{mode}} == \mbox{\hyperlink{PGFplatform_8h_aedd00370d778fa28db56e5d4032d4c5c}{ImageModeGray16}} \&\& \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_aedea199e29cd6c404c82ab97c67e46b4}{bpp}} != 16) \textcolor{keywordflow}{return} \textcolor{keyword}{false};}
\DoxyCodeLine{281         \textcolor{keywordflow}{if} (\mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a3ddaf075db8ee812ad688d9ed39e0698}{mode}} == \mbox{\hyperlink{PGFplatform_8h_a205e54791f7ad54d357330bb99cab3b2}{ImageModeGray32}} \&\& \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_aedea199e29cd6c404c82ab97c67e46b4}{bpp}} != 32) \textcolor{keywordflow}{return} \textcolor{keyword}{false};}
\DoxyCodeLine{282         \textcolor{keywordflow}{if} (\mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a3ddaf075db8ee812ad688d9ed39e0698}{mode}} == \mbox{\hyperlink{PGFplatform_8h_a07e2059cc6697336c5484447578264fc}{ImageModeRGBColor}} \&\& \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_aedea199e29cd6c404c82ab97c67e46b4}{bpp}} != 24) \textcolor{keywordflow}{return} \textcolor{keyword}{false};}
\DoxyCodeLine{283         \textcolor{keywordflow}{if} (\mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a3ddaf075db8ee812ad688d9ed39e0698}{mode}} == \mbox{\hyperlink{PGFplatform_8h_ab7cb460804a8abce27d823d09682c85b}{ImageModeRGBA}} \&\& \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_aedea199e29cd6c404c82ab97c67e46b4}{bpp}} != 32) \textcolor{keywordflow}{return} \textcolor{keyword}{false};}
\DoxyCodeLine{284         \textcolor{keywordflow}{if} (\mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a3ddaf075db8ee812ad688d9ed39e0698}{mode}} == \mbox{\hyperlink{PGFplatform_8h_a1dbd9112d53e5eea856e65ed1e9c6d50}{ImageModeRGB12}} \&\& \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_aedea199e29cd6c404c82ab97c67e46b4}{bpp}} != 12) \textcolor{keywordflow}{return} \textcolor{keyword}{false};}
\DoxyCodeLine{285         \textcolor{keywordflow}{if} (\mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a3ddaf075db8ee812ad688d9ed39e0698}{mode}} == \mbox{\hyperlink{PGFplatform_8h_aadaf1bd7eedf80c33287cfd311dbf068}{ImageModeRGB16}} \&\& \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_aedea199e29cd6c404c82ab97c67e46b4}{bpp}} != 16) \textcolor{keywordflow}{return} \textcolor{keyword}{false};}
\DoxyCodeLine{286         \textcolor{keywordflow}{if} (\mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a3ddaf075db8ee812ad688d9ed39e0698}{mode}} == \mbox{\hyperlink{PGFplatform_8h_ac04b7a3633a0caadba20e20e161239e1}{ImageModeRGB48}} \&\& \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_aedea199e29cd6c404c82ab97c67e46b4}{bpp}} != 48) \textcolor{keywordflow}{return} \textcolor{keyword}{false};}
\DoxyCodeLine{287         \textcolor{keywordflow}{if} (\mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a3ddaf075db8ee812ad688d9ed39e0698}{mode}} == \mbox{\hyperlink{PGFplatform_8h_aa1d93456909be3c716a8c5a30b191c00}{ImageModeLabColor}} \&\& \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_aedea199e29cd6c404c82ab97c67e46b4}{bpp}} != 24) \textcolor{keywordflow}{return} \textcolor{keyword}{false};}
\DoxyCodeLine{288         \textcolor{keywordflow}{if} (\mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a3ddaf075db8ee812ad688d9ed39e0698}{mode}} == \mbox{\hyperlink{PGFplatform_8h_ae7de617953bf44d768dfd82b62a98db5}{ImageModeLab48}} \&\& \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_aedea199e29cd6c404c82ab97c67e46b4}{bpp}} != 48) \textcolor{keywordflow}{return} \textcolor{keyword}{false};}
\DoxyCodeLine{289         \textcolor{keywordflow}{if} (\mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a3ddaf075db8ee812ad688d9ed39e0698}{mode}} == \mbox{\hyperlink{PGFplatform_8h_af50b920dae1922b4eb0bcd82361d880c}{ImageModeCMYKColor}} \&\& \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_aedea199e29cd6c404c82ab97c67e46b4}{bpp}} != 32) \textcolor{keywordflow}{return} \textcolor{keyword}{false};}
\DoxyCodeLine{290         \textcolor{keywordflow}{if} (\mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a3ddaf075db8ee812ad688d9ed39e0698}{mode}} == \mbox{\hyperlink{PGFplatform_8h_ac250ca543e6f93f370614801122b61f6}{ImageModeCMYK64}} \&\& \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_aedea199e29cd6c404c82ab97c67e46b4}{bpp}} != 64) \textcolor{keywordflow}{return} \textcolor{keyword}{false};}
\DoxyCodeLine{291 }
\DoxyCodeLine{292         \textcolor{comment}{// set number of channels}}
\DoxyCodeLine{293         \textcolor{keywordflow}{if} (!\mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_abda7a5f282421cd7e789da62f657efa0}{channels}}) \{}
\DoxyCodeLine{294                 \textcolor{keywordflow}{switch}(\mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a3ddaf075db8ee812ad688d9ed39e0698}{mode}}) \{}
\DoxyCodeLine{295                 \textcolor{keywordflow}{case} \mbox{\hyperlink{PGFplatform_8h_a8905b28d0e3b96cf340ed34957738648}{ImageModeBitmap}}: }
\DoxyCodeLine{296                 \textcolor{keywordflow}{case} \mbox{\hyperlink{PGFplatform_8h_af1937c5b38a21ec5e6b3e11851264be2}{ImageModeIndexedColor}}:}
\DoxyCodeLine{297                 \textcolor{keywordflow}{case} \mbox{\hyperlink{PGFplatform_8h_ac73bfc2f52b9da3083b7087d154c1e2e}{ImageModeGrayScale}}:}
\DoxyCodeLine{298                 \textcolor{keywordflow}{case} \mbox{\hyperlink{PGFplatform_8h_aedd00370d778fa28db56e5d4032d4c5c}{ImageModeGray16}}:}
\DoxyCodeLine{299                 \textcolor{keywordflow}{case} \mbox{\hyperlink{PGFplatform_8h_a205e54791f7ad54d357330bb99cab3b2}{ImageModeGray32}}:}
\DoxyCodeLine{300                         \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_abda7a5f282421cd7e789da62f657efa0}{channels}} = 1; }
\DoxyCodeLine{301                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{302                 \textcolor{keywordflow}{case} \mbox{\hyperlink{PGFplatform_8h_a07e2059cc6697336c5484447578264fc}{ImageModeRGBColor}}:}
\DoxyCodeLine{303                 \textcolor{keywordflow}{case} \mbox{\hyperlink{PGFplatform_8h_a1dbd9112d53e5eea856e65ed1e9c6d50}{ImageModeRGB12}}:}
\DoxyCodeLine{304                 \textcolor{keywordflow}{case} \mbox{\hyperlink{PGFplatform_8h_aadaf1bd7eedf80c33287cfd311dbf068}{ImageModeRGB16}}:}
\DoxyCodeLine{305                 \textcolor{keywordflow}{case} \mbox{\hyperlink{PGFplatform_8h_ac04b7a3633a0caadba20e20e161239e1}{ImageModeRGB48}}:}
\DoxyCodeLine{306                 \textcolor{keywordflow}{case} \mbox{\hyperlink{PGFplatform_8h_aa1d93456909be3c716a8c5a30b191c00}{ImageModeLabColor}}:}
\DoxyCodeLine{307                 \textcolor{keywordflow}{case} \mbox{\hyperlink{PGFplatform_8h_ae7de617953bf44d768dfd82b62a98db5}{ImageModeLab48}}:}
\DoxyCodeLine{308                         \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_abda7a5f282421cd7e789da62f657efa0}{channels}} = 3;}
\DoxyCodeLine{309                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{310                 \textcolor{keywordflow}{case} \mbox{\hyperlink{PGFplatform_8h_ab7cb460804a8abce27d823d09682c85b}{ImageModeRGBA}}:}
\DoxyCodeLine{311                 \textcolor{keywordflow}{case} \mbox{\hyperlink{PGFplatform_8h_af50b920dae1922b4eb0bcd82361d880c}{ImageModeCMYKColor}}:}
\DoxyCodeLine{312                 \textcolor{keywordflow}{case} \mbox{\hyperlink{PGFplatform_8h_ac250ca543e6f93f370614801122b61f6}{ImageModeCMYK64}}:}
\DoxyCodeLine{313                         \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_abda7a5f282421cd7e789da62f657efa0}{channels}} = 4;}
\DoxyCodeLine{314                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{315                 \textcolor{keywordflow}{default}:}
\DoxyCodeLine{316                         \textcolor{keywordflow}{return} \textcolor{keyword}{false};}
\DoxyCodeLine{317                 \}}
\DoxyCodeLine{318         \}}
\DoxyCodeLine{319 }
\DoxyCodeLine{320         \textcolor{comment}{// store used bits per channel}}
\DoxyCodeLine{321         UINT8 bpc = \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_aedea199e29cd6c404c82ab97c67e46b4}{bpp}}/\mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_abda7a5f282421cd7e789da62f657efa0}{channels}};}
\DoxyCodeLine{322         \textcolor{keywordflow}{if} (bpc > 31) bpc = 31;}
\DoxyCodeLine{323         \textcolor{keywordflow}{if} (!\mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_abddcc9ee6e17690986cf77a6d16aceb6}{usedBitsPerChannel}} || \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_abddcc9ee6e17690986cf77a6d16aceb6}{usedBitsPerChannel}} > bpc) \{}
\DoxyCodeLine{324                 \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_abddcc9ee6e17690986cf77a6d16aceb6}{usedBitsPerChannel}} = bpc;}
\DoxyCodeLine{325         \}}
\DoxyCodeLine{326 }
\DoxyCodeLine{327         \textcolor{keywordflow}{return} \textcolor{keyword}{true};}
\DoxyCodeLine{328 \}}

\end{DoxyCode}
\mbox{\Hypertarget{classCPGFImage_a6e745b509e9bea4ad35f951f37693fc4}\label{classCPGFImage_a6e745b509e9bea4ad35f951f37693fc4}} 
\index{CPGFImage@{CPGFImage}!ComputeLevelROI@{ComputeLevelROI}}
\index{ComputeLevelROI@{ComputeLevelROI}!CPGFImage@{CPGFImage}}
\subsubsection{\texorpdfstring{ComputeLevelROI()}{ComputeLevelROI()}}
{\footnotesize\ttfamily \mbox{\hyperlink{structPGFRect}{P\+G\+F\+Rect}} C\+P\+G\+F\+Image\+::\+Compute\+Level\+R\+OI (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const}

Return R\+OI of channel 0 at current level in pixels. The returned rect is only valid after reading a R\+OI. \begin{DoxyReturn}{Returns}
R\+OI in pixels 
\end{DoxyReturn}
\mbox{\Hypertarget{classCPGFImage_ad1ac56e997c83c4c7fe8283b70b84b85}\label{classCPGFImage_ad1ac56e997c83c4c7fe8283b70b84b85}} 
\index{CPGFImage@{CPGFImage}!ComputeLevels@{ComputeLevels}}
\index{ComputeLevels@{ComputeLevels}!CPGFImage@{CPGFImage}}
\subsubsection{\texorpdfstring{ComputeLevels()}{ComputeLevels()}}
{\footnotesize\ttfamily void C\+P\+G\+F\+Image\+::\+Compute\+Levels (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



Definition at line 853 of file P\+G\+Fimage.\+cpp.


\begin{DoxyCode}{0}
\DoxyCodeLine{853                               \{}
\DoxyCodeLine{854         \textcolor{keyword}{const} \textcolor{keywordtype}{int} maxThumbnailWidth = 20*\mbox{\hyperlink{WaveletTransform_8h_a93633fc816f186e990eabf5e8f20a40f}{FilterSize}};}
\DoxyCodeLine{855         \textcolor{keyword}{const} \textcolor{keywordtype}{int} m = \mbox{\hyperlink{PGFplatform_8h_ad6d0138bf7e2cdaabeedc3fea40767ad}{\_\_min}}(\mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a766a68c3284c2ae6d2f54c82e7350ed9}{width}}, \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a7262335e99ca409759e1aa8c0f0164b1}{height}});}
\DoxyCodeLine{856         \textcolor{keywordtype}{int} s = m;}
\DoxyCodeLine{857 }
\DoxyCodeLine{858         \textcolor{keywordflow}{if} (\mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a963890fa1e02a517923f9d0bf0d7e9eb}{nLevels}} < 1 || \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a963890fa1e02a517923f9d0bf0d7e9eb}{nLevels}} > \mbox{\hyperlink{PGFtypes_8h_a2468e509eae9683e25af403249b743a3}{MaxLevel}}) \{}
\DoxyCodeLine{859                 \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a963890fa1e02a517923f9d0bf0d7e9eb}{nLevels}} = 1;}
\DoxyCodeLine{860                 \textcolor{comment}{// compute a good value depending on the size of the image}}
\DoxyCodeLine{861                 \textcolor{keywordflow}{while} (s > maxThumbnailWidth) \{}
\DoxyCodeLine{862                         \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a963890fa1e02a517923f9d0bf0d7e9eb}{nLevels}}++;}
\DoxyCodeLine{863                         s >>= 1;}
\DoxyCodeLine{864                 \}}
\DoxyCodeLine{865         \}}
\DoxyCodeLine{866 }
\DoxyCodeLine{867         \textcolor{keywordtype}{int} levels = \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a963890fa1e02a517923f9d0bf0d7e9eb}{nLevels}}; \textcolor{comment}{// we need a signed value during level reduction}}
\DoxyCodeLine{868 }
\DoxyCodeLine{869         \textcolor{comment}{// reduce number of levels if the image size is smaller than FilterSize*(2\string^levels)}}
\DoxyCodeLine{870         s = \mbox{\hyperlink{WaveletTransform_8h_a93633fc816f186e990eabf5e8f20a40f}{FilterSize}}*(1 << levels); \textcolor{comment}{// must be at least the double filter size because of subsampling}}
\DoxyCodeLine{871         \textcolor{keywordflow}{while} (m < s) \{}
\DoxyCodeLine{872                 levels--;}
\DoxyCodeLine{873                 s >>= 1;}
\DoxyCodeLine{874         \}}
\DoxyCodeLine{875         \textcolor{keywordflow}{if} (levels > \mbox{\hyperlink{PGFtypes_8h_a2468e509eae9683e25af403249b743a3}{MaxLevel}}) \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a963890fa1e02a517923f9d0bf0d7e9eb}{nLevels}} = \mbox{\hyperlink{PGFtypes_8h_a2468e509eae9683e25af403249b743a3}{MaxLevel}};}
\DoxyCodeLine{876         \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (levels < 0) \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a963890fa1e02a517923f9d0bf0d7e9eb}{nLevels}} = 0;}
\DoxyCodeLine{877         \textcolor{keywordflow}{else} \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a963890fa1e02a517923f9d0bf0d7e9eb}{nLevels}} = (UINT8)levels;}
\DoxyCodeLine{878 }
\DoxyCodeLine{879         \textcolor{comment}{// used in Write when PM\_Absolute}}
\DoxyCodeLine{880         \mbox{\hyperlink{classCPGFImage_adc2499451b8f96483a892e53fe5849b1}{m\_percent}} = pow(0.25, \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a963890fa1e02a517923f9d0bf0d7e9eb}{nLevels}});}
\DoxyCodeLine{881 }
\DoxyCodeLine{882         ASSERT(0 <= \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a963890fa1e02a517923f9d0bf0d7e9eb}{nLevels}} \&\& \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a963890fa1e02a517923f9d0bf0d7e9eb}{nLevels}} <= \mbox{\hyperlink{PGFtypes_8h_a2468e509eae9683e25af403249b743a3}{MaxLevel}});}
\DoxyCodeLine{883 \}}

\end{DoxyCode}
\mbox{\Hypertarget{classCPGFImage_a46c30bb2dab1bf3c51f150300b2745b5}\label{classCPGFImage_a46c30bb2dab1bf3c51f150300b2745b5}} 
\index{CPGFImage@{CPGFImage}!ConfigureDecoder@{ConfigureDecoder}}
\index{ConfigureDecoder@{ConfigureDecoder}!CPGFImage@{CPGFImage}}
\subsubsection{\texorpdfstring{ConfigureDecoder()}{ConfigureDecoder()}}
{\footnotesize\ttfamily void C\+P\+G\+F\+Image\+::\+Configure\+Decoder (\begin{DoxyParamCaption}\item[{bool}]{use\+O\+MP = {\ttfamily true},  }\item[{\mbox{\hyperlink{PGFtypes_8h_a0e70eeba0994fafcbfe6cbea3a734096}{Userdata\+Policy}}}]{policy = {\ttfamily \mbox{\hyperlink{PGFtypes_8h_a0e70eeba0994fafcbfe6cbea3a734096ad52de87e33912adabcf1e22f05e38227}{U\+P\+\_\+\+Cache\+All}}},  }\item[{U\+I\+N\+T32}]{prefix\+Size = {\ttfamily 0} }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}

Configures the decoder. 
\begin{DoxyParams}{Parameters}
{\em use\+O\+MP} & Use parallel threading with Open MP during decoding. Default value\+: true. Influences the decoding only if the codec has been compiled with Open\+MP support. \\
\hline
{\em policy} & The file might contain user data (e.\+g. metadata). The policy defines the behaviour during \mbox{\hyperlink{classCPGFImage_adbe9092b915a2c5b2361f4db186b991c}{Open()}}. U\+P\+\_\+\+Cache\+All\+: User data is read and stored completely in a new allocated memory block. It can be accessed by \mbox{\hyperlink{classCPGFImage_aa7c092c2b27df184d7e81bef579e270c}{Get\+User\+Data()}}. U\+P\+\_\+\+Cache\+Prefix\+: Only prefix\+Size bytes at the beginning of the user data are stored in a new allocated memory block. It can be accessed by \mbox{\hyperlink{classCPGFImage_aa7c092c2b27df184d7e81bef579e270c}{Get\+User\+Data()}}. U\+P\+\_\+\+Skip\+: User data is skipped and nothing is cached. \\
\hline
{\em prefix\+Size} & Is only used in combination with U\+P\+\_\+\+Cache\+Prefix. It defines the number of bytes cached. \\
\hline
\end{DoxyParams}


Definition at line 260 of file P\+G\+Fimage.\+h.


\begin{DoxyCode}{0}
\DoxyCodeLine{260 \{ ASSERT(prefixSize <= \mbox{\hyperlink{PGFtypes_8h_a513fcd9e30f1a99d382b5c001499cdf5}{MaxUserDataSize}});  \mbox{\hyperlink{classCPGFImage_a01d0752d97900040fa1db7f02d4770cb}{m\_useOMPinDecoder}} = useOMP; \mbox{\hyperlink{classCPGFImage_a18e28eef51d17c3bd0be4d4f758a6a86}{m\_userDataPolicy}} = (\mbox{\hyperlink{PGFtypes_8h_a0e70eeba0994fafcbfe6cbea3a734096a36fd199cb724d615fbe67a12f7ab69d0}{UP\_CachePrefix}}) ? prefixSize : 0xFFFFFFFF - policy; \}}

\end{DoxyCode}
\mbox{\Hypertarget{classCPGFImage_a3215ac6bee3c5f6bb7e1c4b7fc53a4a2}\label{classCPGFImage_a3215ac6bee3c5f6bb7e1c4b7fc53a4a2}} 
\index{CPGFImage@{CPGFImage}!ConfigureEncoder@{ConfigureEncoder}}
\index{ConfigureEncoder@{ConfigureEncoder}!CPGFImage@{CPGFImage}}
\subsubsection{\texorpdfstring{ConfigureEncoder()}{ConfigureEncoder()}}
{\footnotesize\ttfamily void C\+P\+G\+F\+Image\+::\+Configure\+Encoder (\begin{DoxyParamCaption}\item[{bool}]{use\+O\+MP = {\ttfamily true},  }\item[{bool}]{favor\+Speed\+Over\+Size = {\ttfamily false} }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}

Configures the encoder. 
\begin{DoxyParams}{Parameters}
{\em use\+O\+MP} & Use parallel threading with Open MP during encoding. Default value\+: true. Influences the encoding only if the codec has been compiled with Open\+MP support. \\
\hline
{\em favor\+Speed\+Over\+Size} & Favors encoding speed over compression ratio. Default value\+: false \\
\hline
\end{DoxyParams}


Definition at line 250 of file P\+G\+Fimage.\+h.


\begin{DoxyCode}{0}
\DoxyCodeLine{250 \{ \mbox{\hyperlink{classCPGFImage_a140110570c6d492b23db50189d3f4d48}{m\_useOMPinEncoder}} = useOMP; \mbox{\hyperlink{classCPGFImage_a6925d3950e8f48487205d46de7920d3e}{m\_favorSpeedOverSize}} = favorSpeedOverSize; \}}

\end{DoxyCode}
\mbox{\Hypertarget{classCPGFImage_a4a3e55e2e2d8ddf79506769feb8938ec}\label{classCPGFImage_a4a3e55e2e2d8ddf79506769feb8938ec}} 
\index{CPGFImage@{CPGFImage}!Destroy@{Destroy}}
\index{Destroy@{Destroy}!CPGFImage@{CPGFImage}}
\subsubsection{\texorpdfstring{Destroy()}{Destroy()}}
{\footnotesize\ttfamily void C\+P\+G\+F\+Image\+::\+Destroy (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Definition at line 124 of file P\+G\+Fimage.\+cpp.


\begin{DoxyCode}{0}
\DoxyCodeLine{124                         \{}
\DoxyCodeLine{125         \textcolor{keywordflow}{for} (\textcolor{keywordtype}{int} i = 0; i < \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_abda7a5f282421cd7e789da62f657efa0}{channels}}; i++) \{}
\DoxyCodeLine{126                 \textcolor{keyword}{delete} \mbox{\hyperlink{classCPGFImage_ae3901a689b7d1dd46d48b042c3d31d5c}{m\_wtChannel}}[i]; \textcolor{comment}{// also deletes m\_channel}}
\DoxyCodeLine{127         \}}
\DoxyCodeLine{128         \textcolor{keyword}{delete}[] \mbox{\hyperlink{classCPGFImage_ab8635df22839ffb68bada53e38b9ce73}{m\_postHeader}}.\mbox{\hyperlink{structPGFPostHeader_aeeb6e57e8343eb3d42406f0baf3ae6e1}{userData}}; }
\DoxyCodeLine{129         \textcolor{keyword}{delete}[] \mbox{\hyperlink{classCPGFImage_a1635ef5dca13bd07276d112a72316a73}{m\_levelLength}};}
\DoxyCodeLine{130         \textcolor{keyword}{delete} \mbox{\hyperlink{classCPGFImage_a1058b29a3d046e171a2fe48168b66d38}{m\_decoder}};}
\DoxyCodeLine{131         \textcolor{keyword}{delete} \mbox{\hyperlink{classCPGFImage_a6ef048255812525cd56d7b04df5e6731}{m\_encoder}};}
\DoxyCodeLine{132 }
\DoxyCodeLine{133         \textcolor{keywordflow}{if} (\mbox{\hyperlink{classCPGFImage_a2790b468b6d4841cd34473c4b61d0c7f}{m\_currentLevel}} != -100) \mbox{\hyperlink{classCPGFImage_ab32b4053e41cc205cce45be8045e603b}{Init}}();}
\DoxyCodeLine{134 \}}

\end{DoxyCode}
\mbox{\Hypertarget{classCPGFImage_a1db75413dfdc6f752088a53de0e6b998}\label{classCPGFImage_a1db75413dfdc6f752088a53de0e6b998}} 
\index{CPGFImage@{CPGFImage}!Downsample@{Downsample}}
\index{Downsample@{Downsample}!CPGFImage@{CPGFImage}}
\subsubsection{\texorpdfstring{Downsample()}{Downsample()}}
{\footnotesize\ttfamily void C\+P\+G\+F\+Image\+::\+Downsample (\begin{DoxyParamCaption}\item[{int}]{n\+Channel }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



Definition at line 809 of file P\+G\+Fimage.\+cpp.


\begin{DoxyCode}{0}
\DoxyCodeLine{809                                  \{}
\DoxyCodeLine{810         ASSERT(ch > 0);}
\DoxyCodeLine{811 }
\DoxyCodeLine{812         \textcolor{keyword}{const} \textcolor{keywordtype}{int} w = \mbox{\hyperlink{classCPGFImage_ab6d97aca28795fae697fdda4b8acd8f9}{m\_width}}[0];}
\DoxyCodeLine{813         \textcolor{keyword}{const} \textcolor{keywordtype}{int} w2 = w/2;}
\DoxyCodeLine{814         \textcolor{keyword}{const} \textcolor{keywordtype}{int} h2 = \mbox{\hyperlink{classCPGFImage_a170fd448152303a2d44848a52a8916a0}{m\_height}}[0]/2;}
\DoxyCodeLine{815         \textcolor{keyword}{const} \textcolor{keywordtype}{int} oddW = w\%2;                           \textcolor{comment}{// don't use bool -> problems with MaxSpeed optimization}}
\DoxyCodeLine{816         \textcolor{keyword}{const} \textcolor{keywordtype}{int} oddH = \mbox{\hyperlink{classCPGFImage_a170fd448152303a2d44848a52a8916a0}{m\_height}}[0]\%2;         \textcolor{comment}{// "}}
\DoxyCodeLine{817         \textcolor{keywordtype}{int} loPos = 0;}
\DoxyCodeLine{818         \textcolor{keywordtype}{int} hiPos = w;}
\DoxyCodeLine{819         \textcolor{keywordtype}{int} sampledPos = 0;}
\DoxyCodeLine{820         \mbox{\hyperlink{PGFtypes_8h_acb1ee3f52ccfad782dcaa0abd79e5d05}{DataT}}* buff = \mbox{\hyperlink{classCPGFImage_a36f7f20b38a9cb3a9c88032f5f886345}{m\_channel}}[ch]; ASSERT(buff);}
\DoxyCodeLine{821 }
\DoxyCodeLine{822         \textcolor{keywordflow}{for} (\textcolor{keywordtype}{int} i=0; i < h2; i++) \{}
\DoxyCodeLine{823                 \textcolor{keywordflow}{for} (\textcolor{keywordtype}{int} j=0; j < w2; j++) \{}
\DoxyCodeLine{824                         \textcolor{comment}{// compute average of pixel block}}
\DoxyCodeLine{825                         buff[sampledPos] = (buff[loPos] + buff[loPos + 1] + buff[hiPos] + buff[hiPos + 1]) >> 2;}
\DoxyCodeLine{826                         loPos += 2; hiPos += 2;}
\DoxyCodeLine{827                         sampledPos++;}
\DoxyCodeLine{828                 \}}
\DoxyCodeLine{829                 \textcolor{keywordflow}{if} (oddW) \{ }
\DoxyCodeLine{830                         buff[sampledPos] = (buff[loPos] + buff[hiPos]) >> 1;}
\DoxyCodeLine{831                         loPos++; hiPos++;}
\DoxyCodeLine{832                         sampledPos++;}
\DoxyCodeLine{833                 \}}
\DoxyCodeLine{834                 loPos += w; hiPos += w;}
\DoxyCodeLine{835         \}}
\DoxyCodeLine{836         \textcolor{keywordflow}{if} (oddH) \{}
\DoxyCodeLine{837                 \textcolor{keywordflow}{for} (\textcolor{keywordtype}{int} j=0; j < w2; j++) \{}
\DoxyCodeLine{838                         buff[sampledPos] = (buff[loPos] + buff[loPos+1]) >> 1;}
\DoxyCodeLine{839                         loPos += 2; hiPos += 2;}
\DoxyCodeLine{840                         sampledPos++;}
\DoxyCodeLine{841                 \}}
\DoxyCodeLine{842                 \textcolor{keywordflow}{if} (oddW) \{}
\DoxyCodeLine{843                         buff[sampledPos] = buff[loPos];}
\DoxyCodeLine{844                 \}}
\DoxyCodeLine{845         \}}
\DoxyCodeLine{846 }
\DoxyCodeLine{847         \textcolor{comment}{// downsampled image has half width and half height}}
\DoxyCodeLine{848         \mbox{\hyperlink{classCPGFImage_ab6d97aca28795fae697fdda4b8acd8f9}{m\_width}}[ch] = (\mbox{\hyperlink{classCPGFImage_ab6d97aca28795fae697fdda4b8acd8f9}{m\_width}}[ch] + 1)/2;}
\DoxyCodeLine{849         \mbox{\hyperlink{classCPGFImage_a170fd448152303a2d44848a52a8916a0}{m\_height}}[ch] = (\mbox{\hyperlink{classCPGFImage_a170fd448152303a2d44848a52a8916a0}{m\_height}}[ch] + 1)/2;}
\DoxyCodeLine{850 \}}

\end{DoxyCode}
\mbox{\Hypertarget{classCPGFImage_a1a9c711365d0d6188b89262027e60265}\label{classCPGFImage_a1a9c711365d0d6188b89262027e60265}} 
\index{CPGFImage@{CPGFImage}!GetAlignedROI@{GetAlignedROI}}
\index{GetAlignedROI@{GetAlignedROI}!CPGFImage@{CPGFImage}}
\subsubsection{\texorpdfstring{GetAlignedROI()}{GetAlignedROI()}}
{\footnotesize\ttfamily \mbox{\hyperlink{structPGFRect}{P\+G\+F\+Rect}} C\+P\+G\+F\+Image\+::\+Get\+Aligned\+R\+OI (\begin{DoxyParamCaption}\item[{int}]{c = {\ttfamily 0} }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [private]}}

\mbox{\Hypertarget{classCPGFImage_a6a79885f55b60739b16fb961efb041ce}\label{classCPGFImage_a6a79885f55b60739b16fb961efb041ce}} 
\index{CPGFImage@{CPGFImage}!GetBitmap@{GetBitmap}}
\index{GetBitmap@{GetBitmap}!CPGFImage@{CPGFImage}}
\subsubsection{\texorpdfstring{GetBitmap()}{GetBitmap()}}
{\footnotesize\ttfamily void C\+P\+G\+F\+Image\+::\+Get\+Bitmap (\begin{DoxyParamCaption}\item[{int}]{pitch,  }\item[{U\+I\+N\+T8 $\ast$}]{buff,  }\item[{B\+Y\+TE}]{bpp,  }\item[{int}]{channel\+Map\mbox{[}$\,$\mbox{]} = {\ttfamily nullptr},  }\item[{Callback\+Ptr}]{cb = {\ttfamily nullptr},  }\item[{void $\ast$}]{data = {\ttfamily nullptr} }\end{DoxyParamCaption}) const}

Get image data in interleaved format\+: (ordering of R\+GB data is B\+GR\mbox{[}A\mbox{]}) Upsampling, Y\+UV to R\+GB transform and interleaving are done here to reduce the number of passes over the data. The absolute value of pitch is the number of bytes of an image row of the given image buffer. If pitch is negative, then the image buffer must point to the last row of a bottom-\/up image (first byte on last row). if pitch is positive, then the image buffer must point to the first row of a top-\/down image (first byte). The sequence of output channels in the output image buffer does not need to be the same as provided by P\+GF. In case of different sequences you have to provide a channel\+Map of size of expected channels (depending on image mode). For example, P\+GF provides a channel sequence B\+GR in R\+GB color mode. If your provided image buffer expects a channel sequence A\+R\+GB, then the channel\+Map looks like \{ 3, 2, 1, 0 \}. It might throw an \mbox{\hyperlink{structIOException}{I\+O\+Exception}}. 
\begin{DoxyParams}{Parameters}
{\em pitch} & The number of bytes of a row of the image buffer. \\
\hline
{\em buff} & An image buffer. \\
\hline
{\em bpp} & The number of bits per pixel used in image buffer. \\
\hline
{\em channel\+Map} & A integer array containing the mapping of P\+GF channel ordering to expected channel ordering. \\
\hline
{\em cb} & A pointer to a callback procedure. The procedure is called after each copied buffer row. If cb returns true, then it stops proceeding. \\
\hline
{\em data} & Data Pointer to C++ class container to host callback procedure. \\
\hline
\end{DoxyParams}


Definition at line 1788 of file P\+G\+Fimage.\+cpp.


\begin{DoxyCode}{0}
\DoxyCodeLine{1788                                                                                                                     \{}
\DoxyCodeLine{1789         ASSERT(buff);}
\DoxyCodeLine{1790         UINT32 w = \mbox{\hyperlink{classCPGFImage_ab6d97aca28795fae697fdda4b8acd8f9}{m\_width}}[0];  \textcolor{comment}{// width of decoded image}}
\DoxyCodeLine{1791         UINT32 h = \mbox{\hyperlink{classCPGFImage_a170fd448152303a2d44848a52a8916a0}{m\_height}}[0]; \textcolor{comment}{// height of decoded image}}
\DoxyCodeLine{1792         UINT32 yw = w;                  \textcolor{comment}{// y-channel width}}
\DoxyCodeLine{1793         UINT32 uw = \mbox{\hyperlink{classCPGFImage_ab6d97aca28795fae697fdda4b8acd8f9}{m\_width}}[1];  \textcolor{comment}{// u-channel width}}
\DoxyCodeLine{1794         UINT32 roiOffsetX = 0;}
\DoxyCodeLine{1795         UINT32 roiOffsetY = 0;}
\DoxyCodeLine{1796         UINT32 yOffset = 0;}
\DoxyCodeLine{1797         UINT32 uOffset = 0;}
\DoxyCodeLine{1798 }
\DoxyCodeLine{1799 \textcolor{preprocessor}{\#ifdef \_\_PGFROISUPPORT\_\_}}
\DoxyCodeLine{1800         \textcolor{keyword}{const} \mbox{\hyperlink{structPGFRect}{PGFRect}}\& roi = \mbox{\hyperlink{classCPGFImage_a1a9c711365d0d6188b89262027e60265}{GetAlignedROI}}(); \textcolor{comment}{// in pixels, roi is usually larger than levelRoi}}
\DoxyCodeLine{1801         ASSERT(w == roi.\mbox{\hyperlink{structPGFRect_a70d366f5adc104f7037b627f35a18729}{Width}}() \&\& h == roi.\mbox{\hyperlink{structPGFRect_a139b8bb60ea476cd14856476b2d37b0f}{Height}}());}
\DoxyCodeLine{1802         \textcolor{keyword}{const} \mbox{\hyperlink{structPGFRect}{PGFRect}} levelRoi = \mbox{\hyperlink{classCPGFImage_a6e745b509e9bea4ad35f951f37693fc4}{ComputeLevelROI}}();}
\DoxyCodeLine{1803         ASSERT(roi.\mbox{\hyperlink{structPGFRect_ac3472e1dc20bc4b1584058376fd7b989}{left}} <= levelRoi.left \&\& levelRoi.right <= roi.\mbox{\hyperlink{structPGFRect_a9174d8de6b9018e0c4ef8e29a501b10a}{right}}); }
\DoxyCodeLine{1804         ASSERT(roi.\mbox{\hyperlink{structPGFRect_a79df6810b4ffbf8c8825a67733d56913}{top}} <= levelRoi.top \&\& levelRoi.bottom <= roi.\mbox{\hyperlink{structPGFRect_a7dc57925fee73fb4b3a1e3744971f579}{bottom}}); }
\DoxyCodeLine{1805 }
\DoxyCodeLine{1806         \textcolor{keywordflow}{if} (\mbox{\hyperlink{classCPGFImage_a9db775cf3a36997b55106fbab7284c14}{ROIisSupported}}() \&\& (levelRoi.Width() < w || levelRoi.Height() < h)) \{}
\DoxyCodeLine{1807                 \textcolor{comment}{// ROI is used }}
\DoxyCodeLine{1808                 w = levelRoi.Width();}
\DoxyCodeLine{1809                 h = levelRoi.Height();}
\DoxyCodeLine{1810                 roiOffsetX = levelRoi.left - roi.\mbox{\hyperlink{structPGFRect_ac3472e1dc20bc4b1584058376fd7b989}{left}};}
\DoxyCodeLine{1811                 roiOffsetY = levelRoi.top - roi.\mbox{\hyperlink{structPGFRect_a79df6810b4ffbf8c8825a67733d56913}{top}};}
\DoxyCodeLine{1812                 yOffset = roiOffsetX + roiOffsetY*yw;}
\DoxyCodeLine{1813 }
\DoxyCodeLine{1814                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{classCPGFImage_a9226595ea6b907e4d07301a6ee641b87}{m\_downsample}}) \{}
\DoxyCodeLine{1815                         \textcolor{keyword}{const} \mbox{\hyperlink{structPGFRect}{PGFRect}}\& downsampledRoi = \mbox{\hyperlink{classCPGFImage_a1a9c711365d0d6188b89262027e60265}{GetAlignedROI}}(1);}
\DoxyCodeLine{1816                         uOffset = levelRoi.left/2 - downsampledRoi.\mbox{\hyperlink{structPGFRect_ac3472e1dc20bc4b1584058376fd7b989}{left}} + (levelRoi.top/2 - downsampledRoi.\mbox{\hyperlink{structPGFRect_a79df6810b4ffbf8c8825a67733d56913}{top}})*\mbox{\hyperlink{classCPGFImage_ab6d97aca28795fae697fdda4b8acd8f9}{m\_width}}[1];}
\DoxyCodeLine{1817                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{1818                         uOffset = yOffset;}
\DoxyCodeLine{1819                 \}}
\DoxyCodeLine{1820         \}}
\DoxyCodeLine{1821 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{1822 }
\DoxyCodeLine{1823         \textcolor{keyword}{const} \textcolor{keywordtype}{double} dP = 1.0/h;}
\DoxyCodeLine{1824         \textcolor{keywordtype}{int} defMap[] = \{ 0, 1, 2, 3, 4, 5, 6, 7 \}; ASSERT(\textcolor{keyword}{sizeof}(defMap)/\textcolor{keyword}{sizeof}(defMap[0]) == \mbox{\hyperlink{PGFtypes_8h_a94219182f88d4dbed1021ed04db75e41}{MaxChannels}});}
\DoxyCodeLine{1825         \textcolor{keywordflow}{if} (channelMap == \textcolor{keyword}{nullptr}) channelMap = defMap;}
\DoxyCodeLine{1826         \mbox{\hyperlink{PGFtypes_8h_acb1ee3f52ccfad782dcaa0abd79e5d05}{DataT}} uAvg, vAvg;}
\DoxyCodeLine{1827         \textcolor{keywordtype}{double} percent = 0;}
\DoxyCodeLine{1828         UINT32 i, j;}
\DoxyCodeLine{1829 }
\DoxyCodeLine{1830         \textcolor{keywordflow}{switch}(\mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a3ddaf075db8ee812ad688d9ed39e0698}{mode}}) \{}
\DoxyCodeLine{1831         \textcolor{keywordflow}{case} \mbox{\hyperlink{PGFplatform_8h_a8905b28d0e3b96cf340ed34957738648}{ImageModeBitmap}}:}
\DoxyCodeLine{1832                 \{}
\DoxyCodeLine{1833                         ASSERT(\mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_abda7a5f282421cd7e789da62f657efa0}{channels}} == 1);}
\DoxyCodeLine{1834                         ASSERT(\mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_aedea199e29cd6c404c82ab97c67e46b4}{bpp}} == 1);}
\DoxyCodeLine{1835                         ASSERT(bpp == 1);}
\DoxyCodeLine{1836 }
\DoxyCodeLine{1837                         \textcolor{keyword}{const} UINT32 w2 = (w + 7)/8;}
\DoxyCodeLine{1838                         \mbox{\hyperlink{PGFtypes_8h_acb1ee3f52ccfad782dcaa0abd79e5d05}{DataT}}* y = \mbox{\hyperlink{classCPGFImage_a36f7f20b38a9cb3a9c88032f5f886345}{m\_channel}}[0]; ASSERT(y);}
\DoxyCodeLine{1839 }
\DoxyCodeLine{1840                         \textcolor{keywordflow}{if} (\mbox{\hyperlink{classCPGFImage_ad5ed0ec587742ebf46f72be4abde305d}{m\_preHeader}}.\mbox{\hyperlink{structPGFMagicVersion_aa7ff5e50537cac9dd4c62d4c8982d09d}{version}} \& \mbox{\hyperlink{PGFtypes_8h_a7ec86ea7c424e6e90984fb8ef0e3ada0}{Version7}}) \{}
\DoxyCodeLine{1841                                 \textcolor{comment}{// new unpacked version has a little better compression ratio}}
\DoxyCodeLine{1842                                 \textcolor{comment}{// since version 7}}
\DoxyCodeLine{1843                                 \textcolor{keywordflow}{for} (i = 0; i < h; i++) \{}
\DoxyCodeLine{1844                                         UINT32 cnt = 0;}
\DoxyCodeLine{1845                                         \textcolor{keywordflow}{for} (j = 0; j < w2; j++) \{}
\DoxyCodeLine{1846                                                 UINT8 \textcolor{keywordtype}{byte} = 0;}
\DoxyCodeLine{1847                                                 \textcolor{keywordflow}{for} (\textcolor{keywordtype}{int} k = 0; k < 8; k++) \{}
\DoxyCodeLine{1848                                                         \textcolor{keywordtype}{byte} <<= 1;}
\DoxyCodeLine{1849                                                         UINT8 bit = 0;}
\DoxyCodeLine{1850                                                         \textcolor{keywordflow}{if} (cnt < w) \{}
\DoxyCodeLine{1851                                                                 bit = y[yOffset + cnt] \& 1;}
\DoxyCodeLine{1852                                                         \}}
\DoxyCodeLine{1853                                                         \textcolor{keywordtype}{byte} |= bit;}
\DoxyCodeLine{1854                                                         cnt++;}
\DoxyCodeLine{1855                                                 \}}
\DoxyCodeLine{1856                                                 buff[j] = byte;}
\DoxyCodeLine{1857                                         \}}
\DoxyCodeLine{1858                                         yOffset += yw;}
\DoxyCodeLine{1859                                         buff += pitch;}
\DoxyCodeLine{1860 }
\DoxyCodeLine{1861                                         \textcolor{keywordflow}{if} (cb) \{}
\DoxyCodeLine{1862                                                 percent += dP;}
\DoxyCodeLine{1863                                                 \textcolor{keywordflow}{if} ((*cb)(percent, \textcolor{keyword}{true}, data)) ReturnWithError(EscapePressed);}
\DoxyCodeLine{1864                                         \}}
\DoxyCodeLine{1865                                 \}}
\DoxyCodeLine{1866                         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{1867                                 \textcolor{comment}{// old versions}}
\DoxyCodeLine{1868                                 \textcolor{comment}{// packed pixels: 8 pixel in 1 byte of channel[0]}}
\DoxyCodeLine{1869                                 \textcolor{keywordflow}{if} (!(\mbox{\hyperlink{classCPGFImage_ad5ed0ec587742ebf46f72be4abde305d}{m\_preHeader}}.\mbox{\hyperlink{structPGFMagicVersion_aa7ff5e50537cac9dd4c62d4c8982d09d}{version}} \& \mbox{\hyperlink{PGFtypes_8h_a99612b00f7a591c93702520453567913}{Version5}})) yw = w2; \textcolor{comment}{// not version 5 or 6}}
\DoxyCodeLine{1870                                 yOffset = roiOffsetX/8 + roiOffsetY*yw; \textcolor{comment}{// 1 byte in y contains 8 pixel values}}
\DoxyCodeLine{1871                                 \textcolor{keywordflow}{for} (i = 0; i < h; i++) \{}
\DoxyCodeLine{1872                                         \textcolor{keywordflow}{for} (j = 0; j < w2; j++) \{}
\DoxyCodeLine{1873                                                 buff[j] = \mbox{\hyperlink{classCPGFImage_a7748968cec3128d6dbdeb224814ca14a}{Clamp8}}(y[yOffset + j] + \mbox{\hyperlink{PGFimage_8cpp_a0fc648cb4d04d369ff4692cc07687039}{YUVoffset8}});}
\DoxyCodeLine{1874                                         \}}
\DoxyCodeLine{1875                                         yOffset += yw;}
\DoxyCodeLine{1876                                         buff += pitch;}
\DoxyCodeLine{1877 }
\DoxyCodeLine{1878                                         \textcolor{keywordflow}{if} (cb) \{}
\DoxyCodeLine{1879                                                 percent += dP;}
\DoxyCodeLine{1880                                                 \textcolor{keywordflow}{if} ((*cb)(percent, \textcolor{keyword}{true}, data)) ReturnWithError(EscapePressed);}
\DoxyCodeLine{1881                                         \}}
\DoxyCodeLine{1882                                 \}}
\DoxyCodeLine{1883                         \}}
\DoxyCodeLine{1884                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{1885                 \}}
\DoxyCodeLine{1886         \textcolor{keywordflow}{case} \mbox{\hyperlink{PGFplatform_8h_af1937c5b38a21ec5e6b3e11851264be2}{ImageModeIndexedColor}}:}
\DoxyCodeLine{1887         \textcolor{keywordflow}{case} \mbox{\hyperlink{PGFplatform_8h_ac73bfc2f52b9da3083b7087d154c1e2e}{ImageModeGrayScale}}:}
\DoxyCodeLine{1888         \textcolor{keywordflow}{case} \mbox{\hyperlink{PGFplatform_8h_a5e4deddebb6ff58e1168fc20b0e15cb3}{ImageModeHSLColor}}:}
\DoxyCodeLine{1889         \textcolor{keywordflow}{case} \mbox{\hyperlink{PGFplatform_8h_aca2b65c53ff44940ed27f809de3b28f5}{ImageModeHSBColor}}:}
\DoxyCodeLine{1890                 \{}
\DoxyCodeLine{1891                         ASSERT(\mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_abda7a5f282421cd7e789da62f657efa0}{channels}} >= 1);}
\DoxyCodeLine{1892                         ASSERT(\mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_aedea199e29cd6c404c82ab97c67e46b4}{bpp}} == \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_abda7a5f282421cd7e789da62f657efa0}{channels}}*8);}
\DoxyCodeLine{1893                         ASSERT(bpp\%8 == 0);}
\DoxyCodeLine{1894 }
\DoxyCodeLine{1895                         UINT32 cnt, channels = bpp/8; ASSERT(channels >= \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_abda7a5f282421cd7e789da62f657efa0}{channels}});}
\DoxyCodeLine{1896 }
\DoxyCodeLine{1897                         \textcolor{keywordflow}{for} (i=0; i < h; i++) \{}
\DoxyCodeLine{1898                                 UINT32 yPos = yOffset;}
\DoxyCodeLine{1899                                 cnt = 0;}
\DoxyCodeLine{1900                                 \textcolor{keywordflow}{for} (j=0; j < w; j++) \{}
\DoxyCodeLine{1901                                         \textcolor{keywordflow}{for} (UINT32 c=0; c < \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_abda7a5f282421cd7e789da62f657efa0}{channels}}; c++) \{}
\DoxyCodeLine{1902                                                 buff[cnt + channelMap[c]] = \mbox{\hyperlink{classCPGFImage_a7748968cec3128d6dbdeb224814ca14a}{Clamp8}}(\mbox{\hyperlink{classCPGFImage_a36f7f20b38a9cb3a9c88032f5f886345}{m\_channel}}[c][yPos] + \mbox{\hyperlink{PGFimage_8cpp_a0fc648cb4d04d369ff4692cc07687039}{YUVoffset8}});}
\DoxyCodeLine{1903                                         \}}
\DoxyCodeLine{1904                                         cnt += channels;}
\DoxyCodeLine{1905                                         yPos++;}
\DoxyCodeLine{1906                                 \}}
\DoxyCodeLine{1907                                 yOffset += yw;}
\DoxyCodeLine{1908                                 buff += pitch;}
\DoxyCodeLine{1909 }
\DoxyCodeLine{1910                                 \textcolor{keywordflow}{if} (cb) \{}
\DoxyCodeLine{1911                                         percent += dP;}
\DoxyCodeLine{1912                                         \textcolor{keywordflow}{if} ((*cb)(percent, \textcolor{keyword}{true}, data)) ReturnWithError(EscapePressed);}
\DoxyCodeLine{1913                                 \}}
\DoxyCodeLine{1914                         \}}
\DoxyCodeLine{1915                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{1916                 \}}
\DoxyCodeLine{1917         \textcolor{keywordflow}{case} \mbox{\hyperlink{PGFplatform_8h_aedd00370d778fa28db56e5d4032d4c5c}{ImageModeGray16}}:}
\DoxyCodeLine{1918                 \{}
\DoxyCodeLine{1919                         ASSERT(\mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_abda7a5f282421cd7e789da62f657efa0}{channels}} >= 1);}
\DoxyCodeLine{1920                         ASSERT(\mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_aedea199e29cd6c404c82ab97c67e46b4}{bpp}} == \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_abda7a5f282421cd7e789da62f657efa0}{channels}}*16);}
\DoxyCodeLine{1921 }
\DoxyCodeLine{1922                         \textcolor{keyword}{const} \mbox{\hyperlink{PGFtypes_8h_acb1ee3f52ccfad782dcaa0abd79e5d05}{DataT}} yuvOffset16 = 1 << (\mbox{\hyperlink{classCPGFImage_a6cc4f75843c3c15f573aaa0131649b10}{UsedBitsPerChannel}}() - 1);}
\DoxyCodeLine{1923                         UINT32 cnt, channels;}
\DoxyCodeLine{1924 }
\DoxyCodeLine{1925                         \textcolor{keywordflow}{if} (bpp\%16 == 0) \{}
\DoxyCodeLine{1926                                 \textcolor{keyword}{const} \textcolor{keywordtype}{int} shift = 16 - \mbox{\hyperlink{classCPGFImage_a6cc4f75843c3c15f573aaa0131649b10}{UsedBitsPerChannel}}(); ASSERT(shift >= 0);}
\DoxyCodeLine{1927                                 UINT16 *buff16 = (UINT16 *)buff;}
\DoxyCodeLine{1928                                 \textcolor{keywordtype}{int} pitch16 = pitch/2;}
\DoxyCodeLine{1929                                 channels = bpp/16; ASSERT(channels >= \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_abda7a5f282421cd7e789da62f657efa0}{channels}});}
\DoxyCodeLine{1930 }
\DoxyCodeLine{1931                                 \textcolor{keywordflow}{for} (i=0; i < h; i++) \{}
\DoxyCodeLine{1932                                         UINT32 yPos = yOffset;}
\DoxyCodeLine{1933                                         cnt = 0;}
\DoxyCodeLine{1934                                         \textcolor{keywordflow}{for} (j=0; j < w; j++) \{}
\DoxyCodeLine{1935                                                 \textcolor{keywordflow}{for} (UINT32 c=0; c < \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_abda7a5f282421cd7e789da62f657efa0}{channels}}; c++) \{}
\DoxyCodeLine{1936                                                         buff16[cnt + channelMap[c]] = \mbox{\hyperlink{classCPGFImage_a666cd327643276fdd5e8b123fcbc991f}{Clamp16}}((\mbox{\hyperlink{classCPGFImage_a36f7f20b38a9cb3a9c88032f5f886345}{m\_channel}}[c][yPos] + yuvOffset16) << shift);}
\DoxyCodeLine{1937                                                 \}}
\DoxyCodeLine{1938                                                 cnt += channels;}
\DoxyCodeLine{1939                                                 yPos++;}
\DoxyCodeLine{1940                                         \}}
\DoxyCodeLine{1941                                         yOffset += yw;}
\DoxyCodeLine{1942                                         buff16 += pitch16;}
\DoxyCodeLine{1943 }
\DoxyCodeLine{1944                                         \textcolor{keywordflow}{if} (cb) \{}
\DoxyCodeLine{1945                                                 percent += dP;}
\DoxyCodeLine{1946                                                 \textcolor{keywordflow}{if} ((*cb)(percent, \textcolor{keyword}{true}, data)) ReturnWithError(EscapePressed);}
\DoxyCodeLine{1947                                         \}}
\DoxyCodeLine{1948                                 \}}
\DoxyCodeLine{1949                         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{1950                                 ASSERT(bpp\%8 == 0);}
\DoxyCodeLine{1951                                 \textcolor{keyword}{const} \textcolor{keywordtype}{int} shift = \mbox{\hyperlink{PGFplatform_8h_af643213a7d426b69429d1430cef4ecbb}{\_\_max}}(0, \mbox{\hyperlink{classCPGFImage_a6cc4f75843c3c15f573aaa0131649b10}{UsedBitsPerChannel}}() - 8);}
\DoxyCodeLine{1952                                 channels = bpp/8; ASSERT(channels >= \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_abda7a5f282421cd7e789da62f657efa0}{channels}});}
\DoxyCodeLine{1953                                 }
\DoxyCodeLine{1954                                 \textcolor{keywordflow}{for} (i=0; i < h; i++) \{}
\DoxyCodeLine{1955                                         UINT32 yPos = yOffset;}
\DoxyCodeLine{1956                                         cnt = 0;}
\DoxyCodeLine{1957                                         \textcolor{keywordflow}{for} (j=0; j < w; j++) \{}
\DoxyCodeLine{1958                                                 \textcolor{keywordflow}{for} (UINT32 c=0; c < \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_abda7a5f282421cd7e789da62f657efa0}{channels}}; c++) \{}
\DoxyCodeLine{1959                                                         buff[cnt + channelMap[c]] = \mbox{\hyperlink{classCPGFImage_a7748968cec3128d6dbdeb224814ca14a}{Clamp8}}((\mbox{\hyperlink{classCPGFImage_a36f7f20b38a9cb3a9c88032f5f886345}{m\_channel}}[c][yPos] + yuvOffset16) >> shift);}
\DoxyCodeLine{1960                                                 \}}
\DoxyCodeLine{1961                                                 cnt += channels;}
\DoxyCodeLine{1962                                                 yPos++;}
\DoxyCodeLine{1963                                         \}}
\DoxyCodeLine{1964                                         yOffset += yw;}
\DoxyCodeLine{1965                                         buff += pitch;}
\DoxyCodeLine{1966 }
\DoxyCodeLine{1967                                         \textcolor{keywordflow}{if} (cb) \{}
\DoxyCodeLine{1968                                                 percent += dP;}
\DoxyCodeLine{1969                                                 \textcolor{keywordflow}{if} ((*cb)(percent, \textcolor{keyword}{true}, data)) ReturnWithError(EscapePressed);}
\DoxyCodeLine{1970                                         \}}
\DoxyCodeLine{1971                                 \}}
\DoxyCodeLine{1972                         \}}
\DoxyCodeLine{1973                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{1974                 \}}
\DoxyCodeLine{1975         \textcolor{keywordflow}{case} \mbox{\hyperlink{PGFplatform_8h_a07e2059cc6697336c5484447578264fc}{ImageModeRGBColor}}:}
\DoxyCodeLine{1976                 \{}
\DoxyCodeLine{1977                         ASSERT(\mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_abda7a5f282421cd7e789da62f657efa0}{channels}} == 3);}
\DoxyCodeLine{1978                         ASSERT(\mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_aedea199e29cd6c404c82ab97c67e46b4}{bpp}} == \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_abda7a5f282421cd7e789da62f657efa0}{channels}}*8);}
\DoxyCodeLine{1979                         ASSERT(bpp\%8 == 0);}
\DoxyCodeLine{1980                         ASSERT(bpp >= \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_aedea199e29cd6c404c82ab97c67e46b4}{bpp}});}
\DoxyCodeLine{1981 }
\DoxyCodeLine{1982                         \mbox{\hyperlink{PGFtypes_8h_acb1ee3f52ccfad782dcaa0abd79e5d05}{DataT}}* y = \mbox{\hyperlink{classCPGFImage_a36f7f20b38a9cb3a9c88032f5f886345}{m\_channel}}[0]; ASSERT(y);}
\DoxyCodeLine{1983                         \mbox{\hyperlink{PGFtypes_8h_acb1ee3f52ccfad782dcaa0abd79e5d05}{DataT}}* u = \mbox{\hyperlink{classCPGFImage_a36f7f20b38a9cb3a9c88032f5f886345}{m\_channel}}[1]; ASSERT(u);}
\DoxyCodeLine{1984                         \mbox{\hyperlink{PGFtypes_8h_acb1ee3f52ccfad782dcaa0abd79e5d05}{DataT}}* v = \mbox{\hyperlink{classCPGFImage_a36f7f20b38a9cb3a9c88032f5f886345}{m\_channel}}[2]; ASSERT(v);}
\DoxyCodeLine{1985                         UINT8 *buffg = \&buff[channelMap[1]],}
\DoxyCodeLine{1986                                   *buffr = \&buff[channelMap[2]],}
\DoxyCodeLine{1987                                   *buffb = \&buff[channelMap[0]];}
\DoxyCodeLine{1988                         UINT8 g;}
\DoxyCodeLine{1989                         UINT32 cnt, channels = bpp/8;}
\DoxyCodeLine{1990 }
\DoxyCodeLine{1991                         \textcolor{keywordflow}{if} (\mbox{\hyperlink{classCPGFImage_a9226595ea6b907e4d07301a6ee641b87}{m\_downsample}}) \{}
\DoxyCodeLine{1992                                 \textcolor{keywordflow}{for} (i=0; i < h; i++) \{}
\DoxyCodeLine{1993                                         UINT32 uPos = uOffset;}
\DoxyCodeLine{1994                                         UINT32 yPos = yOffset;}
\DoxyCodeLine{1995                                         cnt = 0;}
\DoxyCodeLine{1996                                         \textcolor{keywordflow}{for} (j=0; j < w; j++) \{}
\DoxyCodeLine{1997                                                 \textcolor{comment}{// u and v are downsampled}}
\DoxyCodeLine{1998                                                 uAvg = u[uPos];}
\DoxyCodeLine{1999                                                 vAvg = v[uPos];}
\DoxyCodeLine{2000                                                 \textcolor{comment}{// Yuv}}
\DoxyCodeLine{2001                                                 buffg[cnt] = g = \mbox{\hyperlink{classCPGFImage_a7748968cec3128d6dbdeb224814ca14a}{Clamp8}}(y[yPos] + \mbox{\hyperlink{PGFimage_8cpp_a0fc648cb4d04d369ff4692cc07687039}{YUVoffset8}} - ((uAvg + vAvg ) >> 2)); \textcolor{comment}{// must be logical shift operator}}
\DoxyCodeLine{2002                                                 buffr[cnt] = \mbox{\hyperlink{classCPGFImage_a7748968cec3128d6dbdeb224814ca14a}{Clamp8}}(uAvg + g);}
\DoxyCodeLine{2003                                                 buffb[cnt] = \mbox{\hyperlink{classCPGFImage_a7748968cec3128d6dbdeb224814ca14a}{Clamp8}}(vAvg + g);}
\DoxyCodeLine{2004                                                 cnt += channels;}
\DoxyCodeLine{2005                                                 \textcolor{keywordflow}{if} (j \& 1) uPos++;}
\DoxyCodeLine{2006                                                 yPos++;}
\DoxyCodeLine{2007                                         \}}
\DoxyCodeLine{2008                                         \textcolor{keywordflow}{if} (i \& 1) uOffset += uw;}
\DoxyCodeLine{2009                                         yOffset += yw;}
\DoxyCodeLine{2010                                         buffb += pitch;}
\DoxyCodeLine{2011                                         buffg += pitch;}
\DoxyCodeLine{2012                                         buffr += pitch;}
\DoxyCodeLine{2013 }
\DoxyCodeLine{2014                                         \textcolor{keywordflow}{if} (cb) \{}
\DoxyCodeLine{2015                                                 percent += dP;}
\DoxyCodeLine{2016                                                 \textcolor{keywordflow}{if} ((*cb)(percent, \textcolor{keyword}{true}, data)) ReturnWithError(EscapePressed);}
\DoxyCodeLine{2017                                         \}}
\DoxyCodeLine{2018                                 \}}
\DoxyCodeLine{2019 }
\DoxyCodeLine{2020                         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{2021                                 \textcolor{keywordflow}{for} (i=0; i < h; i++) \{}
\DoxyCodeLine{2022                                         cnt = 0;}
\DoxyCodeLine{2023                                         UINT32 yPos = yOffset;}
\DoxyCodeLine{2024                                         \textcolor{keywordflow}{for} (j = 0; j < w; j++) \{}
\DoxyCodeLine{2025                                                 uAvg = u[yPos];}
\DoxyCodeLine{2026                                                 vAvg = v[yPos];}
\DoxyCodeLine{2027                                                 \textcolor{comment}{// Yuv}}
\DoxyCodeLine{2028                                                 buffg[cnt] = g = \mbox{\hyperlink{classCPGFImage_a7748968cec3128d6dbdeb224814ca14a}{Clamp8}}(y[yPos] + \mbox{\hyperlink{PGFimage_8cpp_a0fc648cb4d04d369ff4692cc07687039}{YUVoffset8}} - ((uAvg + vAvg ) >> 2)); \textcolor{comment}{// must be logical shift operator}}
\DoxyCodeLine{2029                                                 buffr[cnt] = \mbox{\hyperlink{classCPGFImage_a7748968cec3128d6dbdeb224814ca14a}{Clamp8}}(uAvg + g);}
\DoxyCodeLine{2030                                                 buffb[cnt] = \mbox{\hyperlink{classCPGFImage_a7748968cec3128d6dbdeb224814ca14a}{Clamp8}}(vAvg + g);}
\DoxyCodeLine{2031                                                 cnt += channels;}
\DoxyCodeLine{2032                                                 yPos++;}
\DoxyCodeLine{2033                                         \}}
\DoxyCodeLine{2034                                         yOffset += yw;}
\DoxyCodeLine{2035                                         buffb += pitch;}
\DoxyCodeLine{2036                                         buffg += pitch;}
\DoxyCodeLine{2037                                         buffr += pitch;}
\DoxyCodeLine{2038 }
\DoxyCodeLine{2039                                         \textcolor{keywordflow}{if} (cb) \{}
\DoxyCodeLine{2040                                                 percent += dP;}
\DoxyCodeLine{2041                                                 \textcolor{keywordflow}{if} ((*cb)(percent, \textcolor{keyword}{true}, data)) ReturnWithError(EscapePressed);}
\DoxyCodeLine{2042                                         \}}
\DoxyCodeLine{2043                                 \}}
\DoxyCodeLine{2044                         \}}
\DoxyCodeLine{2045                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{2046                 \}}
\DoxyCodeLine{2047         \textcolor{keywordflow}{case} \mbox{\hyperlink{PGFplatform_8h_ac04b7a3633a0caadba20e20e161239e1}{ImageModeRGB48}}:}
\DoxyCodeLine{2048                 \{}
\DoxyCodeLine{2049                         ASSERT(\mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_abda7a5f282421cd7e789da62f657efa0}{channels}} == 3);}
\DoxyCodeLine{2050                         ASSERT(\mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_aedea199e29cd6c404c82ab97c67e46b4}{bpp}} == 48);}
\DoxyCodeLine{2051 }
\DoxyCodeLine{2052                         \textcolor{keyword}{const} \mbox{\hyperlink{PGFtypes_8h_acb1ee3f52ccfad782dcaa0abd79e5d05}{DataT}} yuvOffset16 = 1 << (\mbox{\hyperlink{classCPGFImage_a6cc4f75843c3c15f573aaa0131649b10}{UsedBitsPerChannel}}() - 1);}
\DoxyCodeLine{2053 }
\DoxyCodeLine{2054                         \mbox{\hyperlink{PGFtypes_8h_acb1ee3f52ccfad782dcaa0abd79e5d05}{DataT}}* y = \mbox{\hyperlink{classCPGFImage_a36f7f20b38a9cb3a9c88032f5f886345}{m\_channel}}[0]; ASSERT(y);}
\DoxyCodeLine{2055                         \mbox{\hyperlink{PGFtypes_8h_acb1ee3f52ccfad782dcaa0abd79e5d05}{DataT}}* u = \mbox{\hyperlink{classCPGFImage_a36f7f20b38a9cb3a9c88032f5f886345}{m\_channel}}[1]; ASSERT(u);}
\DoxyCodeLine{2056                         \mbox{\hyperlink{PGFtypes_8h_acb1ee3f52ccfad782dcaa0abd79e5d05}{DataT}}* v = \mbox{\hyperlink{classCPGFImage_a36f7f20b38a9cb3a9c88032f5f886345}{m\_channel}}[2]; ASSERT(v);}
\DoxyCodeLine{2057                         UINT32 cnt, channels;}
\DoxyCodeLine{2058                         \mbox{\hyperlink{PGFtypes_8h_acb1ee3f52ccfad782dcaa0abd79e5d05}{DataT}} g;}
\DoxyCodeLine{2059 }
\DoxyCodeLine{2060                         \textcolor{keywordflow}{if} (bpp >= 48 \&\& bpp\%16 == 0) \{}
\DoxyCodeLine{2061                                 \textcolor{keyword}{const} \textcolor{keywordtype}{int} shift = 16 - \mbox{\hyperlink{classCPGFImage_a6cc4f75843c3c15f573aaa0131649b10}{UsedBitsPerChannel}}(); ASSERT(shift >= 0);}
\DoxyCodeLine{2062                                 UINT16 *buff16 = (UINT16 *)buff;}
\DoxyCodeLine{2063                                 \textcolor{keywordtype}{int} pitch16 = pitch/2;}
\DoxyCodeLine{2064                                 channels = bpp/16; ASSERT(channels >= \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_abda7a5f282421cd7e789da62f657efa0}{channels}});}
\DoxyCodeLine{2065 }
\DoxyCodeLine{2066                                 \textcolor{keywordflow}{for} (i=0; i < h; i++) \{}
\DoxyCodeLine{2067                                         UINT32 uPos = uOffset;}
\DoxyCodeLine{2068                                         UINT32 yPos = yOffset;}
\DoxyCodeLine{2069                                         cnt = 0;}
\DoxyCodeLine{2070                                         \textcolor{keywordflow}{for} (j=0; j < w; j++) \{}
\DoxyCodeLine{2071                                                 uAvg = u[uPos];}
\DoxyCodeLine{2072                                                 vAvg = v[uPos];}
\DoxyCodeLine{2073                                                 \textcolor{comment}{// Yuv}}
\DoxyCodeLine{2074                                                 g = y[yPos] + yuvOffset16 - ((uAvg + vAvg ) >> 2); \textcolor{comment}{// must be logical shift operator}}
\DoxyCodeLine{2075                                                 buff16[cnt + channelMap[1]] = \mbox{\hyperlink{classCPGFImage_a666cd327643276fdd5e8b123fcbc991f}{Clamp16}}(g << shift);}
\DoxyCodeLine{2076                                                 buff16[cnt + channelMap[2]] = \mbox{\hyperlink{classCPGFImage_a666cd327643276fdd5e8b123fcbc991f}{Clamp16}}((uAvg + g) << shift);}
\DoxyCodeLine{2077                                                 buff16[cnt + channelMap[0]] = \mbox{\hyperlink{classCPGFImage_a666cd327643276fdd5e8b123fcbc991f}{Clamp16}}((vAvg + g) << shift);}
\DoxyCodeLine{2078                                                 cnt += channels;}
\DoxyCodeLine{2079                                                 \textcolor{keywordflow}{if} (!\mbox{\hyperlink{classCPGFImage_a9226595ea6b907e4d07301a6ee641b87}{m\_downsample}} || (j \& 1)) uPos++;}
\DoxyCodeLine{2080                                                 yPos++;}
\DoxyCodeLine{2081                                         \}}
\DoxyCodeLine{2082                                         \textcolor{keywordflow}{if} (!\mbox{\hyperlink{classCPGFImage_a9226595ea6b907e4d07301a6ee641b87}{m\_downsample}} || (i \& 1)) uOffset += uw;}
\DoxyCodeLine{2083                                         yOffset += yw;}
\DoxyCodeLine{2084                                         buff16 += pitch16;}
\DoxyCodeLine{2085 }
\DoxyCodeLine{2086                                         \textcolor{keywordflow}{if} (cb) \{}
\DoxyCodeLine{2087                                                 percent += dP;}
\DoxyCodeLine{2088                                                 \textcolor{keywordflow}{if} ((*cb)(percent, \textcolor{keyword}{true}, data)) ReturnWithError(EscapePressed);}
\DoxyCodeLine{2089                                         \}}
\DoxyCodeLine{2090                                 \}}
\DoxyCodeLine{2091                         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{2092                                 ASSERT(bpp\%8 == 0);}
\DoxyCodeLine{2093                                 \textcolor{keyword}{const} \textcolor{keywordtype}{int} shift = \mbox{\hyperlink{PGFplatform_8h_af643213a7d426b69429d1430cef4ecbb}{\_\_max}}(0, \mbox{\hyperlink{classCPGFImage_a6cc4f75843c3c15f573aaa0131649b10}{UsedBitsPerChannel}}() - 8);}
\DoxyCodeLine{2094                                 channels = bpp/8; ASSERT(channels >= \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_abda7a5f282421cd7e789da62f657efa0}{channels}});}
\DoxyCodeLine{2095 }
\DoxyCodeLine{2096                                 \textcolor{keywordflow}{for} (i=0; i < h; i++) \{}
\DoxyCodeLine{2097                                         UINT32 uPos = uOffset;}
\DoxyCodeLine{2098                                         UINT32 yPos = yOffset;}
\DoxyCodeLine{2099                                         cnt = 0;}
\DoxyCodeLine{2100                                         \textcolor{keywordflow}{for} (j=0; j < w; j++) \{}
\DoxyCodeLine{2101                                                 uAvg = u[uPos];}
\DoxyCodeLine{2102                                                 vAvg = v[uPos];}
\DoxyCodeLine{2103                                                 \textcolor{comment}{// Yuv}}
\DoxyCodeLine{2104                                                 g = y[yPos] + yuvOffset16 - ((uAvg + vAvg ) >> 2); \textcolor{comment}{// must be logical shift operator}}
\DoxyCodeLine{2105                                                 buff[cnt + channelMap[1]] = \mbox{\hyperlink{classCPGFImage_a7748968cec3128d6dbdeb224814ca14a}{Clamp8}}(g >> shift); }
\DoxyCodeLine{2106                                                 buff[cnt + channelMap[2]] = \mbox{\hyperlink{classCPGFImage_a7748968cec3128d6dbdeb224814ca14a}{Clamp8}}((uAvg + g) >> shift);}
\DoxyCodeLine{2107                                                 buff[cnt + channelMap[0]] = \mbox{\hyperlink{classCPGFImage_a7748968cec3128d6dbdeb224814ca14a}{Clamp8}}((vAvg + g) >> shift);}
\DoxyCodeLine{2108                                                 cnt += channels;}
\DoxyCodeLine{2109                                                 \textcolor{keywordflow}{if} (!\mbox{\hyperlink{classCPGFImage_a9226595ea6b907e4d07301a6ee641b87}{m\_downsample}} || (j \& 1)) uPos++;}
\DoxyCodeLine{2110                                                 yPos++;}
\DoxyCodeLine{2111                                         \}}
\DoxyCodeLine{2112                                         \textcolor{keywordflow}{if} (!\mbox{\hyperlink{classCPGFImage_a9226595ea6b907e4d07301a6ee641b87}{m\_downsample}} || (i \& 1)) uOffset += uw;}
\DoxyCodeLine{2113                                         yOffset += yw;}
\DoxyCodeLine{2114                                         buff += pitch;}
\DoxyCodeLine{2115 }
\DoxyCodeLine{2116                                         \textcolor{keywordflow}{if} (cb) \{}
\DoxyCodeLine{2117                                                 percent += dP;}
\DoxyCodeLine{2118                                                 \textcolor{keywordflow}{if} ((*cb)(percent, \textcolor{keyword}{true}, data)) ReturnWithError(EscapePressed);}
\DoxyCodeLine{2119                                         \}}
\DoxyCodeLine{2120                                 \}}
\DoxyCodeLine{2121                         \}}
\DoxyCodeLine{2122                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{2123                 \}}
\DoxyCodeLine{2124         \textcolor{keywordflow}{case} \mbox{\hyperlink{PGFplatform_8h_aa1d93456909be3c716a8c5a30b191c00}{ImageModeLabColor}}:}
\DoxyCodeLine{2125                 \{}
\DoxyCodeLine{2126                         ASSERT(\mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_abda7a5f282421cd7e789da62f657efa0}{channels}} == 3);}
\DoxyCodeLine{2127                         ASSERT(\mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_aedea199e29cd6c404c82ab97c67e46b4}{bpp}} == \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_abda7a5f282421cd7e789da62f657efa0}{channels}}*8);}
\DoxyCodeLine{2128                         ASSERT(bpp\%8 == 0);}
\DoxyCodeLine{2129 }
\DoxyCodeLine{2130                         \mbox{\hyperlink{PGFtypes_8h_acb1ee3f52ccfad782dcaa0abd79e5d05}{DataT}}* l = \mbox{\hyperlink{classCPGFImage_a36f7f20b38a9cb3a9c88032f5f886345}{m\_channel}}[0]; ASSERT(l);}
\DoxyCodeLine{2131                         \mbox{\hyperlink{PGFtypes_8h_acb1ee3f52ccfad782dcaa0abd79e5d05}{DataT}}* a = \mbox{\hyperlink{classCPGFImage_a36f7f20b38a9cb3a9c88032f5f886345}{m\_channel}}[1]; ASSERT(a);}
\DoxyCodeLine{2132                         \mbox{\hyperlink{PGFtypes_8h_acb1ee3f52ccfad782dcaa0abd79e5d05}{DataT}}* b = \mbox{\hyperlink{classCPGFImage_a36f7f20b38a9cb3a9c88032f5f886345}{m\_channel}}[2]; ASSERT(b);}
\DoxyCodeLine{2133                         UINT32 cnt, channels = bpp/8; ASSERT(channels >= \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_abda7a5f282421cd7e789da62f657efa0}{channels}});}
\DoxyCodeLine{2134 }
\DoxyCodeLine{2135                         \textcolor{keywordflow}{for} (i=0; i < h; i++) \{}
\DoxyCodeLine{2136                                 UINT32 uPos = uOffset;}
\DoxyCodeLine{2137                                 UINT32 yPos = yOffset;}
\DoxyCodeLine{2138                                 cnt = 0;}
\DoxyCodeLine{2139                                 \textcolor{keywordflow}{for} (j=0; j < w; j++) \{}
\DoxyCodeLine{2140                                         uAvg = a[uPos];}
\DoxyCodeLine{2141                                         vAvg = b[uPos];}
\DoxyCodeLine{2142                                         buff[cnt + channelMap[0]] = \mbox{\hyperlink{classCPGFImage_a7748968cec3128d6dbdeb224814ca14a}{Clamp8}}(l[yPos] + \mbox{\hyperlink{PGFimage_8cpp_a0fc648cb4d04d369ff4692cc07687039}{YUVoffset8}});}
\DoxyCodeLine{2143                                         buff[cnt + channelMap[1]] = \mbox{\hyperlink{classCPGFImage_a7748968cec3128d6dbdeb224814ca14a}{Clamp8}}(uAvg + \mbox{\hyperlink{PGFimage_8cpp_a0fc648cb4d04d369ff4692cc07687039}{YUVoffset8}}); }
\DoxyCodeLine{2144                                         buff[cnt + channelMap[2]] = \mbox{\hyperlink{classCPGFImage_a7748968cec3128d6dbdeb224814ca14a}{Clamp8}}(vAvg + \mbox{\hyperlink{PGFimage_8cpp_a0fc648cb4d04d369ff4692cc07687039}{YUVoffset8}});}
\DoxyCodeLine{2145                                         cnt += channels;}
\DoxyCodeLine{2146                                         \textcolor{keywordflow}{if} (!\mbox{\hyperlink{classCPGFImage_a9226595ea6b907e4d07301a6ee641b87}{m\_downsample}} || (j \& 1)) uPos++;}
\DoxyCodeLine{2147                                         yPos++;}
\DoxyCodeLine{2148                                 \}}
\DoxyCodeLine{2149                                 \textcolor{keywordflow}{if} (!\mbox{\hyperlink{classCPGFImage_a9226595ea6b907e4d07301a6ee641b87}{m\_downsample}} || (i \& 1)) uOffset += uw;}
\DoxyCodeLine{2150                                 yOffset += yw;}
\DoxyCodeLine{2151                                 buff += pitch;}
\DoxyCodeLine{2152 }
\DoxyCodeLine{2153                                 \textcolor{keywordflow}{if} (cb) \{}
\DoxyCodeLine{2154                                         percent += dP;}
\DoxyCodeLine{2155                                         \textcolor{keywordflow}{if} ((*cb)(percent, \textcolor{keyword}{true}, data)) ReturnWithError(EscapePressed);}
\DoxyCodeLine{2156                                 \}}
\DoxyCodeLine{2157                         \}}
\DoxyCodeLine{2158                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{2159                 \}}
\DoxyCodeLine{2160         \textcolor{keywordflow}{case} \mbox{\hyperlink{PGFplatform_8h_ae7de617953bf44d768dfd82b62a98db5}{ImageModeLab48}}:}
\DoxyCodeLine{2161                 \{}
\DoxyCodeLine{2162                         ASSERT(\mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_abda7a5f282421cd7e789da62f657efa0}{channels}} == 3);}
\DoxyCodeLine{2163                         ASSERT(\mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_aedea199e29cd6c404c82ab97c67e46b4}{bpp}} == \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_abda7a5f282421cd7e789da62f657efa0}{channels}}*16);}
\DoxyCodeLine{2164 }
\DoxyCodeLine{2165                         \textcolor{keyword}{const} \mbox{\hyperlink{PGFtypes_8h_acb1ee3f52ccfad782dcaa0abd79e5d05}{DataT}} yuvOffset16 = 1 << (\mbox{\hyperlink{classCPGFImage_a6cc4f75843c3c15f573aaa0131649b10}{UsedBitsPerChannel}}() - 1);}
\DoxyCodeLine{2166 }
\DoxyCodeLine{2167                         \mbox{\hyperlink{PGFtypes_8h_acb1ee3f52ccfad782dcaa0abd79e5d05}{DataT}}* l = \mbox{\hyperlink{classCPGFImage_a36f7f20b38a9cb3a9c88032f5f886345}{m\_channel}}[0]; ASSERT(l);}
\DoxyCodeLine{2168                         \mbox{\hyperlink{PGFtypes_8h_acb1ee3f52ccfad782dcaa0abd79e5d05}{DataT}}* a = \mbox{\hyperlink{classCPGFImage_a36f7f20b38a9cb3a9c88032f5f886345}{m\_channel}}[1]; ASSERT(a);}
\DoxyCodeLine{2169                         \mbox{\hyperlink{PGFtypes_8h_acb1ee3f52ccfad782dcaa0abd79e5d05}{DataT}}* b = \mbox{\hyperlink{classCPGFImage_a36f7f20b38a9cb3a9c88032f5f886345}{m\_channel}}[2]; ASSERT(b);}
\DoxyCodeLine{2170                         UINT32 cnt, channels;}
\DoxyCodeLine{2171 }
\DoxyCodeLine{2172                         \textcolor{keywordflow}{if} (bpp\%16 == 0) \{}
\DoxyCodeLine{2173                                 \textcolor{keyword}{const} \textcolor{keywordtype}{int} shift = 16 - \mbox{\hyperlink{classCPGFImage_a6cc4f75843c3c15f573aaa0131649b10}{UsedBitsPerChannel}}(); ASSERT(shift >= 0);}
\DoxyCodeLine{2174                                 UINT16 *buff16 = (UINT16 *)buff;}
\DoxyCodeLine{2175                                 \textcolor{keywordtype}{int} pitch16 = pitch/2;}
\DoxyCodeLine{2176                                 channels = bpp/16; ASSERT(channels >= \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_abda7a5f282421cd7e789da62f657efa0}{channels}});}
\DoxyCodeLine{2177 }
\DoxyCodeLine{2178                                 \textcolor{keywordflow}{for} (i=0; i < h; i++) \{}
\DoxyCodeLine{2179                                         UINT32 uPos = uOffset;}
\DoxyCodeLine{2180                                         UINT32 yPos = yOffset;}
\DoxyCodeLine{2181                                         cnt = 0;}
\DoxyCodeLine{2182                                         \textcolor{keywordflow}{for} (j=0; j < w; j++) \{}
\DoxyCodeLine{2183                                                 uAvg = a[uPos];}
\DoxyCodeLine{2184                                                 vAvg = b[uPos];}
\DoxyCodeLine{2185                                                 buff16[cnt + channelMap[0]] = \mbox{\hyperlink{classCPGFImage_a666cd327643276fdd5e8b123fcbc991f}{Clamp16}}((l[yPos] + yuvOffset16) << shift);}
\DoxyCodeLine{2186                                                 buff16[cnt + channelMap[1]] = \mbox{\hyperlink{classCPGFImage_a666cd327643276fdd5e8b123fcbc991f}{Clamp16}}((uAvg + yuvOffset16) << shift);}
\DoxyCodeLine{2187                                                 buff16[cnt + channelMap[2]] = \mbox{\hyperlink{classCPGFImage_a666cd327643276fdd5e8b123fcbc991f}{Clamp16}}((vAvg + yuvOffset16) << shift);}
\DoxyCodeLine{2188                                                 cnt += channels;}
\DoxyCodeLine{2189                                                 \textcolor{keywordflow}{if} (!\mbox{\hyperlink{classCPGFImage_a9226595ea6b907e4d07301a6ee641b87}{m\_downsample}} || (j \& 1)) uPos++;}
\DoxyCodeLine{2190                                                 yPos++;}
\DoxyCodeLine{2191                                         \}}
\DoxyCodeLine{2192                                         \textcolor{keywordflow}{if} (!\mbox{\hyperlink{classCPGFImage_a9226595ea6b907e4d07301a6ee641b87}{m\_downsample}} || (i \& 1)) uOffset += uw;}
\DoxyCodeLine{2193                                         yOffset += yw;}
\DoxyCodeLine{2194                                         buff16 += pitch16;}
\DoxyCodeLine{2195 }
\DoxyCodeLine{2196                                         \textcolor{keywordflow}{if} (cb) \{}
\DoxyCodeLine{2197                                                 percent += dP;}
\DoxyCodeLine{2198                                                 \textcolor{keywordflow}{if} ((*cb)(percent, \textcolor{keyword}{true}, data)) ReturnWithError(EscapePressed);}
\DoxyCodeLine{2199                                         \}}
\DoxyCodeLine{2200                                 \}}
\DoxyCodeLine{2201                         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{2202                                 ASSERT(bpp\%8 == 0);}
\DoxyCodeLine{2203                                 \textcolor{keyword}{const} \textcolor{keywordtype}{int} shift = \mbox{\hyperlink{PGFplatform_8h_af643213a7d426b69429d1430cef4ecbb}{\_\_max}}(0, \mbox{\hyperlink{classCPGFImage_a6cc4f75843c3c15f573aaa0131649b10}{UsedBitsPerChannel}}() - 8);}
\DoxyCodeLine{2204                                 channels = bpp/8; ASSERT(channels >= \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_abda7a5f282421cd7e789da62f657efa0}{channels}});}
\DoxyCodeLine{2205 }
\DoxyCodeLine{2206                                 \textcolor{keywordflow}{for} (i=0; i < h; i++) \{}
\DoxyCodeLine{2207                                         UINT32 uPos = uOffset;}
\DoxyCodeLine{2208                                         UINT32 yPos = yOffset;}
\DoxyCodeLine{2209                                         cnt = 0;}
\DoxyCodeLine{2210                                         \textcolor{keywordflow}{for} (j=0; j < w; j++) \{}
\DoxyCodeLine{2211                                                 uAvg = a[uPos];}
\DoxyCodeLine{2212                                                 vAvg = b[uPos];}
\DoxyCodeLine{2213                                                 buff[cnt + channelMap[0]] = \mbox{\hyperlink{classCPGFImage_a7748968cec3128d6dbdeb224814ca14a}{Clamp8}}((l[yPos] + yuvOffset16) >> shift);}
\DoxyCodeLine{2214                                                 buff[cnt + channelMap[1]] = \mbox{\hyperlink{classCPGFImage_a7748968cec3128d6dbdeb224814ca14a}{Clamp8}}((uAvg + yuvOffset16) >> shift);}
\DoxyCodeLine{2215                                                 buff[cnt + channelMap[2]] = \mbox{\hyperlink{classCPGFImage_a7748968cec3128d6dbdeb224814ca14a}{Clamp8}}((vAvg + yuvOffset16) >> shift);}
\DoxyCodeLine{2216                                                 cnt += channels;}
\DoxyCodeLine{2217                                                 \textcolor{keywordflow}{if} (!\mbox{\hyperlink{classCPGFImage_a9226595ea6b907e4d07301a6ee641b87}{m\_downsample}} || (j \& 1)) uPos++;}
\DoxyCodeLine{2218                                                 yPos++;}
\DoxyCodeLine{2219                                         \}}
\DoxyCodeLine{2220                                         \textcolor{keywordflow}{if} (!\mbox{\hyperlink{classCPGFImage_a9226595ea6b907e4d07301a6ee641b87}{m\_downsample}} || (i \& 1)) uOffset += uw;}
\DoxyCodeLine{2221                                         yOffset += yw;}
\DoxyCodeLine{2222                                         buff += pitch;}
\DoxyCodeLine{2223 }
\DoxyCodeLine{2224                                         \textcolor{keywordflow}{if} (cb) \{}
\DoxyCodeLine{2225                                                 percent += dP;}
\DoxyCodeLine{2226                                                 \textcolor{keywordflow}{if} ((*cb)(percent, \textcolor{keyword}{true}, data)) ReturnWithError(EscapePressed);}
\DoxyCodeLine{2227                                         \}}
\DoxyCodeLine{2228                                 \}}
\DoxyCodeLine{2229                         \}}
\DoxyCodeLine{2230                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{2231                 \}}
\DoxyCodeLine{2232         \textcolor{keywordflow}{case} \mbox{\hyperlink{PGFplatform_8h_ab7cb460804a8abce27d823d09682c85b}{ImageModeRGBA}}:}
\DoxyCodeLine{2233         \textcolor{keywordflow}{case} \mbox{\hyperlink{PGFplatform_8h_af50b920dae1922b4eb0bcd82361d880c}{ImageModeCMYKColor}}:}
\DoxyCodeLine{2234                 \{}
\DoxyCodeLine{2235                         ASSERT(\mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_abda7a5f282421cd7e789da62f657efa0}{channels}} == 4);}
\DoxyCodeLine{2236                         ASSERT(\mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_aedea199e29cd6c404c82ab97c67e46b4}{bpp}} == \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_abda7a5f282421cd7e789da62f657efa0}{channels}}*8);}
\DoxyCodeLine{2237                         ASSERT(bpp\%8 == 0);}
\DoxyCodeLine{2238 }
\DoxyCodeLine{2239                         \mbox{\hyperlink{PGFtypes_8h_acb1ee3f52ccfad782dcaa0abd79e5d05}{DataT}}* y = \mbox{\hyperlink{classCPGFImage_a36f7f20b38a9cb3a9c88032f5f886345}{m\_channel}}[0]; ASSERT(y);}
\DoxyCodeLine{2240                         \mbox{\hyperlink{PGFtypes_8h_acb1ee3f52ccfad782dcaa0abd79e5d05}{DataT}}* u = \mbox{\hyperlink{classCPGFImage_a36f7f20b38a9cb3a9c88032f5f886345}{m\_channel}}[1]; ASSERT(u);}
\DoxyCodeLine{2241                         \mbox{\hyperlink{PGFtypes_8h_acb1ee3f52ccfad782dcaa0abd79e5d05}{DataT}}* v = \mbox{\hyperlink{classCPGFImage_a36f7f20b38a9cb3a9c88032f5f886345}{m\_channel}}[2]; ASSERT(v);}
\DoxyCodeLine{2242                         \mbox{\hyperlink{PGFtypes_8h_acb1ee3f52ccfad782dcaa0abd79e5d05}{DataT}}* a = \mbox{\hyperlink{classCPGFImage_a36f7f20b38a9cb3a9c88032f5f886345}{m\_channel}}[3]; ASSERT(a);}
\DoxyCodeLine{2243                         UINT8 g, aAvg;}
\DoxyCodeLine{2244                         UINT32 cnt, channels = bpp/8; ASSERT(channels >= \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_abda7a5f282421cd7e789da62f657efa0}{channels}});}
\DoxyCodeLine{2245 }
\DoxyCodeLine{2246                         \textcolor{keywordflow}{for} (i=0; i < h; i++) \{}
\DoxyCodeLine{2247                                 UINT32 uPos = uOffset;}
\DoxyCodeLine{2248                                 UINT32 yPos = yOffset;}
\DoxyCodeLine{2249                                 cnt = 0;}
\DoxyCodeLine{2250                                 \textcolor{keywordflow}{for} (j=0; j < w; j++) \{}
\DoxyCodeLine{2251                                         uAvg = u[uPos];}
\DoxyCodeLine{2252                                         vAvg = v[uPos];}
\DoxyCodeLine{2253                                         aAvg = \mbox{\hyperlink{classCPGFImage_a7748968cec3128d6dbdeb224814ca14a}{Clamp8}}(a[uPos] + \mbox{\hyperlink{PGFimage_8cpp_a0fc648cb4d04d369ff4692cc07687039}{YUVoffset8}});}
\DoxyCodeLine{2254                                         \textcolor{comment}{// Yuv}}
\DoxyCodeLine{2255                                         buff[cnt + channelMap[1]] = g = \mbox{\hyperlink{classCPGFImage_a7748968cec3128d6dbdeb224814ca14a}{Clamp8}}(y[yPos] + \mbox{\hyperlink{PGFimage_8cpp_a0fc648cb4d04d369ff4692cc07687039}{YUVoffset8}} - ((uAvg + vAvg ) >> 2)); \textcolor{comment}{// must be logical shift operator}}
\DoxyCodeLine{2256                                         buff[cnt + channelMap[2]] = \mbox{\hyperlink{classCPGFImage_a7748968cec3128d6dbdeb224814ca14a}{Clamp8}}(uAvg + g);}
\DoxyCodeLine{2257                                         buff[cnt + channelMap[0]] = \mbox{\hyperlink{classCPGFImage_a7748968cec3128d6dbdeb224814ca14a}{Clamp8}}(vAvg + g);}
\DoxyCodeLine{2258                                         buff[cnt + channelMap[3]] = aAvg;}
\DoxyCodeLine{2259                                         cnt += channels;}
\DoxyCodeLine{2260                                         \textcolor{keywordflow}{if} (!\mbox{\hyperlink{classCPGFImage_a9226595ea6b907e4d07301a6ee641b87}{m\_downsample}} || (j \& 1)) uPos++;}
\DoxyCodeLine{2261                                         yPos++;}
\DoxyCodeLine{2262                                 \}}
\DoxyCodeLine{2263                                 \textcolor{keywordflow}{if} (!\mbox{\hyperlink{classCPGFImage_a9226595ea6b907e4d07301a6ee641b87}{m\_downsample}} || (i \& 1)) uOffset += uw;}
\DoxyCodeLine{2264                                 yOffset += yw;}
\DoxyCodeLine{2265                                 buff += pitch;}
\DoxyCodeLine{2266 }
\DoxyCodeLine{2267                                 \textcolor{keywordflow}{if} (cb) \{}
\DoxyCodeLine{2268                                         percent += dP;}
\DoxyCodeLine{2269                                         \textcolor{keywordflow}{if} ((*cb)(percent, \textcolor{keyword}{true}, data)) ReturnWithError(EscapePressed);}
\DoxyCodeLine{2270                                 \}}
\DoxyCodeLine{2271                         \}}
\DoxyCodeLine{2272                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{2273                 \}}
\DoxyCodeLine{2274         \textcolor{keywordflow}{case} \mbox{\hyperlink{PGFplatform_8h_ac250ca543e6f93f370614801122b61f6}{ImageModeCMYK64}}: }
\DoxyCodeLine{2275                 \{}
\DoxyCodeLine{2276                         ASSERT(\mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_abda7a5f282421cd7e789da62f657efa0}{channels}} == 4);}
\DoxyCodeLine{2277                         ASSERT(\mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_aedea199e29cd6c404c82ab97c67e46b4}{bpp}} == 64);}
\DoxyCodeLine{2278 }
\DoxyCodeLine{2279                         \textcolor{keyword}{const} \mbox{\hyperlink{PGFtypes_8h_acb1ee3f52ccfad782dcaa0abd79e5d05}{DataT}} yuvOffset16 = 1 << (\mbox{\hyperlink{classCPGFImage_a6cc4f75843c3c15f573aaa0131649b10}{UsedBitsPerChannel}}() - 1);}
\DoxyCodeLine{2280 }
\DoxyCodeLine{2281                         \mbox{\hyperlink{PGFtypes_8h_acb1ee3f52ccfad782dcaa0abd79e5d05}{DataT}}* y = \mbox{\hyperlink{classCPGFImage_a36f7f20b38a9cb3a9c88032f5f886345}{m\_channel}}[0]; ASSERT(y);}
\DoxyCodeLine{2282                         \mbox{\hyperlink{PGFtypes_8h_acb1ee3f52ccfad782dcaa0abd79e5d05}{DataT}}* u = \mbox{\hyperlink{classCPGFImage_a36f7f20b38a9cb3a9c88032f5f886345}{m\_channel}}[1]; ASSERT(u);}
\DoxyCodeLine{2283                         \mbox{\hyperlink{PGFtypes_8h_acb1ee3f52ccfad782dcaa0abd79e5d05}{DataT}}* v = \mbox{\hyperlink{classCPGFImage_a36f7f20b38a9cb3a9c88032f5f886345}{m\_channel}}[2]; ASSERT(v);}
\DoxyCodeLine{2284                         \mbox{\hyperlink{PGFtypes_8h_acb1ee3f52ccfad782dcaa0abd79e5d05}{DataT}}* a = \mbox{\hyperlink{classCPGFImage_a36f7f20b38a9cb3a9c88032f5f886345}{m\_channel}}[3]; ASSERT(a);}
\DoxyCodeLine{2285                         \mbox{\hyperlink{PGFtypes_8h_acb1ee3f52ccfad782dcaa0abd79e5d05}{DataT}} g, aAvg;}
\DoxyCodeLine{2286                         UINT32 cnt, channels;}
\DoxyCodeLine{2287 }
\DoxyCodeLine{2288                         \textcolor{keywordflow}{if} (bpp\%16 == 0) \{}
\DoxyCodeLine{2289                                 \textcolor{keyword}{const} \textcolor{keywordtype}{int} shift = 16 - \mbox{\hyperlink{classCPGFImage_a6cc4f75843c3c15f573aaa0131649b10}{UsedBitsPerChannel}}(); ASSERT(shift >= 0);}
\DoxyCodeLine{2290                                 UINT16 *buff16 = (UINT16 *)buff;}
\DoxyCodeLine{2291                                 \textcolor{keywordtype}{int} pitch16 = pitch/2;}
\DoxyCodeLine{2292                                 channels = bpp/16; ASSERT(channels >= \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_abda7a5f282421cd7e789da62f657efa0}{channels}});}
\DoxyCodeLine{2293 }
\DoxyCodeLine{2294                                 \textcolor{keywordflow}{for} (i=0; i < h; i++) \{}
\DoxyCodeLine{2295                                         UINT32 uPos = uOffset;}
\DoxyCodeLine{2296                                         UINT32 yPos = yOffset;}
\DoxyCodeLine{2297                                         cnt = 0;}
\DoxyCodeLine{2298                                         \textcolor{keywordflow}{for} (j=0; j < w; j++) \{}
\DoxyCodeLine{2299                                                 uAvg = u[uPos];}
\DoxyCodeLine{2300                                                 vAvg = v[uPos];}
\DoxyCodeLine{2301                                                 aAvg = a[uPos] + yuvOffset16;}
\DoxyCodeLine{2302                                                 \textcolor{comment}{// Yuv}}
\DoxyCodeLine{2303                                                 g = y[yPos] + yuvOffset16 - ((uAvg + vAvg ) >> 2); \textcolor{comment}{// must be logical shift operator}}
\DoxyCodeLine{2304                                                 buff16[cnt + channelMap[1]] = \mbox{\hyperlink{classCPGFImage_a666cd327643276fdd5e8b123fcbc991f}{Clamp16}}(g << shift);}
\DoxyCodeLine{2305                                                 buff16[cnt + channelMap[2]] = \mbox{\hyperlink{classCPGFImage_a666cd327643276fdd5e8b123fcbc991f}{Clamp16}}((uAvg + g) << shift);}
\DoxyCodeLine{2306                                                 buff16[cnt + channelMap[0]] = \mbox{\hyperlink{classCPGFImage_a666cd327643276fdd5e8b123fcbc991f}{Clamp16}}((vAvg + g) << shift);}
\DoxyCodeLine{2307                                                 buff16[cnt + channelMap[3]] = \mbox{\hyperlink{classCPGFImage_a666cd327643276fdd5e8b123fcbc991f}{Clamp16}}(aAvg << shift);}
\DoxyCodeLine{2308                                                 cnt += channels;}
\DoxyCodeLine{2309                                                 \textcolor{keywordflow}{if} (!\mbox{\hyperlink{classCPGFImage_a9226595ea6b907e4d07301a6ee641b87}{m\_downsample}} || (j \& 1)) uPos++;}
\DoxyCodeLine{2310                                                 yPos++;}
\DoxyCodeLine{2311                                         \}}
\DoxyCodeLine{2312                                         \textcolor{keywordflow}{if} (!\mbox{\hyperlink{classCPGFImage_a9226595ea6b907e4d07301a6ee641b87}{m\_downsample}} || (i \& 1)) uOffset += uw;}
\DoxyCodeLine{2313                                         yOffset += yw;}
\DoxyCodeLine{2314                                         buff16 += pitch16;}
\DoxyCodeLine{2315 }
\DoxyCodeLine{2316                                         \textcolor{keywordflow}{if} (cb) \{}
\DoxyCodeLine{2317                                                 percent += dP;}
\DoxyCodeLine{2318                                                 \textcolor{keywordflow}{if} ((*cb)(percent, \textcolor{keyword}{true}, data)) ReturnWithError(EscapePressed);}
\DoxyCodeLine{2319                                         \}}
\DoxyCodeLine{2320                                 \}}
\DoxyCodeLine{2321                         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{2322                                 ASSERT(bpp\%8 == 0);}
\DoxyCodeLine{2323                                 \textcolor{keyword}{const} \textcolor{keywordtype}{int} shift = \mbox{\hyperlink{PGFplatform_8h_af643213a7d426b69429d1430cef4ecbb}{\_\_max}}(0, \mbox{\hyperlink{classCPGFImage_a6cc4f75843c3c15f573aaa0131649b10}{UsedBitsPerChannel}}() - 8);}
\DoxyCodeLine{2324                                 channels = bpp/8; ASSERT(channels >= \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_abda7a5f282421cd7e789da62f657efa0}{channels}});}
\DoxyCodeLine{2325 }
\DoxyCodeLine{2326                                 \textcolor{keywordflow}{for} (i=0; i < h; i++) \{}
\DoxyCodeLine{2327                                         UINT32 uPos = uOffset;}
\DoxyCodeLine{2328                                         UINT32 yPos = yOffset;}
\DoxyCodeLine{2329                                         cnt = 0;}
\DoxyCodeLine{2330                                         \textcolor{keywordflow}{for} (j=0; j < w; j++) \{}
\DoxyCodeLine{2331                                                 uAvg = u[uPos];}
\DoxyCodeLine{2332                                                 vAvg = v[uPos];}
\DoxyCodeLine{2333                                                 aAvg = a[uPos] + yuvOffset16;}
\DoxyCodeLine{2334                                                 \textcolor{comment}{// Yuv}}
\DoxyCodeLine{2335                                                 g = y[yPos] + yuvOffset16 - ((uAvg + vAvg ) >> 2); \textcolor{comment}{// must be logical shift operator}}
\DoxyCodeLine{2336                                                 buff[cnt + channelMap[1]] = \mbox{\hyperlink{classCPGFImage_a7748968cec3128d6dbdeb224814ca14a}{Clamp8}}(g >> shift); }
\DoxyCodeLine{2337                                                 buff[cnt + channelMap[2]] = \mbox{\hyperlink{classCPGFImage_a7748968cec3128d6dbdeb224814ca14a}{Clamp8}}((uAvg + g) >> shift);}
\DoxyCodeLine{2338                                                 buff[cnt + channelMap[0]] = \mbox{\hyperlink{classCPGFImage_a7748968cec3128d6dbdeb224814ca14a}{Clamp8}}((vAvg + g) >> shift);}
\DoxyCodeLine{2339                                                 buff[cnt + channelMap[3]] = \mbox{\hyperlink{classCPGFImage_a7748968cec3128d6dbdeb224814ca14a}{Clamp8}}(aAvg >> shift);}
\DoxyCodeLine{2340                                                 cnt += channels;}
\DoxyCodeLine{2341                                                 \textcolor{keywordflow}{if} (!\mbox{\hyperlink{classCPGFImage_a9226595ea6b907e4d07301a6ee641b87}{m\_downsample}} || (j \& 1)) uPos++;}
\DoxyCodeLine{2342                                                 yPos++;}
\DoxyCodeLine{2343                                         \}}
\DoxyCodeLine{2344                                         \textcolor{keywordflow}{if} (!\mbox{\hyperlink{classCPGFImage_a9226595ea6b907e4d07301a6ee641b87}{m\_downsample}} || (i \& 1)) uOffset += uw;}
\DoxyCodeLine{2345                                         yOffset += yw;}
\DoxyCodeLine{2346                                         buff += pitch;}
\DoxyCodeLine{2347 }
\DoxyCodeLine{2348                                         \textcolor{keywordflow}{if} (cb) \{}
\DoxyCodeLine{2349                                                 percent += dP;}
\DoxyCodeLine{2350                                                 \textcolor{keywordflow}{if} ((*cb)(percent, \textcolor{keyword}{true}, data)) ReturnWithError(EscapePressed);}
\DoxyCodeLine{2351                                         \}}
\DoxyCodeLine{2352                                 \}}
\DoxyCodeLine{2353                         \}}
\DoxyCodeLine{2354                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{2355                 \}}
\DoxyCodeLine{2356 \textcolor{preprocessor}{\#ifdef \_\_PGF32SUPPORT\_\_}}
\DoxyCodeLine{2357         \textcolor{keywordflow}{case} \mbox{\hyperlink{PGFplatform_8h_a205e54791f7ad54d357330bb99cab3b2}{ImageModeGray32}}:}
\DoxyCodeLine{2358                 \{}
\DoxyCodeLine{2359                         ASSERT(\mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_abda7a5f282421cd7e789da62f657efa0}{channels}} == 1);}
\DoxyCodeLine{2360                         ASSERT(\mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_aedea199e29cd6c404c82ab97c67e46b4}{bpp}} == 32);}
\DoxyCodeLine{2361 }
\DoxyCodeLine{2362                         \textcolor{keyword}{const} \textcolor{keywordtype}{int} yuvOffset31 = 1 << (\mbox{\hyperlink{classCPGFImage_a6cc4f75843c3c15f573aaa0131649b10}{UsedBitsPerChannel}}() - 1);}
\DoxyCodeLine{2363                         \mbox{\hyperlink{PGFtypes_8h_acb1ee3f52ccfad782dcaa0abd79e5d05}{DataT}}* y = \mbox{\hyperlink{classCPGFImage_a36f7f20b38a9cb3a9c88032f5f886345}{m\_channel}}[0]; ASSERT(y);}
\DoxyCodeLine{2364 }
\DoxyCodeLine{2365                         \textcolor{keywordflow}{if} (bpp == 32) \{}
\DoxyCodeLine{2366                                 \textcolor{keyword}{const} \textcolor{keywordtype}{int} shift = 31 - \mbox{\hyperlink{classCPGFImage_a6cc4f75843c3c15f573aaa0131649b10}{UsedBitsPerChannel}}(); ASSERT(shift >= 0);}
\DoxyCodeLine{2367                                 UINT32 *buff32 = (UINT32 *)buff;}
\DoxyCodeLine{2368                                 \textcolor{keywordtype}{int} pitch32 = pitch/4;}
\DoxyCodeLine{2369 }
\DoxyCodeLine{2370                                 \textcolor{keywordflow}{for} (i=0; i < h; i++) \{}
\DoxyCodeLine{2371                                         UINT32 yPos = yOffset;}
\DoxyCodeLine{2372                                         \textcolor{keywordflow}{for} (j = 0; j < w; j++) \{}
\DoxyCodeLine{2373                                                 buff32[j] = \mbox{\hyperlink{classCPGFImage_a075dc79f2453625086a3f1987d692296}{Clamp31}}((y[yPos++] + yuvOffset31) << shift);}
\DoxyCodeLine{2374                                         \}}
\DoxyCodeLine{2375                                         yOffset += yw;}
\DoxyCodeLine{2376                                         buff32 += pitch32;}
\DoxyCodeLine{2377 }
\DoxyCodeLine{2378                                         \textcolor{keywordflow}{if} (cb) \{}
\DoxyCodeLine{2379                                                 percent += dP;}
\DoxyCodeLine{2380                                                 \textcolor{keywordflow}{if} ((*cb)(percent, \textcolor{keyword}{true}, data)) ReturnWithError(EscapePressed);}
\DoxyCodeLine{2381                                         \}}
\DoxyCodeLine{2382                                 \}}
\DoxyCodeLine{2383                         \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (bpp == 16) \{}
\DoxyCodeLine{2384                                 \textcolor{keyword}{const} \textcolor{keywordtype}{int} usedBits = \mbox{\hyperlink{classCPGFImage_a6cc4f75843c3c15f573aaa0131649b10}{UsedBitsPerChannel}}();}
\DoxyCodeLine{2385                                 UINT16 *buff16 = (UINT16 *)buff;}
\DoxyCodeLine{2386                                 \textcolor{keywordtype}{int} pitch16 = pitch/2;}
\DoxyCodeLine{2387 }
\DoxyCodeLine{2388                                 \textcolor{keywordflow}{if} (usedBits < 16) \{}
\DoxyCodeLine{2389                                         \textcolor{keyword}{const} \textcolor{keywordtype}{int} shift = 16 - usedBits;}
\DoxyCodeLine{2390                                         \textcolor{keywordflow}{for} (i=0; i < h; i++) \{}
\DoxyCodeLine{2391                                                 UINT32 yPos = yOffset;}
\DoxyCodeLine{2392                                                 \textcolor{keywordflow}{for} (j = 0; j < w; j++) \{}
\DoxyCodeLine{2393                                                         buff16[j] = \mbox{\hyperlink{classCPGFImage_a666cd327643276fdd5e8b123fcbc991f}{Clamp16}}((y[yPos++] + yuvOffset31) << shift);}
\DoxyCodeLine{2394                                                 \}}
\DoxyCodeLine{2395                                                 yOffset += yw;}
\DoxyCodeLine{2396                                                 buff16 += pitch16;}
\DoxyCodeLine{2397 }
\DoxyCodeLine{2398                                                 \textcolor{keywordflow}{if} (cb) \{}
\DoxyCodeLine{2399                                                         percent += dP;}
\DoxyCodeLine{2400                                                         \textcolor{keywordflow}{if} ((*cb)(percent, \textcolor{keyword}{true}, data)) ReturnWithError(EscapePressed);}
\DoxyCodeLine{2401                                                 \}}
\DoxyCodeLine{2402                                         \}}
\DoxyCodeLine{2403                                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{2404                                         \textcolor{keyword}{const} \textcolor{keywordtype}{int} shift = \mbox{\hyperlink{PGFplatform_8h_af643213a7d426b69429d1430cef4ecbb}{\_\_max}}(0, usedBits - 16);}
\DoxyCodeLine{2405                                         \textcolor{keywordflow}{for} (i=0; i < h; i++) \{}
\DoxyCodeLine{2406                                                 UINT32 yPos = yOffset;}
\DoxyCodeLine{2407                                                 \textcolor{keywordflow}{for} (j = 0; j < w; j++) \{}
\DoxyCodeLine{2408                                                         buff16[j] = \mbox{\hyperlink{classCPGFImage_a666cd327643276fdd5e8b123fcbc991f}{Clamp16}}((y[yPos++] + yuvOffset31) >> shift);}
\DoxyCodeLine{2409                                                 \}}
\DoxyCodeLine{2410                                                 yOffset += yw;}
\DoxyCodeLine{2411                                                 buff16 += pitch16;}
\DoxyCodeLine{2412 }
\DoxyCodeLine{2413                                                 \textcolor{keywordflow}{if} (cb) \{}
\DoxyCodeLine{2414                                                         percent += dP;}
\DoxyCodeLine{2415                                                         \textcolor{keywordflow}{if} ((*cb)(percent, \textcolor{keyword}{true}, data)) ReturnWithError(EscapePressed);}
\DoxyCodeLine{2416                                                 \}}
\DoxyCodeLine{2417                                         \}}
\DoxyCodeLine{2418                                 \}}
\DoxyCodeLine{2419                         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{2420                                 ASSERT(bpp == 8);}
\DoxyCodeLine{2421                                 \textcolor{keyword}{const} \textcolor{keywordtype}{int} shift = \mbox{\hyperlink{PGFplatform_8h_af643213a7d426b69429d1430cef4ecbb}{\_\_max}}(0, \mbox{\hyperlink{classCPGFImage_a6cc4f75843c3c15f573aaa0131649b10}{UsedBitsPerChannel}}() - 8);}
\DoxyCodeLine{2422                                 }
\DoxyCodeLine{2423                                 \textcolor{keywordflow}{for} (i=0; i < h; i++) \{}
\DoxyCodeLine{2424                                         UINT32 yPos = yOffset;}
\DoxyCodeLine{2425                                         \textcolor{keywordflow}{for} (j = 0; j < w; j++) \{}
\DoxyCodeLine{2426                                                 buff[j] = \mbox{\hyperlink{classCPGFImage_a7748968cec3128d6dbdeb224814ca14a}{Clamp8}}((y[yPos++] + yuvOffset31) >> shift);}
\DoxyCodeLine{2427                                         \}}
\DoxyCodeLine{2428                                         yOffset += yw;}
\DoxyCodeLine{2429                                         buff += pitch;}
\DoxyCodeLine{2430 }
\DoxyCodeLine{2431                                         \textcolor{keywordflow}{if} (cb) \{}
\DoxyCodeLine{2432                                                 percent += dP;}
\DoxyCodeLine{2433                                                 \textcolor{keywordflow}{if} ((*cb)(percent, \textcolor{keyword}{true}, data)) ReturnWithError(EscapePressed);}
\DoxyCodeLine{2434                                         \}}
\DoxyCodeLine{2435                                 \}}
\DoxyCodeLine{2436                         \}}
\DoxyCodeLine{2437                         \textcolor{keywordflow}{break};  }
\DoxyCodeLine{2438                 \}}
\DoxyCodeLine{2439 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{2440         \textcolor{keywordflow}{case} \mbox{\hyperlink{PGFplatform_8h_a1dbd9112d53e5eea856e65ed1e9c6d50}{ImageModeRGB12}}: }
\DoxyCodeLine{2441                 \{}
\DoxyCodeLine{2442                         ASSERT(\mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_abda7a5f282421cd7e789da62f657efa0}{channels}} == 3);}
\DoxyCodeLine{2443                         ASSERT(\mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_aedea199e29cd6c404c82ab97c67e46b4}{bpp}} == \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_abda7a5f282421cd7e789da62f657efa0}{channels}}*4);}
\DoxyCodeLine{2444                         ASSERT(bpp == \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_abda7a5f282421cd7e789da62f657efa0}{channels}}*4);}
\DoxyCodeLine{2445                         ASSERT(!\mbox{\hyperlink{classCPGFImage_a9226595ea6b907e4d07301a6ee641b87}{m\_downsample}});}
\DoxyCodeLine{2446 }
\DoxyCodeLine{2447                         \mbox{\hyperlink{PGFtypes_8h_acb1ee3f52ccfad782dcaa0abd79e5d05}{DataT}}* y = \mbox{\hyperlink{classCPGFImage_a36f7f20b38a9cb3a9c88032f5f886345}{m\_channel}}[0]; ASSERT(y);}
\DoxyCodeLine{2448                         \mbox{\hyperlink{PGFtypes_8h_acb1ee3f52ccfad782dcaa0abd79e5d05}{DataT}}* u = \mbox{\hyperlink{classCPGFImage_a36f7f20b38a9cb3a9c88032f5f886345}{m\_channel}}[1]; ASSERT(u);}
\DoxyCodeLine{2449                         \mbox{\hyperlink{PGFtypes_8h_acb1ee3f52ccfad782dcaa0abd79e5d05}{DataT}}* v = \mbox{\hyperlink{classCPGFImage_a36f7f20b38a9cb3a9c88032f5f886345}{m\_channel}}[2]; ASSERT(v);}
\DoxyCodeLine{2450                         UINT16 yval;}
\DoxyCodeLine{2451                         UINT32 cnt;}
\DoxyCodeLine{2452 }
\DoxyCodeLine{2453                         \textcolor{keywordflow}{for} (i=0; i < h; i++) \{}
\DoxyCodeLine{2454                                 UINT32 yPos = yOffset;}
\DoxyCodeLine{2455                                 cnt = 0;}
\DoxyCodeLine{2456                                 \textcolor{keywordflow}{for} (j=0; j < w; j++) \{}
\DoxyCodeLine{2457                                         \textcolor{comment}{// Yuv}}
\DoxyCodeLine{2458                                         uAvg = u[yPos];}
\DoxyCodeLine{2459                                         vAvg = v[yPos];}
\DoxyCodeLine{2460                                         yval = \mbox{\hyperlink{classCPGFImage_adc3d79612346af8109230039b1077c46}{Clamp4}}(y[yPos] + \mbox{\hyperlink{PGFimage_8cpp_a532f21ec0d021733ebae0ad001bb0bef}{YUVoffset4}} - ((uAvg + vAvg ) >> 2)); \textcolor{comment}{// must be logical shift operator}}
\DoxyCodeLine{2461                                         \textcolor{keywordflow}{if} (j\%2 == 0) \{}
\DoxyCodeLine{2462                                                 buff[cnt] = UINT8(\mbox{\hyperlink{classCPGFImage_adc3d79612346af8109230039b1077c46}{Clamp4}}(vAvg + yval) | (yval << 4));}
\DoxyCodeLine{2463                                                 cnt++;}
\DoxyCodeLine{2464                                                 buff[cnt] = \mbox{\hyperlink{classCPGFImage_adc3d79612346af8109230039b1077c46}{Clamp4}}(uAvg + yval);}
\DoxyCodeLine{2465                                         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{2466                                                 buff[cnt] |= \mbox{\hyperlink{classCPGFImage_adc3d79612346af8109230039b1077c46}{Clamp4}}(vAvg + yval) << 4;}
\DoxyCodeLine{2467                                                 cnt++;}
\DoxyCodeLine{2468                                                 buff[cnt] = UINT8(yval | (\mbox{\hyperlink{classCPGFImage_adc3d79612346af8109230039b1077c46}{Clamp4}}(uAvg + yval) << 4));}
\DoxyCodeLine{2469                                                 cnt++;}
\DoxyCodeLine{2470                                         \}}
\DoxyCodeLine{2471                                         yPos++;}
\DoxyCodeLine{2472                                 \}}
\DoxyCodeLine{2473                                 yOffset += yw;}
\DoxyCodeLine{2474                                 buff += pitch;}
\DoxyCodeLine{2475 }
\DoxyCodeLine{2476                                 \textcolor{keywordflow}{if} (cb) \{}
\DoxyCodeLine{2477                                         percent += dP;}
\DoxyCodeLine{2478                                         \textcolor{keywordflow}{if} ((*cb)(percent, \textcolor{keyword}{true}, data)) ReturnWithError(EscapePressed);}
\DoxyCodeLine{2479                                 \}}
\DoxyCodeLine{2480                         \}}
\DoxyCodeLine{2481                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{2482                 \}}
\DoxyCodeLine{2483         \textcolor{keywordflow}{case} \mbox{\hyperlink{PGFplatform_8h_aadaf1bd7eedf80c33287cfd311dbf068}{ImageModeRGB16}}: }
\DoxyCodeLine{2484                 \{}
\DoxyCodeLine{2485                         ASSERT(\mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_abda7a5f282421cd7e789da62f657efa0}{channels}} == 3);}
\DoxyCodeLine{2486                         ASSERT(\mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_aedea199e29cd6c404c82ab97c67e46b4}{bpp}} == 16);}
\DoxyCodeLine{2487                         ASSERT(bpp == 16);}
\DoxyCodeLine{2488                         ASSERT(!\mbox{\hyperlink{classCPGFImage_a9226595ea6b907e4d07301a6ee641b87}{m\_downsample}});}
\DoxyCodeLine{2489 }
\DoxyCodeLine{2490                         \mbox{\hyperlink{PGFtypes_8h_acb1ee3f52ccfad782dcaa0abd79e5d05}{DataT}}* y = \mbox{\hyperlink{classCPGFImage_a36f7f20b38a9cb3a9c88032f5f886345}{m\_channel}}[0]; ASSERT(y);}
\DoxyCodeLine{2491                         \mbox{\hyperlink{PGFtypes_8h_acb1ee3f52ccfad782dcaa0abd79e5d05}{DataT}}* u = \mbox{\hyperlink{classCPGFImage_a36f7f20b38a9cb3a9c88032f5f886345}{m\_channel}}[1]; ASSERT(u);}
\DoxyCodeLine{2492                         \mbox{\hyperlink{PGFtypes_8h_acb1ee3f52ccfad782dcaa0abd79e5d05}{DataT}}* v = \mbox{\hyperlink{classCPGFImage_a36f7f20b38a9cb3a9c88032f5f886345}{m\_channel}}[2]; ASSERT(v);}
\DoxyCodeLine{2493                         UINT16 yval;}
\DoxyCodeLine{2494                         UINT16 *buff16 = (UINT16 *)buff;}
\DoxyCodeLine{2495                         \textcolor{keywordtype}{int} pitch16 = pitch/2;}
\DoxyCodeLine{2496 }
\DoxyCodeLine{2497                         \textcolor{keywordflow}{for} (i=0; i < h; i++) \{}
\DoxyCodeLine{2498                                 UINT32 yPos = yOffset;}
\DoxyCodeLine{2499                                 \textcolor{keywordflow}{for} (j = 0; j < w; j++) \{}
\DoxyCodeLine{2500                                         \textcolor{comment}{// Yuv}}
\DoxyCodeLine{2501                                         uAvg = u[yPos];}
\DoxyCodeLine{2502                                         vAvg = v[yPos];}
\DoxyCodeLine{2503                                         yval = \mbox{\hyperlink{classCPGFImage_a15adcf6db4b6c3f60db26c7809b0bd54}{Clamp6}}(y[yPos++] + \mbox{\hyperlink{PGFimage_8cpp_ae908d3596ec0b26c916572376f8ac1d7}{YUVoffset6}} - ((uAvg + vAvg ) >> 2)); \textcolor{comment}{// must be logical shift operator}}
\DoxyCodeLine{2504                                         buff16[j] = (yval << 5) | ((\mbox{\hyperlink{classCPGFImage_a15adcf6db4b6c3f60db26c7809b0bd54}{Clamp6}}(uAvg + yval) >> 1) << 11) | (\mbox{\hyperlink{classCPGFImage_a15adcf6db4b6c3f60db26c7809b0bd54}{Clamp6}}(vAvg + yval) >> 1);}
\DoxyCodeLine{2505                                 \}}
\DoxyCodeLine{2506                                 yOffset += yw;}
\DoxyCodeLine{2507                                 buff16 += pitch16;}
\DoxyCodeLine{2508 }
\DoxyCodeLine{2509                                 \textcolor{keywordflow}{if} (cb) \{}
\DoxyCodeLine{2510                                         percent += dP;}
\DoxyCodeLine{2511                                         \textcolor{keywordflow}{if} ((*cb)(percent, \textcolor{keyword}{true}, data)) ReturnWithError(EscapePressed);}
\DoxyCodeLine{2512                                 \}}
\DoxyCodeLine{2513                         \}}
\DoxyCodeLine{2514                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{2515                 \}}
\DoxyCodeLine{2516         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{2517                 ASSERT(\textcolor{keyword}{false});}
\DoxyCodeLine{2518         \}}
\DoxyCodeLine{2519 }
\DoxyCodeLine{2520 \textcolor{preprocessor}{\#ifdef \_DEBUG}}
\DoxyCodeLine{2521         \textcolor{comment}{// display ROI (RGB) in debugger}}
\DoxyCodeLine{2522         roiimage.width = w;}
\DoxyCodeLine{2523         roiimage.height = h;}
\DoxyCodeLine{2524         \textcolor{keywordflow}{if} (pitch > 0) \{}
\DoxyCodeLine{2525                 roiimage.pitch = pitch;}
\DoxyCodeLine{2526                 roiimage.data = buff;}
\DoxyCodeLine{2527         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{2528                 roiimage.pitch = -pitch;}
\DoxyCodeLine{2529                 roiimage.data = buff + (h - 1)*pitch;}
\DoxyCodeLine{2530         \}}
\DoxyCodeLine{2531 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{2532 }
\DoxyCodeLine{2533 \}                       }

\end{DoxyCode}
\mbox{\Hypertarget{classCPGFImage_ae4be1897b3b07449b7e77f95a29032f6}\label{classCPGFImage_ae4be1897b3b07449b7e77f95a29032f6}} 
\index{CPGFImage@{CPGFImage}!GetChannel@{GetChannel}}
\index{GetChannel@{GetChannel}!CPGFImage@{CPGFImage}}
\subsubsection{\texorpdfstring{GetChannel()}{GetChannel()}}
{\footnotesize\ttfamily \mbox{\hyperlink{PGFtypes_8h_acb1ee3f52ccfad782dcaa0abd79e5d05}{DataT}}$\ast$ C\+P\+G\+F\+Image\+::\+Get\+Channel (\begin{DoxyParamCaption}\item[{int}]{c = {\ttfamily 0} }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}

Return an internal Y\+UV image channel. 
\begin{DoxyParams}{Parameters}
{\em c} & A channel index \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
An internal Y\+UV image channel 
\end{DoxyReturn}


Definition at line 317 of file P\+G\+Fimage.\+h.


\begin{DoxyCode}{0}
\DoxyCodeLine{317 \{ ASSERT(c >= 0 \&\& c < \mbox{\hyperlink{PGFtypes_8h_a94219182f88d4dbed1021ed04db75e41}{MaxChannels}}); \textcolor{keywordflow}{return} \mbox{\hyperlink{classCPGFImage_a36f7f20b38a9cb3a9c88032f5f886345}{m\_channel}}[c]; \}}

\end{DoxyCode}
\mbox{\Hypertarget{classCPGFImage_af9e57bf57786030eab6ed17df9d9342e}\label{classCPGFImage_af9e57bf57786030eab6ed17df9d9342e}} 
\index{CPGFImage@{CPGFImage}!GetColorTable@{GetColorTable}}
\index{GetColorTable@{GetColorTable}!CPGFImage@{CPGFImage}}
\subsubsection{\texorpdfstring{GetColorTable()}{GetColorTable()}\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily void C\+P\+G\+F\+Image\+::\+Get\+Color\+Table (\begin{DoxyParamCaption}\item[{U\+I\+N\+T32}]{i\+First\+Color,  }\item[{U\+I\+N\+T32}]{n\+Colors,  }\item[{R\+G\+B\+Q\+U\+AD $\ast$}]{prgb\+Colors }\end{DoxyParamCaption}) const}

Retrieves red, green, blue (R\+GB) color values from a range of entries in the palette of the D\+IB section. It might throw an \mbox{\hyperlink{structIOException}{I\+O\+Exception}}. 
\begin{DoxyParams}{Parameters}
{\em i\+First\+Color} & The color table index of the first entry to retrieve. \\
\hline
{\em n\+Colors} & The number of color table entries to retrieve. \\
\hline
{\em prgb\+Colors} & A pointer to the array of R\+G\+B\+Q\+U\+AD structures to retrieve the color table entries. \\
\hline
\end{DoxyParams}


Definition at line 1349 of file P\+G\+Fimage.\+cpp.


\begin{DoxyCode}{0}
\DoxyCodeLine{1349                                                                                            \{}
\DoxyCodeLine{1350         \textcolor{keywordflow}{if} (iFirstColor + nColors > \mbox{\hyperlink{PGFtypes_8h_a9d98169485fbcb79dd2277c567f3f27d}{ColorTableLen}}) ReturnWithError(ColorTableError);}
\DoxyCodeLine{1351 }
\DoxyCodeLine{1352         \textcolor{keywordflow}{for} (UINT32 i=iFirstColor, j=0; j < nColors; i++, j++) \{}
\DoxyCodeLine{1353                 prgbColors[j] = \mbox{\hyperlink{classCPGFImage_ab8635df22839ffb68bada53e38b9ce73}{m\_postHeader}}.\mbox{\hyperlink{structPGFPostHeader_a3a7faf3091c0faa2e508ecdeb54ea706}{clut}}[i];}
\DoxyCodeLine{1354         \}}
\DoxyCodeLine{1355 \}}

\end{DoxyCode}
\mbox{\Hypertarget{classCPGFImage_aef236343eaa0809a255d1bea58e9bf9d}\label{classCPGFImage_aef236343eaa0809a255d1bea58e9bf9d}} 
\index{CPGFImage@{CPGFImage}!GetColorTable@{GetColorTable}}
\index{GetColorTable@{GetColorTable}!CPGFImage@{CPGFImage}}
\subsubsection{\texorpdfstring{GetColorTable()}{GetColorTable()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily const R\+G\+B\+Q\+U\+AD$\ast$ C\+P\+G\+F\+Image\+::\+Get\+Color\+Table (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}

\begin{DoxyReturn}{Returns}
Address of color table 
\end{DoxyReturn}


Definition at line 330 of file P\+G\+Fimage.\+h.


\begin{DoxyCode}{0}
\DoxyCodeLine{330 \{ \textcolor{keywordflow}{return} \mbox{\hyperlink{classCPGFImage_ab8635df22839ffb68bada53e38b9ce73}{m\_postHeader}}.\mbox{\hyperlink{structPGFPostHeader_a3a7faf3091c0faa2e508ecdeb54ea706}{clut}}; \}}

\end{DoxyCode}
\mbox{\Hypertarget{classCPGFImage_acf90fa7c083fba0479ce70200cccf716}\label{classCPGFImage_acf90fa7c083fba0479ce70200cccf716}} 
\index{CPGFImage@{CPGFImage}!GetEncodedHeaderLength@{GetEncodedHeaderLength}}
\index{GetEncodedHeaderLength@{GetEncodedHeaderLength}!CPGFImage@{CPGFImage}}
\subsubsection{\texorpdfstring{GetEncodedHeaderLength()}{GetEncodedHeaderLength()}}
{\footnotesize\ttfamily U\+I\+N\+T32 C\+P\+G\+F\+Image\+::\+Get\+Encoded\+Header\+Length (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const}

Return the length of all encoded headers in bytes. Precondition\+: The P\+GF image has been opened with a call of Open(...). \begin{DoxyReturn}{Returns}
The length of all encoded headers in bytes 
\end{DoxyReturn}


Definition at line 648 of file P\+G\+Fimage.\+cpp.


\begin{DoxyCode}{0}
\DoxyCodeLine{648                                                \{ }
\DoxyCodeLine{649         ASSERT(\mbox{\hyperlink{classCPGFImage_a1058b29a3d046e171a2fe48168b66d38}{m\_decoder}}); }
\DoxyCodeLine{650         \textcolor{keywordflow}{return} \mbox{\hyperlink{classCPGFImage_a1058b29a3d046e171a2fe48168b66d38}{m\_decoder}}->\mbox{\hyperlink{classCDecoder_a4e9c1ffe92430bf2420b8da76f145fcf}{GetEncodedHeaderLength}}(); }
\DoxyCodeLine{651 \}}

\end{DoxyCode}
\mbox{\Hypertarget{classCPGFImage_a9d39b7f0067bf5b35b0cd7cbba9a1d4f}\label{classCPGFImage_a9d39b7f0067bf5b35b0cd7cbba9a1d4f}} 
\index{CPGFImage@{CPGFImage}!GetEncodedLevelLength@{GetEncodedLevelLength}}
\index{GetEncodedLevelLength@{GetEncodedLevelLength}!CPGFImage@{CPGFImage}}
\subsubsection{\texorpdfstring{GetEncodedLevelLength()}{GetEncodedLevelLength()}}
{\footnotesize\ttfamily U\+I\+N\+T32 C\+P\+G\+F\+Image\+::\+Get\+Encoded\+Level\+Length (\begin{DoxyParamCaption}\item[{int}]{level }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}

Return the length of an encoded P\+GF level in bytes. Precondition\+: The P\+GF image has been opened with a call of Open(...). 
\begin{DoxyParams}{Parameters}
{\em level} & The image level \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The length of a P\+GF level in bytes 
\end{DoxyReturn}


Definition at line 367 of file P\+G\+Fimage.\+h.


\begin{DoxyCode}{0}
\DoxyCodeLine{367 \{ ASSERT(level >= 0 \&\& level < \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a963890fa1e02a517923f9d0bf0d7e9eb}{nLevels}}); \textcolor{keywordflow}{return} \mbox{\hyperlink{classCPGFImage_a1635ef5dca13bd07276d112a72316a73}{m\_levelLength}}[\mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a963890fa1e02a517923f9d0bf0d7e9eb}{nLevels}} - level - 1]; \}}

\end{DoxyCode}
\mbox{\Hypertarget{classCPGFImage_a485b62ca1f9b649d6ff590fe28657cf3}\label{classCPGFImage_a485b62ca1f9b649d6ff590fe28657cf3}} 
\index{CPGFImage@{CPGFImage}!GetHeader@{GetHeader}}
\index{GetHeader@{GetHeader}!CPGFImage@{CPGFImage}}
\subsubsection{\texorpdfstring{GetHeader()}{GetHeader()}}
{\footnotesize\ttfamily const \mbox{\hyperlink{structPGFHeader}{P\+G\+F\+Header}}$\ast$ C\+P\+G\+F\+Image\+::\+Get\+Header (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}

Return the P\+GF header structure. \begin{DoxyReturn}{Returns}
A P\+GF header structure 
\end{DoxyReturn}


Definition at line 335 of file P\+G\+Fimage.\+h.


\begin{DoxyCode}{0}
\DoxyCodeLine{335 \{ \textcolor{keywordflow}{return} \&\mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}; \}}

\end{DoxyCode}
\mbox{\Hypertarget{classCPGFImage_a205a92be52bd2047ade0398ed4bb2afb}\label{classCPGFImage_a205a92be52bd2047ade0398ed4bb2afb}} 
\index{CPGFImage@{CPGFImage}!GetMaxValue@{GetMaxValue}}
\index{GetMaxValue@{GetMaxValue}!CPGFImage@{CPGFImage}}
\subsubsection{\texorpdfstring{GetMaxValue()}{GetMaxValue()}}
{\footnotesize\ttfamily U\+I\+N\+T32 C\+P\+G\+F\+Image\+::\+Get\+Max\+Value (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}

Get maximum intensity value for image modes with more than eight bits per channel. Don\textquotesingle{}t call this method before the P\+GF header has been read. \begin{DoxyReturn}{Returns}
The maximum intensity value. 
\end{DoxyReturn}


Definition at line 341 of file P\+G\+Fimage.\+h.


\begin{DoxyCode}{0}
\DoxyCodeLine{341 \{ \textcolor{keywordflow}{return} (1 << \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_abddcc9ee6e17690986cf77a6d16aceb6}{usedBitsPerChannel}}) - 1; \}}

\end{DoxyCode}
\mbox{\Hypertarget{classCPGFImage_aa7c092c2b27df184d7e81bef579e270c}\label{classCPGFImage_aa7c092c2b27df184d7e81bef579e270c}} 
\index{CPGFImage@{CPGFImage}!GetUserData@{GetUserData}}
\index{GetUserData@{GetUserData}!CPGFImage@{CPGFImage}}
\subsubsection{\texorpdfstring{GetUserData()}{GetUserData()}}
{\footnotesize\ttfamily const U\+I\+N\+T8 $\ast$ C\+P\+G\+F\+Image\+::\+Get\+User\+Data (\begin{DoxyParamCaption}\item[{U\+I\+N\+T32 \&}]{cached\+Size,  }\item[{U\+I\+N\+T32 $\ast$}]{p\+Total\+Size = {\ttfamily nullptr} }\end{DoxyParamCaption}) const}

Return user data and size of user data. Precondition\+: The P\+GF image has been opened with a call of Open(...). 
\begin{DoxyParams}{Parameters}
{\em cached\+Size} & \mbox{[}out\mbox{]} Size of returned user data in bytes. \\
\hline
{\em p\+Total\+Size} & \mbox{[}optional out\mbox{]} Pointer to return the size of user data stored in image header in bytes. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
A pointer to user data or nullptr if there is no user data available.
\end{DoxyReturn}
Return user data and size of user data. Precondition\+: The P\+GF image has been opened with a call of Open(...). In an encoder scenario don\textquotesingle{}t call this method before \mbox{\hyperlink{classCPGFImage_a1d853cd049417f0afc9a868664d7134d}{Write\+Header()}}. 
\begin{DoxyParams}{Parameters}
{\em cached\+Size} & \mbox{[}out\mbox{]} Size of returned user data in bytes. \\
\hline
{\em p\+Total\+Size} & \mbox{[}optional out\mbox{]} Pointer to return the size of user data stored in image header in bytes. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
A pointer to user data or nullptr if there is no user data available. 
\end{DoxyReturn}


Definition at line 337 of file P\+G\+Fimage.\+cpp.


\begin{DoxyCode}{0}
\DoxyCodeLine{337                                                                                   \{}
\DoxyCodeLine{338         cachedSize = \mbox{\hyperlink{classCPGFImage_ab8635df22839ffb68bada53e38b9ce73}{m\_postHeader}}.\mbox{\hyperlink{structPGFPostHeader_a104e3ef6de85dfdbbd867a250fcd82d4}{cachedUserDataLen}};}
\DoxyCodeLine{339         \textcolor{keywordflow}{if} (pTotalSize) *pTotalSize = \mbox{\hyperlink{classCPGFImage_ab8635df22839ffb68bada53e38b9ce73}{m\_postHeader}}.\mbox{\hyperlink{structPGFPostHeader_a0fb630d6cd14ed865dd5fe20227279f2}{userDataLen}};}
\DoxyCodeLine{340         \textcolor{keywordflow}{return} \mbox{\hyperlink{classCPGFImage_ab8635df22839ffb68bada53e38b9ce73}{m\_postHeader}}.\mbox{\hyperlink{structPGFPostHeader_aeeb6e57e8343eb3d42406f0baf3ae6e1}{userData}};}
\DoxyCodeLine{341 \}}

\end{DoxyCode}
\mbox{\Hypertarget{classCPGFImage_a216a89fa33c755a379ba243610284b03}\label{classCPGFImage_a216a89fa33c755a379ba243610284b03}} 
\index{CPGFImage@{CPGFImage}!GetUserDataPos@{GetUserDataPos}}
\index{GetUserDataPos@{GetUserDataPos}!CPGFImage@{CPGFImage}}
\subsubsection{\texorpdfstring{GetUserDataPos()}{GetUserDataPos()}}
{\footnotesize\ttfamily U\+I\+N\+T64 C\+P\+G\+F\+Image\+::\+Get\+User\+Data\+Pos (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}

Return the stream position of the user data or 0. Precondition\+: The P\+GF image has been opened with a call of Open(...). 

Definition at line 346 of file P\+G\+Fimage.\+h.


\begin{DoxyCode}{0}
\DoxyCodeLine{346 \{ \textcolor{keywordflow}{return} \mbox{\hyperlink{classCPGFImage_acf4ae6e169ddf84e32cf9b57a22800b3}{m\_userDataPos}}; \}                                                                  }

\end{DoxyCode}
\mbox{\Hypertarget{classCPGFImage_a37c2f9a6b99c0e0b3564433e21f88e9b}\label{classCPGFImage_a37c2f9a6b99c0e0b3564433e21f88e9b}} 
\index{CPGFImage@{CPGFImage}!GetYUV@{GetYUV}}
\index{GetYUV@{GetYUV}!CPGFImage@{CPGFImage}}
\subsubsection{\texorpdfstring{GetYUV()}{GetYUV()}}
{\footnotesize\ttfamily void C\+P\+G\+F\+Image\+::\+Get\+Y\+UV (\begin{DoxyParamCaption}\item[{int}]{pitch,  }\item[{\mbox{\hyperlink{PGFtypes_8h_acb1ee3f52ccfad782dcaa0abd79e5d05}{DataT}} $\ast$}]{buff,  }\item[{B\+Y\+TE}]{bpp,  }\item[{int}]{channel\+Map\mbox{[}$\,$\mbox{]} = {\ttfamily nullptr},  }\item[{Callback\+Ptr}]{cb = {\ttfamily nullptr},  }\item[{void $\ast$}]{data = {\ttfamily nullptr} }\end{DoxyParamCaption}) const}

Get Y\+UV image data in interleaved format\+: (ordering is Y\+UV\mbox{[}A\mbox{]}) The absolute value of pitch is the number of bytes of an image row of the given image buffer. If pitch is negative, then the image buffer must point to the last row of a bottom-\/up image (first byte on last row). if pitch is positive, then the image buffer must point to the first row of a top-\/down image (first byte). The sequence of output channels in the output image buffer does not need to be the same as provided by P\+GF. In case of different sequences you have to provide a channel\+Map of size of expected channels (depending on image mode). For example, P\+GF provides a channel sequence B\+GR in R\+GB color mode. If your provided image buffer expects a channel sequence V\+UY, then the channel\+Map looks like \{ 2, 1, 0 \}. It might throw an \mbox{\hyperlink{structIOException}{I\+O\+Exception}}. 
\begin{DoxyParams}{Parameters}
{\em pitch} & The number of bytes of a row of the image buffer. \\
\hline
{\em buff} & An image buffer. \\
\hline
{\em bpp} & The number of bits per pixel used in image buffer. \\
\hline
{\em channel\+Map} & A integer array containing the mapping of P\+GF channel ordering to expected channel ordering. \\
\hline
{\em cb} & A pointer to a callback procedure. The procedure is called after each copied buffer row. If cb returns true, then it stops proceeding. \\
\hline
{\em data} & Data Pointer to C++ class container to host callback procedure.\\
\hline
\end{DoxyParams}
Get Y\+UV image data in interleaved format\+: (ordering is Y\+UV\mbox{[}A\mbox{]}) The absolute value of pitch is the number of bytes of an image row of the given image buffer. If pitch is negative, then the image buffer must point to the last row of a bottom-\/up image (first byte on last row). if pitch is positive, then the image buffer must point to the first row of a top-\/down image (first byte). The sequence of output channels in the output image buffer does not need to be the same as provided by P\+GF. In case of different sequences you have to provide a channel\+Map of size of expected channels (depending on image mode). For example, P\+GF provides a channel sequence B\+GR in R\+GB color mode. If your provided image buffer expects a channel sequence V\+UY, then the channel\+Map looks like \{ 2, 1, 0 \}. It might throw an \mbox{\hyperlink{structIOException}{I\+O\+Exception}}. 
\begin{DoxyParams}{Parameters}
{\em pitch} & The number of bytes of a row of the image buffer. \\
\hline
{\em buff} & An image buffer. \\
\hline
{\em bpp} & The number of bits per pixel used in image buffer. \\
\hline
{\em channel\+Map} & A integer array containing the mapping of P\+GF channel ordering to expected channel ordering. \\
\hline
{\em cb} & A pointer to a callback procedure. The procedure is called after each copied buffer row. If cb returns true, then it stops proceeding. \\
\hline
\end{DoxyParams}


Definition at line 2549 of file P\+G\+Fimage.\+cpp.


\begin{DoxyCode}{0}
\DoxyCodeLine{2549                                                                                                                  \{}
\DoxyCodeLine{2550         ASSERT(buff);}
\DoxyCodeLine{2551         \textcolor{keyword}{const} UINT32 w = \mbox{\hyperlink{classCPGFImage_ab6d97aca28795fae697fdda4b8acd8f9}{m\_width}}[0];}
\DoxyCodeLine{2552         \textcolor{keyword}{const} UINT32 h = \mbox{\hyperlink{classCPGFImage_a170fd448152303a2d44848a52a8916a0}{m\_height}}[0];}
\DoxyCodeLine{2553         \textcolor{keyword}{const} \textcolor{keywordtype}{bool} wOdd = (1 == w\%2);}
\DoxyCodeLine{2554         \textcolor{keyword}{const} \textcolor{keywordtype}{int} dataBits = \mbox{\hyperlink{PGFtypes_8h_adbb49c2b6ab931f68f08a8dc1141727d}{DataTSize}}*8; ASSERT(dataBits == 16 || dataBits == 32);}
\DoxyCodeLine{2555         \textcolor{keyword}{const} \textcolor{keywordtype}{int} pitch2 = pitch/\mbox{\hyperlink{PGFtypes_8h_adbb49c2b6ab931f68f08a8dc1141727d}{DataTSize}};}
\DoxyCodeLine{2556         \textcolor{keyword}{const} \textcolor{keywordtype}{int} yuvOffset = (dataBits == 16) ? \mbox{\hyperlink{PGFimage_8cpp_a0fc648cb4d04d369ff4692cc07687039}{YUVoffset8}} : \mbox{\hyperlink{PGFimage_8cpp_aa4cf76945d82d946aa5e89ffd4072159}{YUVoffset16}};}
\DoxyCodeLine{2557         \textcolor{keyword}{const} \textcolor{keywordtype}{double} dP = 1.0/h;}
\DoxyCodeLine{2558 }
\DoxyCodeLine{2559         \textcolor{keywordtype}{int} defMap[] = \{ 0, 1, 2, 3, 4, 5, 6, 7 \}; ASSERT(\textcolor{keyword}{sizeof}(defMap)/\textcolor{keyword}{sizeof}(defMap[0]) == \mbox{\hyperlink{PGFtypes_8h_a94219182f88d4dbed1021ed04db75e41}{MaxChannels}});}
\DoxyCodeLine{2560         \textcolor{keywordflow}{if} (channelMap == \textcolor{keyword}{nullptr}) channelMap = defMap;}
\DoxyCodeLine{2561         \textcolor{keywordtype}{int} sampledPos = 0, yPos = 0;}
\DoxyCodeLine{2562         \mbox{\hyperlink{PGFtypes_8h_acb1ee3f52ccfad782dcaa0abd79e5d05}{DataT}} uAvg, vAvg;}
\DoxyCodeLine{2563         \textcolor{keywordtype}{double} percent = 0;}
\DoxyCodeLine{2564         UINT32 i, j;}
\DoxyCodeLine{2565 }
\DoxyCodeLine{2566         \textcolor{keywordflow}{if} (\mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_abda7a5f282421cd7e789da62f657efa0}{channels}} == 3) \{ }
\DoxyCodeLine{2567                 ASSERT(bpp\%dataBits == 0);}
\DoxyCodeLine{2568 }
\DoxyCodeLine{2569                 \mbox{\hyperlink{PGFtypes_8h_acb1ee3f52ccfad782dcaa0abd79e5d05}{DataT}}* y = \mbox{\hyperlink{classCPGFImage_a36f7f20b38a9cb3a9c88032f5f886345}{m\_channel}}[0]; ASSERT(y);}
\DoxyCodeLine{2570                 \mbox{\hyperlink{PGFtypes_8h_acb1ee3f52ccfad782dcaa0abd79e5d05}{DataT}}* u = \mbox{\hyperlink{classCPGFImage_a36f7f20b38a9cb3a9c88032f5f886345}{m\_channel}}[1]; ASSERT(u);}
\DoxyCodeLine{2571                 \mbox{\hyperlink{PGFtypes_8h_acb1ee3f52ccfad782dcaa0abd79e5d05}{DataT}}* v = \mbox{\hyperlink{classCPGFImage_a36f7f20b38a9cb3a9c88032f5f886345}{m\_channel}}[2]; ASSERT(v);}
\DoxyCodeLine{2572                 \textcolor{keywordtype}{int} cnt, channels = bpp/dataBits; ASSERT(channels >= \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_abda7a5f282421cd7e789da62f657efa0}{channels}});}
\DoxyCodeLine{2573 }
\DoxyCodeLine{2574                 \textcolor{keywordflow}{for} (i=0; i < h; i++) \{}
\DoxyCodeLine{2575                         \textcolor{keywordflow}{if} (i\%2) sampledPos -= (w + 1)/2;}
\DoxyCodeLine{2576                         cnt = 0;}
\DoxyCodeLine{2577                         \textcolor{keywordflow}{for} (j=0; j < w; j++) \{}
\DoxyCodeLine{2578                                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{classCPGFImage_a9226595ea6b907e4d07301a6ee641b87}{m\_downsample}}) \{}
\DoxyCodeLine{2579                                         \textcolor{comment}{// image was downsampled}}
\DoxyCodeLine{2580                                         uAvg = u[sampledPos];}
\DoxyCodeLine{2581                                         vAvg = v[sampledPos];}
\DoxyCodeLine{2582                                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{2583                                         uAvg = u[yPos];}
\DoxyCodeLine{2584                                         vAvg = v[yPos];}
\DoxyCodeLine{2585                                 \}}
\DoxyCodeLine{2586                                 buff[cnt + channelMap[0]] = y[yPos];}
\DoxyCodeLine{2587                                 buff[cnt + channelMap[1]] = uAvg;}
\DoxyCodeLine{2588                                 buff[cnt + channelMap[2]] = vAvg;}
\DoxyCodeLine{2589                                 yPos++; }
\DoxyCodeLine{2590                                 cnt += channels;}
\DoxyCodeLine{2591                                 \textcolor{keywordflow}{if} (j\%2) sampledPos++;}
\DoxyCodeLine{2592                         \}}
\DoxyCodeLine{2593                         buff += pitch2;}
\DoxyCodeLine{2594                         \textcolor{keywordflow}{if} (wOdd) sampledPos++;}
\DoxyCodeLine{2595 }
\DoxyCodeLine{2596                         \textcolor{keywordflow}{if} (cb) \{}
\DoxyCodeLine{2597                                 percent += dP;}
\DoxyCodeLine{2598                                 \textcolor{keywordflow}{if} ((*cb)(percent, \textcolor{keyword}{true}, data)) ReturnWithError(EscapePressed);}
\DoxyCodeLine{2599                         \}}
\DoxyCodeLine{2600                 \}}
\DoxyCodeLine{2601         \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (\mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_abda7a5f282421cd7e789da62f657efa0}{channels}} == 4) \{}
\DoxyCodeLine{2602                 ASSERT(\mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_aedea199e29cd6c404c82ab97c67e46b4}{bpp}} == \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_abda7a5f282421cd7e789da62f657efa0}{channels}}*8);}
\DoxyCodeLine{2603                 ASSERT(bpp\%dataBits == 0);}
\DoxyCodeLine{2604 }
\DoxyCodeLine{2605                 \mbox{\hyperlink{PGFtypes_8h_acb1ee3f52ccfad782dcaa0abd79e5d05}{DataT}}* y = \mbox{\hyperlink{classCPGFImage_a36f7f20b38a9cb3a9c88032f5f886345}{m\_channel}}[0]; ASSERT(y);}
\DoxyCodeLine{2606                 \mbox{\hyperlink{PGFtypes_8h_acb1ee3f52ccfad782dcaa0abd79e5d05}{DataT}}* u = \mbox{\hyperlink{classCPGFImage_a36f7f20b38a9cb3a9c88032f5f886345}{m\_channel}}[1]; ASSERT(u);}
\DoxyCodeLine{2607                 \mbox{\hyperlink{PGFtypes_8h_acb1ee3f52ccfad782dcaa0abd79e5d05}{DataT}}* v = \mbox{\hyperlink{classCPGFImage_a36f7f20b38a9cb3a9c88032f5f886345}{m\_channel}}[2]; ASSERT(v);}
\DoxyCodeLine{2608                 \mbox{\hyperlink{PGFtypes_8h_acb1ee3f52ccfad782dcaa0abd79e5d05}{DataT}}* a = \mbox{\hyperlink{classCPGFImage_a36f7f20b38a9cb3a9c88032f5f886345}{m\_channel}}[3]; ASSERT(a);}
\DoxyCodeLine{2609                 UINT8 aAvg;}
\DoxyCodeLine{2610                 \textcolor{keywordtype}{int} cnt, channels = bpp/dataBits; ASSERT(channels >= \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_abda7a5f282421cd7e789da62f657efa0}{channels}});}
\DoxyCodeLine{2611 }
\DoxyCodeLine{2612                 \textcolor{keywordflow}{for} (i=0; i < h; i++) \{}
\DoxyCodeLine{2613                         \textcolor{keywordflow}{if} (i\%2) sampledPos -= (w + 1)/2;}
\DoxyCodeLine{2614                         cnt = 0;}
\DoxyCodeLine{2615                         \textcolor{keywordflow}{for} (j=0; j < w; j++) \{}
\DoxyCodeLine{2616                                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{classCPGFImage_a9226595ea6b907e4d07301a6ee641b87}{m\_downsample}}) \{}
\DoxyCodeLine{2617                                         \textcolor{comment}{// image was downsampled}}
\DoxyCodeLine{2618                                         uAvg = u[sampledPos];}
\DoxyCodeLine{2619                                         vAvg = v[sampledPos];}
\DoxyCodeLine{2620                                         aAvg = \mbox{\hyperlink{classCPGFImage_a7748968cec3128d6dbdeb224814ca14a}{Clamp8}}(a[sampledPos] + yuvOffset);}
\DoxyCodeLine{2621                                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{2622                                         uAvg = u[yPos];}
\DoxyCodeLine{2623                                         vAvg = v[yPos];}
\DoxyCodeLine{2624                                         aAvg = \mbox{\hyperlink{classCPGFImage_a7748968cec3128d6dbdeb224814ca14a}{Clamp8}}(a[yPos] + yuvOffset);}
\DoxyCodeLine{2625                                 \}}
\DoxyCodeLine{2626                                 \textcolor{comment}{// Yuv}}
\DoxyCodeLine{2627                                 buff[cnt + channelMap[0]] = y[yPos];}
\DoxyCodeLine{2628                                 buff[cnt + channelMap[1]] = uAvg;}
\DoxyCodeLine{2629                                 buff[cnt + channelMap[2]] = vAvg;}
\DoxyCodeLine{2630                                 buff[cnt + channelMap[3]] = aAvg;}
\DoxyCodeLine{2631                                 yPos++; }
\DoxyCodeLine{2632                                 cnt += channels;}
\DoxyCodeLine{2633                                 \textcolor{keywordflow}{if} (j\%2) sampledPos++;}
\DoxyCodeLine{2634                         \}}
\DoxyCodeLine{2635                         buff += pitch2;}
\DoxyCodeLine{2636                         \textcolor{keywordflow}{if} (wOdd) sampledPos++;}
\DoxyCodeLine{2637 }
\DoxyCodeLine{2638                         \textcolor{keywordflow}{if} (cb) \{}
\DoxyCodeLine{2639                                 percent += dP;}
\DoxyCodeLine{2640                                 \textcolor{keywordflow}{if} ((*cb)(percent, \textcolor{keyword}{true}, data)) ReturnWithError(EscapePressed);}
\DoxyCodeLine{2641                         \}}
\DoxyCodeLine{2642                 \}}
\DoxyCodeLine{2643         \}}
\DoxyCodeLine{2644 \}}

\end{DoxyCode}
\mbox{\Hypertarget{classCPGFImage_aab401a02923fc9161e890602f26c829e}\label{classCPGFImage_aab401a02923fc9161e890602f26c829e}} 
\index{CPGFImage@{CPGFImage}!Height@{Height}}
\index{Height@{Height}!CPGFImage@{CPGFImage}}
\subsubsection{\texorpdfstring{Height()}{Height()}}
{\footnotesize\ttfamily U\+I\+N\+T32 C\+P\+G\+F\+Image\+::\+Height (\begin{DoxyParamCaption}\item[{int}]{level = {\ttfamily 0} }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}

Return image height of channel 0 at given level in pixels. The returned height is independent of any Read-\/operations and R\+OI. 
\begin{DoxyParams}{Parameters}
{\em level} & A level \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
Image level height in pixels 
\end{DoxyReturn}


Definition at line 420 of file P\+G\+Fimage.\+h.


\begin{DoxyCode}{0}
\DoxyCodeLine{420 \{ ASSERT(level >= 0); \textcolor{keywordflow}{return} \mbox{\hyperlink{classCPGFImage_ad7e2f885a059a39ca15a47ecb497833b}{LevelSizeL}}(\mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a7262335e99ca409759e1aa8c0f0164b1}{height}}, level); \}}

\end{DoxyCode}
\mbox{\Hypertarget{classCPGFImage_a3c0895f4738c5222de1920c941a71541}\label{classCPGFImage_a3c0895f4738c5222de1920c941a71541}} 
\index{CPGFImage@{CPGFImage}!ImportBitmap@{ImportBitmap}}
\index{ImportBitmap@{ImportBitmap}!CPGFImage@{CPGFImage}}
\subsubsection{\texorpdfstring{ImportBitmap()}{ImportBitmap()}}
{\footnotesize\ttfamily void C\+P\+G\+F\+Image\+::\+Import\+Bitmap (\begin{DoxyParamCaption}\item[{int}]{pitch,  }\item[{U\+I\+N\+T8 $\ast$}]{buff,  }\item[{B\+Y\+TE}]{bpp,  }\item[{int}]{channel\+Map\mbox{[}$\,$\mbox{]} = {\ttfamily nullptr},  }\item[{Callback\+Ptr}]{cb = {\ttfamily nullptr},  }\item[{void $\ast$}]{data = {\ttfamily nullptr} }\end{DoxyParamCaption})}

Import an image from a specified image buffer. This method is usually called before Write(...) and after Set\+Header(...). The absolute value of pitch is the number of bytes of an image row. If pitch is negative, then buff points to the last row of a bottom-\/up image (first byte on last row). If pitch is positive, then buff points to the first row of a top-\/down image (first byte). The sequence of input channels in the input image buffer does not need to be the same as expected from P\+GF. In case of different sequences you have to provide a channel\+Map of size of expected channels (depending on image mode). For example, P\+GF expects in R\+GB color mode a channel sequence B\+GR. If your provided image buffer contains a channel sequence A\+R\+GB, then the channel\+Map looks like \{ 3, 2, 1, 0 \}. It might throw an \mbox{\hyperlink{structIOException}{I\+O\+Exception}}. 
\begin{DoxyParams}{Parameters}
{\em pitch} & The number of bytes of a row of the image buffer. \\
\hline
{\em buff} & An image buffer. \\
\hline
{\em bpp} & The number of bits per pixel used in image buffer. \\
\hline
{\em channel\+Map} & A integer array containing the mapping of input channel ordering to expected channel ordering. \\
\hline
{\em cb} & A pointer to a callback procedure. The procedure is called after each imported buffer row. If cb returns true, then it stops proceeding. \\
\hline
{\em data} & Data Pointer to C++ class container to host callback procedure. \\
\hline
\end{DoxyParams}


Definition at line 791 of file P\+G\+Fimage.\+cpp.


\begin{DoxyCode}{0}
\DoxyCodeLine{791                                                                                                                  \{}
\DoxyCodeLine{792         ASSERT(buff);}
\DoxyCodeLine{793         ASSERT(\mbox{\hyperlink{classCPGFImage_a36f7f20b38a9cb3a9c88032f5f886345}{m\_channel}}[0]);}
\DoxyCodeLine{794 }
\DoxyCodeLine{795         \textcolor{comment}{// color transform}}
\DoxyCodeLine{796         \mbox{\hyperlink{classCPGFImage_a7a870dea53390ffe1af210069f6b30eb}{RgbToYuv}}(pitch, buff, bpp, channelMap, cb, data);}
\DoxyCodeLine{797 }
\DoxyCodeLine{798         \textcolor{keywordflow}{if} (\mbox{\hyperlink{classCPGFImage_a9226595ea6b907e4d07301a6ee641b87}{m\_downsample}}) \{}
\DoxyCodeLine{799                 \textcolor{comment}{// Subsampling of the chrominance and alpha channels}}
\DoxyCodeLine{800                 \textcolor{keywordflow}{for} (\textcolor{keywordtype}{int} i=1; i < \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_abda7a5f282421cd7e789da62f657efa0}{channels}}; i++) \{}
\DoxyCodeLine{801                         \mbox{\hyperlink{classCPGFImage_a1db75413dfdc6f752088a53de0e6b998}{Downsample}}(i);}
\DoxyCodeLine{802                 \}}
\DoxyCodeLine{803         \}}
\DoxyCodeLine{804 \}}

\end{DoxyCode}
\mbox{\Hypertarget{classCPGFImage_a5c32194271d4e115b8f5c7fdfc1670a5}\label{classCPGFImage_a5c32194271d4e115b8f5c7fdfc1670a5}} 
\index{CPGFImage@{CPGFImage}!ImportIsSupported@{ImportIsSupported}}
\index{ImportIsSupported@{ImportIsSupported}!CPGFImage@{CPGFImage}}
\subsubsection{\texorpdfstring{ImportIsSupported()}{ImportIsSupported()}}
{\footnotesize\ttfamily bool C\+P\+G\+F\+Image\+::\+Import\+Is\+Supported (\begin{DoxyParamCaption}\item[{B\+Y\+TE}]{mode }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}

Check for valid import image mode. 
\begin{DoxyParams}{Parameters}
{\em mode} & Image mode \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
True if an image of given mode can be imported with Import\+Bitmap(...) 
\end{DoxyReturn}


Definition at line 1304 of file P\+G\+Fimage.\+cpp.


\begin{DoxyCode}{0}
\DoxyCodeLine{1304                                            \{}
\DoxyCodeLine{1305         \textcolor{keywordtype}{size\_t} size = \mbox{\hyperlink{PGFtypes_8h_adbb49c2b6ab931f68f08a8dc1141727d}{DataTSize}};}
\DoxyCodeLine{1306 }
\DoxyCodeLine{1307         \textcolor{keywordflow}{if} (size >= 2) \{}
\DoxyCodeLine{1308                 \textcolor{keywordflow}{switch}(mode) \{}
\DoxyCodeLine{1309                         \textcolor{keywordflow}{case} \mbox{\hyperlink{PGFplatform_8h_a8905b28d0e3b96cf340ed34957738648}{ImageModeBitmap}}:}
\DoxyCodeLine{1310                         \textcolor{keywordflow}{case} \mbox{\hyperlink{PGFplatform_8h_af1937c5b38a21ec5e6b3e11851264be2}{ImageModeIndexedColor}}:}
\DoxyCodeLine{1311                         \textcolor{keywordflow}{case} \mbox{\hyperlink{PGFplatform_8h_ac73bfc2f52b9da3083b7087d154c1e2e}{ImageModeGrayScale}}:}
\DoxyCodeLine{1312                         \textcolor{keywordflow}{case} \mbox{\hyperlink{PGFplatform_8h_a07e2059cc6697336c5484447578264fc}{ImageModeRGBColor}}:}
\DoxyCodeLine{1313                         \textcolor{keywordflow}{case} \mbox{\hyperlink{PGFplatform_8h_af50b920dae1922b4eb0bcd82361d880c}{ImageModeCMYKColor}}:}
\DoxyCodeLine{1314                         \textcolor{keywordflow}{case} \mbox{\hyperlink{PGFplatform_8h_a5e4deddebb6ff58e1168fc20b0e15cb3}{ImageModeHSLColor}}:}
\DoxyCodeLine{1315                         \textcolor{keywordflow}{case} \mbox{\hyperlink{PGFplatform_8h_aca2b65c53ff44940ed27f809de3b28f5}{ImageModeHSBColor}}:}
\DoxyCodeLine{1316                         \textcolor{comment}{//case ImageModeDuotone:}}
\DoxyCodeLine{1317                         \textcolor{keywordflow}{case} \mbox{\hyperlink{PGFplatform_8h_aa1d93456909be3c716a8c5a30b191c00}{ImageModeLabColor}}:}
\DoxyCodeLine{1318                         \textcolor{keywordflow}{case} \mbox{\hyperlink{PGFplatform_8h_a1dbd9112d53e5eea856e65ed1e9c6d50}{ImageModeRGB12}}:}
\DoxyCodeLine{1319                         \textcolor{keywordflow}{case} \mbox{\hyperlink{PGFplatform_8h_aadaf1bd7eedf80c33287cfd311dbf068}{ImageModeRGB16}}:}
\DoxyCodeLine{1320                         \textcolor{keywordflow}{case} \mbox{\hyperlink{PGFplatform_8h_ab7cb460804a8abce27d823d09682c85b}{ImageModeRGBA}}:}
\DoxyCodeLine{1321                                 \textcolor{keywordflow}{return} \textcolor{keyword}{true};}
\DoxyCodeLine{1322                 \}}
\DoxyCodeLine{1323         \}}
\DoxyCodeLine{1324         \textcolor{keywordflow}{if} (size >= 3) \{}
\DoxyCodeLine{1325                 \textcolor{keywordflow}{switch}(mode) \{}
\DoxyCodeLine{1326                         \textcolor{keywordflow}{case} \mbox{\hyperlink{PGFplatform_8h_aedd00370d778fa28db56e5d4032d4c5c}{ImageModeGray16}}:}
\DoxyCodeLine{1327                         \textcolor{keywordflow}{case} \mbox{\hyperlink{PGFplatform_8h_ac04b7a3633a0caadba20e20e161239e1}{ImageModeRGB48}}:}
\DoxyCodeLine{1328                         \textcolor{keywordflow}{case} \mbox{\hyperlink{PGFplatform_8h_ae7de617953bf44d768dfd82b62a98db5}{ImageModeLab48}}:}
\DoxyCodeLine{1329                         \textcolor{keywordflow}{case} \mbox{\hyperlink{PGFplatform_8h_ac250ca543e6f93f370614801122b61f6}{ImageModeCMYK64}}:}
\DoxyCodeLine{1330                         \textcolor{comment}{//case ImageModeDuotone16:}}
\DoxyCodeLine{1331                                 \textcolor{keywordflow}{return} \textcolor{keyword}{true};}
\DoxyCodeLine{1332                 \}}
\DoxyCodeLine{1333         \}}
\DoxyCodeLine{1334         \textcolor{keywordflow}{if} (size >=4) \{}
\DoxyCodeLine{1335                 \textcolor{keywordflow}{switch}(mode) \{}
\DoxyCodeLine{1336                         \textcolor{keywordflow}{case} \mbox{\hyperlink{PGFplatform_8h_a205e54791f7ad54d357330bb99cab3b2}{ImageModeGray32}}:}
\DoxyCodeLine{1337                                 \textcolor{keywordflow}{return} \textcolor{keyword}{true};}
\DoxyCodeLine{1338                 \}}
\DoxyCodeLine{1339         \}}
\DoxyCodeLine{1340         \textcolor{keywordflow}{return} \textcolor{keyword}{false};}
\DoxyCodeLine{1341 \}}

\end{DoxyCode}
\mbox{\Hypertarget{classCPGFImage_a5685c45a74b14b9f12ee2d81f49718f3}\label{classCPGFImage_a5685c45a74b14b9f12ee2d81f49718f3}} 
\index{CPGFImage@{CPGFImage}!ImportYUV@{ImportYUV}}
\index{ImportYUV@{ImportYUV}!CPGFImage@{CPGFImage}}
\subsubsection{\texorpdfstring{ImportYUV()}{ImportYUV()}}
{\footnotesize\ttfamily void C\+P\+G\+F\+Image\+::\+Import\+Y\+UV (\begin{DoxyParamCaption}\item[{int}]{pitch,  }\item[{\mbox{\hyperlink{PGFtypes_8h_acb1ee3f52ccfad782dcaa0abd79e5d05}{DataT}} $\ast$}]{buff,  }\item[{B\+Y\+TE}]{bpp,  }\item[{int}]{channel\+Map\mbox{[}$\,$\mbox{]} = {\ttfamily nullptr},  }\item[{Callback\+Ptr}]{cb = {\ttfamily nullptr},  }\item[{void $\ast$}]{data = {\ttfamily nullptr} }\end{DoxyParamCaption})}

Import a Y\+UV image from a specified image buffer. The absolute value of pitch is the number of bytes of an image row. If pitch is negative, then buff points to the last row of a bottom-\/up image (first byte on last row). If pitch is positive, then buff points to the first row of a top-\/down image (first byte). The sequence of input channels in the input image buffer does not need to be the same as expected from P\+GF. In case of different sequences you have to provide a channel\+Map of size of expected channels (depending on image mode). For example, P\+GF expects in R\+GB color mode a channel sequence B\+GR. If your provided image buffer contains a channel sequence V\+UY, then the channel\+Map looks like \{ 2, 1, 0 \}. It might throw an \mbox{\hyperlink{structIOException}{I\+O\+Exception}}. 
\begin{DoxyParams}{Parameters}
{\em pitch} & The number of bytes of a row of the image buffer. \\
\hline
{\em buff} & An image buffer. \\
\hline
{\em bpp} & The number of bits per pixel used in image buffer. \\
\hline
{\em channel\+Map} & A integer array containing the mapping of input channel ordering to expected channel ordering. \\
\hline
{\em cb} & A pointer to a callback procedure. The procedure is called after each imported buffer row. If cb returns true, then it stops proceeding. \\
\hline
{\em data} & Data Pointer to C++ class container to host callback procedure.\\
\hline
\end{DoxyParams}
Import a Y\+UV image from a specified image buffer. The absolute value of pitch is the number of bytes of an image row. If pitch is negative, then buff points to the last row of a bottom-\/up image (first byte on last row). If pitch is positive, then buff points to the first row of a top-\/down image (first byte). The sequence of input channels in the input image buffer does not need to be the same as expected from P\+GF. In case of different sequences you have to provide a channel\+Map of size of expected channels (depending on image mode). For example, P\+GF expects in R\+GB color mode a channel sequence B\+GR. If your provided image buffer contains a channel sequence V\+UY, then the channel\+Map looks like \{ 2, 1, 0 \}. It might throw an \mbox{\hyperlink{structIOException}{I\+O\+Exception}}. 
\begin{DoxyParams}{Parameters}
{\em pitch} & The number of bytes of a row of the image buffer. \\
\hline
{\em buff} & An image buffer. \\
\hline
{\em bpp} & The number of bits per pixel used in image buffer. \\
\hline
{\em channel\+Map} & A integer array containing the mapping of input channel ordering to expected channel ordering. \\
\hline
{\em cb} & A pointer to a callback procedure. The procedure is called after each imported buffer row. If cb returns true, then it stops proceeding. \\
\hline
\end{DoxyParams}


Definition at line 2660 of file P\+G\+Fimage.\+cpp.


\begin{DoxyCode}{0}
\DoxyCodeLine{2660                                                                                                               \{}
\DoxyCodeLine{2661         ASSERT(buff);}
\DoxyCodeLine{2662         \textcolor{keyword}{const} \textcolor{keywordtype}{double} dP = 1.0/\mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a7262335e99ca409759e1aa8c0f0164b1}{height}};}
\DoxyCodeLine{2663         \textcolor{keyword}{const} \textcolor{keywordtype}{int} dataBits = \mbox{\hyperlink{PGFtypes_8h_adbb49c2b6ab931f68f08a8dc1141727d}{DataTSize}}*8; ASSERT(dataBits == 16 || dataBits == 32);}
\DoxyCodeLine{2664         \textcolor{keyword}{const} \textcolor{keywordtype}{int} pitch2 = pitch/\mbox{\hyperlink{PGFtypes_8h_adbb49c2b6ab931f68f08a8dc1141727d}{DataTSize}};}
\DoxyCodeLine{2665         \textcolor{keyword}{const} \textcolor{keywordtype}{int} yuvOffset = (dataBits == 16) ? \mbox{\hyperlink{PGFimage_8cpp_a0fc648cb4d04d369ff4692cc07687039}{YUVoffset8}} : \mbox{\hyperlink{PGFimage_8cpp_aa4cf76945d82d946aa5e89ffd4072159}{YUVoffset16}};}
\DoxyCodeLine{2666 }
\DoxyCodeLine{2667         \textcolor{keywordtype}{int} yPos = 0, cnt = 0;}
\DoxyCodeLine{2668         \textcolor{keywordtype}{double} percent = 0;}
\DoxyCodeLine{2669         \textcolor{keywordtype}{int} defMap[] = \{ 0, 1, 2, 3, 4, 5, 6, 7 \}; ASSERT(\textcolor{keyword}{sizeof}(defMap)/\textcolor{keyword}{sizeof}(defMap[0]) == \mbox{\hyperlink{PGFtypes_8h_a94219182f88d4dbed1021ed04db75e41}{MaxChannels}});}
\DoxyCodeLine{2670 }
\DoxyCodeLine{2671         \textcolor{keywordflow}{if} (channelMap == \textcolor{keyword}{nullptr}) channelMap = defMap;}
\DoxyCodeLine{2672 }
\DoxyCodeLine{2673         \textcolor{keywordflow}{if} (\mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_abda7a5f282421cd7e789da62f657efa0}{channels}} == 3)     \{}
\DoxyCodeLine{2674                 ASSERT(bpp\%dataBits == 0);}
\DoxyCodeLine{2675 }
\DoxyCodeLine{2676                 \mbox{\hyperlink{PGFtypes_8h_acb1ee3f52ccfad782dcaa0abd79e5d05}{DataT}}* y = \mbox{\hyperlink{classCPGFImage_a36f7f20b38a9cb3a9c88032f5f886345}{m\_channel}}[0]; ASSERT(y);}
\DoxyCodeLine{2677                 \mbox{\hyperlink{PGFtypes_8h_acb1ee3f52ccfad782dcaa0abd79e5d05}{DataT}}* u = \mbox{\hyperlink{classCPGFImage_a36f7f20b38a9cb3a9c88032f5f886345}{m\_channel}}[1]; ASSERT(u);}
\DoxyCodeLine{2678                 \mbox{\hyperlink{PGFtypes_8h_acb1ee3f52ccfad782dcaa0abd79e5d05}{DataT}}* v = \mbox{\hyperlink{classCPGFImage_a36f7f20b38a9cb3a9c88032f5f886345}{m\_channel}}[2]; ASSERT(v);}
\DoxyCodeLine{2679                 \textcolor{keyword}{const} \textcolor{keywordtype}{int} channels = bpp/dataBits; ASSERT(channels >= \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_abda7a5f282421cd7e789da62f657efa0}{channels}});}
\DoxyCodeLine{2680 }
\DoxyCodeLine{2681                 \textcolor{keywordflow}{for} (UINT32 h=0; h < \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a7262335e99ca409759e1aa8c0f0164b1}{height}}; h++) \{}
\DoxyCodeLine{2682                         \textcolor{keywordflow}{if} (cb) \{}
\DoxyCodeLine{2683                                 \textcolor{keywordflow}{if} ((*cb)(percent, \textcolor{keyword}{true}, data)) ReturnWithError(EscapePressed);}
\DoxyCodeLine{2684                                 percent += dP;}
\DoxyCodeLine{2685                         \}}
\DoxyCodeLine{2686 }
\DoxyCodeLine{2687                         cnt = 0;}
\DoxyCodeLine{2688                         \textcolor{keywordflow}{for} (UINT32 w=0; w < \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a766a68c3284c2ae6d2f54c82e7350ed9}{width}}; w++) \{}
\DoxyCodeLine{2689                                 y[yPos] = buff[cnt + channelMap[0]];}
\DoxyCodeLine{2690                                 u[yPos] = buff[cnt + channelMap[1]];}
\DoxyCodeLine{2691                                 v[yPos] = buff[cnt + channelMap[2]];}
\DoxyCodeLine{2692                                 yPos++;}
\DoxyCodeLine{2693                                 cnt += channels;}
\DoxyCodeLine{2694                         \}}
\DoxyCodeLine{2695                         buff += pitch2;}
\DoxyCodeLine{2696                 \}       }
\DoxyCodeLine{2697         \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (\mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_abda7a5f282421cd7e789da62f657efa0}{channels}} == 4) \{}
\DoxyCodeLine{2698                 ASSERT(bpp\%dataBits == 0);}
\DoxyCodeLine{2699 }
\DoxyCodeLine{2700                 \mbox{\hyperlink{PGFtypes_8h_acb1ee3f52ccfad782dcaa0abd79e5d05}{DataT}}* y = \mbox{\hyperlink{classCPGFImage_a36f7f20b38a9cb3a9c88032f5f886345}{m\_channel}}[0]; ASSERT(y);}
\DoxyCodeLine{2701                 \mbox{\hyperlink{PGFtypes_8h_acb1ee3f52ccfad782dcaa0abd79e5d05}{DataT}}* u = \mbox{\hyperlink{classCPGFImage_a36f7f20b38a9cb3a9c88032f5f886345}{m\_channel}}[1]; ASSERT(u);}
\DoxyCodeLine{2702                 \mbox{\hyperlink{PGFtypes_8h_acb1ee3f52ccfad782dcaa0abd79e5d05}{DataT}}* v = \mbox{\hyperlink{classCPGFImage_a36f7f20b38a9cb3a9c88032f5f886345}{m\_channel}}[2]; ASSERT(v);}
\DoxyCodeLine{2703                 \mbox{\hyperlink{PGFtypes_8h_acb1ee3f52ccfad782dcaa0abd79e5d05}{DataT}}* a = \mbox{\hyperlink{classCPGFImage_a36f7f20b38a9cb3a9c88032f5f886345}{m\_channel}}[3]; ASSERT(a);}
\DoxyCodeLine{2704                 \textcolor{keyword}{const} \textcolor{keywordtype}{int} channels = bpp/dataBits; ASSERT(channels >= \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_abda7a5f282421cd7e789da62f657efa0}{channels}});}
\DoxyCodeLine{2705 }
\DoxyCodeLine{2706                 \textcolor{keywordflow}{for} (UINT32 h=0; h < \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a7262335e99ca409759e1aa8c0f0164b1}{height}}; h++) \{}
\DoxyCodeLine{2707                         \textcolor{keywordflow}{if} (cb) \{}
\DoxyCodeLine{2708                                 \textcolor{keywordflow}{if} ((*cb)(percent, \textcolor{keyword}{true}, data)) ReturnWithError(EscapePressed);}
\DoxyCodeLine{2709                                 percent += dP;}
\DoxyCodeLine{2710                         \}}
\DoxyCodeLine{2711 }
\DoxyCodeLine{2712                         cnt = 0;}
\DoxyCodeLine{2713                         \textcolor{keywordflow}{for} (UINT32 w=0; w < \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a766a68c3284c2ae6d2f54c82e7350ed9}{width}}; w++) \{}
\DoxyCodeLine{2714                                 y[yPos] = buff[cnt + channelMap[0]];}
\DoxyCodeLine{2715                                 u[yPos] = buff[cnt + channelMap[1]];}
\DoxyCodeLine{2716                                 v[yPos] = buff[cnt + channelMap[2]];}
\DoxyCodeLine{2717                                 a[yPos] = buff[cnt + channelMap[3]] - yuvOffset;}
\DoxyCodeLine{2718                                 yPos++;}
\DoxyCodeLine{2719                                 cnt += channels;}
\DoxyCodeLine{2720                         \}}
\DoxyCodeLine{2721                         buff += pitch2;}
\DoxyCodeLine{2722                 \}       }
\DoxyCodeLine{2723         \}}
\DoxyCodeLine{2724 }
\DoxyCodeLine{2725         \textcolor{keywordflow}{if} (\mbox{\hyperlink{classCPGFImage_a9226595ea6b907e4d07301a6ee641b87}{m\_downsample}}) \{}
\DoxyCodeLine{2726                 \textcolor{comment}{// Subsampling of the chrominance and alpha channels}}
\DoxyCodeLine{2727                 \textcolor{keywordflow}{for} (\textcolor{keywordtype}{int} i=1; i < \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_abda7a5f282421cd7e789da62f657efa0}{channels}}; i++) \{}
\DoxyCodeLine{2728                         \mbox{\hyperlink{classCPGFImage_a1db75413dfdc6f752088a53de0e6b998}{Downsample}}(i);}
\DoxyCodeLine{2729                 \}}
\DoxyCodeLine{2730         \}}
\DoxyCodeLine{2731 \}}

\end{DoxyCode}
\mbox{\Hypertarget{classCPGFImage_ab32b4053e41cc205cce45be8045e603b}\label{classCPGFImage_ab32b4053e41cc205cce45be8045e603b}} 
\index{CPGFImage@{CPGFImage}!Init@{Init}}
\index{Init@{Init}!CPGFImage@{CPGFImage}}
\subsubsection{\texorpdfstring{Init()}{Init()}}
{\footnotesize\ttfamily void C\+P\+G\+F\+Image\+::\+Init (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



Definition at line 69 of file P\+G\+Fimage.\+cpp.


\begin{DoxyCode}{0}
\DoxyCodeLine{69                      \{}
\DoxyCodeLine{70         \textcolor{comment}{// init pointers}}
\DoxyCodeLine{71         \mbox{\hyperlink{classCPGFImage_a1058b29a3d046e171a2fe48168b66d38}{m\_decoder}} = \textcolor{keyword}{nullptr};}
\DoxyCodeLine{72         \mbox{\hyperlink{classCPGFImage_a6ef048255812525cd56d7b04df5e6731}{m\_encoder}} = \textcolor{keyword}{nullptr};}
\DoxyCodeLine{73         \mbox{\hyperlink{classCPGFImage_a1635ef5dca13bd07276d112a72316a73}{m\_levelLength}} = \textcolor{keyword}{nullptr};}
\DoxyCodeLine{74 }
\DoxyCodeLine{75         \textcolor{comment}{// init members}}
\DoxyCodeLine{76 \textcolor{preprocessor}{\#ifdef \_\_PGFROISUPPORT\_\_}}
\DoxyCodeLine{77         \mbox{\hyperlink{classCPGFImage_af6d3fe5a8622634d1d0faf56cde335ef}{m\_streamReinitialized}} = \textcolor{keyword}{false};}
\DoxyCodeLine{78 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{79         \mbox{\hyperlink{classCPGFImage_a2790b468b6d4841cd34473c4b61d0c7f}{m\_currentLevel}} = 0;}
\DoxyCodeLine{80         \mbox{\hyperlink{classCPGFImage_a57cc024db6e510f95f3238f448a0fed5}{m\_quant}} = 0;}
\DoxyCodeLine{81         \mbox{\hyperlink{classCPGFImage_acf4ae6e169ddf84e32cf9b57a22800b3}{m\_userDataPos}} = 0;}
\DoxyCodeLine{82         \mbox{\hyperlink{classCPGFImage_a9226595ea6b907e4d07301a6ee641b87}{m\_downsample}} = \textcolor{keyword}{false};}
\DoxyCodeLine{83         \mbox{\hyperlink{classCPGFImage_a6925d3950e8f48487205d46de7920d3e}{m\_favorSpeedOverSize}} = \textcolor{keyword}{false};}
\DoxyCodeLine{84         \mbox{\hyperlink{classCPGFImage_a140110570c6d492b23db50189d3f4d48}{m\_useOMPinEncoder}} = \textcolor{keyword}{true};}
\DoxyCodeLine{85         \mbox{\hyperlink{classCPGFImage_a01d0752d97900040fa1db7f02d4770cb}{m\_useOMPinDecoder}} = \textcolor{keyword}{true};}
\DoxyCodeLine{86         \mbox{\hyperlink{classCPGFImage_ac262a389df92493dfca63b2f1f06fe78}{m\_cb}} = \textcolor{keyword}{nullptr};}
\DoxyCodeLine{87         \mbox{\hyperlink{classCPGFImage_a45861a83c95188610063233149187f3c}{m\_cbArg}} = \textcolor{keyword}{nullptr};}
\DoxyCodeLine{88         \mbox{\hyperlink{classCPGFImage_a8b4d6d5ef343f0f428b35c9bf1020569}{m\_progressMode}} = \mbox{\hyperlink{PGFtypes_8h_a04561479f4f8aa5a0775d8b541a1157ea441b3bb041d0f7715659f45d8b766983}{PM\_Relative}};}
\DoxyCodeLine{89         \mbox{\hyperlink{classCPGFImage_adc2499451b8f96483a892e53fe5849b1}{m\_percent}} = 0;}
\DoxyCodeLine{90         \mbox{\hyperlink{classCPGFImage_a18e28eef51d17c3bd0be4d4f758a6a86}{m\_userDataPolicy}} = \mbox{\hyperlink{PGFtypes_8h_a0e70eeba0994fafcbfe6cbea3a734096ad52de87e33912adabcf1e22f05e38227}{UP\_CacheAll}};}
\DoxyCodeLine{91 }
\DoxyCodeLine{92         \textcolor{comment}{// init preHeader}}
\DoxyCodeLine{93         memcpy(\mbox{\hyperlink{classCPGFImage_ad5ed0ec587742ebf46f72be4abde305d}{m\_preHeader}}.\mbox{\hyperlink{structPGFMagicVersion_a8b27eabb723f35b4fdb9e357e69b334b}{magic}}, \mbox{\hyperlink{PGFtypes_8h_a6af5fdbb431a51fc87698ac0b2da8e34}{PGFMagic}}, 3);}
\DoxyCodeLine{94         \mbox{\hyperlink{classCPGFImage_ad5ed0ec587742ebf46f72be4abde305d}{m\_preHeader}}.\mbox{\hyperlink{structPGFMagicVersion_aa7ff5e50537cac9dd4c62d4c8982d09d}{version}} = \mbox{\hyperlink{PGFtypes_8h_aba6dadeb0788b7e02ab3c4425c6ef38a}{PGFVersion}};}
\DoxyCodeLine{95         \mbox{\hyperlink{classCPGFImage_ad5ed0ec587742ebf46f72be4abde305d}{m\_preHeader}}.\mbox{\hyperlink{structPGFPreHeader_a71b1463b71b722459dad25a3ef0b492b}{hSize}} = 0;}
\DoxyCodeLine{96 }
\DoxyCodeLine{97         \textcolor{comment}{// init postHeader}}
\DoxyCodeLine{98         \mbox{\hyperlink{classCPGFImage_ab8635df22839ffb68bada53e38b9ce73}{m\_postHeader}}.\mbox{\hyperlink{structPGFPostHeader_aeeb6e57e8343eb3d42406f0baf3ae6e1}{userData}} = \textcolor{keyword}{nullptr};}
\DoxyCodeLine{99         \mbox{\hyperlink{classCPGFImage_ab8635df22839ffb68bada53e38b9ce73}{m\_postHeader}}.\mbox{\hyperlink{structPGFPostHeader_a0fb630d6cd14ed865dd5fe20227279f2}{userDataLen}} = 0;}
\DoxyCodeLine{100         \mbox{\hyperlink{classCPGFImage_ab8635df22839ffb68bada53e38b9ce73}{m\_postHeader}}.\mbox{\hyperlink{structPGFPostHeader_a104e3ef6de85dfdbbd867a250fcd82d4}{cachedUserDataLen}} = 0;}
\DoxyCodeLine{101 }
\DoxyCodeLine{102         \textcolor{comment}{// init channels}}
\DoxyCodeLine{103         \textcolor{keywordflow}{for} (\textcolor{keywordtype}{int} i = 0; i < \mbox{\hyperlink{PGFtypes_8h_a94219182f88d4dbed1021ed04db75e41}{MaxChannels}}; i++) \{}
\DoxyCodeLine{104                 \mbox{\hyperlink{classCPGFImage_a36f7f20b38a9cb3a9c88032f5f886345}{m\_channel}}[i] = \textcolor{keyword}{nullptr};}
\DoxyCodeLine{105                 \mbox{\hyperlink{classCPGFImage_ae3901a689b7d1dd46d48b042c3d31d5c}{m\_wtChannel}}[i] = \textcolor{keyword}{nullptr};}
\DoxyCodeLine{106         \}}
\DoxyCodeLine{107 }
\DoxyCodeLine{108         \textcolor{comment}{// set image width and height}}
\DoxyCodeLine{109         \textcolor{keywordflow}{for} (\textcolor{keywordtype}{int} i = 0; i < \mbox{\hyperlink{PGFtypes_8h_a94219182f88d4dbed1021ed04db75e41}{MaxChannels}}; i++) \{}
\DoxyCodeLine{110                 \mbox{\hyperlink{classCPGFImage_ab6d97aca28795fae697fdda4b8acd8f9}{m\_width}}[0] = 0;}
\DoxyCodeLine{111                 \mbox{\hyperlink{classCPGFImage_a170fd448152303a2d44848a52a8916a0}{m\_height}}[0] = 0;}
\DoxyCodeLine{112         \}}
\DoxyCodeLine{113 \}}

\end{DoxyCode}
\mbox{\Hypertarget{classCPGFImage_a3b6f8f9c75dd377a3cd6bf1e07e68531}\label{classCPGFImage_a3b6f8f9c75dd377a3cd6bf1e07e68531}} 
\index{CPGFImage@{CPGFImage}!IsFullyRead@{IsFullyRead}}
\index{IsFullyRead@{IsFullyRead}!CPGFImage@{CPGFImage}}
\subsubsection{\texorpdfstring{IsFullyRead()}{IsFullyRead()}}
{\footnotesize\ttfamily bool C\+P\+G\+F\+Image\+::\+Is\+Fully\+Read (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



Return true if all levels have been read. 



Definition at line 436 of file P\+G\+Fimage.\+h.


\begin{DoxyCode}{0}
\DoxyCodeLine{436 \{ \textcolor{keywordflow}{return} \mbox{\hyperlink{classCPGFImage_a2790b468b6d4841cd34473c4b61d0c7f}{m\_currentLevel}} == 0; \}}

\end{DoxyCode}
\mbox{\Hypertarget{classCPGFImage_a73a46482fbfc549f8baa485c9b09f67a}\label{classCPGFImage_a73a46482fbfc549f8baa485c9b09f67a}} 
\index{CPGFImage@{CPGFImage}!IsOpen@{IsOpen}}
\index{IsOpen@{IsOpen}!CPGFImage@{CPGFImage}}
\subsubsection{\texorpdfstring{IsOpen()}{IsOpen()}}
{\footnotesize\ttfamily bool C\+P\+G\+F\+Image\+::\+Is\+Open (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



Returns true if the P\+GF has been opened for reading. 



Definition at line 77 of file P\+G\+Fimage.\+h.


\begin{DoxyCode}{0}
\DoxyCodeLine{77 \{ \textcolor{keywordflow}{return} \mbox{\hyperlink{classCPGFImage_a1058b29a3d046e171a2fe48168b66d38}{m\_decoder}} != \textcolor{keyword}{nullptr}; \}}

\end{DoxyCode}
\mbox{\Hypertarget{classCPGFImage_a4619eb255afd03dabea2b0afbe6e0d94}\label{classCPGFImage_a4619eb255afd03dabea2b0afbe6e0d94}} 
\index{CPGFImage@{CPGFImage}!Level@{Level}}
\index{Level@{Level}!CPGFImage@{CPGFImage}}
\subsubsection{\texorpdfstring{Level()}{Level()}}
{\footnotesize\ttfamily B\+Y\+TE C\+P\+G\+F\+Image\+::\+Level (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}

Return current image level. Since Read(...) can be used to read each image level separately, it is helpful to know the current level. The current level immediately after Open(...) is \mbox{\hyperlink{classCPGFImage_ab3678d05c031dc4cbf5451e7f4f6bdf3}{Levels()}}. \begin{DoxyReturn}{Returns}
Current image level 
\end{DoxyReturn}


Definition at line 427 of file P\+G\+Fimage.\+h.


\begin{DoxyCode}{0}
\DoxyCodeLine{427 \{ \textcolor{keywordflow}{return} (BYTE)\mbox{\hyperlink{classCPGFImage_a2790b468b6d4841cd34473c4b61d0c7f}{m\_currentLevel}}; \}}

\end{DoxyCode}
\mbox{\Hypertarget{classCPGFImage_ab3678d05c031dc4cbf5451e7f4f6bdf3}\label{classCPGFImage_ab3678d05c031dc4cbf5451e7f4f6bdf3}} 
\index{CPGFImage@{CPGFImage}!Levels@{Levels}}
\index{Levels@{Levels}!CPGFImage@{CPGFImage}}
\subsubsection{\texorpdfstring{Levels()}{Levels()}}
{\footnotesize\ttfamily B\+Y\+TE C\+P\+G\+F\+Image\+::\+Levels (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}

Return the number of image levels. \begin{DoxyReturn}{Returns}
Number of image levels 
\end{DoxyReturn}


Definition at line 432 of file P\+G\+Fimage.\+h.


\begin{DoxyCode}{0}
\DoxyCodeLine{432 \{ \textcolor{keywordflow}{return} \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a963890fa1e02a517923f9d0bf0d7e9eb}{nLevels}}; \}}

\end{DoxyCode}
\mbox{\Hypertarget{classCPGFImage_a96e7712f6033810f386a23f2faec0037}\label{classCPGFImage_a96e7712f6033810f386a23f2faec0037}} 
\index{CPGFImage@{CPGFImage}!LevelSizeH@{LevelSizeH}}
\index{LevelSizeH@{LevelSizeH}!CPGFImage@{CPGFImage}}
\subsubsection{\texorpdfstring{LevelSizeH()}{LevelSizeH()}}
{\footnotesize\ttfamily static U\+I\+N\+T32 C\+P\+G\+F\+Image\+::\+Level\+SizeH (\begin{DoxyParamCaption}\item[{U\+I\+N\+T32}]{size,  }\item[{int}]{level }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}

Compute and return image width/height of HH subband at given level. 
\begin{DoxyParams}{Parameters}
{\em size} & Original image size (e.\+g. width or height at level 0) \\
\hline
{\em level} & An image level \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
high pass size at given level in pixels 
\end{DoxyReturn}


Definition at line 506 of file P\+G\+Fimage.\+h.


\begin{DoxyCode}{0}
\DoxyCodeLine{506 \{ ASSERT(level >= 0); UINT32 d = 1 << (level - 1); \textcolor{keywordflow}{return} (size + d - 1) >> level; \}}

\end{DoxyCode}
\mbox{\Hypertarget{classCPGFImage_ad7e2f885a059a39ca15a47ecb497833b}\label{classCPGFImage_ad7e2f885a059a39ca15a47ecb497833b}} 
\index{CPGFImage@{CPGFImage}!LevelSizeL@{LevelSizeL}}
\index{LevelSizeL@{LevelSizeL}!CPGFImage@{CPGFImage}}
\subsubsection{\texorpdfstring{LevelSizeL()}{LevelSizeL()}}
{\footnotesize\ttfamily static U\+I\+N\+T32 C\+P\+G\+F\+Image\+::\+Level\+SizeL (\begin{DoxyParamCaption}\item[{U\+I\+N\+T32}]{size,  }\item[{int}]{level }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}

Compute and return image width/height of LL subband at given level. 
\begin{DoxyParams}{Parameters}
{\em size} & Original image size (e.\+g. width or height at level 0) \\
\hline
{\em level} & An image level \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
Image width/height at given level in pixels 
\end{DoxyReturn}


Definition at line 499 of file P\+G\+Fimage.\+h.


\begin{DoxyCode}{0}
\DoxyCodeLine{499 \{ ASSERT(level >= 0); UINT32 d = 1 << level; \textcolor{keywordflow}{return} (size + d - 1) >> level; \}}

\end{DoxyCode}
\mbox{\Hypertarget{classCPGFImage_a368601b5942e4406cdb87120406ff075}\label{classCPGFImage_a368601b5942e4406cdb87120406ff075}} 
\index{CPGFImage@{CPGFImage}!MaxChannelDepth@{MaxChannelDepth}}
\index{MaxChannelDepth@{MaxChannelDepth}!CPGFImage@{CPGFImage}}
\subsubsection{\texorpdfstring{MaxChannelDepth()}{MaxChannelDepth()}}
{\footnotesize\ttfamily static B\+Y\+TE C\+P\+G\+F\+Image\+::\+Max\+Channel\+Depth (\begin{DoxyParamCaption}\item[{B\+Y\+TE}]{version = {\ttfamily \mbox{\hyperlink{PGFtypes_8h_aba6dadeb0788b7e02ab3c4425c6ef38a}{P\+G\+F\+Version}}} }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}

Return maximum channel depth. 
\begin{DoxyParams}{Parameters}
{\em version} & pgf pre-\/header version number \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
maximum channel depth in bit of given version (16 or 32 bit) 
\end{DoxyReturn}


Definition at line 518 of file P\+G\+Fimage.\+h.


\begin{DoxyCode}{0}
\DoxyCodeLine{518 \{ \textcolor{keywordflow}{return} (version \& \mbox{\hyperlink{PGFtypes_8h_aa4ea0b8cc599de9a0f0af11de65b1eb4}{PGF32}}) ? 32 : 16; \}}

\end{DoxyCode}
\mbox{\Hypertarget{classCPGFImage_a8c60aabdcf2556e9a425052e7f5b5d30}\label{classCPGFImage_a8c60aabdcf2556e9a425052e7f5b5d30}} 
\index{CPGFImage@{CPGFImage}!Mode@{Mode}}
\index{Mode@{Mode}!CPGFImage@{CPGFImage}}
\subsubsection{\texorpdfstring{Mode()}{Mode()}}
{\footnotesize\ttfamily B\+Y\+TE C\+P\+G\+F\+Image\+::\+Mode (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}

Return the image mode. An image mode is a predefined constant value (see also \mbox{\hyperlink{PGFtypes_8h}{P\+G\+Ftypes.\+h}}) compatible with Adobe Photoshop. It represents an image type and format. \begin{DoxyReturn}{Returns}
Image mode 
\end{DoxyReturn}


Definition at line 455 of file P\+G\+Fimage.\+h.


\begin{DoxyCode}{0}
\DoxyCodeLine{455 \{ \textcolor{keywordflow}{return} \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a3ddaf075db8ee812ad688d9ed39e0698}{mode}}; \}}

\end{DoxyCode}
\mbox{\Hypertarget{classCPGFImage_adbe9092b915a2c5b2361f4db186b991c}\label{classCPGFImage_adbe9092b915a2c5b2361f4db186b991c}} 
\index{CPGFImage@{CPGFImage}!Open@{Open}}
\index{Open@{Open}!CPGFImage@{CPGFImage}}
\subsubsection{\texorpdfstring{Open()}{Open()}}
{\footnotesize\ttfamily void C\+P\+G\+F\+Image\+::\+Open (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{classCPGFStream}{C\+P\+G\+F\+Stream}} $\ast$}]{stream }\end{DoxyParamCaption})}

Open a P\+GF image at current stream position\+: read pre-\/header, header, and ckeck image type. Precondition\+: The stream has been opened for reading. It might throw an \mbox{\hyperlink{structIOException}{I\+O\+Exception}}. 
\begin{DoxyParams}{Parameters}
{\em stream} & A P\+GF stream \\
\hline
\end{DoxyParams}


Definition at line 141 of file P\+G\+Fimage.\+cpp.


\begin{DoxyCode}{0}
\DoxyCodeLine{141                                        \{}
\DoxyCodeLine{142         ASSERT(stream);}
\DoxyCodeLine{143 }
\DoxyCodeLine{144         \textcolor{comment}{// create decoder and read PGFPreHeader PGFHeader PGFPostHeader LevelLengths}}
\DoxyCodeLine{145         \mbox{\hyperlink{classCPGFImage_a1058b29a3d046e171a2fe48168b66d38}{m\_decoder}} = \textcolor{keyword}{new} \mbox{\hyperlink{classCDecoder}{CDecoder}}(stream, \mbox{\hyperlink{classCPGFImage_ad5ed0ec587742ebf46f72be4abde305d}{m\_preHeader}}, \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}, \mbox{\hyperlink{classCPGFImage_ab8635df22839ffb68bada53e38b9ce73}{m\_postHeader}}, \mbox{\hyperlink{classCPGFImage_a1635ef5dca13bd07276d112a72316a73}{m\_levelLength}}, }
\DoxyCodeLine{146                 \mbox{\hyperlink{classCPGFImage_acf4ae6e169ddf84e32cf9b57a22800b3}{m\_userDataPos}}, \mbox{\hyperlink{classCPGFImage_a01d0752d97900040fa1db7f02d4770cb}{m\_useOMPinDecoder}}, \mbox{\hyperlink{classCPGFImage_a18e28eef51d17c3bd0be4d4f758a6a86}{m\_userDataPolicy}});}
\DoxyCodeLine{147 }
\DoxyCodeLine{148         \textcolor{keywordflow}{if} (\mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a963890fa1e02a517923f9d0bf0d7e9eb}{nLevels}} > \mbox{\hyperlink{PGFtypes_8h_a2468e509eae9683e25af403249b743a3}{MaxLevel}}) ReturnWithError(FormatCannotRead);}
\DoxyCodeLine{149 }
\DoxyCodeLine{150         \textcolor{comment}{// set current level}}
\DoxyCodeLine{151         \mbox{\hyperlink{classCPGFImage_a2790b468b6d4841cd34473c4b61d0c7f}{m\_currentLevel}} = \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a963890fa1e02a517923f9d0bf0d7e9eb}{nLevels}};}
\DoxyCodeLine{152 }
\DoxyCodeLine{153         \textcolor{comment}{// set image width and height}}
\DoxyCodeLine{154         \mbox{\hyperlink{classCPGFImage_ab6d97aca28795fae697fdda4b8acd8f9}{m\_width}}[0] = \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a766a68c3284c2ae6d2f54c82e7350ed9}{width}};}
\DoxyCodeLine{155         \mbox{\hyperlink{classCPGFImage_a170fd448152303a2d44848a52a8916a0}{m\_height}}[0] = \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a7262335e99ca409759e1aa8c0f0164b1}{height}};}
\DoxyCodeLine{156 }
\DoxyCodeLine{157         \textcolor{comment}{// complete header}}
\DoxyCodeLine{158         \textcolor{keywordflow}{if} (!\mbox{\hyperlink{classCPGFImage_a0f517491e6b64353cd9ba45f8697b865}{CompleteHeader}}()) ReturnWithError(FormatCannotRead);}
\DoxyCodeLine{159 }
\DoxyCodeLine{160         \textcolor{comment}{// interpret quant parameter}}
\DoxyCodeLine{161         \textcolor{keywordflow}{if} (\mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_ac314a16d5984aea88f4a5ff38f49c08b}{quality}} > \mbox{\hyperlink{PGFtypes_8h_ac3fdd6d7d71ed50f3b7365d5bc287cda}{DownsampleThreshold}} \&\& }
\DoxyCodeLine{162                 (\mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a3ddaf075db8ee812ad688d9ed39e0698}{mode}} == \mbox{\hyperlink{PGFplatform_8h_a07e2059cc6697336c5484447578264fc}{ImageModeRGBColor}} || }
\DoxyCodeLine{163                  \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a3ddaf075db8ee812ad688d9ed39e0698}{mode}} == \mbox{\hyperlink{PGFplatform_8h_ab7cb460804a8abce27d823d09682c85b}{ImageModeRGBA}} || }
\DoxyCodeLine{164                  \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a3ddaf075db8ee812ad688d9ed39e0698}{mode}} == \mbox{\hyperlink{PGFplatform_8h_ac04b7a3633a0caadba20e20e161239e1}{ImageModeRGB48}} || }
\DoxyCodeLine{165                  \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a3ddaf075db8ee812ad688d9ed39e0698}{mode}} == \mbox{\hyperlink{PGFplatform_8h_af50b920dae1922b4eb0bcd82361d880c}{ImageModeCMYKColor}} || }
\DoxyCodeLine{166                  \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a3ddaf075db8ee812ad688d9ed39e0698}{mode}} == \mbox{\hyperlink{PGFplatform_8h_ac250ca543e6f93f370614801122b61f6}{ImageModeCMYK64}} || }
\DoxyCodeLine{167                  \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a3ddaf075db8ee812ad688d9ed39e0698}{mode}} == \mbox{\hyperlink{PGFplatform_8h_aa1d93456909be3c716a8c5a30b191c00}{ImageModeLabColor}} || }
\DoxyCodeLine{168                  \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a3ddaf075db8ee812ad688d9ed39e0698}{mode}} == \mbox{\hyperlink{PGFplatform_8h_ae7de617953bf44d768dfd82b62a98db5}{ImageModeLab48}})) \{}
\DoxyCodeLine{169                 \mbox{\hyperlink{classCPGFImage_a9226595ea6b907e4d07301a6ee641b87}{m\_downsample}} = \textcolor{keyword}{true};}
\DoxyCodeLine{170                 \mbox{\hyperlink{classCPGFImage_a57cc024db6e510f95f3238f448a0fed5}{m\_quant}} = \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_ac314a16d5984aea88f4a5ff38f49c08b}{quality}} - 1;}
\DoxyCodeLine{171         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{172                 \mbox{\hyperlink{classCPGFImage_a9226595ea6b907e4d07301a6ee641b87}{m\_downsample}} = \textcolor{keyword}{false};}
\DoxyCodeLine{173                 \mbox{\hyperlink{classCPGFImage_a57cc024db6e510f95f3238f448a0fed5}{m\_quant}} = \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_ac314a16d5984aea88f4a5ff38f49c08b}{quality}};}
\DoxyCodeLine{174         \}}
\DoxyCodeLine{175 }
\DoxyCodeLine{176         \textcolor{comment}{// set channel dimensions (chrominance is subsampled by factor 2)}}
\DoxyCodeLine{177         \textcolor{keywordflow}{if} (\mbox{\hyperlink{classCPGFImage_a9226595ea6b907e4d07301a6ee641b87}{m\_downsample}}) \{}
\DoxyCodeLine{178                 \textcolor{keywordflow}{for} (\textcolor{keywordtype}{int} i=1; i < \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_abda7a5f282421cd7e789da62f657efa0}{channels}}; i++) \{}
\DoxyCodeLine{179                         \mbox{\hyperlink{classCPGFImage_ab6d97aca28795fae697fdda4b8acd8f9}{m\_width}}[i] = (\mbox{\hyperlink{classCPGFImage_ab6d97aca28795fae697fdda4b8acd8f9}{m\_width}}[0] + 1) >> 1;}
\DoxyCodeLine{180                         \mbox{\hyperlink{classCPGFImage_a170fd448152303a2d44848a52a8916a0}{m\_height}}[i] = (\mbox{\hyperlink{classCPGFImage_a170fd448152303a2d44848a52a8916a0}{m\_height}}[0] + 1) >> 1;}
\DoxyCodeLine{181                 \}}
\DoxyCodeLine{182         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{183                 \textcolor{keywordflow}{for} (\textcolor{keywordtype}{int} i=1; i < \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_abda7a5f282421cd7e789da62f657efa0}{channels}}; i++) \{}
\DoxyCodeLine{184                         \mbox{\hyperlink{classCPGFImage_ab6d97aca28795fae697fdda4b8acd8f9}{m\_width}}[i] = \mbox{\hyperlink{classCPGFImage_ab6d97aca28795fae697fdda4b8acd8f9}{m\_width}}[0];}
\DoxyCodeLine{185                         \mbox{\hyperlink{classCPGFImage_a170fd448152303a2d44848a52a8916a0}{m\_height}}[i] = \mbox{\hyperlink{classCPGFImage_a170fd448152303a2d44848a52a8916a0}{m\_height}}[0];}
\DoxyCodeLine{186                 \}}
\DoxyCodeLine{187         \}}
\DoxyCodeLine{188 }
\DoxyCodeLine{189         \textcolor{keywordflow}{if} (\mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a963890fa1e02a517923f9d0bf0d7e9eb}{nLevels}} > 0) \{}
\DoxyCodeLine{190                 \textcolor{comment}{// init wavelet subbands}}
\DoxyCodeLine{191                 \textcolor{keywordflow}{for} (\textcolor{keywordtype}{int} i=0; i < \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_abda7a5f282421cd7e789da62f657efa0}{channels}}; i++) \{}
\DoxyCodeLine{192                         \mbox{\hyperlink{classCPGFImage_ae3901a689b7d1dd46d48b042c3d31d5c}{m\_wtChannel}}[i] = \textcolor{keyword}{new} \mbox{\hyperlink{classCSubband_a30d2cc4fc1b1060bf29a6576d926a615}{CWaveletTransform}}(\mbox{\hyperlink{classCPGFImage_ab6d97aca28795fae697fdda4b8acd8f9}{m\_width}}[i], \mbox{\hyperlink{classCPGFImage_a170fd448152303a2d44848a52a8916a0}{m\_height}}[i], \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a963890fa1e02a517923f9d0bf0d7e9eb}{nLevels}});}
\DoxyCodeLine{193                 \}}
\DoxyCodeLine{194 }
\DoxyCodeLine{195                 \textcolor{comment}{// used in Read when PM\_Absolute}}
\DoxyCodeLine{196                 \mbox{\hyperlink{classCPGFImage_adc2499451b8f96483a892e53fe5849b1}{m\_percent}} = pow(0.25, \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a963890fa1e02a517923f9d0bf0d7e9eb}{nLevels}});}
\DoxyCodeLine{197 }
\DoxyCodeLine{198         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{199                 \textcolor{comment}{// very small image: we don't use DWT and encoding}}
\DoxyCodeLine{200 }
\DoxyCodeLine{201                 \textcolor{comment}{// read channels}}
\DoxyCodeLine{202                 \textcolor{keywordflow}{for} (\textcolor{keywordtype}{int} c=0; c < \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_abda7a5f282421cd7e789da62f657efa0}{channels}}; c++) \{}
\DoxyCodeLine{203                         \textcolor{keyword}{const} UINT32 size = \mbox{\hyperlink{classCPGFImage_ab6d97aca28795fae697fdda4b8acd8f9}{m\_width}}[c]*\mbox{\hyperlink{classCPGFImage_a170fd448152303a2d44848a52a8916a0}{m\_height}}[c];}
\DoxyCodeLine{204                         \mbox{\hyperlink{classCPGFImage_a36f7f20b38a9cb3a9c88032f5f886345}{m\_channel}}[c] = \textcolor{keyword}{new}(std::nothrow) \mbox{\hyperlink{PGFtypes_8h_acb1ee3f52ccfad782dcaa0abd79e5d05}{DataT}}[size];}
\DoxyCodeLine{205                         \textcolor{keywordflow}{if} (!\mbox{\hyperlink{classCPGFImage_a36f7f20b38a9cb3a9c88032f5f886345}{m\_channel}}[c]) ReturnWithError(InsufficientMemory);}
\DoxyCodeLine{206 }
\DoxyCodeLine{207                         \textcolor{comment}{// read channel data from stream}}
\DoxyCodeLine{208                         \textcolor{keywordflow}{for} (UINT32 i=0; i < size; i++) \{}
\DoxyCodeLine{209                                 \textcolor{keywordtype}{int} count = \mbox{\hyperlink{PGFtypes_8h_adbb49c2b6ab931f68f08a8dc1141727d}{DataTSize}};}
\DoxyCodeLine{210                                 stream->\mbox{\hyperlink{classCPGFStream_afdc81fe9b4d2d962b8112e50eace95a2}{Read}}(\&count, \&\mbox{\hyperlink{classCPGFImage_a36f7f20b38a9cb3a9c88032f5f886345}{m\_channel}}[c][i]);}
\DoxyCodeLine{211                                 \textcolor{keywordflow}{if} (count != \mbox{\hyperlink{PGFtypes_8h_adbb49c2b6ab931f68f08a8dc1141727d}{DataTSize}}) ReturnWithError(MissingData);}
\DoxyCodeLine{212                         \}}
\DoxyCodeLine{213                 \}}
\DoxyCodeLine{214         \}}
\DoxyCodeLine{215 \}}

\end{DoxyCode}
\mbox{\Hypertarget{classCPGFImage_a6d8ca06237591aae49d7f25278067c63}\label{classCPGFImage_a6d8ca06237591aae49d7f25278067c63}} 
\index{CPGFImage@{CPGFImage}!Quality@{Quality}}
\index{Quality@{Quality}!CPGFImage@{CPGFImage}}
\subsubsection{\texorpdfstring{Quality()}{Quality()}}
{\footnotesize\ttfamily B\+Y\+TE C\+P\+G\+F\+Image\+::\+Quality (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}

Return the P\+GF quality. The quality is inbetween 0 and Max\+Quality. P\+GF quality 0 means lossless quality. \begin{DoxyReturn}{Returns}
P\+GF quality 
\end{DoxyReturn}


Definition at line 442 of file P\+G\+Fimage.\+h.


\begin{DoxyCode}{0}
\DoxyCodeLine{442 \{ \textcolor{keywordflow}{return} \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_ac314a16d5984aea88f4a5ff38f49c08b}{quality}}; \}}

\end{DoxyCode}
\mbox{\Hypertarget{classCPGFImage_a4a1d49cdf9da6934381bb25332d85ccf}\label{classCPGFImage_a4a1d49cdf9da6934381bb25332d85ccf}} 
\index{CPGFImage@{CPGFImage}!Read@{Read}}
\index{Read@{Read}!CPGFImage@{CPGFImage}}
\subsubsection{\texorpdfstring{Read()}{Read()}\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily void C\+P\+G\+F\+Image\+::\+Read (\begin{DoxyParamCaption}\item[{int}]{level = {\ttfamily 0},  }\item[{Callback\+Ptr}]{cb = {\ttfamily nullptr},  }\item[{void $\ast$}]{data = {\ttfamily nullptr} }\end{DoxyParamCaption})}

Read and decode some levels of a P\+GF image at current stream position. A P\+GF image is structered in levels, numbered between 0 and \mbox{\hyperlink{classCPGFImage_ab3678d05c031dc4cbf5451e7f4f6bdf3}{Levels()}} -\/ 1. Each level can be seen as a single image, containing the same content as all other levels, but in a different size (width, height). The image size at level i is double the size (width, height) of the image at level i+1. The image at level 0 contains the original size. Precondition\+: The P\+GF image has been opened with a call of Open(...). It might throw an \mbox{\hyperlink{structIOException}{I\+O\+Exception}}. 
\begin{DoxyParams}{Parameters}
{\em level} & \mbox{[}0, n\+Levels) The image level of the resulting image in the internal image buffer. \\
\hline
{\em cb} & A pointer to a callback procedure. The procedure is called after reading a single level. If cb returns true, then it stops proceeding. \\
\hline
{\em data} & Data Pointer to C++ class container to host callback procedure. \\
\hline
\end{DoxyParams}


Definition at line 402 of file P\+G\+Fimage.\+cpp.


\begin{DoxyCode}{0}
\DoxyCodeLine{402                                                                 \{}
\DoxyCodeLine{403         ASSERT((level >= 0 \&\& level < \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a963890fa1e02a517923f9d0bf0d7e9eb}{nLevels}}) || \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a963890fa1e02a517923f9d0bf0d7e9eb}{nLevels}} == 0); \textcolor{comment}{// m\_header.nLevels == 0: image didn't use wavelet transform}}
\DoxyCodeLine{404         ASSERT(\mbox{\hyperlink{classCPGFImage_a1058b29a3d046e171a2fe48168b66d38}{m\_decoder}});}
\DoxyCodeLine{405 }
\DoxyCodeLine{406 \textcolor{preprocessor}{\#ifdef \_\_PGFROISUPPORT\_\_}}
\DoxyCodeLine{407         \textcolor{keywordflow}{if} (\mbox{\hyperlink{classCPGFImage_a9db775cf3a36997b55106fbab7284c14}{ROIisSupported}}() \&\& \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a963890fa1e02a517923f9d0bf0d7e9eb}{nLevels}} > 0) \{}
\DoxyCodeLine{408                 \textcolor{comment}{// new encoding scheme supporting ROI}}
\DoxyCodeLine{409                 \mbox{\hyperlink{structPGFRect}{PGFRect}} rect(0, 0, \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a766a68c3284c2ae6d2f54c82e7350ed9}{width}}, \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a7262335e99ca409759e1aa8c0f0164b1}{height}});}
\DoxyCodeLine{410                 \mbox{\hyperlink{classCPGFImage_a4a1d49cdf9da6934381bb25332d85ccf}{Read}}(rect, level, cb, data);}
\DoxyCodeLine{411                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{412         \}}
\DoxyCodeLine{413 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{414 }
\DoxyCodeLine{415         \textcolor{keywordflow}{if} (\mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a963890fa1e02a517923f9d0bf0d7e9eb}{nLevels}} == 0) \{}
\DoxyCodeLine{416                 \textcolor{keywordflow}{if} (level == 0) \{}
\DoxyCodeLine{417                         \textcolor{comment}{// the data has already been read during open}}
\DoxyCodeLine{418                         \textcolor{comment}{// now update progress}}
\DoxyCodeLine{419                         \textcolor{keywordflow}{if} (cb) \{}
\DoxyCodeLine{420                                 \textcolor{keywordflow}{if} ((*cb)(1.0, \textcolor{keyword}{true}, data)) ReturnWithError(EscapePressed);}
\DoxyCodeLine{421                         \}}
\DoxyCodeLine{422                 \}}
\DoxyCodeLine{423         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{424                 \textcolor{keyword}{const} \textcolor{keywordtype}{int} levelDiff = \mbox{\hyperlink{classCPGFImage_a2790b468b6d4841cd34473c4b61d0c7f}{m\_currentLevel}} - level;}
\DoxyCodeLine{425                 \textcolor{keywordtype}{double} percent = (\mbox{\hyperlink{classCPGFImage_a8b4d6d5ef343f0f428b35c9bf1020569}{m\_progressMode}} == \mbox{\hyperlink{PGFtypes_8h_a04561479f4f8aa5a0775d8b541a1157ea441b3bb041d0f7715659f45d8b766983}{PM\_Relative}}) ? pow(0.25, levelDiff) : \mbox{\hyperlink{classCPGFImage_adc2499451b8f96483a892e53fe5849b1}{m\_percent}};}
\DoxyCodeLine{426 }
\DoxyCodeLine{427                 \textcolor{comment}{// encoding scheme without ROI}}
\DoxyCodeLine{428                 \textcolor{keywordflow}{while} (\mbox{\hyperlink{classCPGFImage_a2790b468b6d4841cd34473c4b61d0c7f}{m\_currentLevel}} > level) \{}
\DoxyCodeLine{429                         \textcolor{keywordflow}{for} (\textcolor{keywordtype}{int} i=0; i < \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_abda7a5f282421cd7e789da62f657efa0}{channels}}; i++) \{}
\DoxyCodeLine{430                                 \mbox{\hyperlink{classCWaveletTransform}{CWaveletTransform}}* wtChannel = \mbox{\hyperlink{classCPGFImage_ae3901a689b7d1dd46d48b042c3d31d5c}{m\_wtChannel}}[i];}
\DoxyCodeLine{431                                 ASSERT(wtChannel);}
\DoxyCodeLine{432 }
\DoxyCodeLine{433                                 \textcolor{comment}{// decode file and write stream to m\_wtChannel}}
\DoxyCodeLine{434                                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{classCPGFImage_a2790b468b6d4841cd34473c4b61d0c7f}{m\_currentLevel}} == \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a963890fa1e02a517923f9d0bf0d7e9eb}{nLevels}}) \{ }
\DoxyCodeLine{435                                         \textcolor{comment}{// last level also has LL band}}
\DoxyCodeLine{436                                         wtChannel->\mbox{\hyperlink{classCWaveletTransform_a347b59b1d7bc18de9294c714afac7ddf}{GetSubband}}(\mbox{\hyperlink{classCPGFImage_a2790b468b6d4841cd34473c4b61d0c7f}{m\_currentLevel}}, \mbox{\hyperlink{PGFtypes_8h_a871118a09520247c78a71ecd7b0abd58a11ea57bac296f79f8acbaf6fdf6bcc20}{LL}})->\mbox{\hyperlink{classCSubband_af109a0516ded3bea57348a0f4318c2fb}{PlaceTile}}(*\mbox{\hyperlink{classCPGFImage_a1058b29a3d046e171a2fe48168b66d38}{m\_decoder}}, \mbox{\hyperlink{classCPGFImage_a57cc024db6e510f95f3238f448a0fed5}{m\_quant}});}
\DoxyCodeLine{437                                 \}}
\DoxyCodeLine{438                                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{classCPGFImage_ad5ed0ec587742ebf46f72be4abde305d}{m\_preHeader}}.\mbox{\hyperlink{structPGFMagicVersion_aa7ff5e50537cac9dd4c62d4c8982d09d}{version}} \& \mbox{\hyperlink{PGFtypes_8h_a99612b00f7a591c93702520453567913}{Version5}}) \{}
\DoxyCodeLine{439                                         \textcolor{comment}{// since version 5}}
\DoxyCodeLine{440                                         wtChannel->\mbox{\hyperlink{classCWaveletTransform_a347b59b1d7bc18de9294c714afac7ddf}{GetSubband}}(\mbox{\hyperlink{classCPGFImage_a2790b468b6d4841cd34473c4b61d0c7f}{m\_currentLevel}}, \mbox{\hyperlink{PGFtypes_8h_a871118a09520247c78a71ecd7b0abd58aad18f3a107c5bc020bff8923ad43bbc1}{HL}})->\mbox{\hyperlink{classCSubband_af109a0516ded3bea57348a0f4318c2fb}{PlaceTile}}(*\mbox{\hyperlink{classCPGFImage_a1058b29a3d046e171a2fe48168b66d38}{m\_decoder}}, \mbox{\hyperlink{classCPGFImage_a57cc024db6e510f95f3238f448a0fed5}{m\_quant}});}
\DoxyCodeLine{441                                         wtChannel->\mbox{\hyperlink{classCWaveletTransform_a347b59b1d7bc18de9294c714afac7ddf}{GetSubband}}(\mbox{\hyperlink{classCPGFImage_a2790b468b6d4841cd34473c4b61d0c7f}{m\_currentLevel}}, \mbox{\hyperlink{PGFtypes_8h_a871118a09520247c78a71ecd7b0abd58aadab8e0111f669b137544a4ecce92997}{LH}})->\mbox{\hyperlink{classCSubband_af109a0516ded3bea57348a0f4318c2fb}{PlaceTile}}(*\mbox{\hyperlink{classCPGFImage_a1058b29a3d046e171a2fe48168b66d38}{m\_decoder}}, \mbox{\hyperlink{classCPGFImage_a57cc024db6e510f95f3238f448a0fed5}{m\_quant}});}
\DoxyCodeLine{442                                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{443                                         \textcolor{comment}{// until version 4}}
\DoxyCodeLine{444                                         \mbox{\hyperlink{classCPGFImage_a1058b29a3d046e171a2fe48168b66d38}{m\_decoder}}->\mbox{\hyperlink{classCDecoder_a7112215e28ac56d75bdf4a5786f57a34}{DecodeInterleaved}}(wtChannel, \mbox{\hyperlink{classCPGFImage_a2790b468b6d4841cd34473c4b61d0c7f}{m\_currentLevel}}, \mbox{\hyperlink{classCPGFImage_a57cc024db6e510f95f3238f448a0fed5}{m\_quant}});}
\DoxyCodeLine{445                                 \}}
\DoxyCodeLine{446                                 wtChannel->\mbox{\hyperlink{classCWaveletTransform_a347b59b1d7bc18de9294c714afac7ddf}{GetSubband}}(\mbox{\hyperlink{classCPGFImage_a2790b468b6d4841cd34473c4b61d0c7f}{m\_currentLevel}}, \mbox{\hyperlink{PGFtypes_8h_a871118a09520247c78a71ecd7b0abd58adb4fbeed3fdce116b66baef714de6667}{HH}})->\mbox{\hyperlink{classCSubband_af109a0516ded3bea57348a0f4318c2fb}{PlaceTile}}(*\mbox{\hyperlink{classCPGFImage_a1058b29a3d046e171a2fe48168b66d38}{m\_decoder}}, \mbox{\hyperlink{classCPGFImage_a57cc024db6e510f95f3238f448a0fed5}{m\_quant}});}
\DoxyCodeLine{447                         \}}
\DoxyCodeLine{448 }
\DoxyCodeLine{449                         \textcolor{keyword}{volatile} OSError error = NoError; \textcolor{comment}{// volatile prevents optimizations}}
\DoxyCodeLine{450 \textcolor{preprocessor}{\#ifdef LIBPGF\_USE\_OPENMP}}
\DoxyCodeLine{451 \textcolor{preprocessor}{                        \#pragma omp parallel for default(shared) }}
\DoxyCodeLine{452 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{453                         \textcolor{keywordflow}{for} (\textcolor{keywordtype}{int} i=0; i < \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_abda7a5f282421cd7e789da62f657efa0}{channels}}; i++) \{}
\DoxyCodeLine{454                                 \textcolor{comment}{// inverse transform from m\_wtChannel to m\_channel}}
\DoxyCodeLine{455                                 \textcolor{keywordflow}{if} (error == NoError) \{}
\DoxyCodeLine{456                                         OSError err = \mbox{\hyperlink{classCPGFImage_ae3901a689b7d1dd46d48b042c3d31d5c}{m\_wtChannel}}[i]->\mbox{\hyperlink{classCWaveletTransform_a26a70797c2a0db893876b75d131f420c}{InverseTransform}}(\mbox{\hyperlink{classCPGFImage_a2790b468b6d4841cd34473c4b61d0c7f}{m\_currentLevel}}, \&\mbox{\hyperlink{classCPGFImage_ab6d97aca28795fae697fdda4b8acd8f9}{m\_width}}[i], \&\mbox{\hyperlink{classCPGFImage_a170fd448152303a2d44848a52a8916a0}{m\_height}}[i], \&\mbox{\hyperlink{classCPGFImage_a36f7f20b38a9cb3a9c88032f5f886345}{m\_channel}}[i]);      }
\DoxyCodeLine{457                                         \textcolor{keywordflow}{if} (err != NoError) error = err;}
\DoxyCodeLine{458                                 \}}
\DoxyCodeLine{459                                 ASSERT(\mbox{\hyperlink{classCPGFImage_a36f7f20b38a9cb3a9c88032f5f886345}{m\_channel}}[i]);}
\DoxyCodeLine{460                         \}}
\DoxyCodeLine{461                         \textcolor{keywordflow}{if} (error != NoError) ReturnWithError(error);}
\DoxyCodeLine{462 }
\DoxyCodeLine{463                         \textcolor{comment}{// set new level: must be done before refresh callback}}
\DoxyCodeLine{464                         \mbox{\hyperlink{classCPGFImage_a2790b468b6d4841cd34473c4b61d0c7f}{m\_currentLevel}}--;}
\DoxyCodeLine{465 }
\DoxyCodeLine{466                         \textcolor{comment}{// now we have to refresh the display}}
\DoxyCodeLine{467                         \textcolor{keywordflow}{if} (\mbox{\hyperlink{classCPGFImage_ac262a389df92493dfca63b2f1f06fe78}{m\_cb}}) \mbox{\hyperlink{classCPGFImage_ac262a389df92493dfca63b2f1f06fe78}{m\_cb}}(\mbox{\hyperlink{classCPGFImage_a45861a83c95188610063233149187f3c}{m\_cbArg}});}
\DoxyCodeLine{468 }
\DoxyCodeLine{469                         \textcolor{comment}{// now update progress}}
\DoxyCodeLine{470                         \textcolor{keywordflow}{if} (cb) \{}
\DoxyCodeLine{471                                 percent *= 4;}
\DoxyCodeLine{472                                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{classCPGFImage_a8b4d6d5ef343f0f428b35c9bf1020569}{m\_progressMode}} == \mbox{\hyperlink{PGFtypes_8h_a04561479f4f8aa5a0775d8b541a1157ea5c4b3258347f3f6ce4dbfb52ccd70e02}{PM\_Absolute}}) \mbox{\hyperlink{classCPGFImage_adc2499451b8f96483a892e53fe5849b1}{m\_percent}} = percent;}
\DoxyCodeLine{473                                 \textcolor{keywordflow}{if} ((*cb)(percent, \textcolor{keyword}{true}, data)) ReturnWithError(EscapePressed);}
\DoxyCodeLine{474                         \}}
\DoxyCodeLine{475                 \}}
\DoxyCodeLine{476         \}}
\DoxyCodeLine{477 \}}

\end{DoxyCode}
\mbox{\Hypertarget{classCPGFImage_ad25f535f946f5a711576d6b28774cbb9}\label{classCPGFImage_ad25f535f946f5a711576d6b28774cbb9}} 
\index{CPGFImage@{CPGFImage}!Read@{Read}}
\index{Read@{Read}!CPGFImage@{CPGFImage}}
\subsubsection{\texorpdfstring{Read()}{Read()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily void C\+P\+G\+F\+Image\+::\+Read (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{structPGFRect}{P\+G\+F\+Rect}} \&}]{rect,  }\item[{int}]{level = {\ttfamily 0},  }\item[{Callback\+Ptr}]{cb = {\ttfamily nullptr},  }\item[{void $\ast$}]{data = {\ttfamily nullptr} }\end{DoxyParamCaption})}

Read a rectangular region of interest of a P\+GF image at current stream position. The origin of the coordinate axis is the top-\/left corner of the image. All coordinates are measured in pixels. It might throw an \mbox{\hyperlink{structIOException}{I\+O\+Exception}}. 
\begin{DoxyParams}{Parameters}
{\em rect} & \mbox{[}inout\mbox{]} Rectangular region of interest (R\+OI) at level 0. The rect might be cropped. \\
\hline
{\em level} & \mbox{[}0, n\+Levels) The image level of the resulting image in the internal image buffer. \\
\hline
{\em cb} & A pointer to a callback procedure. The procedure is called after reading a single level. If cb returns true, then it stops proceeding. \\
\hline
{\em data} & Data Pointer to C++ class container to host callback procedure. \\
\hline
\end{DoxyParams}
\mbox{\Hypertarget{classCPGFImage_a570d1d1072cdd3e24b838c066abc8da3}\label{classCPGFImage_a570d1d1072cdd3e24b838c066abc8da3}} 
\index{CPGFImage@{CPGFImage}!ReadEncodedData@{ReadEncodedData}}
\index{ReadEncodedData@{ReadEncodedData}!CPGFImage@{CPGFImage}}
\subsubsection{\texorpdfstring{ReadEncodedData()}{ReadEncodedData()}}
{\footnotesize\ttfamily U\+I\+N\+T32 C\+P\+G\+F\+Image\+::\+Read\+Encoded\+Data (\begin{DoxyParamCaption}\item[{int}]{level,  }\item[{U\+I\+N\+T8 $\ast$}]{target,  }\item[{U\+I\+N\+T32}]{target\+Len }\end{DoxyParamCaption}) const}

Reads the data of an encoded P\+GF level and copies it to a target buffer without decoding. Precondition\+: The P\+GF image has been opened with a call of Open(...). It might throw an \mbox{\hyperlink{structIOException}{I\+O\+Exception}}. 
\begin{DoxyParams}{Parameters}
{\em level} & The image level \\
\hline
{\em target} & The target buffer \\
\hline
{\em target\+Len} & The length of the target buffer in bytes \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The number of bytes copied to the target buffer 
\end{DoxyReturn}


Definition at line 706 of file P\+G\+Fimage.\+cpp.


\begin{DoxyCode}{0}
\DoxyCodeLine{706                                                                                   \{}
\DoxyCodeLine{707         ASSERT(level >= 0 \&\& level < \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a963890fa1e02a517923f9d0bf0d7e9eb}{nLevels}});}
\DoxyCodeLine{708         ASSERT(target);}
\DoxyCodeLine{709         ASSERT(targetLen > 0);}
\DoxyCodeLine{710         ASSERT(\mbox{\hyperlink{classCPGFImage_a1058b29a3d046e171a2fe48168b66d38}{m\_decoder}});}
\DoxyCodeLine{711 }
\DoxyCodeLine{712         \textcolor{comment}{// reset stream position}}
\DoxyCodeLine{713         \mbox{\hyperlink{classCPGFImage_a1058b29a3d046e171a2fe48168b66d38}{m\_decoder}}->\mbox{\hyperlink{classCDecoder_ae6d16df70a317f3dc805894cf6101fe2}{SetStreamPosToData}}();}
\DoxyCodeLine{714 }
\DoxyCodeLine{715         \textcolor{comment}{// position stream}}
\DoxyCodeLine{716         UINT64 offset = 0;}
\DoxyCodeLine{717 }
\DoxyCodeLine{718         \textcolor{keywordflow}{for} (\textcolor{keywordtype}{int} i=\mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a963890fa1e02a517923f9d0bf0d7e9eb}{nLevels}} - 1; i > level; i--) \{}
\DoxyCodeLine{719                 offset += \mbox{\hyperlink{classCPGFImage_a1635ef5dca13bd07276d112a72316a73}{m\_levelLength}}[\mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a963890fa1e02a517923f9d0bf0d7e9eb}{nLevels}} - 1 - i];}
\DoxyCodeLine{720         \}}
\DoxyCodeLine{721         \mbox{\hyperlink{classCPGFImage_a1058b29a3d046e171a2fe48168b66d38}{m\_decoder}}->\mbox{\hyperlink{classCDecoder_acc125e94ea5c6af11a91ac1c4a43cf8f}{Skip}}(offset);}
\DoxyCodeLine{722 }
\DoxyCodeLine{723         \textcolor{comment}{// compute number of bytes to read}}
\DoxyCodeLine{724         UINT32 len = \mbox{\hyperlink{PGFplatform_8h_ad6d0138bf7e2cdaabeedc3fea40767ad}{\_\_min}}(targetLen, \mbox{\hyperlink{classCPGFImage_a9d39b7f0067bf5b35b0cd7cbba9a1d4f}{GetEncodedLevelLength}}(level));}
\DoxyCodeLine{725 }
\DoxyCodeLine{726         \textcolor{comment}{// read data}}
\DoxyCodeLine{727         len = \mbox{\hyperlink{classCPGFImage_a1058b29a3d046e171a2fe48168b66d38}{m\_decoder}}->\mbox{\hyperlink{classCDecoder_a4146a0adddfe52ca79de8b0be58e8482}{ReadEncodedData}}(target, len);}
\DoxyCodeLine{728         ASSERT(len >= 0 \&\& len <= targetLen);}
\DoxyCodeLine{729 }
\DoxyCodeLine{730         \textcolor{keywordflow}{return} len;}
\DoxyCodeLine{731 \}}

\end{DoxyCode}
\mbox{\Hypertarget{classCPGFImage_a55a27e09a6bcd1bca6d57335956dc76c}\label{classCPGFImage_a55a27e09a6bcd1bca6d57335956dc76c}} 
\index{CPGFImage@{CPGFImage}!ReadEncodedHeader@{ReadEncodedHeader}}
\index{ReadEncodedHeader@{ReadEncodedHeader}!CPGFImage@{CPGFImage}}
\subsubsection{\texorpdfstring{ReadEncodedHeader()}{ReadEncodedHeader()}}
{\footnotesize\ttfamily U\+I\+N\+T32 C\+P\+G\+F\+Image\+::\+Read\+Encoded\+Header (\begin{DoxyParamCaption}\item[{U\+I\+N\+T8 $\ast$}]{target,  }\item[{U\+I\+N\+T32}]{target\+Len }\end{DoxyParamCaption}) const}

Reads the encoded P\+GF header and copies it to a target buffer. Precondition\+: The P\+GF image has been opened with a call of Open(...). It might throw an \mbox{\hyperlink{structIOException}{I\+O\+Exception}}. 
\begin{DoxyParams}{Parameters}
{\em target} & The target buffer \\
\hline
{\em target\+Len} & The length of the target buffer in bytes \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The number of bytes copied to the target buffer 
\end{DoxyReturn}


Definition at line 660 of file P\+G\+Fimage.\+cpp.


\begin{DoxyCode}{0}
\DoxyCodeLine{660                                                                          \{}
\DoxyCodeLine{661         ASSERT(target);}
\DoxyCodeLine{662         ASSERT(targetLen > 0);}
\DoxyCodeLine{663         ASSERT(\mbox{\hyperlink{classCPGFImage_a1058b29a3d046e171a2fe48168b66d38}{m\_decoder}});}
\DoxyCodeLine{664 }
\DoxyCodeLine{665         \textcolor{comment}{// reset stream position}}
\DoxyCodeLine{666         \mbox{\hyperlink{classCPGFImage_a1058b29a3d046e171a2fe48168b66d38}{m\_decoder}}->\mbox{\hyperlink{classCDecoder_ab043bb3599b2301bebd22527258ac4cf}{SetStreamPosToStart}}();}
\DoxyCodeLine{667 }
\DoxyCodeLine{668         \textcolor{comment}{// compute number of bytes to read}}
\DoxyCodeLine{669         UINT32 len = \mbox{\hyperlink{PGFplatform_8h_ad6d0138bf7e2cdaabeedc3fea40767ad}{\_\_min}}(targetLen, \mbox{\hyperlink{classCPGFImage_acf90fa7c083fba0479ce70200cccf716}{GetEncodedHeaderLength}}());}
\DoxyCodeLine{670 }
\DoxyCodeLine{671         \textcolor{comment}{// read data}}
\DoxyCodeLine{672         len = \mbox{\hyperlink{classCPGFImage_a1058b29a3d046e171a2fe48168b66d38}{m\_decoder}}->\mbox{\hyperlink{classCDecoder_a4146a0adddfe52ca79de8b0be58e8482}{ReadEncodedData}}(target, len);}
\DoxyCodeLine{673         ASSERT(len >= 0 \&\& len <= targetLen);}
\DoxyCodeLine{674 }
\DoxyCodeLine{675         \textcolor{keywordflow}{return} len;}
\DoxyCodeLine{676 \}}

\end{DoxyCode}
\mbox{\Hypertarget{classCPGFImage_a126846c7265783e14da0f4dde6c9346b}\label{classCPGFImage_a126846c7265783e14da0f4dde6c9346b}} 
\index{CPGFImage@{CPGFImage}!ReadPreview@{ReadPreview}}
\index{ReadPreview@{ReadPreview}!CPGFImage@{CPGFImage}}
\subsubsection{\texorpdfstring{ReadPreview()}{ReadPreview()}}
{\footnotesize\ttfamily void C\+P\+G\+F\+Image\+::\+Read\+Preview (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}

Read and decode smallest level of a P\+GF image at current stream position. For details, please refert to Read(...) Precondition\+: The P\+GF image has been opened with a call of Open(...). It might throw an \mbox{\hyperlink{structIOException}{I\+O\+Exception}}. 

Definition at line 111 of file P\+G\+Fimage.\+h.


\begin{DoxyCode}{0}
\DoxyCodeLine{111 \{ \mbox{\hyperlink{classCPGFImage_a4a1d49cdf9da6934381bb25332d85ccf}{Read}}(\mbox{\hyperlink{classCPGFImage_ab3678d05c031dc4cbf5451e7f4f6bdf3}{Levels}}() - 1); \}}

\end{DoxyCode}
\mbox{\Hypertarget{classCPGFImage_abf906b469e11800e819db00009255b90}\label{classCPGFImage_abf906b469e11800e819db00009255b90}} 
\index{CPGFImage@{CPGFImage}!Reconstruct@{Reconstruct}}
\index{Reconstruct@{Reconstruct}!CPGFImage@{CPGFImage}}
\subsubsection{\texorpdfstring{Reconstruct()}{Reconstruct()}}
{\footnotesize\ttfamily void C\+P\+G\+F\+Image\+::\+Reconstruct (\begin{DoxyParamCaption}\item[{int}]{level = {\ttfamily 0} }\end{DoxyParamCaption})}

After you\textquotesingle{}ve written a P\+GF image, you can call this method followed by Get\+Bitmap/\+Get\+Y\+UV to get a quick reconstruction (coded -\/$>$ decoded image). It might throw an \mbox{\hyperlink{structIOException}{I\+O\+Exception}}. 
\begin{DoxyParams}{Parameters}
{\em level} & The image level of the resulting image in the internal image buffer. \\
\hline
\end{DoxyParams}


Definition at line 348 of file P\+G\+Fimage.\+cpp.


\begin{DoxyCode}{0}
\DoxyCodeLine{348                                        \{}
\DoxyCodeLine{349         \textcolor{keywordflow}{if} (\mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a963890fa1e02a517923f9d0bf0d7e9eb}{nLevels}} == 0) \{}
\DoxyCodeLine{350                 \textcolor{comment}{// image didn't use wavelet transform}}
\DoxyCodeLine{351                 \textcolor{keywordflow}{if} (level == 0) \{}
\DoxyCodeLine{352                         \textcolor{keywordflow}{for} (\textcolor{keywordtype}{int} i=0; i < \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_abda7a5f282421cd7e789da62f657efa0}{channels}}; i++) \{}
\DoxyCodeLine{353                                 ASSERT(\mbox{\hyperlink{classCPGFImage_ae3901a689b7d1dd46d48b042c3d31d5c}{m\_wtChannel}}[i]);}
\DoxyCodeLine{354                                 \mbox{\hyperlink{classCPGFImage_a36f7f20b38a9cb3a9c88032f5f886345}{m\_channel}}[i] = \mbox{\hyperlink{classCPGFImage_ae3901a689b7d1dd46d48b042c3d31d5c}{m\_wtChannel}}[i]->\mbox{\hyperlink{classCWaveletTransform_a347b59b1d7bc18de9294c714afac7ddf}{GetSubband}}(0, \mbox{\hyperlink{PGFtypes_8h_a871118a09520247c78a71ecd7b0abd58a11ea57bac296f79f8acbaf6fdf6bcc20}{LL}})->\mbox{\hyperlink{classCSubband_aa4a60fd0c2e3ad2742bca6b8e819d5c5}{GetBuffer}}();}
\DoxyCodeLine{355                         \}}
\DoxyCodeLine{356                 \}}
\DoxyCodeLine{357         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{358                 \textcolor{keywordtype}{int} currentLevel = \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a963890fa1e02a517923f9d0bf0d7e9eb}{nLevels}};}
\DoxyCodeLine{359 }
\DoxyCodeLine{360 \textcolor{preprocessor}{        \#ifdef \_\_PGFROISUPPORT\_\_}}
\DoxyCodeLine{361                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{classCPGFImage_a9db775cf3a36997b55106fbab7284c14}{ROIisSupported}}()) \{}
\DoxyCodeLine{362                         \textcolor{comment}{// enable ROI reading}}
\DoxyCodeLine{363                         \mbox{\hyperlink{classCPGFImage_a83c737ee649fdc92c55b7a6ffe1153b2}{SetROI}}(\mbox{\hyperlink{structPGFRect}{PGFRect}}(0, 0, \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a766a68c3284c2ae6d2f54c82e7350ed9}{width}}, \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a7262335e99ca409759e1aa8c0f0164b1}{height}}));}
\DoxyCodeLine{364                 \}}
\DoxyCodeLine{365 \textcolor{preprocessor}{        \#endif}}
\DoxyCodeLine{366 }
\DoxyCodeLine{367                 \textcolor{keywordflow}{while} (currentLevel > level) \{}
\DoxyCodeLine{368                         \textcolor{keywordflow}{for} (\textcolor{keywordtype}{int} i=0; i < \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_abda7a5f282421cd7e789da62f657efa0}{channels}}; i++) \{}
\DoxyCodeLine{369                                 ASSERT(\mbox{\hyperlink{classCPGFImage_ae3901a689b7d1dd46d48b042c3d31d5c}{m\_wtChannel}}[i]);}
\DoxyCodeLine{370                                 \textcolor{comment}{// dequantize subbands}}
\DoxyCodeLine{371                                 \textcolor{keywordflow}{if} (currentLevel == \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a963890fa1e02a517923f9d0bf0d7e9eb}{nLevels}}) \{ }
\DoxyCodeLine{372                                         \textcolor{comment}{// last level also has LL band}}
\DoxyCodeLine{373                                         \mbox{\hyperlink{classCPGFImage_ae3901a689b7d1dd46d48b042c3d31d5c}{m\_wtChannel}}[i]->\mbox{\hyperlink{classCWaveletTransform_a347b59b1d7bc18de9294c714afac7ddf}{GetSubband}}(currentLevel, \mbox{\hyperlink{PGFtypes_8h_a871118a09520247c78a71ecd7b0abd58a11ea57bac296f79f8acbaf6fdf6bcc20}{LL}})->\mbox{\hyperlink{classCSubband_a45102bab9eee9b4e2beeea105712f292}{Dequantize}}(\mbox{\hyperlink{classCPGFImage_a57cc024db6e510f95f3238f448a0fed5}{m\_quant}});}
\DoxyCodeLine{374                                 \}}
\DoxyCodeLine{375                                 \mbox{\hyperlink{classCPGFImage_ae3901a689b7d1dd46d48b042c3d31d5c}{m\_wtChannel}}[i]->\mbox{\hyperlink{classCWaveletTransform_a347b59b1d7bc18de9294c714afac7ddf}{GetSubband}}(currentLevel, \mbox{\hyperlink{PGFtypes_8h_a871118a09520247c78a71ecd7b0abd58aad18f3a107c5bc020bff8923ad43bbc1}{HL}})->\mbox{\hyperlink{classCSubband_a45102bab9eee9b4e2beeea105712f292}{Dequantize}}(\mbox{\hyperlink{classCPGFImage_a57cc024db6e510f95f3238f448a0fed5}{m\_quant}});}
\DoxyCodeLine{376                                 \mbox{\hyperlink{classCPGFImage_ae3901a689b7d1dd46d48b042c3d31d5c}{m\_wtChannel}}[i]->\mbox{\hyperlink{classCWaveletTransform_a347b59b1d7bc18de9294c714afac7ddf}{GetSubband}}(currentLevel, \mbox{\hyperlink{PGFtypes_8h_a871118a09520247c78a71ecd7b0abd58aadab8e0111f669b137544a4ecce92997}{LH}})->\mbox{\hyperlink{classCSubband_a45102bab9eee9b4e2beeea105712f292}{Dequantize}}(\mbox{\hyperlink{classCPGFImage_a57cc024db6e510f95f3238f448a0fed5}{m\_quant}});}
\DoxyCodeLine{377                                 \mbox{\hyperlink{classCPGFImage_ae3901a689b7d1dd46d48b042c3d31d5c}{m\_wtChannel}}[i]->\mbox{\hyperlink{classCWaveletTransform_a347b59b1d7bc18de9294c714afac7ddf}{GetSubband}}(currentLevel, \mbox{\hyperlink{PGFtypes_8h_a871118a09520247c78a71ecd7b0abd58adb4fbeed3fdce116b66baef714de6667}{HH}})->\mbox{\hyperlink{classCSubband_a45102bab9eee9b4e2beeea105712f292}{Dequantize}}(\mbox{\hyperlink{classCPGFImage_a57cc024db6e510f95f3238f448a0fed5}{m\_quant}});}
\DoxyCodeLine{378 }
\DoxyCodeLine{379                                 \textcolor{comment}{// inverse transform from m\_wtChannel to m\_channel}}
\DoxyCodeLine{380                                 OSError err = \mbox{\hyperlink{classCPGFImage_ae3901a689b7d1dd46d48b042c3d31d5c}{m\_wtChannel}}[i]->\mbox{\hyperlink{classCWaveletTransform_a26a70797c2a0db893876b75d131f420c}{InverseTransform}}(currentLevel, \&\mbox{\hyperlink{classCPGFImage_ab6d97aca28795fae697fdda4b8acd8f9}{m\_width}}[i], \&\mbox{\hyperlink{classCPGFImage_a170fd448152303a2d44848a52a8916a0}{m\_height}}[i], \&\mbox{\hyperlink{classCPGFImage_a36f7f20b38a9cb3a9c88032f5f886345}{m\_channel}}[i]);}
\DoxyCodeLine{381                                 \textcolor{keywordflow}{if} (err != NoError) ReturnWithError(err);}
\DoxyCodeLine{382                                 ASSERT(\mbox{\hyperlink{classCPGFImage_a36f7f20b38a9cb3a9c88032f5f886345}{m\_channel}}[i]);}
\DoxyCodeLine{383                         \}}
\DoxyCodeLine{384 }
\DoxyCodeLine{385                         currentLevel--;}
\DoxyCodeLine{386                 \}}
\DoxyCodeLine{387         \}}
\DoxyCodeLine{388 \}}

\end{DoxyCode}
\mbox{\Hypertarget{classCPGFImage_a7df11c06be23e14f83c9aa343f1204d0}\label{classCPGFImage_a7df11c06be23e14f83c9aa343f1204d0}} 
\index{CPGFImage@{CPGFImage}!ResetStreamPos@{ResetStreamPos}}
\index{ResetStreamPos@{ResetStreamPos}!CPGFImage@{CPGFImage}}
\subsubsection{\texorpdfstring{ResetStreamPos()}{ResetStreamPos()}}
{\footnotesize\ttfamily void C\+P\+G\+F\+Image\+::\+Reset\+Stream\+Pos (\begin{DoxyParamCaption}\item[{bool}]{start\+Of\+Data }\end{DoxyParamCaption})}

Reset stream position to start of P\+GF pre-\/header or start of data. Must not be called before \mbox{\hyperlink{classCPGFImage_adbe9092b915a2c5b2361f4db186b991c}{Open()}} or before \mbox{\hyperlink{classCPGFImage_acd13d233dceaeefce3def7d71ebf4f82}{Write()}}. Use this method after \mbox{\hyperlink{classCPGFImage_a4a1d49cdf9da6934381bb25332d85ccf}{Read()}} if you want to read the same image several times, e.\+g. reading different R\+O\+Is. 
\begin{DoxyParams}{Parameters}
{\em start\+Of\+Data} & true\+: you want to read the same image several times. false\+: resets stream position to the initial position \\
\hline
\end{DoxyParams}


Definition at line 682 of file P\+G\+Fimage.\+cpp.


\begin{DoxyCode}{0}
\DoxyCodeLine{682                                                \{}
\DoxyCodeLine{683         \textcolor{keywordflow}{if} (startOfData) \{}
\DoxyCodeLine{684                 ASSERT(\mbox{\hyperlink{classCPGFImage_a1058b29a3d046e171a2fe48168b66d38}{m\_decoder}});}
\DoxyCodeLine{685                 \mbox{\hyperlink{classCPGFImage_a1058b29a3d046e171a2fe48168b66d38}{m\_decoder}}->\mbox{\hyperlink{classCDecoder_ae6d16df70a317f3dc805894cf6101fe2}{SetStreamPosToData}}();}
\DoxyCodeLine{686         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{687                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{classCPGFImage_a1058b29a3d046e171a2fe48168b66d38}{m\_decoder}}) \{}
\DoxyCodeLine{688                         \mbox{\hyperlink{classCPGFImage_a1058b29a3d046e171a2fe48168b66d38}{m\_decoder}}->\mbox{\hyperlink{classCDecoder_ab043bb3599b2301bebd22527258ac4cf}{SetStreamPosToStart}}();}
\DoxyCodeLine{689                 \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (\mbox{\hyperlink{classCPGFImage_a6ef048255812525cd56d7b04df5e6731}{m\_encoder}}) \{}
\DoxyCodeLine{690                         \mbox{\hyperlink{classCPGFImage_a6ef048255812525cd56d7b04df5e6731}{m\_encoder}}->\mbox{\hyperlink{classCEncoder_ae0e408b0d15b7b2ad1f28236e980b00e}{SetStreamPosToStart}}();}
\DoxyCodeLine{691                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{692                         ASSERT(\textcolor{keyword}{false});}
\DoxyCodeLine{693                 \}}
\DoxyCodeLine{694         \}}
\DoxyCodeLine{695 \}}

\end{DoxyCode}
\mbox{\Hypertarget{classCPGFImage_a7a870dea53390ffe1af210069f6b30eb}\label{classCPGFImage_a7a870dea53390ffe1af210069f6b30eb}} 
\index{CPGFImage@{CPGFImage}!RgbToYuv@{RgbToYuv}}
\index{RgbToYuv@{RgbToYuv}!CPGFImage@{CPGFImage}}
\subsubsection{\texorpdfstring{RgbToYuv()}{RgbToYuv()}}
{\footnotesize\ttfamily void C\+P\+G\+F\+Image\+::\+Rgb\+To\+Yuv (\begin{DoxyParamCaption}\item[{int}]{pitch,  }\item[{U\+I\+N\+T8 $\ast$}]{rgb\+Buff,  }\item[{B\+Y\+TE}]{bpp,  }\item[{int}]{channel\+Map\mbox{[}$\,$\mbox{]},  }\item[{Callback\+Ptr}]{cb,  }\item[{void $\ast$}]{data }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



Definition at line 1388 of file P\+G\+Fimage.\+cpp.


\begin{DoxyCode}{0}
\DoxyCodeLine{1388                                                                                                          \{}
\DoxyCodeLine{1389         ASSERT(buff);}
\DoxyCodeLine{1390         UINT32 yPos = 0, cnt = 0;}
\DoxyCodeLine{1391         \textcolor{keywordtype}{double} percent = 0;}
\DoxyCodeLine{1392         \textcolor{keyword}{const} \textcolor{keywordtype}{double} dP = 1.0/\mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a7262335e99ca409759e1aa8c0f0164b1}{height}};}
\DoxyCodeLine{1393         \textcolor{keywordtype}{int} defMap[] = \{ 0, 1, 2, 3, 4, 5, 6, 7 \}; ASSERT(\textcolor{keyword}{sizeof}(defMap)/\textcolor{keyword}{sizeof}(defMap[0]) == \mbox{\hyperlink{PGFtypes_8h_a94219182f88d4dbed1021ed04db75e41}{MaxChannels}});}
\DoxyCodeLine{1394 }
\DoxyCodeLine{1395         \textcolor{keywordflow}{if} (channelMap == \textcolor{keyword}{nullptr}) channelMap = defMap;}
\DoxyCodeLine{1396 }
\DoxyCodeLine{1397         \textcolor{keywordflow}{switch}(\mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a3ddaf075db8ee812ad688d9ed39e0698}{mode}}) \{}
\DoxyCodeLine{1398         \textcolor{keywordflow}{case} \mbox{\hyperlink{PGFplatform_8h_a8905b28d0e3b96cf340ed34957738648}{ImageModeBitmap}}:}
\DoxyCodeLine{1399                 \{}
\DoxyCodeLine{1400                         ASSERT(\mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_abda7a5f282421cd7e789da62f657efa0}{channels}} == 1);}
\DoxyCodeLine{1401                         ASSERT(\mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_aedea199e29cd6c404c82ab97c67e46b4}{bpp}} == 1);}
\DoxyCodeLine{1402                         ASSERT(bpp == 1);}
\DoxyCodeLine{1403                         }
\DoxyCodeLine{1404                         \textcolor{keyword}{const} UINT32 w = \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a766a68c3284c2ae6d2f54c82e7350ed9}{width}};}
\DoxyCodeLine{1405                         \textcolor{keyword}{const} UINT32 w2 = (\mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a766a68c3284c2ae6d2f54c82e7350ed9}{width}} + 7)/8;}
\DoxyCodeLine{1406                         \mbox{\hyperlink{PGFtypes_8h_acb1ee3f52ccfad782dcaa0abd79e5d05}{DataT}}* y = \mbox{\hyperlink{classCPGFImage_a36f7f20b38a9cb3a9c88032f5f886345}{m\_channel}}[0]; ASSERT(y);}
\DoxyCodeLine{1407 }
\DoxyCodeLine{1408                         \textcolor{comment}{// new unpacked version since version 7}}
\DoxyCodeLine{1409                         \textcolor{keywordflow}{for} (UINT32 h = 0; h < \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a7262335e99ca409759e1aa8c0f0164b1}{height}}; h++) \{}
\DoxyCodeLine{1410                                 \textcolor{keywordflow}{if} (cb) \{}
\DoxyCodeLine{1411                                         \textcolor{keywordflow}{if} ((*cb)(percent, \textcolor{keyword}{true}, data)) ReturnWithError(EscapePressed);}
\DoxyCodeLine{1412                                         percent += dP;}
\DoxyCodeLine{1413                                 \}}
\DoxyCodeLine{1414                                 cnt = 0;}
\DoxyCodeLine{1415                                 \textcolor{keywordflow}{for} (UINT32 j = 0; j < w2; j++) \{}
\DoxyCodeLine{1416                                         UINT8 \textcolor{keywordtype}{byte} = buff[j];}
\DoxyCodeLine{1417                                         \textcolor{keywordflow}{for} (\textcolor{keywordtype}{int} k = 0; k < 8; k++) \{}
\DoxyCodeLine{1418                                                 UINT8 bit = (\textcolor{keywordtype}{byte} \& 0x80) >> 7;}
\DoxyCodeLine{1419                                                 \textcolor{keywordflow}{if} (cnt < w) y[yPos++] = bit;}
\DoxyCodeLine{1420                                                 \textcolor{keywordtype}{byte} <<= 1;}
\DoxyCodeLine{1421                                                 cnt++;}
\DoxyCodeLine{1422                                         \}}
\DoxyCodeLine{1423                                 \}}
\DoxyCodeLine{1424                                 buff += pitch;}
\DoxyCodeLine{1425                         \}}
\DoxyCodeLine{1426                         \textcolor{comment}{/* old version: packed values: 8 pixels in 1 byte}}
\DoxyCodeLine{1427 \textcolor{comment}{                        for (UINT32 h = 0; h < m\_header.height; h++) \{}}
\DoxyCodeLine{1428 \textcolor{comment}{                                if (cb) \{}}
\DoxyCodeLine{1429 \textcolor{comment}{                                        if ((*cb)(percent, true, data)) ReturnWithError(EscapePressed);}}
\DoxyCodeLine{1430 \textcolor{comment}{                                        percent += dP;}}
\DoxyCodeLine{1431 \textcolor{comment}{                                \}}}
\DoxyCodeLine{1432 \textcolor{comment}{}}
\DoxyCodeLine{1433 \textcolor{comment}{                                for (UINT32 j = 0; j < w2; j++) \{}}
\DoxyCodeLine{1434 \textcolor{comment}{                                        y[yPos++] = buff[j] - YUVoffset8;}}
\DoxyCodeLine{1435 \textcolor{comment}{                                \}}}
\DoxyCodeLine{1436 \textcolor{comment}{                                // version 5 and 6}}
\DoxyCodeLine{1437 \textcolor{comment}{                                // for (UINT32 j = w2; j < w; j++) \{}}
\DoxyCodeLine{1438 \textcolor{comment}{                                //      y[yPos++] = YUVoffset8;}}
\DoxyCodeLine{1439 \textcolor{comment}{                                //\}}}
\DoxyCodeLine{1440 \textcolor{comment}{                                buff += pitch;}}
\DoxyCodeLine{1441 \textcolor{comment}{                        \}}}
\DoxyCodeLine{1442 \textcolor{comment}{                        */}}
\DoxyCodeLine{1443                 \}}
\DoxyCodeLine{1444                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{1445         \textcolor{keywordflow}{case} \mbox{\hyperlink{PGFplatform_8h_af1937c5b38a21ec5e6b3e11851264be2}{ImageModeIndexedColor}}:}
\DoxyCodeLine{1446         \textcolor{keywordflow}{case} \mbox{\hyperlink{PGFplatform_8h_ac73bfc2f52b9da3083b7087d154c1e2e}{ImageModeGrayScale}}:}
\DoxyCodeLine{1447         \textcolor{keywordflow}{case} \mbox{\hyperlink{PGFplatform_8h_a5e4deddebb6ff58e1168fc20b0e15cb3}{ImageModeHSLColor}}:}
\DoxyCodeLine{1448         \textcolor{keywordflow}{case} \mbox{\hyperlink{PGFplatform_8h_aca2b65c53ff44940ed27f809de3b28f5}{ImageModeHSBColor}}:}
\DoxyCodeLine{1449         \textcolor{keywordflow}{case} \mbox{\hyperlink{PGFplatform_8h_aa1d93456909be3c716a8c5a30b191c00}{ImageModeLabColor}}:}
\DoxyCodeLine{1450                 \{}
\DoxyCodeLine{1451                         ASSERT(\mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_abda7a5f282421cd7e789da62f657efa0}{channels}} >= 1);}
\DoxyCodeLine{1452                         ASSERT(\mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_aedea199e29cd6c404c82ab97c67e46b4}{bpp}} == \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_abda7a5f282421cd7e789da62f657efa0}{channels}}*8);}
\DoxyCodeLine{1453                         ASSERT(bpp\%8 == 0);}
\DoxyCodeLine{1454                         \textcolor{keyword}{const} \textcolor{keywordtype}{int} channels = bpp/8; ASSERT(channels >= \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_abda7a5f282421cd7e789da62f657efa0}{channels}});}
\DoxyCodeLine{1455 }
\DoxyCodeLine{1456                         \textcolor{keywordflow}{for} (UINT32 h=0; h < \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a7262335e99ca409759e1aa8c0f0164b1}{height}}; h++) \{}
\DoxyCodeLine{1457                                 \textcolor{keywordflow}{if} (cb) \{}
\DoxyCodeLine{1458                                         \textcolor{keywordflow}{if} ((*cb)(percent, \textcolor{keyword}{true}, data)) ReturnWithError(EscapePressed);}
\DoxyCodeLine{1459                                         percent += dP;}
\DoxyCodeLine{1460                                 \}}
\DoxyCodeLine{1461 }
\DoxyCodeLine{1462                                 cnt = 0;}
\DoxyCodeLine{1463                                 \textcolor{keywordflow}{for} (UINT32 w=0; w < \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a766a68c3284c2ae6d2f54c82e7350ed9}{width}}; w++) \{}
\DoxyCodeLine{1464                                         \textcolor{keywordflow}{for} (\textcolor{keywordtype}{int} c=0; c < \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_abda7a5f282421cd7e789da62f657efa0}{channels}}; c++) \{}
\DoxyCodeLine{1465                                                 \mbox{\hyperlink{classCPGFImage_a36f7f20b38a9cb3a9c88032f5f886345}{m\_channel}}[c][yPos] = buff[cnt + channelMap[c]] - \mbox{\hyperlink{PGFimage_8cpp_a0fc648cb4d04d369ff4692cc07687039}{YUVoffset8}};}
\DoxyCodeLine{1466                                         \}}
\DoxyCodeLine{1467                                         cnt += channels;}
\DoxyCodeLine{1468                                         yPos++;}
\DoxyCodeLine{1469                                 \}}
\DoxyCodeLine{1470                                 buff += pitch;  }
\DoxyCodeLine{1471                         \}}
\DoxyCodeLine{1472                 \}}
\DoxyCodeLine{1473                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{1474         \textcolor{keywordflow}{case} \mbox{\hyperlink{PGFplatform_8h_aedd00370d778fa28db56e5d4032d4c5c}{ImageModeGray16}}:}
\DoxyCodeLine{1475         \textcolor{keywordflow}{case} \mbox{\hyperlink{PGFplatform_8h_ae7de617953bf44d768dfd82b62a98db5}{ImageModeLab48}}:}
\DoxyCodeLine{1476                 \{}
\DoxyCodeLine{1477                         ASSERT(\mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_abda7a5f282421cd7e789da62f657efa0}{channels}} >= 1);}
\DoxyCodeLine{1478                         ASSERT(\mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_aedea199e29cd6c404c82ab97c67e46b4}{bpp}} == \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_abda7a5f282421cd7e789da62f657efa0}{channels}}*16);}
\DoxyCodeLine{1479                         ASSERT(bpp\%16 == 0);}
\DoxyCodeLine{1480 }
\DoxyCodeLine{1481                         UINT16 *buff16 = (UINT16 *)buff;}
\DoxyCodeLine{1482                         \textcolor{keyword}{const} \textcolor{keywordtype}{int} pitch16 = pitch/2;}
\DoxyCodeLine{1483                         \textcolor{keyword}{const} \textcolor{keywordtype}{int} channels = bpp/16; ASSERT(channels >= \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_abda7a5f282421cd7e789da62f657efa0}{channels}});}
\DoxyCodeLine{1484                         \textcolor{keyword}{const} \textcolor{keywordtype}{int} shift = 16 - \mbox{\hyperlink{classCPGFImage_a6cc4f75843c3c15f573aaa0131649b10}{UsedBitsPerChannel}}(); ASSERT(shift >= 0);}
\DoxyCodeLine{1485                         \textcolor{keyword}{const} \mbox{\hyperlink{PGFtypes_8h_acb1ee3f52ccfad782dcaa0abd79e5d05}{DataT}} yuvOffset16 = 1 << (\mbox{\hyperlink{classCPGFImage_a6cc4f75843c3c15f573aaa0131649b10}{UsedBitsPerChannel}}() - 1);}
\DoxyCodeLine{1486 }
\DoxyCodeLine{1487                         \textcolor{keywordflow}{for} (UINT32 h=0; h < \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a7262335e99ca409759e1aa8c0f0164b1}{height}}; h++) \{}
\DoxyCodeLine{1488                                 \textcolor{keywordflow}{if} (cb) \{}
\DoxyCodeLine{1489                                         \textcolor{keywordflow}{if} ((*cb)(percent, \textcolor{keyword}{true}, data)) ReturnWithError(EscapePressed);}
\DoxyCodeLine{1490                                         percent += dP;}
\DoxyCodeLine{1491                                 \}}
\DoxyCodeLine{1492 }
\DoxyCodeLine{1493                                 cnt = 0;}
\DoxyCodeLine{1494                                 \textcolor{keywordflow}{for} (UINT32 w=0; w < \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a766a68c3284c2ae6d2f54c82e7350ed9}{width}}; w++) \{}
\DoxyCodeLine{1495                                         \textcolor{keywordflow}{for} (\textcolor{keywordtype}{int} c=0; c < \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_abda7a5f282421cd7e789da62f657efa0}{channels}}; c++) \{}
\DoxyCodeLine{1496                                                 \mbox{\hyperlink{classCPGFImage_a36f7f20b38a9cb3a9c88032f5f886345}{m\_channel}}[c][yPos] = (buff16[cnt + channelMap[c]] >> shift) - yuvOffset16;}
\DoxyCodeLine{1497                                         \}}
\DoxyCodeLine{1498                                         cnt += channels;}
\DoxyCodeLine{1499                                         yPos++;}
\DoxyCodeLine{1500                                 \}}
\DoxyCodeLine{1501                                 buff16 += pitch16;}
\DoxyCodeLine{1502                         \}}
\DoxyCodeLine{1503                 \}}
\DoxyCodeLine{1504                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{1505         \textcolor{keywordflow}{case} \mbox{\hyperlink{PGFplatform_8h_a07e2059cc6697336c5484447578264fc}{ImageModeRGBColor}}:}
\DoxyCodeLine{1506                 \{}
\DoxyCodeLine{1507                         ASSERT(\mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_abda7a5f282421cd7e789da62f657efa0}{channels}} == 3);}
\DoxyCodeLine{1508                         ASSERT(\mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_aedea199e29cd6c404c82ab97c67e46b4}{bpp}} == \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_abda7a5f282421cd7e789da62f657efa0}{channels}}*8);}
\DoxyCodeLine{1509                         ASSERT(bpp\%8 == 0);}
\DoxyCodeLine{1510 }
\DoxyCodeLine{1511                         \mbox{\hyperlink{PGFtypes_8h_acb1ee3f52ccfad782dcaa0abd79e5d05}{DataT}}* y = \mbox{\hyperlink{classCPGFImage_a36f7f20b38a9cb3a9c88032f5f886345}{m\_channel}}[0]; ASSERT(y);}
\DoxyCodeLine{1512                         \mbox{\hyperlink{PGFtypes_8h_acb1ee3f52ccfad782dcaa0abd79e5d05}{DataT}}* u = \mbox{\hyperlink{classCPGFImage_a36f7f20b38a9cb3a9c88032f5f886345}{m\_channel}}[1]; ASSERT(u);}
\DoxyCodeLine{1513                         \mbox{\hyperlink{PGFtypes_8h_acb1ee3f52ccfad782dcaa0abd79e5d05}{DataT}}* v = \mbox{\hyperlink{classCPGFImage_a36f7f20b38a9cb3a9c88032f5f886345}{m\_channel}}[2]; ASSERT(v);}
\DoxyCodeLine{1514                         \textcolor{keyword}{const} \textcolor{keywordtype}{int} channels = bpp/8; ASSERT(channels >= \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_abda7a5f282421cd7e789da62f657efa0}{channels}});}
\DoxyCodeLine{1515                         UINT8 b, g, r;}
\DoxyCodeLine{1516 }
\DoxyCodeLine{1517                         \textcolor{keywordflow}{for} (UINT32 h=0; h < \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a7262335e99ca409759e1aa8c0f0164b1}{height}}; h++) \{}
\DoxyCodeLine{1518                                 \textcolor{keywordflow}{if} (cb) \{}
\DoxyCodeLine{1519                                         \textcolor{keywordflow}{if} ((*cb)(percent, \textcolor{keyword}{true}, data)) ReturnWithError(EscapePressed);}
\DoxyCodeLine{1520                                         percent += dP;}
\DoxyCodeLine{1521                                 \}}
\DoxyCodeLine{1522 }
\DoxyCodeLine{1523                                 cnt = 0;}
\DoxyCodeLine{1524                                 \textcolor{keywordflow}{for} (UINT32 w=0; w < \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a766a68c3284c2ae6d2f54c82e7350ed9}{width}}; w++) \{}
\DoxyCodeLine{1525                                         b = buff[cnt + channelMap[0]];}
\DoxyCodeLine{1526                                         g = buff[cnt + channelMap[1]];}
\DoxyCodeLine{1527                                         r = buff[cnt + channelMap[2]];}
\DoxyCodeLine{1528                                         \textcolor{comment}{// Yuv}}
\DoxyCodeLine{1529                                         y[yPos] = ((b + (g << 1) + r) >> 2) - \mbox{\hyperlink{PGFimage_8cpp_a0fc648cb4d04d369ff4692cc07687039}{YUVoffset8}};}
\DoxyCodeLine{1530                                         u[yPos] = r - g;}
\DoxyCodeLine{1531                                         v[yPos] = b - g;}
\DoxyCodeLine{1532                                         yPos++;}
\DoxyCodeLine{1533                                         cnt += channels;}
\DoxyCodeLine{1534                                 \}}
\DoxyCodeLine{1535                                 buff += pitch;}
\DoxyCodeLine{1536                         \}       }
\DoxyCodeLine{1537                 \}}
\DoxyCodeLine{1538                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{1539         \textcolor{keywordflow}{case} \mbox{\hyperlink{PGFplatform_8h_ac04b7a3633a0caadba20e20e161239e1}{ImageModeRGB48}}:}
\DoxyCodeLine{1540                 \{}
\DoxyCodeLine{1541                         ASSERT(\mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_abda7a5f282421cd7e789da62f657efa0}{channels}} == 3);}
\DoxyCodeLine{1542                         ASSERT(\mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_aedea199e29cd6c404c82ab97c67e46b4}{bpp}} == \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_abda7a5f282421cd7e789da62f657efa0}{channels}}*16);}
\DoxyCodeLine{1543                         ASSERT(bpp\%16 == 0);}
\DoxyCodeLine{1544 }
\DoxyCodeLine{1545                         UINT16 *buff16 = (UINT16 *)buff;}
\DoxyCodeLine{1546                         \textcolor{keyword}{const} \textcolor{keywordtype}{int} pitch16 = pitch/2;}
\DoxyCodeLine{1547                         \textcolor{keyword}{const} \textcolor{keywordtype}{int} channels = bpp/16; ASSERT(channels >= \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_abda7a5f282421cd7e789da62f657efa0}{channels}});}
\DoxyCodeLine{1548                         \textcolor{keyword}{const} \textcolor{keywordtype}{int} shift = 16 - \mbox{\hyperlink{classCPGFImage_a6cc4f75843c3c15f573aaa0131649b10}{UsedBitsPerChannel}}(); ASSERT(shift >= 0);}
\DoxyCodeLine{1549                         \textcolor{keyword}{const} \mbox{\hyperlink{PGFtypes_8h_acb1ee3f52ccfad782dcaa0abd79e5d05}{DataT}} yuvOffset16 = 1 << (\mbox{\hyperlink{classCPGFImage_a6cc4f75843c3c15f573aaa0131649b10}{UsedBitsPerChannel}}() - 1);}
\DoxyCodeLine{1550 }
\DoxyCodeLine{1551                         \mbox{\hyperlink{PGFtypes_8h_acb1ee3f52ccfad782dcaa0abd79e5d05}{DataT}}* y = \mbox{\hyperlink{classCPGFImage_a36f7f20b38a9cb3a9c88032f5f886345}{m\_channel}}[0]; ASSERT(y);}
\DoxyCodeLine{1552                         \mbox{\hyperlink{PGFtypes_8h_acb1ee3f52ccfad782dcaa0abd79e5d05}{DataT}}* u = \mbox{\hyperlink{classCPGFImage_a36f7f20b38a9cb3a9c88032f5f886345}{m\_channel}}[1]; ASSERT(u);}
\DoxyCodeLine{1553                         \mbox{\hyperlink{PGFtypes_8h_acb1ee3f52ccfad782dcaa0abd79e5d05}{DataT}}* v = \mbox{\hyperlink{classCPGFImage_a36f7f20b38a9cb3a9c88032f5f886345}{m\_channel}}[2]; ASSERT(v);}
\DoxyCodeLine{1554                         UINT16 b, g, r;}
\DoxyCodeLine{1555 }
\DoxyCodeLine{1556                         \textcolor{keywordflow}{for} (UINT32 h=0; h < \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a7262335e99ca409759e1aa8c0f0164b1}{height}}; h++) \{}
\DoxyCodeLine{1557                                 \textcolor{keywordflow}{if} (cb) \{}
\DoxyCodeLine{1558                                         \textcolor{keywordflow}{if} ((*cb)(percent, \textcolor{keyword}{true}, data)) ReturnWithError(EscapePressed);}
\DoxyCodeLine{1559                                         percent += dP;}
\DoxyCodeLine{1560                                 \}}
\DoxyCodeLine{1561 }
\DoxyCodeLine{1562                                 cnt = 0;}
\DoxyCodeLine{1563                                 \textcolor{keywordflow}{for} (UINT32 w=0; w < \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a766a68c3284c2ae6d2f54c82e7350ed9}{width}}; w++) \{}
\DoxyCodeLine{1564                                         b = buff16[cnt + channelMap[0]] >> shift;}
\DoxyCodeLine{1565                                         g = buff16[cnt + channelMap[1]] >> shift;}
\DoxyCodeLine{1566                                         r = buff16[cnt + channelMap[2]] >> shift;}
\DoxyCodeLine{1567                                         \textcolor{comment}{// Yuv}}
\DoxyCodeLine{1568                                         y[yPos] = ((b + (g << 1) + r) >> 2) - yuvOffset16;}
\DoxyCodeLine{1569                                         u[yPos] = r - g;}
\DoxyCodeLine{1570                                         v[yPos] = b - g;}
\DoxyCodeLine{1571                                         yPos++;}
\DoxyCodeLine{1572                                         cnt += channels;}
\DoxyCodeLine{1573                                 \}}
\DoxyCodeLine{1574                                 buff16 += pitch16;}
\DoxyCodeLine{1575                         \}       }
\DoxyCodeLine{1576                 \}}
\DoxyCodeLine{1577                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{1578         \textcolor{keywordflow}{case} \mbox{\hyperlink{PGFplatform_8h_ab7cb460804a8abce27d823d09682c85b}{ImageModeRGBA}}:}
\DoxyCodeLine{1579         \textcolor{keywordflow}{case} \mbox{\hyperlink{PGFplatform_8h_af50b920dae1922b4eb0bcd82361d880c}{ImageModeCMYKColor}}:}
\DoxyCodeLine{1580                 \{}
\DoxyCodeLine{1581                         ASSERT(\mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_abda7a5f282421cd7e789da62f657efa0}{channels}} == 4);}
\DoxyCodeLine{1582                         ASSERT(\mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_aedea199e29cd6c404c82ab97c67e46b4}{bpp}} == \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_abda7a5f282421cd7e789da62f657efa0}{channels}}*8);}
\DoxyCodeLine{1583                         ASSERT(bpp\%8 == 0);}
\DoxyCodeLine{1584                         \textcolor{keyword}{const} \textcolor{keywordtype}{int} channels = bpp/8; ASSERT(channels >= \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_abda7a5f282421cd7e789da62f657efa0}{channels}});}
\DoxyCodeLine{1585 }
\DoxyCodeLine{1586                         \mbox{\hyperlink{PGFtypes_8h_acb1ee3f52ccfad782dcaa0abd79e5d05}{DataT}}* y = \mbox{\hyperlink{classCPGFImage_a36f7f20b38a9cb3a9c88032f5f886345}{m\_channel}}[0]; ASSERT(y);}
\DoxyCodeLine{1587                         \mbox{\hyperlink{PGFtypes_8h_acb1ee3f52ccfad782dcaa0abd79e5d05}{DataT}}* u = \mbox{\hyperlink{classCPGFImage_a36f7f20b38a9cb3a9c88032f5f886345}{m\_channel}}[1]; ASSERT(u);}
\DoxyCodeLine{1588                         \mbox{\hyperlink{PGFtypes_8h_acb1ee3f52ccfad782dcaa0abd79e5d05}{DataT}}* v = \mbox{\hyperlink{classCPGFImage_a36f7f20b38a9cb3a9c88032f5f886345}{m\_channel}}[2]; ASSERT(v);}
\DoxyCodeLine{1589                         \mbox{\hyperlink{PGFtypes_8h_acb1ee3f52ccfad782dcaa0abd79e5d05}{DataT}}* a = \mbox{\hyperlink{classCPGFImage_a36f7f20b38a9cb3a9c88032f5f886345}{m\_channel}}[3]; ASSERT(a);}
\DoxyCodeLine{1590                         UINT8 b, g, r;}
\DoxyCodeLine{1591 }
\DoxyCodeLine{1592                         \textcolor{keywordflow}{for} (UINT32 h=0; h < \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a7262335e99ca409759e1aa8c0f0164b1}{height}}; h++) \{}
\DoxyCodeLine{1593                                 \textcolor{keywordflow}{if} (cb) \{}
\DoxyCodeLine{1594                                         \textcolor{keywordflow}{if} ((*cb)(percent, \textcolor{keyword}{true}, data)) ReturnWithError(EscapePressed);}
\DoxyCodeLine{1595                                         percent += dP;}
\DoxyCodeLine{1596                                 \}}
\DoxyCodeLine{1597 }
\DoxyCodeLine{1598                                 cnt = 0;}
\DoxyCodeLine{1599                                 \textcolor{keywordflow}{for} (UINT32 w=0; w < \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a766a68c3284c2ae6d2f54c82e7350ed9}{width}}; w++) \{}
\DoxyCodeLine{1600                                         b = buff[cnt + channelMap[0]];}
\DoxyCodeLine{1601                                         g = buff[cnt + channelMap[1]];}
\DoxyCodeLine{1602                                         r = buff[cnt + channelMap[2]];}
\DoxyCodeLine{1603                                         \textcolor{comment}{// Yuv}}
\DoxyCodeLine{1604                                         y[yPos] = ((b + (g << 1) + r) >> 2) - \mbox{\hyperlink{PGFimage_8cpp_a0fc648cb4d04d369ff4692cc07687039}{YUVoffset8}};}
\DoxyCodeLine{1605                                         u[yPos] = r - g;}
\DoxyCodeLine{1606                                         v[yPos] = b - g;}
\DoxyCodeLine{1607                                         a[yPos++] = buff[cnt + channelMap[3]] - \mbox{\hyperlink{PGFimage_8cpp_a0fc648cb4d04d369ff4692cc07687039}{YUVoffset8}};}
\DoxyCodeLine{1608                                         cnt += channels;}
\DoxyCodeLine{1609                                 \}}
\DoxyCodeLine{1610                                 buff += pitch;}
\DoxyCodeLine{1611                         \}       }
\DoxyCodeLine{1612                 \}}
\DoxyCodeLine{1613                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{1614         \textcolor{keywordflow}{case} \mbox{\hyperlink{PGFplatform_8h_ac250ca543e6f93f370614801122b61f6}{ImageModeCMYK64}}:}
\DoxyCodeLine{1615                 \{}
\DoxyCodeLine{1616                         ASSERT(\mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_abda7a5f282421cd7e789da62f657efa0}{channels}} == 4);}
\DoxyCodeLine{1617                         ASSERT(\mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_aedea199e29cd6c404c82ab97c67e46b4}{bpp}} == \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_abda7a5f282421cd7e789da62f657efa0}{channels}}*16);}
\DoxyCodeLine{1618                         ASSERT(bpp\%16 == 0);}
\DoxyCodeLine{1619 }
\DoxyCodeLine{1620                         UINT16 *buff16 = (UINT16 *)buff;}
\DoxyCodeLine{1621                         \textcolor{keyword}{const} \textcolor{keywordtype}{int} pitch16 = pitch/2;}
\DoxyCodeLine{1622                         \textcolor{keyword}{const} \textcolor{keywordtype}{int} channels = bpp/16; ASSERT(channels >= \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_abda7a5f282421cd7e789da62f657efa0}{channels}});}
\DoxyCodeLine{1623                         \textcolor{keyword}{const} \textcolor{keywordtype}{int} shift = 16 - \mbox{\hyperlink{classCPGFImage_a6cc4f75843c3c15f573aaa0131649b10}{UsedBitsPerChannel}}(); ASSERT(shift >= 0);}
\DoxyCodeLine{1624                         \textcolor{keyword}{const} \mbox{\hyperlink{PGFtypes_8h_acb1ee3f52ccfad782dcaa0abd79e5d05}{DataT}} yuvOffset16 = 1 << (\mbox{\hyperlink{classCPGFImage_a6cc4f75843c3c15f573aaa0131649b10}{UsedBitsPerChannel}}() - 1);}
\DoxyCodeLine{1625                         }
\DoxyCodeLine{1626                         \mbox{\hyperlink{PGFtypes_8h_acb1ee3f52ccfad782dcaa0abd79e5d05}{DataT}}* y = \mbox{\hyperlink{classCPGFImage_a36f7f20b38a9cb3a9c88032f5f886345}{m\_channel}}[0]; ASSERT(y);}
\DoxyCodeLine{1627                         \mbox{\hyperlink{PGFtypes_8h_acb1ee3f52ccfad782dcaa0abd79e5d05}{DataT}}* u = \mbox{\hyperlink{classCPGFImage_a36f7f20b38a9cb3a9c88032f5f886345}{m\_channel}}[1]; ASSERT(u);}
\DoxyCodeLine{1628                         \mbox{\hyperlink{PGFtypes_8h_acb1ee3f52ccfad782dcaa0abd79e5d05}{DataT}}* v = \mbox{\hyperlink{classCPGFImage_a36f7f20b38a9cb3a9c88032f5f886345}{m\_channel}}[2]; ASSERT(v);}
\DoxyCodeLine{1629                         \mbox{\hyperlink{PGFtypes_8h_acb1ee3f52ccfad782dcaa0abd79e5d05}{DataT}}* a = \mbox{\hyperlink{classCPGFImage_a36f7f20b38a9cb3a9c88032f5f886345}{m\_channel}}[3]; ASSERT(a);}
\DoxyCodeLine{1630                         UINT16 b, g, r;}
\DoxyCodeLine{1631 }
\DoxyCodeLine{1632                         \textcolor{keywordflow}{for} (UINT32 h=0; h < \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a7262335e99ca409759e1aa8c0f0164b1}{height}}; h++) \{}
\DoxyCodeLine{1633                                 \textcolor{keywordflow}{if} (cb) \{}
\DoxyCodeLine{1634                                         \textcolor{keywordflow}{if} ((*cb)(percent, \textcolor{keyword}{true}, data)) ReturnWithError(EscapePressed);}
\DoxyCodeLine{1635                                         percent += dP;}
\DoxyCodeLine{1636                                 \}}
\DoxyCodeLine{1637 }
\DoxyCodeLine{1638                                 cnt = 0;}
\DoxyCodeLine{1639                                 \textcolor{keywordflow}{for} (UINT32 w=0; w < \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a766a68c3284c2ae6d2f54c82e7350ed9}{width}}; w++) \{}
\DoxyCodeLine{1640                                         b = buff16[cnt + channelMap[0]] >> shift;}
\DoxyCodeLine{1641                                         g = buff16[cnt + channelMap[1]] >> shift;}
\DoxyCodeLine{1642                                         r = buff16[cnt + channelMap[2]] >> shift;}
\DoxyCodeLine{1643                                         \textcolor{comment}{// Yuv}}
\DoxyCodeLine{1644                                         y[yPos] = ((b + (g << 1) + r) >> 2) - yuvOffset16;}
\DoxyCodeLine{1645                                         u[yPos] = r - g;}
\DoxyCodeLine{1646                                         v[yPos] = b - g;}
\DoxyCodeLine{1647                                         a[yPos++] = (buff16[cnt + channelMap[3]] >> shift) - yuvOffset16;}
\DoxyCodeLine{1648                                         cnt += channels;}
\DoxyCodeLine{1649                                 \}}
\DoxyCodeLine{1650                                 buff16 += pitch16;}
\DoxyCodeLine{1651                         \}       }
\DoxyCodeLine{1652                 \}}
\DoxyCodeLine{1653                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{1654 \textcolor{preprocessor}{\#ifdef \_\_PGF32SUPPORT\_\_}}
\DoxyCodeLine{1655         \textcolor{keywordflow}{case} \mbox{\hyperlink{PGFplatform_8h_a205e54791f7ad54d357330bb99cab3b2}{ImageModeGray32}}:}
\DoxyCodeLine{1656                 \{}
\DoxyCodeLine{1657                         ASSERT(\mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_abda7a5f282421cd7e789da62f657efa0}{channels}} == 1);}
\DoxyCodeLine{1658                         ASSERT(\mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_aedea199e29cd6c404c82ab97c67e46b4}{bpp}} == 32);}
\DoxyCodeLine{1659                         ASSERT(bpp == 32);}
\DoxyCodeLine{1660                         ASSERT(\mbox{\hyperlink{PGFtypes_8h_adbb49c2b6ab931f68f08a8dc1141727d}{DataTSize}} == \textcolor{keyword}{sizeof}(UINT32));}
\DoxyCodeLine{1661 }
\DoxyCodeLine{1662                         \mbox{\hyperlink{PGFtypes_8h_acb1ee3f52ccfad782dcaa0abd79e5d05}{DataT}}* y = \mbox{\hyperlink{classCPGFImage_a36f7f20b38a9cb3a9c88032f5f886345}{m\_channel}}[0]; ASSERT(y);}
\DoxyCodeLine{1663 }
\DoxyCodeLine{1664                         UINT32 *buff32 = (UINT32 *)buff;}
\DoxyCodeLine{1665                         \textcolor{keyword}{const} \textcolor{keywordtype}{int} pitch32 = pitch/4;}
\DoxyCodeLine{1666                         \textcolor{keyword}{const} \textcolor{keywordtype}{int} shift = 31 - \mbox{\hyperlink{classCPGFImage_a6cc4f75843c3c15f573aaa0131649b10}{UsedBitsPerChannel}}(); ASSERT(shift >= 0);}
\DoxyCodeLine{1667                         \textcolor{keyword}{const} \mbox{\hyperlink{PGFtypes_8h_acb1ee3f52ccfad782dcaa0abd79e5d05}{DataT}} yuvOffset31 = 1 << (\mbox{\hyperlink{classCPGFImage_a6cc4f75843c3c15f573aaa0131649b10}{UsedBitsPerChannel}}() - 1);}
\DoxyCodeLine{1668 }
\DoxyCodeLine{1669                         \textcolor{keywordflow}{for} (UINT32 h=0; h < \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a7262335e99ca409759e1aa8c0f0164b1}{height}}; h++) \{}
\DoxyCodeLine{1670                                 \textcolor{keywordflow}{if} (cb) \{}
\DoxyCodeLine{1671                                         \textcolor{keywordflow}{if} ((*cb)(percent, \textcolor{keyword}{true}, data)) ReturnWithError(EscapePressed);}
\DoxyCodeLine{1672                                         percent += dP;}
\DoxyCodeLine{1673                                 \}}
\DoxyCodeLine{1674 }
\DoxyCodeLine{1675                                 \textcolor{keywordflow}{for} (UINT32 w=0; w < \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a766a68c3284c2ae6d2f54c82e7350ed9}{width}}; w++) \{}
\DoxyCodeLine{1676                                         y[yPos++] = (buff32[w] >> shift) - yuvOffset31;}
\DoxyCodeLine{1677                                 \}}
\DoxyCodeLine{1678                                 buff32 += pitch32;}
\DoxyCodeLine{1679                         \}}
\DoxyCodeLine{1680                 \}}
\DoxyCodeLine{1681                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{1682 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{1683         \textcolor{keywordflow}{case} \mbox{\hyperlink{PGFplatform_8h_a1dbd9112d53e5eea856e65ed1e9c6d50}{ImageModeRGB12}}:}
\DoxyCodeLine{1684                 \{}
\DoxyCodeLine{1685                         ASSERT(\mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_abda7a5f282421cd7e789da62f657efa0}{channels}} == 3);}
\DoxyCodeLine{1686                         ASSERT(\mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_aedea199e29cd6c404c82ab97c67e46b4}{bpp}} == \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_abda7a5f282421cd7e789da62f657efa0}{channels}}*4);}
\DoxyCodeLine{1687                         ASSERT(bpp == \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_abda7a5f282421cd7e789da62f657efa0}{channels}}*4);}
\DoxyCodeLine{1688 }
\DoxyCodeLine{1689                         \mbox{\hyperlink{PGFtypes_8h_acb1ee3f52ccfad782dcaa0abd79e5d05}{DataT}}* y = \mbox{\hyperlink{classCPGFImage_a36f7f20b38a9cb3a9c88032f5f886345}{m\_channel}}[0]; ASSERT(y);}
\DoxyCodeLine{1690                         \mbox{\hyperlink{PGFtypes_8h_acb1ee3f52ccfad782dcaa0abd79e5d05}{DataT}}* u = \mbox{\hyperlink{classCPGFImage_a36f7f20b38a9cb3a9c88032f5f886345}{m\_channel}}[1]; ASSERT(u);}
\DoxyCodeLine{1691                         \mbox{\hyperlink{PGFtypes_8h_acb1ee3f52ccfad782dcaa0abd79e5d05}{DataT}}* v = \mbox{\hyperlink{classCPGFImage_a36f7f20b38a9cb3a9c88032f5f886345}{m\_channel}}[2]; ASSERT(v);}
\DoxyCodeLine{1692 }
\DoxyCodeLine{1693                         UINT8 rgb = 0, b, g, r;}
\DoxyCodeLine{1694 }
\DoxyCodeLine{1695                         \textcolor{keywordflow}{for} (UINT32 h=0; h < \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a7262335e99ca409759e1aa8c0f0164b1}{height}}; h++) \{}
\DoxyCodeLine{1696                                 \textcolor{keywordflow}{if} (cb) \{}
\DoxyCodeLine{1697                                         \textcolor{keywordflow}{if} ((*cb)(percent, \textcolor{keyword}{true}, data)) ReturnWithError(EscapePressed);}
\DoxyCodeLine{1698                                         percent += dP;}
\DoxyCodeLine{1699                                 \}}
\DoxyCodeLine{1700 }
\DoxyCodeLine{1701                                 cnt = 0;}
\DoxyCodeLine{1702                                 \textcolor{keywordflow}{for} (UINT32 w=0; w < \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a766a68c3284c2ae6d2f54c82e7350ed9}{width}}; w++) \{}
\DoxyCodeLine{1703                                         \textcolor{keywordflow}{if} (w\%2 == 0) \{}
\DoxyCodeLine{1704                                                 \textcolor{comment}{// even pixel position}}
\DoxyCodeLine{1705                                                 rgb = buff[cnt];}
\DoxyCodeLine{1706                                                 b = rgb \& 0x0F;}
\DoxyCodeLine{1707                                                 g = (rgb \& 0xF0) >> 4;}
\DoxyCodeLine{1708                                                 cnt++;}
\DoxyCodeLine{1709                                                 rgb = buff[cnt];}
\DoxyCodeLine{1710                                                 r = rgb \& 0x0F;}
\DoxyCodeLine{1711                                         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{1712                                                 \textcolor{comment}{// odd pixel position}}
\DoxyCodeLine{1713                                                 b = (rgb \& 0xF0) >> 4;}
\DoxyCodeLine{1714                                                 cnt++;}
\DoxyCodeLine{1715                                                 rgb = buff[cnt];}
\DoxyCodeLine{1716                                                 g = rgb \& 0x0F;}
\DoxyCodeLine{1717                                                 r = (rgb \& 0xF0) >> 4;}
\DoxyCodeLine{1718                                                 cnt++;}
\DoxyCodeLine{1719                                         \}}
\DoxyCodeLine{1720 }
\DoxyCodeLine{1721                                         \textcolor{comment}{// Yuv}}
\DoxyCodeLine{1722                                         y[yPos] = ((b + (g << 1) + r) >> 2) - \mbox{\hyperlink{PGFimage_8cpp_a532f21ec0d021733ebae0ad001bb0bef}{YUVoffset4}};}
\DoxyCodeLine{1723                                         u[yPos] = r - g;}
\DoxyCodeLine{1724                                         v[yPos] = b - g;}
\DoxyCodeLine{1725                                         yPos++;}
\DoxyCodeLine{1726                                 \}}
\DoxyCodeLine{1727                                 buff += pitch;}
\DoxyCodeLine{1728                         \}       }
\DoxyCodeLine{1729                 \}}
\DoxyCodeLine{1730                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{1731         \textcolor{keywordflow}{case} \mbox{\hyperlink{PGFplatform_8h_aadaf1bd7eedf80c33287cfd311dbf068}{ImageModeRGB16}}:}
\DoxyCodeLine{1732                 \{}
\DoxyCodeLine{1733                         ASSERT(\mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_abda7a5f282421cd7e789da62f657efa0}{channels}} == 3);}
\DoxyCodeLine{1734                         ASSERT(\mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_aedea199e29cd6c404c82ab97c67e46b4}{bpp}} == 16);}
\DoxyCodeLine{1735                         ASSERT(bpp == 16);}
\DoxyCodeLine{1736                         }
\DoxyCodeLine{1737                         \mbox{\hyperlink{PGFtypes_8h_acb1ee3f52ccfad782dcaa0abd79e5d05}{DataT}}* y = \mbox{\hyperlink{classCPGFImage_a36f7f20b38a9cb3a9c88032f5f886345}{m\_channel}}[0]; ASSERT(y);}
\DoxyCodeLine{1738                         \mbox{\hyperlink{PGFtypes_8h_acb1ee3f52ccfad782dcaa0abd79e5d05}{DataT}}* u = \mbox{\hyperlink{classCPGFImage_a36f7f20b38a9cb3a9c88032f5f886345}{m\_channel}}[1]; ASSERT(u);}
\DoxyCodeLine{1739                         \mbox{\hyperlink{PGFtypes_8h_acb1ee3f52ccfad782dcaa0abd79e5d05}{DataT}}* v = \mbox{\hyperlink{classCPGFImage_a36f7f20b38a9cb3a9c88032f5f886345}{m\_channel}}[2]; ASSERT(v);}
\DoxyCodeLine{1740 }
\DoxyCodeLine{1741                         UINT16 *buff16 = (UINT16 *)buff;}
\DoxyCodeLine{1742                         UINT16 rgb, b, g, r;}
\DoxyCodeLine{1743                         \textcolor{keyword}{const} \textcolor{keywordtype}{int} pitch16 = pitch/2;}
\DoxyCodeLine{1744 }
\DoxyCodeLine{1745                         \textcolor{keywordflow}{for} (UINT32 h=0; h < \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a7262335e99ca409759e1aa8c0f0164b1}{height}}; h++) \{}
\DoxyCodeLine{1746                                 \textcolor{keywordflow}{if} (cb) \{}
\DoxyCodeLine{1747                                         \textcolor{keywordflow}{if} ((*cb)(percent, \textcolor{keyword}{true}, data)) ReturnWithError(EscapePressed);}
\DoxyCodeLine{1748                                         percent += dP;}
\DoxyCodeLine{1749                                 \}}
\DoxyCodeLine{1750                                 \textcolor{keywordflow}{for} (UINT32 w=0; w < \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a766a68c3284c2ae6d2f54c82e7350ed9}{width}}; w++) \{}
\DoxyCodeLine{1751                                         rgb = buff16[w]; }
\DoxyCodeLine{1752                                         r = (rgb \& 0xF800) >> 10;       \textcolor{comment}{// highest 5 bits}}
\DoxyCodeLine{1753                                         g = (rgb \& 0x07E0) >> 5;        \textcolor{comment}{// middle 6 bits}}
\DoxyCodeLine{1754                                         b = (rgb \& 0x001F) << 1;        \textcolor{comment}{// lowest 5 bits}}
\DoxyCodeLine{1755                                         \textcolor{comment}{// Yuv}}
\DoxyCodeLine{1756                                         y[yPos] = ((b + (g << 1) + r) >> 2) - \mbox{\hyperlink{PGFimage_8cpp_ae908d3596ec0b26c916572376f8ac1d7}{YUVoffset6}};}
\DoxyCodeLine{1757                                         u[yPos] = r - g;}
\DoxyCodeLine{1758                                         v[yPos] = b - g;}
\DoxyCodeLine{1759                                         yPos++;}
\DoxyCodeLine{1760                                 \}}
\DoxyCodeLine{1761 }
\DoxyCodeLine{1762                                 buff16 += pitch16;}
\DoxyCodeLine{1763                         \}       }
\DoxyCodeLine{1764                 \}}
\DoxyCodeLine{1765                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{1766         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{1767                 ASSERT(\textcolor{keyword}{false});}
\DoxyCodeLine{1768         \}}
\DoxyCodeLine{1769 \}}

\end{DoxyCode}
\mbox{\Hypertarget{classCPGFImage_a9db775cf3a36997b55106fbab7284c14}\label{classCPGFImage_a9db775cf3a36997b55106fbab7284c14}} 
\index{CPGFImage@{CPGFImage}!ROIisSupported@{ROIisSupported}}
\index{ROIisSupported@{ROIisSupported}!CPGFImage@{CPGFImage}}
\subsubsection{\texorpdfstring{ROIisSupported()}{ROIisSupported()}}
{\footnotesize\ttfamily bool C\+P\+G\+F\+Image\+::\+R\+O\+Iis\+Supported (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}

Return true if the pgf image supports Region Of Interest (R\+OI). \begin{DoxyReturn}{Returns}
true if the pgf image supports R\+OI. 
\end{DoxyReturn}


Definition at line 466 of file P\+G\+Fimage.\+h.


\begin{DoxyCode}{0}
\DoxyCodeLine{466 \{ \textcolor{keywordflow}{return} (\mbox{\hyperlink{classCPGFImage_ad5ed0ec587742ebf46f72be4abde305d}{m\_preHeader}}.\mbox{\hyperlink{structPGFMagicVersion_aa7ff5e50537cac9dd4c62d4c8982d09d}{version}} \& \mbox{\hyperlink{PGFtypes_8h_a0ba6d90f8f69de741164e86a2b4c10af}{PGFROI}}) == \mbox{\hyperlink{PGFtypes_8h_a0ba6d90f8f69de741164e86a2b4c10af}{PGFROI}}; \}}

\end{DoxyCode}
\mbox{\Hypertarget{classCPGFImage_a2f470e1cfdb1300338e32f0926588a6c}\label{classCPGFImage_a2f470e1cfdb1300338e32f0926588a6c}} 
\index{CPGFImage@{CPGFImage}!SetChannel@{SetChannel}}
\index{SetChannel@{SetChannel}!CPGFImage@{CPGFImage}}
\subsubsection{\texorpdfstring{SetChannel()}{SetChannel()}}
{\footnotesize\ttfamily void C\+P\+G\+F\+Image\+::\+Set\+Channel (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{PGFtypes_8h_acb1ee3f52ccfad782dcaa0abd79e5d05}{DataT}} $\ast$}]{channel,  }\item[{int}]{c = {\ttfamily 0} }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}

Set internal P\+GF image buffer channel. 
\begin{DoxyParams}{Parameters}
{\em channel} & A Y\+UV data channel \\
\hline
{\em c} & A channel index \\
\hline
\end{DoxyParams}


Definition at line 272 of file P\+G\+Fimage.\+h.


\begin{DoxyCode}{0}
\DoxyCodeLine{272 \{ ASSERT(c >= 0 \&\& c < \mbox{\hyperlink{PGFtypes_8h_a94219182f88d4dbed1021ed04db75e41}{MaxChannels}}); \mbox{\hyperlink{classCPGFImage_a36f7f20b38a9cb3a9c88032f5f886345}{m\_channel}}[c] = channel; \}}

\end{DoxyCode}
\mbox{\Hypertarget{classCPGFImage_a35b54c9108fa67d99fad592b415b2bf5}\label{classCPGFImage_a35b54c9108fa67d99fad592b415b2bf5}} 
\index{CPGFImage@{CPGFImage}!SetColorTable@{SetColorTable}}
\index{SetColorTable@{SetColorTable}!CPGFImage@{CPGFImage}}
\subsubsection{\texorpdfstring{SetColorTable()}{SetColorTable()}}
{\footnotesize\ttfamily void C\+P\+G\+F\+Image\+::\+Set\+Color\+Table (\begin{DoxyParamCaption}\item[{U\+I\+N\+T32}]{i\+First\+Color,  }\item[{U\+I\+N\+T32}]{n\+Colors,  }\item[{const R\+G\+B\+Q\+U\+AD $\ast$}]{prgb\+Colors }\end{DoxyParamCaption})}

Sets the red, green, blue (R\+GB) color values for a range of entries in the palette (clut). It might throw an \mbox{\hyperlink{structIOException}{I\+O\+Exception}}. 
\begin{DoxyParams}{Parameters}
{\em i\+First\+Color} & The color table index of the first entry to set. \\
\hline
{\em n\+Colors} & The number of color table entries to set. \\
\hline
{\em prgb\+Colors} & A pointer to the array of R\+G\+B\+Q\+U\+AD structures to set the color table entries. \\
\hline
\end{DoxyParams}


Definition at line 1363 of file P\+G\+Fimage.\+cpp.


\begin{DoxyCode}{0}
\DoxyCodeLine{1363                                                                                            \{}
\DoxyCodeLine{1364         \textcolor{keywordflow}{if} (iFirstColor + nColors > \mbox{\hyperlink{PGFtypes_8h_a9d98169485fbcb79dd2277c567f3f27d}{ColorTableLen}}) ReturnWithError(ColorTableError);}
\DoxyCodeLine{1365 }
\DoxyCodeLine{1366         \textcolor{keywordflow}{for} (UINT32 i=iFirstColor, j=0; j < nColors; i++, j++) \{}
\DoxyCodeLine{1367                 \mbox{\hyperlink{classCPGFImage_ab8635df22839ffb68bada53e38b9ce73}{m\_postHeader}}.\mbox{\hyperlink{structPGFPostHeader_a3a7faf3091c0faa2e508ecdeb54ea706}{clut}}[i] = prgbColors[j];}
\DoxyCodeLine{1368         \}}
\DoxyCodeLine{1369 \}}

\end{DoxyCode}
\mbox{\Hypertarget{classCPGFImage_a200790d3be292a19fe8cbdd78ddfc386}\label{classCPGFImage_a200790d3be292a19fe8cbdd78ddfc386}} 
\index{CPGFImage@{CPGFImage}!SetHeader@{SetHeader}}
\index{SetHeader@{SetHeader}!CPGFImage@{CPGFImage}}
\subsubsection{\texorpdfstring{SetHeader()}{SetHeader()}}
{\footnotesize\ttfamily void C\+P\+G\+F\+Image\+::\+Set\+Header (\begin{DoxyParamCaption}\item[{const \mbox{\hyperlink{structPGFHeader}{P\+G\+F\+Header}} \&}]{header,  }\item[{B\+Y\+TE}]{flags = {\ttfamily 0},  }\item[{const U\+I\+N\+T8 $\ast$}]{user\+Data = {\ttfamily 0},  }\item[{U\+I\+N\+T32}]{user\+Data\+Length = {\ttfamily 0} }\end{DoxyParamCaption})}

Set P\+GF header and user data. Precondition\+: The P\+GF image has been never opened with Open(...). It might throw an \mbox{\hyperlink{structIOException}{I\+O\+Exception}}. 
\begin{DoxyParams}{Parameters}
{\em header} & A valid and already filled in P\+GF header structure \\
\hline
{\em flags} & A combination of additional version flags. In case you use level-\/wise encoding then set flag = P\+G\+F\+R\+OI. \\
\hline
{\em user\+Data} & A user-\/defined memory block containing any kind of cached metadata. \\
\hline
{\em user\+Data\+Length} & The size of user-\/defined memory block in bytes \\
\hline
\end{DoxyParams}


Definition at line 893 of file P\+G\+Fimage.\+cpp.


\begin{DoxyCode}{0}
\DoxyCodeLine{893                                                                                                                  \{}
\DoxyCodeLine{894         ASSERT(!\mbox{\hyperlink{classCPGFImage_a1058b29a3d046e171a2fe48168b66d38}{m\_decoder}});    \textcolor{comment}{// current image must be closed}}
\DoxyCodeLine{895         ASSERT(header.\mbox{\hyperlink{structPGFHeader_ac314a16d5984aea88f4a5ff38f49c08b}{quality}} <= \mbox{\hyperlink{PGFtypes_8h_a70d2da7f475eb7f6564e75d64ee77ae4}{MaxQuality}});}
\DoxyCodeLine{896         ASSERT(userDataLength <= \mbox{\hyperlink{PGFtypes_8h_a513fcd9e30f1a99d382b5c001499cdf5}{MaxUserDataSize}});}
\DoxyCodeLine{897         }
\DoxyCodeLine{898         \textcolor{comment}{// init state}}
\DoxyCodeLine{899 \textcolor{preprocessor}{\#ifdef \_\_PGFROISUPPORT\_\_}}
\DoxyCodeLine{900         \mbox{\hyperlink{classCPGFImage_af6d3fe5a8622634d1d0faf56cde335ef}{m\_streamReinitialized}} = \textcolor{keyword}{false};}
\DoxyCodeLine{901 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{902 }
\DoxyCodeLine{903         \textcolor{comment}{// init preHeader}}
\DoxyCodeLine{904         memcpy(\mbox{\hyperlink{classCPGFImage_ad5ed0ec587742ebf46f72be4abde305d}{m\_preHeader}}.\mbox{\hyperlink{structPGFMagicVersion_a8b27eabb723f35b4fdb9e357e69b334b}{magic}}, \mbox{\hyperlink{PGFtypes_8h_a6af5fdbb431a51fc87698ac0b2da8e34}{PGFMagic}}, 3);}
\DoxyCodeLine{905         \mbox{\hyperlink{classCPGFImage_ad5ed0ec587742ebf46f72be4abde305d}{m\_preHeader}}.\mbox{\hyperlink{structPGFMagicVersion_aa7ff5e50537cac9dd4c62d4c8982d09d}{version}} = \mbox{\hyperlink{PGFtypes_8h_aba6dadeb0788b7e02ab3c4425c6ef38a}{PGFVersion}} | flags;}
\DoxyCodeLine{906         \mbox{\hyperlink{classCPGFImage_ad5ed0ec587742ebf46f72be4abde305d}{m\_preHeader}}.\mbox{\hyperlink{structPGFPreHeader_a71b1463b71b722459dad25a3ef0b492b}{hSize}} = \mbox{\hyperlink{PGFtypes_8h_a36882df0caa9057f3144aeb429a2d468}{HeaderSize}};}
\DoxyCodeLine{907 }
\DoxyCodeLine{908         \textcolor{comment}{// copy header}}
\DoxyCodeLine{909         memcpy(\&\mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}, \&header, \mbox{\hyperlink{PGFtypes_8h_a36882df0caa9057f3144aeb429a2d468}{HeaderSize}});}
\DoxyCodeLine{910 }
\DoxyCodeLine{911         \textcolor{comment}{// check quality}}
\DoxyCodeLine{912         \textcolor{keywordflow}{if} (\mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_ac314a16d5984aea88f4a5ff38f49c08b}{quality}} > \mbox{\hyperlink{PGFtypes_8h_a70d2da7f475eb7f6564e75d64ee77ae4}{MaxQuality}}) \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_ac314a16d5984aea88f4a5ff38f49c08b}{quality}} = \mbox{\hyperlink{PGFtypes_8h_a70d2da7f475eb7f6564e75d64ee77ae4}{MaxQuality}};}
\DoxyCodeLine{913 }
\DoxyCodeLine{914         \textcolor{comment}{// complete header}}
\DoxyCodeLine{915         \mbox{\hyperlink{classCPGFImage_a0f517491e6b64353cd9ba45f8697b865}{CompleteHeader}}();}
\DoxyCodeLine{916 }
\DoxyCodeLine{917         \textcolor{comment}{// check and set number of levels}}
\DoxyCodeLine{918         \mbox{\hyperlink{classCPGFImage_ad1ac56e997c83c4c7fe8283b70b84b85}{ComputeLevels}}();}
\DoxyCodeLine{919 }
\DoxyCodeLine{920         \textcolor{comment}{// check for downsample}}
\DoxyCodeLine{921         \textcolor{keywordflow}{if} (\mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_ac314a16d5984aea88f4a5ff38f49c08b}{quality}} > \mbox{\hyperlink{PGFtypes_8h_ac3fdd6d7d71ed50f3b7365d5bc287cda}{DownsampleThreshold}} \&\&  (\mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a3ddaf075db8ee812ad688d9ed39e0698}{mode}} == \mbox{\hyperlink{PGFplatform_8h_a07e2059cc6697336c5484447578264fc}{ImageModeRGBColor}} || }
\DoxyCodeLine{922                                                                                                         \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a3ddaf075db8ee812ad688d9ed39e0698}{mode}} == \mbox{\hyperlink{PGFplatform_8h_ab7cb460804a8abce27d823d09682c85b}{ImageModeRGBA}} || }
\DoxyCodeLine{923                                                                                                         \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a3ddaf075db8ee812ad688d9ed39e0698}{mode}} == \mbox{\hyperlink{PGFplatform_8h_ac04b7a3633a0caadba20e20e161239e1}{ImageModeRGB48}} || }
\DoxyCodeLine{924                                                                                                         \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a3ddaf075db8ee812ad688d9ed39e0698}{mode}} == \mbox{\hyperlink{PGFplatform_8h_af50b920dae1922b4eb0bcd82361d880c}{ImageModeCMYKColor}} || }
\DoxyCodeLine{925                                                                                                         \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a3ddaf075db8ee812ad688d9ed39e0698}{mode}} == \mbox{\hyperlink{PGFplatform_8h_ac250ca543e6f93f370614801122b61f6}{ImageModeCMYK64}} || }
\DoxyCodeLine{926                                                                                                         \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a3ddaf075db8ee812ad688d9ed39e0698}{mode}} == \mbox{\hyperlink{PGFplatform_8h_aa1d93456909be3c716a8c5a30b191c00}{ImageModeLabColor}} || }
\DoxyCodeLine{927                                                                                                         \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a3ddaf075db8ee812ad688d9ed39e0698}{mode}} == \mbox{\hyperlink{PGFplatform_8h_ae7de617953bf44d768dfd82b62a98db5}{ImageModeLab48}})) \{}
\DoxyCodeLine{928                 \mbox{\hyperlink{classCPGFImage_a9226595ea6b907e4d07301a6ee641b87}{m\_downsample}} = \textcolor{keyword}{true};}
\DoxyCodeLine{929                 \mbox{\hyperlink{classCPGFImage_a57cc024db6e510f95f3238f448a0fed5}{m\_quant}} = \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_ac314a16d5984aea88f4a5ff38f49c08b}{quality}} - 1;}
\DoxyCodeLine{930         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{931                 \mbox{\hyperlink{classCPGFImage_a9226595ea6b907e4d07301a6ee641b87}{m\_downsample}} = \textcolor{keyword}{false};}
\DoxyCodeLine{932                 \mbox{\hyperlink{classCPGFImage_a57cc024db6e510f95f3238f448a0fed5}{m\_quant}} = \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_ac314a16d5984aea88f4a5ff38f49c08b}{quality}};}
\DoxyCodeLine{933         \}}
\DoxyCodeLine{934 }
\DoxyCodeLine{935         \textcolor{comment}{// update header size and copy user data}}
\DoxyCodeLine{936         \textcolor{keywordflow}{if} (\mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a3ddaf075db8ee812ad688d9ed39e0698}{mode}} == \mbox{\hyperlink{PGFplatform_8h_af1937c5b38a21ec5e6b3e11851264be2}{ImageModeIndexedColor}}) \{}
\DoxyCodeLine{937                 \textcolor{comment}{// update header size}}
\DoxyCodeLine{938                 \mbox{\hyperlink{classCPGFImage_ad5ed0ec587742ebf46f72be4abde305d}{m\_preHeader}}.\mbox{\hyperlink{structPGFPreHeader_a71b1463b71b722459dad25a3ef0b492b}{hSize}} += \mbox{\hyperlink{PGFtypes_8h_a50366374d6b8b02c5314f67cdd5aba9b}{ColorTableSize}};}
\DoxyCodeLine{939         \}}
\DoxyCodeLine{940         \textcolor{keywordflow}{if} (userDataLength \&\& userData) \{}
\DoxyCodeLine{941                 \textcolor{keywordflow}{if} (userDataLength > \mbox{\hyperlink{PGFtypes_8h_a513fcd9e30f1a99d382b5c001499cdf5}{MaxUserDataSize}}) userDataLength = \mbox{\hyperlink{PGFtypes_8h_a513fcd9e30f1a99d382b5c001499cdf5}{MaxUserDataSize}};}
\DoxyCodeLine{942                 \mbox{\hyperlink{classCPGFImage_ab8635df22839ffb68bada53e38b9ce73}{m\_postHeader}}.\mbox{\hyperlink{structPGFPostHeader_aeeb6e57e8343eb3d42406f0baf3ae6e1}{userData}} = \textcolor{keyword}{new}(std::nothrow) UINT8[userDataLength];}
\DoxyCodeLine{943                 \textcolor{keywordflow}{if} (!\mbox{\hyperlink{classCPGFImage_ab8635df22839ffb68bada53e38b9ce73}{m\_postHeader}}.\mbox{\hyperlink{structPGFPostHeader_aeeb6e57e8343eb3d42406f0baf3ae6e1}{userData}}) ReturnWithError(InsufficientMemory);}
\DoxyCodeLine{944                 \mbox{\hyperlink{classCPGFImage_ab8635df22839ffb68bada53e38b9ce73}{m\_postHeader}}.\mbox{\hyperlink{structPGFPostHeader_a0fb630d6cd14ed865dd5fe20227279f2}{userDataLen}} = \mbox{\hyperlink{classCPGFImage_ab8635df22839ffb68bada53e38b9ce73}{m\_postHeader}}.\mbox{\hyperlink{structPGFPostHeader_a104e3ef6de85dfdbbd867a250fcd82d4}{cachedUserDataLen}} = userDataLength;}
\DoxyCodeLine{945                 memcpy(\mbox{\hyperlink{classCPGFImage_ab8635df22839ffb68bada53e38b9ce73}{m\_postHeader}}.\mbox{\hyperlink{structPGFPostHeader_aeeb6e57e8343eb3d42406f0baf3ae6e1}{userData}}, userData, userDataLength);}
\DoxyCodeLine{946                 \textcolor{comment}{// update header size}}
\DoxyCodeLine{947                 \mbox{\hyperlink{classCPGFImage_ad5ed0ec587742ebf46f72be4abde305d}{m\_preHeader}}.\mbox{\hyperlink{structPGFPreHeader_a71b1463b71b722459dad25a3ef0b492b}{hSize}} += userDataLength;}
\DoxyCodeLine{948         \}}
\DoxyCodeLine{949 }
\DoxyCodeLine{950         \textcolor{comment}{// allocate channels}}
\DoxyCodeLine{951         \textcolor{keywordflow}{for} (\textcolor{keywordtype}{int} i=0; i < \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_abda7a5f282421cd7e789da62f657efa0}{channels}}; i++) \{}
\DoxyCodeLine{952                 \textcolor{comment}{// set current width and height}}
\DoxyCodeLine{953                 \mbox{\hyperlink{classCPGFImage_ab6d97aca28795fae697fdda4b8acd8f9}{m\_width}}[i] = \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a766a68c3284c2ae6d2f54c82e7350ed9}{width}};}
\DoxyCodeLine{954                 \mbox{\hyperlink{classCPGFImage_a170fd448152303a2d44848a52a8916a0}{m\_height}}[i] = \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a7262335e99ca409759e1aa8c0f0164b1}{height}};}
\DoxyCodeLine{955 }
\DoxyCodeLine{956                 \textcolor{comment}{// allocate channels}}
\DoxyCodeLine{957                 ASSERT(!\mbox{\hyperlink{classCPGFImage_a36f7f20b38a9cb3a9c88032f5f886345}{m\_channel}}[i]);}
\DoxyCodeLine{958                 \mbox{\hyperlink{classCPGFImage_a36f7f20b38a9cb3a9c88032f5f886345}{m\_channel}}[i] = \textcolor{keyword}{new}(std::nothrow) \mbox{\hyperlink{PGFtypes_8h_acb1ee3f52ccfad782dcaa0abd79e5d05}{DataT}}[\mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a766a68c3284c2ae6d2f54c82e7350ed9}{width}}*\mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a7262335e99ca409759e1aa8c0f0164b1}{height}}];}
\DoxyCodeLine{959                 if (!\mbox{\hyperlink{classCPGFImage_a36f7f20b38a9cb3a9c88032f5f886345}{m\_channel}}[i]) \{}
\DoxyCodeLine{960                         \textcolor{keywordflow}{if} (i) i--;}
\DoxyCodeLine{961                         \textcolor{keywordflow}{while}(i) \{}
\DoxyCodeLine{962                                 \textcolor{keyword}{delete}[] \mbox{\hyperlink{classCPGFImage_a36f7f20b38a9cb3a9c88032f5f886345}{m\_channel}}[i]; \mbox{\hyperlink{classCPGFImage_a36f7f20b38a9cb3a9c88032f5f886345}{m\_channel}}[i] = 0;}
\DoxyCodeLine{963                                 i--;}
\DoxyCodeLine{964                         \}}
\DoxyCodeLine{965                         ReturnWithError(InsufficientMemory);}
\DoxyCodeLine{966                 \}}
\DoxyCodeLine{967         \}}
\DoxyCodeLine{968 \}}

\end{DoxyCode}
\mbox{\Hypertarget{classCPGFImage_a6a6370e6737d250360cb6431d885a685}\label{classCPGFImage_a6a6370e6737d250360cb6431d885a685}} 
\index{CPGFImage@{CPGFImage}!SetMaxValue@{SetMaxValue}}
\index{SetMaxValue@{SetMaxValue}!CPGFImage@{CPGFImage}}
\subsubsection{\texorpdfstring{SetMaxValue()}{SetMaxValue()}}
{\footnotesize\ttfamily void C\+P\+G\+F\+Image\+::\+Set\+Max\+Value (\begin{DoxyParamCaption}\item[{U\+I\+N\+T32}]{max\+Value }\end{DoxyParamCaption})}

Set maximum intensity value for image modes with more than eight bits per channel. Call this method after Set\+Header, but before Import\+Bitmap. 
\begin{DoxyParams}{Parameters}
{\em max\+Value} & The maximum intensity value. \\
\hline
\end{DoxyParams}


Definition at line 737 of file P\+G\+Fimage.\+cpp.


\begin{DoxyCode}{0}
\DoxyCodeLine{737                                            \{}
\DoxyCodeLine{738         \textcolor{keyword}{const} BYTE bpc = \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_aedea199e29cd6c404c82ab97c67e46b4}{bpp}}/\mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_abda7a5f282421cd7e789da62f657efa0}{channels}};}
\DoxyCodeLine{739         BYTE pot = 0;}
\DoxyCodeLine{740 }
\DoxyCodeLine{741         \textcolor{keywordflow}{while}(maxValue > 0) \{}
\DoxyCodeLine{742                 pot++;}
\DoxyCodeLine{743                 maxValue >>= 1;}
\DoxyCodeLine{744         \}}
\DoxyCodeLine{745         \textcolor{comment}{// store bits per channel}}
\DoxyCodeLine{746         \textcolor{keywordflow}{if} (pot > bpc) pot = bpc;}
\DoxyCodeLine{747         \textcolor{keywordflow}{if} (pot > 31) pot = 31;}
\DoxyCodeLine{748         \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_abddcc9ee6e17690986cf77a6d16aceb6}{usedBitsPerChannel}} = pot;}
\DoxyCodeLine{749 \}}

\end{DoxyCode}
\mbox{\Hypertarget{classCPGFImage_ad5ec0d246d068c55fdea5712f2b1609c}\label{classCPGFImage_ad5ec0d246d068c55fdea5712f2b1609c}} 
\index{CPGFImage@{CPGFImage}!SetProgressMode@{SetProgressMode}}
\index{SetProgressMode@{SetProgressMode}!CPGFImage@{CPGFImage}}
\subsubsection{\texorpdfstring{SetProgressMode()}{SetProgressMode()}}
{\footnotesize\ttfamily void C\+P\+G\+F\+Image\+::\+Set\+Progress\+Mode (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{PGFtypes_8h_a04561479f4f8aa5a0775d8b541a1157e}{Progress\+Mode}}}]{pm }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}

Set progress mode used in Read and Write. Default mode is P\+M\+\_\+\+Relative. This method must be called before \mbox{\hyperlink{classCPGFImage_adbe9092b915a2c5b2361f4db186b991c}{Open()}} or \mbox{\hyperlink{classCPGFImage_a200790d3be292a19fe8cbdd78ddfc386}{Set\+Header()}}. P\+M\+\_\+\+Relative\+: 100\% = level difference between current level and target level of Read/\+Write P\+M\+\_\+\+Absolute\+: 100\% = number of levels 

Definition at line 296 of file P\+G\+Fimage.\+h.


\begin{DoxyCode}{0}
\DoxyCodeLine{296 \{ \mbox{\hyperlink{classCPGFImage_a8b4d6d5ef343f0f428b35c9bf1020569}{m\_progressMode}} = pm; \}}

\end{DoxyCode}
\mbox{\Hypertarget{classCPGFImage_abbca597528f7f9bd28ddd95e8f530e24}\label{classCPGFImage_abbca597528f7f9bd28ddd95e8f530e24}} 
\index{CPGFImage@{CPGFImage}!SetRefreshCallback@{SetRefreshCallback}}
\index{SetRefreshCallback@{SetRefreshCallback}!CPGFImage@{CPGFImage}}
\subsubsection{\texorpdfstring{SetRefreshCallback()}{SetRefreshCallback()}}
{\footnotesize\ttfamily void C\+P\+G\+F\+Image\+::\+Set\+Refresh\+Callback (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{PGFtypes_8h_a80e898ce785fbd6fb0dfcc5903be79c2}{Refresh\+CB}}}]{callback,  }\item[{void $\ast$}]{arg }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}

Set refresh callback procedure and its parameter. The refresh callback is called during Read(...) after each level read. 
\begin{DoxyParams}{Parameters}
{\em callback} & A refresh callback procedure \\
\hline
{\em arg} & A parameter of the refresh callback procedure \\
\hline
\end{DoxyParams}


Definition at line 303 of file P\+G\+Fimage.\+h.


\begin{DoxyCode}{0}
\DoxyCodeLine{303 \{ \mbox{\hyperlink{classCPGFImage_ac262a389df92493dfca63b2f1f06fe78}{m\_cb}} = callback; \mbox{\hyperlink{classCPGFImage_a45861a83c95188610063233149187f3c}{m\_cbArg}} = arg; \}}

\end{DoxyCode}
\mbox{\Hypertarget{classCPGFImage_a83c737ee649fdc92c55b7a6ffe1153b2}\label{classCPGFImage_a83c737ee649fdc92c55b7a6ffe1153b2}} 
\index{CPGFImage@{CPGFImage}!SetROI@{SetROI}}
\index{SetROI@{SetROI}!CPGFImage@{CPGFImage}}
\subsubsection{\texorpdfstring{SetROI()}{SetROI()}}
{\footnotesize\ttfamily void C\+P\+G\+F\+Image\+::\+Set\+R\+OI (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{structPGFRect}{P\+G\+F\+Rect}}}]{rect }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}

\mbox{\Hypertarget{classCPGFImage_a921e1ec08da8ddf6ab4d5657e5610fee}\label{classCPGFImage_a921e1ec08da8ddf6ab4d5657e5610fee}} 
\index{CPGFImage@{CPGFImage}!UpdatePostHeaderSize@{UpdatePostHeaderSize}}
\index{UpdatePostHeaderSize@{UpdatePostHeaderSize}!CPGFImage@{CPGFImage}}
\subsubsection{\texorpdfstring{UpdatePostHeaderSize()}{UpdatePostHeaderSize()}}
{\footnotesize\ttfamily U\+I\+N\+T32 C\+P\+G\+F\+Image\+::\+Update\+Post\+Header\+Size (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



Definition at line 1123 of file P\+G\+Fimage.\+cpp.


\begin{DoxyCode}{0}
\DoxyCodeLine{1123                                        \{}
\DoxyCodeLine{1124         ASSERT(\mbox{\hyperlink{classCPGFImage_a6ef048255812525cd56d7b04df5e6731}{m\_encoder}});}
\DoxyCodeLine{1125 }
\DoxyCodeLine{1126         INT64 offset = \mbox{\hyperlink{classCPGFImage_a6ef048255812525cd56d7b04df5e6731}{m\_encoder}}->\mbox{\hyperlink{classCEncoder_a8aadfcf080fad9a5cd82b532dc847d5b}{ComputeOffset}}(); ASSERT(offset >= 0);}
\DoxyCodeLine{1127 }
\DoxyCodeLine{1128         \textcolor{keywordflow}{if} (offset > 0) \{}
\DoxyCodeLine{1129                 \textcolor{comment}{// update post-header size and rewrite pre-header}}
\DoxyCodeLine{1130                 \mbox{\hyperlink{classCPGFImage_ad5ed0ec587742ebf46f72be4abde305d}{m\_preHeader}}.\mbox{\hyperlink{structPGFPreHeader_a71b1463b71b722459dad25a3ef0b492b}{hSize}} += (UINT32)offset;}
\DoxyCodeLine{1131                 \mbox{\hyperlink{classCPGFImage_a6ef048255812525cd56d7b04df5e6731}{m\_encoder}}->\mbox{\hyperlink{classCEncoder_adcacefab75d6ab0e562d854f31d242ff}{UpdatePostHeaderSize}}(\mbox{\hyperlink{classCPGFImage_ad5ed0ec587742ebf46f72be4abde305d}{m\_preHeader}});}
\DoxyCodeLine{1132         \}}
\DoxyCodeLine{1133 }
\DoxyCodeLine{1134         \textcolor{comment}{// write dummy levelLength into stream}}
\DoxyCodeLine{1135         \textcolor{keywordflow}{return} \mbox{\hyperlink{classCPGFImage_a6ef048255812525cd56d7b04df5e6731}{m\_encoder}}->\mbox{\hyperlink{classCEncoder_ad29dd5328d1198a672599034e7315922}{WriteLevelLength}}(\mbox{\hyperlink{classCPGFImage_a1635ef5dca13bd07276d112a72316a73}{m\_levelLength}});}
\DoxyCodeLine{1136 \}}

\end{DoxyCode}
\mbox{\Hypertarget{classCPGFImage_a6cc4f75843c3c15f573aaa0131649b10}\label{classCPGFImage_a6cc4f75843c3c15f573aaa0131649b10}} 
\index{CPGFImage@{CPGFImage}!UsedBitsPerChannel@{UsedBitsPerChannel}}
\index{UsedBitsPerChannel@{UsedBitsPerChannel}!CPGFImage@{CPGFImage}}
\subsubsection{\texorpdfstring{UsedBitsPerChannel()}{UsedBitsPerChannel()}}
{\footnotesize\ttfamily B\+Y\+TE C\+P\+G\+F\+Image\+::\+Used\+Bits\+Per\+Channel (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const}

Returns number of used bits per input/output image channel. Precondition\+: header must be initialized. \begin{DoxyReturn}{Returns}
number of used bits per input/output image channel. 
\end{DoxyReturn}


Definition at line 755 of file P\+G\+Fimage.\+cpp.


\begin{DoxyCode}{0}
\DoxyCodeLine{755                                          \{}
\DoxyCodeLine{756         \textcolor{keyword}{const} BYTE bpc = \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_aedea199e29cd6c404c82ab97c67e46b4}{bpp}}/\mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_abda7a5f282421cd7e789da62f657efa0}{channels}};}
\DoxyCodeLine{757 }
\DoxyCodeLine{758         \textcolor{keywordflow}{if} (bpc > 8) \{}
\DoxyCodeLine{759                 \textcolor{keywordflow}{return} \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_abddcc9ee6e17690986cf77a6d16aceb6}{usedBitsPerChannel}};}
\DoxyCodeLine{760         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{761                 \textcolor{keywordflow}{return} bpc;}
\DoxyCodeLine{762         \}}
\DoxyCodeLine{763 \}}

\end{DoxyCode}
\mbox{\Hypertarget{classCPGFImage_aa872f5010f55a3bc696706d259b52051}\label{classCPGFImage_aa872f5010f55a3bc696706d259b52051}} 
\index{CPGFImage@{CPGFImage}!Version@{Version}}
\index{Version@{Version}!CPGFImage@{CPGFImage}}
\subsubsection{\texorpdfstring{Version()}{Version()}}
{\footnotesize\ttfamily B\+Y\+TE C\+P\+G\+F\+Image\+::\+Version (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}

Returns the used codec major version of a pgf image \begin{DoxyReturn}{Returns}
P\+GF codec major version of this image 
\end{DoxyReturn}


Definition at line 484 of file P\+G\+Fimage.\+h.


\begin{DoxyCode}{0}
\DoxyCodeLine{484 \{ BYTE ver = \mbox{\hyperlink{classCPGFImage_a58e8d626654a10486149146c8cd41d11}{CodecMajorVersion}}(\mbox{\hyperlink{classCPGFImage_ad5ed0ec587742ebf46f72be4abde305d}{m\_preHeader}}.\mbox{\hyperlink{structPGFMagicVersion_aa7ff5e50537cac9dd4c62d4c8982d09d}{version}}); \textcolor{keywordflow}{return} (ver <= 7) ? ver : (BYTE)\mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a637699477fb97e62d8cc3c102fac1fbb}{version}}.\mbox{\hyperlink{structPGFVersionNumber_a382f48922a9135e41e53f60e28815af2}{major}}; \}}

\end{DoxyCode}
\mbox{\Hypertarget{classCPGFImage_a327590f3bda3700649fbc7c99f8206f2}\label{classCPGFImage_a327590f3bda3700649fbc7c99f8206f2}} 
\index{CPGFImage@{CPGFImage}!Width@{Width}}
\index{Width@{Width}!CPGFImage@{CPGFImage}}
\subsubsection{\texorpdfstring{Width()}{Width()}}
{\footnotesize\ttfamily U\+I\+N\+T32 C\+P\+G\+F\+Image\+::\+Width (\begin{DoxyParamCaption}\item[{int}]{level = {\ttfamily 0} }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}

Return image width of channel 0 at given level in pixels. The returned width is independent of any Read-\/operations and R\+OI. 
\begin{DoxyParams}{Parameters}
{\em level} & A level \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
Image level width in pixels 
\end{DoxyReturn}


Definition at line 413 of file P\+G\+Fimage.\+h.


\begin{DoxyCode}{0}
\DoxyCodeLine{413 \{ ASSERT(level >= 0); \textcolor{keywordflow}{return} \mbox{\hyperlink{classCPGFImage_ad7e2f885a059a39ca15a47ecb497833b}{LevelSizeL}}(\mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a766a68c3284c2ae6d2f54c82e7350ed9}{width}}, level); \}}

\end{DoxyCode}
\mbox{\Hypertarget{classCPGFImage_acd13d233dceaeefce3def7d71ebf4f82}\label{classCPGFImage_acd13d233dceaeefce3def7d71ebf4f82}} 
\index{CPGFImage@{CPGFImage}!Write@{Write}}
\index{Write@{Write}!CPGFImage@{CPGFImage}}
\subsubsection{\texorpdfstring{Write()}{Write()}\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily void C\+P\+G\+F\+Image\+::\+Write (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{classCPGFStream}{C\+P\+G\+F\+Stream}} $\ast$}]{stream,  }\item[{U\+I\+N\+T32 $\ast$}]{n\+Written\+Bytes = {\ttfamily nullptr},  }\item[{Callback\+Ptr}]{cb = {\ttfamily nullptr},  }\item[{void $\ast$}]{data = {\ttfamily nullptr} }\end{DoxyParamCaption})}

Encode and write an entire P\+GF image (header and image) at current stream position. A P\+GF image is structered in levels, numbered between 0 and \mbox{\hyperlink{classCPGFImage_ab3678d05c031dc4cbf5451e7f4f6bdf3}{Levels()}} -\/ 1. Each level can be seen as a single image, containing the same content as all other levels, but in a different size (width, height). The image size at level i is double the size (width, height) of the image at level i+1. The image at level 0 contains the original size. Precondition\+: the P\+GF image contains a valid header (see also Set\+Header(...)). It might throw an \mbox{\hyperlink{structIOException}{I\+O\+Exception}}. 
\begin{DoxyParams}{Parameters}
{\em stream} & A P\+GF stream \\
\hline
{\em n\+Written\+Bytes} & \mbox{[}in-\/out\mbox{]} The number of bytes written into stream are added to the input value. \\
\hline
{\em cb} & A pointer to a callback procedure. The procedure is called after writing a single level. If cb returns true, then it stops proceeding. \\
\hline
{\em data} & Data Pointer to C++ class container to host callback procedure. \\
\hline
\end{DoxyParams}


Definition at line 1220 of file P\+G\+Fimage.\+cpp.


\begin{DoxyCode}{0}
\DoxyCodeLine{1220                                                                                                  \{}
\DoxyCodeLine{1221         ASSERT(stream);}
\DoxyCodeLine{1222         ASSERT(\mbox{\hyperlink{classCPGFImage_ad5ed0ec587742ebf46f72be4abde305d}{m\_preHeader}}.\mbox{\hyperlink{structPGFPreHeader_a71b1463b71b722459dad25a3ef0b492b}{hSize}});}
\DoxyCodeLine{1223 }
\DoxyCodeLine{1224         \textcolor{comment}{// create wavelet transform channels and encoder}}
\DoxyCodeLine{1225         UINT32 nBytes = \mbox{\hyperlink{classCPGFImage_a1d853cd049417f0afc9a868664d7134d}{WriteHeader}}(stream);}
\DoxyCodeLine{1226 }
\DoxyCodeLine{1227         \textcolor{comment}{// write image}}
\DoxyCodeLine{1228         nBytes += \mbox{\hyperlink{classCPGFImage_a0f0657eaf1a62ab14c01834e5c7adb07}{WriteImage}}(stream, cb, data);}
\DoxyCodeLine{1229 }
\DoxyCodeLine{1230         \textcolor{comment}{// return written bytes}}
\DoxyCodeLine{1231         \textcolor{keywordflow}{if} (nWrittenBytes) *nWrittenBytes += nBytes;}
\DoxyCodeLine{1232 \}}

\end{DoxyCode}
\mbox{\Hypertarget{classCPGFImage_a9a0ef3ad10c8a14b2b9a8d6153387ffe}\label{classCPGFImage_a9a0ef3ad10c8a14b2b9a8d6153387ffe}} 
\index{CPGFImage@{CPGFImage}!Write@{Write}}
\index{Write@{Write}!CPGFImage@{CPGFImage}}
\subsubsection{\texorpdfstring{Write()}{Write()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily U\+I\+N\+T32 C\+P\+G\+F\+Image\+::\+Write (\begin{DoxyParamCaption}\item[{int}]{level,  }\item[{Callback\+Ptr}]{cb = {\ttfamily nullptr},  }\item[{void $\ast$}]{data = {\ttfamily nullptr} }\end{DoxyParamCaption})}

Encode and write down to given level at current stream position. A P\+GF image is structered in levels, numbered between 0 and \mbox{\hyperlink{classCPGFImage_ab3678d05c031dc4cbf5451e7f4f6bdf3}{Levels()}} -\/ 1. Each level can be seen as a single image, containing the same content as all other levels, but in a different size (width, height). The image size at level i is double the size (width, height) of the image at level i+1. The image at level 0 contains the original size. Preconditions\+: the P\+GF image contains a valid header (see also Set\+Header(...)) and \mbox{\hyperlink{classCPGFImage_a1d853cd049417f0afc9a868664d7134d}{Write\+Header()}} has been called before. \mbox{\hyperlink{classCPGFImage_ab3678d05c031dc4cbf5451e7f4f6bdf3}{Levels()}} $>$ 0. The R\+OI encoding scheme must be used (see also Set\+Header(...)). It might throw an \mbox{\hyperlink{structIOException}{I\+O\+Exception}}. 
\begin{DoxyParams}{Parameters}
{\em level} & \mbox{[}0, n\+Levels) The image level of the resulting image in the internal image buffer. \\
\hline
{\em cb} & A pointer to a callback procedure. The procedure is called after writing a single level. If cb returns true, then it stops proceeding. \\
\hline
{\em data} & Data Pointer to C++ class container to host callback procedure. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The number of bytes written into stream. 
\end{DoxyReturn}
\mbox{\Hypertarget{classCPGFImage_a1d853cd049417f0afc9a868664d7134d}\label{classCPGFImage_a1d853cd049417f0afc9a868664d7134d}} 
\index{CPGFImage@{CPGFImage}!WriteHeader@{WriteHeader}}
\index{WriteHeader@{WriteHeader}!CPGFImage@{CPGFImage}}
\subsubsection{\texorpdfstring{WriteHeader()}{WriteHeader()}}
{\footnotesize\ttfamily U\+I\+N\+T32 C\+P\+G\+F\+Image\+::\+Write\+Header (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{classCPGFStream}{C\+P\+G\+F\+Stream}} $\ast$}]{stream }\end{DoxyParamCaption})}

Create wavelet transform channels and encoder. Write header at current stream position. Call this method before your first call of Write(int level) or \mbox{\hyperlink{classCPGFImage_a0f0657eaf1a62ab14c01834e5c7adb07}{Write\+Image()}}, but after \mbox{\hyperlink{classCPGFImage_a200790d3be292a19fe8cbdd78ddfc386}{Set\+Header()}}. This method is called inside of Write(stream, ...). It might throw an \mbox{\hyperlink{structIOException}{I\+O\+Exception}}. 
\begin{DoxyParams}{Parameters}
{\em stream} & A P\+GF stream \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The number of bytes written into stream.
\end{DoxyReturn}
Create wavelet transform channels and encoder. Write header at current stream position. Performs forward F\+WT. Call this method before your first call of Write(int level) or \mbox{\hyperlink{classCPGFImage_a0f0657eaf1a62ab14c01834e5c7adb07}{Write\+Image()}}, but after \mbox{\hyperlink{classCPGFImage_a200790d3be292a19fe8cbdd78ddfc386}{Set\+Header()}}. This method is called inside of Write(stream, ...). It might throw an \mbox{\hyperlink{structIOException}{I\+O\+Exception}}. 
\begin{DoxyParams}{Parameters}
{\em stream} & A P\+GF stream \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The number of bytes written into stream. 
\end{DoxyReturn}


Definition at line 978 of file P\+G\+Fimage.\+cpp.


\begin{DoxyCode}{0}
\DoxyCodeLine{978                                                 \{}
\DoxyCodeLine{979         ASSERT(\mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a963890fa1e02a517923f9d0bf0d7e9eb}{nLevels}} <= \mbox{\hyperlink{PGFtypes_8h_a2468e509eae9683e25af403249b743a3}{MaxLevel}});}
\DoxyCodeLine{980         ASSERT(\mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_ac314a16d5984aea88f4a5ff38f49c08b}{quality}} <= \mbox{\hyperlink{PGFtypes_8h_a70d2da7f475eb7f6564e75d64ee77ae4}{MaxQuality}}); \textcolor{comment}{// quality is already initialized}}
\DoxyCodeLine{981 }
\DoxyCodeLine{982         \textcolor{keywordflow}{if} (\mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a963890fa1e02a517923f9d0bf0d7e9eb}{nLevels}} > 0) \{}
\DoxyCodeLine{983                 \textcolor{keyword}{volatile} OSError error = NoError; \textcolor{comment}{// volatile prevents optimizations}}
\DoxyCodeLine{984                 \textcolor{comment}{// create new wt channels}}
\DoxyCodeLine{985 \textcolor{preprocessor}{\#ifdef LIBPGF\_USE\_OPENMP}}
\DoxyCodeLine{986 \textcolor{preprocessor}{                \#pragma omp parallel for default(shared)}}
\DoxyCodeLine{987 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{988                 \textcolor{keywordflow}{for} (\textcolor{keywordtype}{int} i=0; i < \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_abda7a5f282421cd7e789da62f657efa0}{channels}}; i++) \{}
\DoxyCodeLine{989                         \mbox{\hyperlink{PGFtypes_8h_acb1ee3f52ccfad782dcaa0abd79e5d05}{DataT}} *temp = \textcolor{keyword}{nullptr};}
\DoxyCodeLine{990                         \textcolor{keywordflow}{if} (error == NoError) \{}
\DoxyCodeLine{991                                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{classCPGFImage_ae3901a689b7d1dd46d48b042c3d31d5c}{m\_wtChannel}}[i]) \{}
\DoxyCodeLine{992                                         ASSERT(\mbox{\hyperlink{classCPGFImage_a36f7f20b38a9cb3a9c88032f5f886345}{m\_channel}}[i]);}
\DoxyCodeLine{993                                         \textcolor{comment}{// copy m\_channel to temp}}
\DoxyCodeLine{994                                         \textcolor{keywordtype}{int} size = \mbox{\hyperlink{classCPGFImage_a170fd448152303a2d44848a52a8916a0}{m\_height}}[i]*\mbox{\hyperlink{classCPGFImage_ab6d97aca28795fae697fdda4b8acd8f9}{m\_width}}[i];}
\DoxyCodeLine{995                                         temp = \textcolor{keyword}{new}(std::nothrow) \mbox{\hyperlink{PGFtypes_8h_acb1ee3f52ccfad782dcaa0abd79e5d05}{DataT}}[size];}
\DoxyCodeLine{996                                         \textcolor{keywordflow}{if} (temp) \{}
\DoxyCodeLine{997                                                 memcpy(temp, \mbox{\hyperlink{classCPGFImage_a36f7f20b38a9cb3a9c88032f5f886345}{m\_channel}}[i], size*\mbox{\hyperlink{PGFtypes_8h_adbb49c2b6ab931f68f08a8dc1141727d}{DataTSize}});}
\DoxyCodeLine{998                                                 \textcolor{keyword}{delete} \mbox{\hyperlink{classCPGFImage_ae3901a689b7d1dd46d48b042c3d31d5c}{m\_wtChannel}}[i];       \textcolor{comment}{// also deletes m\_channel}}
\DoxyCodeLine{999                                                 \mbox{\hyperlink{classCPGFImage_a36f7f20b38a9cb3a9c88032f5f886345}{m\_channel}}[i] = \textcolor{keyword}{nullptr};}
\DoxyCodeLine{1000                                         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{1001                                                 error = InsufficientMemory;}
\DoxyCodeLine{1002                                         \}}
\DoxyCodeLine{1003                                 \}}
\DoxyCodeLine{1004                                 \textcolor{keywordflow}{if} (error == NoError) \{}
\DoxyCodeLine{1005                                         \textcolor{keywordflow}{if} (temp) \{}
\DoxyCodeLine{1006                                                 ASSERT(!\mbox{\hyperlink{classCPGFImage_a36f7f20b38a9cb3a9c88032f5f886345}{m\_channel}}[i]);}
\DoxyCodeLine{1007                                                 \mbox{\hyperlink{classCPGFImage_a36f7f20b38a9cb3a9c88032f5f886345}{m\_channel}}[i] = temp;}
\DoxyCodeLine{1008                                         \}}
\DoxyCodeLine{1009                                         \mbox{\hyperlink{classCPGFImage_ae3901a689b7d1dd46d48b042c3d31d5c}{m\_wtChannel}}[i] = \textcolor{keyword}{new} \mbox{\hyperlink{classCSubband_a30d2cc4fc1b1060bf29a6576d926a615}{CWaveletTransform}}(\mbox{\hyperlink{classCPGFImage_ab6d97aca28795fae697fdda4b8acd8f9}{m\_width}}[i], \mbox{\hyperlink{classCPGFImage_a170fd448152303a2d44848a52a8916a0}{m\_height}}[i], \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a963890fa1e02a517923f9d0bf0d7e9eb}{nLevels}}, \mbox{\hyperlink{classCPGFImage_a36f7f20b38a9cb3a9c88032f5f886345}{m\_channel}}[i]);}
\DoxyCodeLine{1010                                         \textcolor{keywordflow}{if} (\mbox{\hyperlink{classCPGFImage_ae3901a689b7d1dd46d48b042c3d31d5c}{m\_wtChannel}}[i]) \{}
\DoxyCodeLine{1011 \textcolor{preprocessor}{                                        \#ifdef \_\_PGFROISUPPORT\_\_}}
\DoxyCodeLine{1012                                                 \mbox{\hyperlink{classCPGFImage_ae3901a689b7d1dd46d48b042c3d31d5c}{m\_wtChannel}}[i]->SetROI(\mbox{\hyperlink{structPGFRect}{PGFRect}}(0, 0, \mbox{\hyperlink{classCPGFImage_ab6d97aca28795fae697fdda4b8acd8f9}{m\_width}}[i], \mbox{\hyperlink{classCPGFImage_a170fd448152303a2d44848a52a8916a0}{m\_height}}[i]));}
\DoxyCodeLine{1013 \textcolor{preprocessor}{                                        \#endif}}
\DoxyCodeLine{1014                                         }
\DoxyCodeLine{1015                                                 \textcolor{comment}{// wavelet subband decomposition }}
\DoxyCodeLine{1016                                                 \textcolor{keywordflow}{for} (\textcolor{keywordtype}{int} l=0; error == NoError \&\& l < \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a963890fa1e02a517923f9d0bf0d7e9eb}{nLevels}}; l++) \{}
\DoxyCodeLine{1017                                                         OSError err = \mbox{\hyperlink{classCPGFImage_ae3901a689b7d1dd46d48b042c3d31d5c}{m\_wtChannel}}[i]->\mbox{\hyperlink{classCWaveletTransform_a7278418accd9329b9264ebe5f584001f}{ForwardTransform}}(l, \mbox{\hyperlink{classCPGFImage_a57cc024db6e510f95f3238f448a0fed5}{m\_quant}});}
\DoxyCodeLine{1018                                                         \textcolor{keywordflow}{if} (err != NoError) error = err;}
\DoxyCodeLine{1019                                                 \}}
\DoxyCodeLine{1020                                         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{1021                                                 \textcolor{keyword}{delete}[] \mbox{\hyperlink{classCPGFImage_a36f7f20b38a9cb3a9c88032f5f886345}{m\_channel}}[i];}
\DoxyCodeLine{1022                                                 error = InsufficientMemory;}
\DoxyCodeLine{1023                                         \}}
\DoxyCodeLine{1024                                 \}}
\DoxyCodeLine{1025                         \}}
\DoxyCodeLine{1026                 \}}
\DoxyCodeLine{1027                 \textcolor{keywordflow}{if} (error != NoError) \{}
\DoxyCodeLine{1028                         \textcolor{comment}{// free already allocated memory}}
\DoxyCodeLine{1029                         \textcolor{keywordflow}{for} (\textcolor{keywordtype}{int} i=0; i < \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_abda7a5f282421cd7e789da62f657efa0}{channels}}; i++) \{}
\DoxyCodeLine{1030                                 \textcolor{keyword}{delete} \mbox{\hyperlink{classCPGFImage_ae3901a689b7d1dd46d48b042c3d31d5c}{m\_wtChannel}}[i];}
\DoxyCodeLine{1031                         \}}
\DoxyCodeLine{1032                         ReturnWithError(error);}
\DoxyCodeLine{1033                 \}}
\DoxyCodeLine{1034 }
\DoxyCodeLine{1035                 \mbox{\hyperlink{classCPGFImage_a2790b468b6d4841cd34473c4b61d0c7f}{m\_currentLevel}} = \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a963890fa1e02a517923f9d0bf0d7e9eb}{nLevels}};}
\DoxyCodeLine{1036 }
\DoxyCodeLine{1037                 \textcolor{comment}{// create encoder, write headers and user data, but not level-length area}}
\DoxyCodeLine{1038                 \mbox{\hyperlink{classCPGFImage_a6ef048255812525cd56d7b04df5e6731}{m\_encoder}} = \textcolor{keyword}{new} \mbox{\hyperlink{classCEncoder}{CEncoder}}(stream, \mbox{\hyperlink{classCPGFImage_ad5ed0ec587742ebf46f72be4abde305d}{m\_preHeader}}, \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}, \mbox{\hyperlink{classCPGFImage_ab8635df22839ffb68bada53e38b9ce73}{m\_postHeader}}, \mbox{\hyperlink{classCPGFImage_acf4ae6e169ddf84e32cf9b57a22800b3}{m\_userDataPos}}, \mbox{\hyperlink{classCPGFImage_a140110570c6d492b23db50189d3f4d48}{m\_useOMPinEncoder}});}
\DoxyCodeLine{1039                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{classCPGFImage_a6925d3950e8f48487205d46de7920d3e}{m\_favorSpeedOverSize}}) \mbox{\hyperlink{classCPGFImage_a6ef048255812525cd56d7b04df5e6731}{m\_encoder}}->\mbox{\hyperlink{classCEncoder_aa2ffd887a5d8b2e63dfa5b7188ca49f1}{FavorSpeedOverSize}}();}
\DoxyCodeLine{1040 }
\DoxyCodeLine{1041 \textcolor{preprocessor}{        \#ifdef \_\_PGFROISUPPORT\_\_}}
\DoxyCodeLine{1042                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{classCPGFImage_a9db775cf3a36997b55106fbab7284c14}{ROIisSupported}}()) \{}
\DoxyCodeLine{1043                         \textcolor{comment}{// new encoding scheme supporting ROI}}
\DoxyCodeLine{1044                         \mbox{\hyperlink{classCPGFImage_a6ef048255812525cd56d7b04df5e6731}{m\_encoder}}->SetROI();}
\DoxyCodeLine{1045                 \}}
\DoxyCodeLine{1046 \textcolor{preprocessor}{        \#endif}}
\DoxyCodeLine{1047 }
\DoxyCodeLine{1048         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{1049                 \textcolor{comment}{// very small image: we don't use DWT and encoding}}
\DoxyCodeLine{1050 }
\DoxyCodeLine{1051                 \textcolor{comment}{// create encoder, write headers and user data, but not level-length area}}
\DoxyCodeLine{1052                 \mbox{\hyperlink{classCPGFImage_a6ef048255812525cd56d7b04df5e6731}{m\_encoder}} = \textcolor{keyword}{new} \mbox{\hyperlink{classCEncoder}{CEncoder}}(stream, \mbox{\hyperlink{classCPGFImage_ad5ed0ec587742ebf46f72be4abde305d}{m\_preHeader}}, \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}, \mbox{\hyperlink{classCPGFImage_ab8635df22839ffb68bada53e38b9ce73}{m\_postHeader}}, \mbox{\hyperlink{classCPGFImage_acf4ae6e169ddf84e32cf9b57a22800b3}{m\_userDataPos}}, \mbox{\hyperlink{classCPGFImage_a140110570c6d492b23db50189d3f4d48}{m\_useOMPinEncoder}});}
\DoxyCodeLine{1053         \}}
\DoxyCodeLine{1054 }
\DoxyCodeLine{1055         INT64 nBytes = \mbox{\hyperlink{classCPGFImage_a6ef048255812525cd56d7b04df5e6731}{m\_encoder}}->\mbox{\hyperlink{classCEncoder_a5c8dc9273c8a17ce72e86fec5f389112}{ComputeHeaderLength}}();}
\DoxyCodeLine{1056         \textcolor{keywordflow}{return} (nBytes > 0) ? (UINT32)nBytes : 0;}
\DoxyCodeLine{1057 \}}

\end{DoxyCode}
\mbox{\Hypertarget{classCPGFImage_a0f0657eaf1a62ab14c01834e5c7adb07}\label{classCPGFImage_a0f0657eaf1a62ab14c01834e5c7adb07}} 
\index{CPGFImage@{CPGFImage}!WriteImage@{WriteImage}}
\index{WriteImage@{WriteImage}!CPGFImage@{CPGFImage}}
\subsubsection{\texorpdfstring{WriteImage()}{WriteImage()}}
{\footnotesize\ttfamily U\+I\+N\+T32 C\+P\+G\+F\+Image\+::\+Write\+Image (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{classCPGFStream}{C\+P\+G\+F\+Stream}} $\ast$}]{stream,  }\item[{Callback\+Ptr}]{cb = {\ttfamily nullptr},  }\item[{void $\ast$}]{data = {\ttfamily nullptr} }\end{DoxyParamCaption})}

Encode and write an image at current stream position. Call this method after \mbox{\hyperlink{classCPGFImage_a1d853cd049417f0afc9a868664d7134d}{Write\+Header()}}. In case you want to write uncached metadata, then do that after \mbox{\hyperlink{classCPGFImage_a1d853cd049417f0afc9a868664d7134d}{Write\+Header()}} and before \mbox{\hyperlink{classCPGFImage_a0f0657eaf1a62ab14c01834e5c7adb07}{Write\+Image()}}. This method is called inside of Write(stream, ...). It might throw an \mbox{\hyperlink{structIOException}{I\+O\+Exception}}. 
\begin{DoxyParams}{Parameters}
{\em stream} & A P\+GF stream \\
\hline
{\em cb} & A pointer to a callback procedure. The procedure is called after writing a single level. If cb returns true, then it stops proceeding. \\
\hline
{\em data} & Data Pointer to C++ class container to host callback procedure. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The number of bytes written into stream. 
\end{DoxyReturn}


Definition at line 1149 of file P\+G\+Fimage.\+cpp.


\begin{DoxyCode}{0}
\DoxyCodeLine{1149                                                                                \{}
\DoxyCodeLine{1150         ASSERT(stream);}
\DoxyCodeLine{1151         ASSERT(\mbox{\hyperlink{classCPGFImage_ad5ed0ec587742ebf46f72be4abde305d}{m\_preHeader}}.\mbox{\hyperlink{structPGFPreHeader_a71b1463b71b722459dad25a3ef0b492b}{hSize}});}
\DoxyCodeLine{1152 }
\DoxyCodeLine{1153         \textcolor{keywordtype}{int} levels = \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a963890fa1e02a517923f9d0bf0d7e9eb}{nLevels}};}
\DoxyCodeLine{1154         \textcolor{keywordtype}{double} percent = pow(0.25, levels);}
\DoxyCodeLine{1155 }
\DoxyCodeLine{1156         \textcolor{comment}{// update post-header size, rewrite pre-header, and write dummy levelLength}}
\DoxyCodeLine{1157         UINT32 nWrittenBytes = \mbox{\hyperlink{classCPGFImage_a921e1ec08da8ddf6ab4d5657e5610fee}{UpdatePostHeaderSize}}();}
\DoxyCodeLine{1158 }
\DoxyCodeLine{1159         \textcolor{keywordflow}{if} (levels == 0) \{}
\DoxyCodeLine{1160                 \textcolor{comment}{// for very small images: write channels uncoded}}
\DoxyCodeLine{1161                 \textcolor{keywordflow}{for} (\textcolor{keywordtype}{int} c=0; c < \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_abda7a5f282421cd7e789da62f657efa0}{channels}}; c++) \{}
\DoxyCodeLine{1162                         \textcolor{keyword}{const} UINT32 size = \mbox{\hyperlink{classCPGFImage_ab6d97aca28795fae697fdda4b8acd8f9}{m\_width}}[c]*\mbox{\hyperlink{classCPGFImage_a170fd448152303a2d44848a52a8916a0}{m\_height}}[c];}
\DoxyCodeLine{1163 }
\DoxyCodeLine{1164                         \textcolor{comment}{// write channel data into stream}}
\DoxyCodeLine{1165                         \textcolor{keywordflow}{for} (UINT32 i=0; i < size; i++) \{}
\DoxyCodeLine{1166                                 \textcolor{keywordtype}{int} count = \mbox{\hyperlink{PGFtypes_8h_adbb49c2b6ab931f68f08a8dc1141727d}{DataTSize}};}
\DoxyCodeLine{1167                                 stream->\mbox{\hyperlink{classCPGFStream_a0a46ae977995134787219288f4123134}{Write}}(\&count, \&\mbox{\hyperlink{classCPGFImage_a36f7f20b38a9cb3a9c88032f5f886345}{m\_channel}}[c][i]);}
\DoxyCodeLine{1168                         \}}
\DoxyCodeLine{1169                 \}}
\DoxyCodeLine{1170 }
\DoxyCodeLine{1171                 \textcolor{comment}{// now update progress}}
\DoxyCodeLine{1172                 \textcolor{keywordflow}{if} (cb) \{}
\DoxyCodeLine{1173                         \textcolor{keywordflow}{if} ((*cb)(1, \textcolor{keyword}{true}, data)) ReturnWithError(EscapePressed);}
\DoxyCodeLine{1174                 \}}
\DoxyCodeLine{1175 }
\DoxyCodeLine{1176         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{1177                 \textcolor{comment}{// encode quantized wavelet coefficients and write to PGF file}}
\DoxyCodeLine{1178                 \textcolor{comment}{// encode subbands, higher levels first}}
\DoxyCodeLine{1179                 \textcolor{comment}{// color channels are interleaved}}
\DoxyCodeLine{1180 }
\DoxyCodeLine{1181                 \textcolor{comment}{// encode all levels}}
\DoxyCodeLine{1182                 \textcolor{keywordflow}{for} (\mbox{\hyperlink{classCPGFImage_a2790b468b6d4841cd34473c4b61d0c7f}{m\_currentLevel}} = levels; \mbox{\hyperlink{classCPGFImage_a2790b468b6d4841cd34473c4b61d0c7f}{m\_currentLevel}} > 0; ) \{}
\DoxyCodeLine{1183                         \mbox{\hyperlink{classCPGFImage_a1075a31893ee4ea2c686f5b471dd3664}{WriteLevel}}(); \textcolor{comment}{// decrements m\_currentLevel}}
\DoxyCodeLine{1184 }
\DoxyCodeLine{1185                         \textcolor{comment}{// now update progress}}
\DoxyCodeLine{1186                         \textcolor{keywordflow}{if} (cb) \{}
\DoxyCodeLine{1187                                 percent *= 4;}
\DoxyCodeLine{1188                                 \textcolor{keywordflow}{if} ((*cb)(percent, \textcolor{keyword}{true}, data)) ReturnWithError(EscapePressed);}
\DoxyCodeLine{1189                         \}}
\DoxyCodeLine{1190                 \}}
\DoxyCodeLine{1191 }
\DoxyCodeLine{1192                 \textcolor{comment}{// flush encoder and write level lengths}}
\DoxyCodeLine{1193                 \mbox{\hyperlink{classCPGFImage_a6ef048255812525cd56d7b04df5e6731}{m\_encoder}}->\mbox{\hyperlink{classCEncoder_a8e25f046e6f9bb67a7c5b3e71e5b6a32}{Flush}}();}
\DoxyCodeLine{1194         \}}
\DoxyCodeLine{1195 }
\DoxyCodeLine{1196         \textcolor{comment}{// update level lengths}}
\DoxyCodeLine{1197         nWrittenBytes += \mbox{\hyperlink{classCPGFImage_a6ef048255812525cd56d7b04df5e6731}{m\_encoder}}->\mbox{\hyperlink{classCEncoder_a93d5e9bf075e804eb9626d4b0292c4dd}{UpdateLevelLength}}(); \textcolor{comment}{// return written image bytes }}
\DoxyCodeLine{1198 }
\DoxyCodeLine{1199         \textcolor{comment}{// delete encoder}}
\DoxyCodeLine{1200         \textcolor{keyword}{delete} \mbox{\hyperlink{classCPGFImage_a6ef048255812525cd56d7b04df5e6731}{m\_encoder}}; \mbox{\hyperlink{classCPGFImage_a6ef048255812525cd56d7b04df5e6731}{m\_encoder}} = \textcolor{keyword}{nullptr};}
\DoxyCodeLine{1201 }
\DoxyCodeLine{1202         ASSERT(!\mbox{\hyperlink{classCPGFImage_a6ef048255812525cd56d7b04df5e6731}{m\_encoder}});}
\DoxyCodeLine{1203 }
\DoxyCodeLine{1204         \textcolor{keywordflow}{return} nWrittenBytes;}
\DoxyCodeLine{1205 \}}

\end{DoxyCode}
\mbox{\Hypertarget{classCPGFImage_a1075a31893ee4ea2c686f5b471dd3664}\label{classCPGFImage_a1075a31893ee4ea2c686f5b471dd3664}} 
\index{CPGFImage@{CPGFImage}!WriteLevel@{WriteLevel}}
\index{WriteLevel@{WriteLevel}!CPGFImage@{CPGFImage}}
\subsubsection{\texorpdfstring{WriteLevel()}{WriteLevel()}}
{\footnotesize\ttfamily void C\+P\+G\+F\+Image\+::\+Write\+Level (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



Definition at line 1067 of file P\+G\+Fimage.\+cpp.


\begin{DoxyCode}{0}
\DoxyCodeLine{1067                            \{}
\DoxyCodeLine{1068         ASSERT(\mbox{\hyperlink{classCPGFImage_a6ef048255812525cd56d7b04df5e6731}{m\_encoder}});}
\DoxyCodeLine{1069         ASSERT(\mbox{\hyperlink{classCPGFImage_a2790b468b6d4841cd34473c4b61d0c7f}{m\_currentLevel}} > 0);}
\DoxyCodeLine{1070         ASSERT(\mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a963890fa1e02a517923f9d0bf0d7e9eb}{nLevels}} > 0);}
\DoxyCodeLine{1071 }
\DoxyCodeLine{1072 \textcolor{preprocessor}{\#ifdef \_\_PGFROISUPPORT\_\_}}
\DoxyCodeLine{1073         \textcolor{keywordflow}{if} (\mbox{\hyperlink{classCPGFImage_a9db775cf3a36997b55106fbab7284c14}{ROIisSupported}}()) \{}
\DoxyCodeLine{1074                 \textcolor{keyword}{const} \textcolor{keywordtype}{int} lastChannel = \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_abda7a5f282421cd7e789da62f657efa0}{channels}} - 1;}
\DoxyCodeLine{1075 }
\DoxyCodeLine{1076                 \textcolor{keywordflow}{for} (\textcolor{keywordtype}{int} i=0; i < \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_abda7a5f282421cd7e789da62f657efa0}{channels}}; i++) \{}
\DoxyCodeLine{1077                         \textcolor{comment}{// get number of tiles and tile indices}}
\DoxyCodeLine{1078                         \textcolor{keyword}{const} UINT32 nTiles = \mbox{\hyperlink{classCPGFImage_ae3901a689b7d1dd46d48b042c3d31d5c}{m\_wtChannel}}[i]->GetNofTiles(\mbox{\hyperlink{classCPGFImage_a2790b468b6d4841cd34473c4b61d0c7f}{m\_currentLevel}});}
\DoxyCodeLine{1079                         \textcolor{keyword}{const} UINT32 lastTile = nTiles - 1;}
\DoxyCodeLine{1080 }
\DoxyCodeLine{1081                         \textcolor{keywordflow}{if} (\mbox{\hyperlink{classCPGFImage_a2790b468b6d4841cd34473c4b61d0c7f}{m\_currentLevel}} == \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a963890fa1e02a517923f9d0bf0d7e9eb}{nLevels}}) \{}
\DoxyCodeLine{1082                                 \textcolor{comment}{// last level also has LL band}}
\DoxyCodeLine{1083                                 ASSERT(nTiles == 1);}
\DoxyCodeLine{1084                                 \mbox{\hyperlink{classCPGFImage_ae3901a689b7d1dd46d48b042c3d31d5c}{m\_wtChannel}}[i]->\mbox{\hyperlink{classCWaveletTransform_a347b59b1d7bc18de9294c714afac7ddf}{GetSubband}}(\mbox{\hyperlink{classCPGFImage_a2790b468b6d4841cd34473c4b61d0c7f}{m\_currentLevel}}, \mbox{\hyperlink{PGFtypes_8h_a871118a09520247c78a71ecd7b0abd58a11ea57bac296f79f8acbaf6fdf6bcc20}{LL}})->\mbox{\hyperlink{classCSubband_a85cb6f480676ba18999f66e682370d65}{ExtractTile}}(*\mbox{\hyperlink{classCPGFImage_a6ef048255812525cd56d7b04df5e6731}{m\_encoder}});}
\DoxyCodeLine{1085                                 \mbox{\hyperlink{classCPGFImage_a6ef048255812525cd56d7b04df5e6731}{m\_encoder}}->EncodeTileBuffer(); \textcolor{comment}{// encode macro block with tile-end = true}}
\DoxyCodeLine{1086                         \}}
\DoxyCodeLine{1087                         \textcolor{keywordflow}{for} (UINT32 tileY=0; tileY < nTiles; tileY++) \{}
\DoxyCodeLine{1088                                 \textcolor{keywordflow}{for} (UINT32 tileX=0; tileX < nTiles; tileX++) \{}
\DoxyCodeLine{1089                                         \textcolor{comment}{// extract tile to macro block and encode already filled macro blocks with tile-end = false}}
\DoxyCodeLine{1090                                         \mbox{\hyperlink{classCPGFImage_ae3901a689b7d1dd46d48b042c3d31d5c}{m\_wtChannel}}[i]->\mbox{\hyperlink{classCWaveletTransform_a347b59b1d7bc18de9294c714afac7ddf}{GetSubband}}(\mbox{\hyperlink{classCPGFImage_a2790b468b6d4841cd34473c4b61d0c7f}{m\_currentLevel}}, \mbox{\hyperlink{PGFtypes_8h_a871118a09520247c78a71ecd7b0abd58aad18f3a107c5bc020bff8923ad43bbc1}{HL}})->\mbox{\hyperlink{classCSubband_a85cb6f480676ba18999f66e682370d65}{ExtractTile}}(*\mbox{\hyperlink{classCPGFImage_a6ef048255812525cd56d7b04df5e6731}{m\_encoder}}, \textcolor{keyword}{true}, tileX, tileY);}
\DoxyCodeLine{1091                                         \mbox{\hyperlink{classCPGFImage_ae3901a689b7d1dd46d48b042c3d31d5c}{m\_wtChannel}}[i]->\mbox{\hyperlink{classCWaveletTransform_a347b59b1d7bc18de9294c714afac7ddf}{GetSubband}}(\mbox{\hyperlink{classCPGFImage_a2790b468b6d4841cd34473c4b61d0c7f}{m\_currentLevel}}, \mbox{\hyperlink{PGFtypes_8h_a871118a09520247c78a71ecd7b0abd58aadab8e0111f669b137544a4ecce92997}{LH}})->\mbox{\hyperlink{classCSubband_a85cb6f480676ba18999f66e682370d65}{ExtractTile}}(*\mbox{\hyperlink{classCPGFImage_a6ef048255812525cd56d7b04df5e6731}{m\_encoder}}, \textcolor{keyword}{true}, tileX, tileY);}
\DoxyCodeLine{1092                                         \mbox{\hyperlink{classCPGFImage_ae3901a689b7d1dd46d48b042c3d31d5c}{m\_wtChannel}}[i]->\mbox{\hyperlink{classCWaveletTransform_a347b59b1d7bc18de9294c714afac7ddf}{GetSubband}}(\mbox{\hyperlink{classCPGFImage_a2790b468b6d4841cd34473c4b61d0c7f}{m\_currentLevel}}, \mbox{\hyperlink{PGFtypes_8h_a871118a09520247c78a71ecd7b0abd58adb4fbeed3fdce116b66baef714de6667}{HH}})->\mbox{\hyperlink{classCSubband_a85cb6f480676ba18999f66e682370d65}{ExtractTile}}(*\mbox{\hyperlink{classCPGFImage_a6ef048255812525cd56d7b04df5e6731}{m\_encoder}}, \textcolor{keyword}{true}, tileX, tileY);}
\DoxyCodeLine{1093                                         \textcolor{keywordflow}{if} (i == lastChannel \&\& tileY == lastTile \&\& tileX == lastTile) \{}
\DoxyCodeLine{1094                                                 \textcolor{comment}{// all necessary data are buffered. next call of EncodeTileBuffer will write the last piece of data of the current level.}}
\DoxyCodeLine{1095                                                 \mbox{\hyperlink{classCPGFImage_a6ef048255812525cd56d7b04df5e6731}{m\_encoder}}->\mbox{\hyperlink{classCEncoder_acff251105003f4a4376a01180dbdc757}{SetEncodedLevel}}(--\mbox{\hyperlink{classCPGFImage_a2790b468b6d4841cd34473c4b61d0c7f}{m\_currentLevel}});}
\DoxyCodeLine{1096                                         \}}
\DoxyCodeLine{1097                                         \mbox{\hyperlink{classCPGFImage_a6ef048255812525cd56d7b04df5e6731}{m\_encoder}}->EncodeTileBuffer(); \textcolor{comment}{// encode last macro block with tile-end = true}}
\DoxyCodeLine{1098                                 \}}
\DoxyCodeLine{1099                         \}}
\DoxyCodeLine{1100                 \}}
\DoxyCodeLine{1101         \} \textcolor{keywordflow}{else} }
\DoxyCodeLine{1102 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{1103         \{}
\DoxyCodeLine{1104                 \textcolor{keywordflow}{for} (\textcolor{keywordtype}{int} i=0; i < \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_abda7a5f282421cd7e789da62f657efa0}{channels}}; i++) \{}
\DoxyCodeLine{1105                         ASSERT(\mbox{\hyperlink{classCPGFImage_ae3901a689b7d1dd46d48b042c3d31d5c}{m\_wtChannel}}[i]);}
\DoxyCodeLine{1106                         \textcolor{keywordflow}{if} (\mbox{\hyperlink{classCPGFImage_a2790b468b6d4841cd34473c4b61d0c7f}{m\_currentLevel}} == \mbox{\hyperlink{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}{m\_header}}.\mbox{\hyperlink{structPGFHeader_a963890fa1e02a517923f9d0bf0d7e9eb}{nLevels}}) \{ }
\DoxyCodeLine{1107                                 \textcolor{comment}{// last level also has LL band}}
\DoxyCodeLine{1108                                 \mbox{\hyperlink{classCPGFImage_ae3901a689b7d1dd46d48b042c3d31d5c}{m\_wtChannel}}[i]->\mbox{\hyperlink{classCWaveletTransform_a347b59b1d7bc18de9294c714afac7ddf}{GetSubband}}(\mbox{\hyperlink{classCPGFImage_a2790b468b6d4841cd34473c4b61d0c7f}{m\_currentLevel}}, \mbox{\hyperlink{PGFtypes_8h_a871118a09520247c78a71ecd7b0abd58a11ea57bac296f79f8acbaf6fdf6bcc20}{LL}})->\mbox{\hyperlink{classCSubband_a85cb6f480676ba18999f66e682370d65}{ExtractTile}}(*\mbox{\hyperlink{classCPGFImage_a6ef048255812525cd56d7b04df5e6731}{m\_encoder}});}
\DoxyCodeLine{1109                         \}}
\DoxyCodeLine{1110                         \textcolor{comment}{//encoder.EncodeInterleaved(m\_wtChannel[i], m\_currentLevel, m\_quant); // until version 4}}
\DoxyCodeLine{1111                         \mbox{\hyperlink{classCPGFImage_ae3901a689b7d1dd46d48b042c3d31d5c}{m\_wtChannel}}[i]->\mbox{\hyperlink{classCWaveletTransform_a347b59b1d7bc18de9294c714afac7ddf}{GetSubband}}(\mbox{\hyperlink{classCPGFImage_a2790b468b6d4841cd34473c4b61d0c7f}{m\_currentLevel}}, \mbox{\hyperlink{PGFtypes_8h_a871118a09520247c78a71ecd7b0abd58aad18f3a107c5bc020bff8923ad43bbc1}{HL}})->\mbox{\hyperlink{classCSubband_a85cb6f480676ba18999f66e682370d65}{ExtractTile}}(*\mbox{\hyperlink{classCPGFImage_a6ef048255812525cd56d7b04df5e6731}{m\_encoder}}); \textcolor{comment}{// since version 5}}
\DoxyCodeLine{1112                         \mbox{\hyperlink{classCPGFImage_ae3901a689b7d1dd46d48b042c3d31d5c}{m\_wtChannel}}[i]->\mbox{\hyperlink{classCWaveletTransform_a347b59b1d7bc18de9294c714afac7ddf}{GetSubband}}(\mbox{\hyperlink{classCPGFImage_a2790b468b6d4841cd34473c4b61d0c7f}{m\_currentLevel}}, \mbox{\hyperlink{PGFtypes_8h_a871118a09520247c78a71ecd7b0abd58aadab8e0111f669b137544a4ecce92997}{LH}})->\mbox{\hyperlink{classCSubband_a85cb6f480676ba18999f66e682370d65}{ExtractTile}}(*\mbox{\hyperlink{classCPGFImage_a6ef048255812525cd56d7b04df5e6731}{m\_encoder}}); \textcolor{comment}{// since version 5}}
\DoxyCodeLine{1113                         \mbox{\hyperlink{classCPGFImage_ae3901a689b7d1dd46d48b042c3d31d5c}{m\_wtChannel}}[i]->\mbox{\hyperlink{classCWaveletTransform_a347b59b1d7bc18de9294c714afac7ddf}{GetSubband}}(\mbox{\hyperlink{classCPGFImage_a2790b468b6d4841cd34473c4b61d0c7f}{m\_currentLevel}}, \mbox{\hyperlink{PGFtypes_8h_a871118a09520247c78a71ecd7b0abd58adb4fbeed3fdce116b66baef714de6667}{HH}})->\mbox{\hyperlink{classCSubband_a85cb6f480676ba18999f66e682370d65}{ExtractTile}}(*\mbox{\hyperlink{classCPGFImage_a6ef048255812525cd56d7b04df5e6731}{m\_encoder}});}
\DoxyCodeLine{1114                 \}}
\DoxyCodeLine{1115 }
\DoxyCodeLine{1116                 \textcolor{comment}{// all necessary data are buffered. next call of EncodeBuffer will write the last piece of data of the current level.}}
\DoxyCodeLine{1117                 \mbox{\hyperlink{classCPGFImage_a6ef048255812525cd56d7b04df5e6731}{m\_encoder}}->\mbox{\hyperlink{classCEncoder_acff251105003f4a4376a01180dbdc757}{SetEncodedLevel}}(--\mbox{\hyperlink{classCPGFImage_a2790b468b6d4841cd34473c4b61d0c7f}{m\_currentLevel}});}
\DoxyCodeLine{1118         \}}
\DoxyCodeLine{1119 \}}

\end{DoxyCode}


\subsection{Member Data Documentation}
\mbox{\Hypertarget{classCPGFImage_ac262a389df92493dfca63b2f1f06fe78}\label{classCPGFImage_ac262a389df92493dfca63b2f1f06fe78}} 
\index{CPGFImage@{CPGFImage}!m\_cb@{m\_cb}}
\index{m\_cb@{m\_cb}!CPGFImage@{CPGFImage}}
\subsubsection{\texorpdfstring{m\_cb}{m\_cb}}
{\footnotesize\ttfamily \mbox{\hyperlink{PGFtypes_8h_a80e898ce785fbd6fb0dfcc5903be79c2}{Refresh\+CB}} C\+P\+G\+F\+Image\+::m\+\_\+cb\hspace{0.3cm}{\ttfamily [private]}}



pointer to refresh callback procedure 



Definition at line 545 of file P\+G\+Fimage.\+h.

\mbox{\Hypertarget{classCPGFImage_a45861a83c95188610063233149187f3c}\label{classCPGFImage_a45861a83c95188610063233149187f3c}} 
\index{CPGFImage@{CPGFImage}!m\_cbArg@{m\_cbArg}}
\index{m\_cbArg@{m\_cbArg}!CPGFImage@{CPGFImage}}
\subsubsection{\texorpdfstring{m\_cbArg}{m\_cbArg}}
{\footnotesize\ttfamily void$\ast$ C\+P\+G\+F\+Image\+::m\+\_\+cb\+Arg\hspace{0.3cm}{\ttfamily [private]}}



refresh callback argument 



Definition at line 546 of file P\+G\+Fimage.\+h.

\mbox{\Hypertarget{classCPGFImage_a36f7f20b38a9cb3a9c88032f5f886345}\label{classCPGFImage_a36f7f20b38a9cb3a9c88032f5f886345}} 
\index{CPGFImage@{CPGFImage}!m\_channel@{m\_channel}}
\index{m\_channel@{m\_channel}!CPGFImage@{CPGFImage}}
\subsubsection{\texorpdfstring{m\_channel}{m\_channel}}
{\footnotesize\ttfamily \mbox{\hyperlink{PGFtypes_8h_acb1ee3f52ccfad782dcaa0abd79e5d05}{DataT}}$\ast$ C\+P\+G\+F\+Image\+::m\+\_\+channel\mbox{[}\mbox{\hyperlink{PGFtypes_8h_a94219182f88d4dbed1021ed04db75e41}{Max\+Channels}}\mbox{]}\hspace{0.3cm}{\ttfamily [protected]}}



untransformed channels in Y\+UV format 



Definition at line 522 of file P\+G\+Fimage.\+h.

\mbox{\Hypertarget{classCPGFImage_a2790b468b6d4841cd34473c4b61d0c7f}\label{classCPGFImage_a2790b468b6d4841cd34473c4b61d0c7f}} 
\index{CPGFImage@{CPGFImage}!m\_currentLevel@{m\_currentLevel}}
\index{m\_currentLevel@{m\_currentLevel}!CPGFImage@{CPGFImage}}
\subsubsection{\texorpdfstring{m\_currentLevel}{m\_currentLevel}}
{\footnotesize\ttfamily int C\+P\+G\+F\+Image\+::m\+\_\+current\+Level\hspace{0.3cm}{\ttfamily [protected]}}



transform level of current image 



Definition at line 532 of file P\+G\+Fimage.\+h.

\mbox{\Hypertarget{classCPGFImage_a1058b29a3d046e171a2fe48168b66d38}\label{classCPGFImage_a1058b29a3d046e171a2fe48168b66d38}} 
\index{CPGFImage@{CPGFImage}!m\_decoder@{m\_decoder}}
\index{m\_decoder@{m\_decoder}!CPGFImage@{CPGFImage}}
\subsubsection{\texorpdfstring{m\_decoder}{m\_decoder}}
{\footnotesize\ttfamily \mbox{\hyperlink{classCDecoder}{C\+Decoder}}$\ast$ C\+P\+G\+F\+Image\+::m\+\_\+decoder\hspace{0.3cm}{\ttfamily [protected]}}



P\+GF decoder. 



Definition at line 523 of file P\+G\+Fimage.\+h.

\mbox{\Hypertarget{classCPGFImage_a9226595ea6b907e4d07301a6ee641b87}\label{classCPGFImage_a9226595ea6b907e4d07301a6ee641b87}} 
\index{CPGFImage@{CPGFImage}!m\_downsample@{m\_downsample}}
\index{m\_downsample@{m\_downsample}!CPGFImage@{CPGFImage}}
\subsubsection{\texorpdfstring{m\_downsample}{m\_downsample}}
{\footnotesize\ttfamily bool C\+P\+G\+F\+Image\+::m\+\_\+downsample\hspace{0.3cm}{\ttfamily [protected]}}



chrominance channels are downsampled 



Definition at line 535 of file P\+G\+Fimage.\+h.

\mbox{\Hypertarget{classCPGFImage_a6ef048255812525cd56d7b04df5e6731}\label{classCPGFImage_a6ef048255812525cd56d7b04df5e6731}} 
\index{CPGFImage@{CPGFImage}!m\_encoder@{m\_encoder}}
\index{m\_encoder@{m\_encoder}!CPGFImage@{CPGFImage}}
\subsubsection{\texorpdfstring{m\_encoder}{m\_encoder}}
{\footnotesize\ttfamily \mbox{\hyperlink{classCEncoder}{C\+Encoder}}$\ast$ C\+P\+G\+F\+Image\+::m\+\_\+encoder\hspace{0.3cm}{\ttfamily [protected]}}



P\+GF encoder. 



Definition at line 524 of file P\+G\+Fimage.\+h.

\mbox{\Hypertarget{classCPGFImage_a6925d3950e8f48487205d46de7920d3e}\label{classCPGFImage_a6925d3950e8f48487205d46de7920d3e}} 
\index{CPGFImage@{CPGFImage}!m\_favorSpeedOverSize@{m\_favorSpeedOverSize}}
\index{m\_favorSpeedOverSize@{m\_favorSpeedOverSize}!CPGFImage@{CPGFImage}}
\subsubsection{\texorpdfstring{m\_favorSpeedOverSize}{m\_favorSpeedOverSize}}
{\footnotesize\ttfamily bool C\+P\+G\+F\+Image\+::m\+\_\+favor\+Speed\+Over\+Size\hspace{0.3cm}{\ttfamily [protected]}}



favor encoding speed over compression ratio 



Definition at line 536 of file P\+G\+Fimage.\+h.

\mbox{\Hypertarget{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}\label{classCPGFImage_a1a45b90decf13d8e8243bd84bac690d0}} 
\index{CPGFImage@{CPGFImage}!m\_header@{m\_header}}
\index{m\_header@{m\_header}!CPGFImage@{CPGFImage}}
\subsubsection{\texorpdfstring{m\_header}{m\_header}}
{\footnotesize\ttfamily \mbox{\hyperlink{structPGFHeader}{P\+G\+F\+Header}} C\+P\+G\+F\+Image\+::m\+\_\+header\hspace{0.3cm}{\ttfamily [protected]}}



P\+GF file header. 



Definition at line 529 of file P\+G\+Fimage.\+h.

\mbox{\Hypertarget{classCPGFImage_a170fd448152303a2d44848a52a8916a0}\label{classCPGFImage_a170fd448152303a2d44848a52a8916a0}} 
\index{CPGFImage@{CPGFImage}!m\_height@{m\_height}}
\index{m\_height@{m\_height}!CPGFImage@{CPGFImage}}
\subsubsection{\texorpdfstring{m\_height}{m\_height}}
{\footnotesize\ttfamily U\+I\+N\+T32 C\+P\+G\+F\+Image\+::m\+\_\+height\mbox{[}\mbox{\hyperlink{PGFtypes_8h_a94219182f88d4dbed1021ed04db75e41}{Max\+Channels}}\mbox{]}\hspace{0.3cm}{\ttfamily [protected]}}



height of each channel at current level 



Definition at line 527 of file P\+G\+Fimage.\+h.

\mbox{\Hypertarget{classCPGFImage_a1635ef5dca13bd07276d112a72316a73}\label{classCPGFImage_a1635ef5dca13bd07276d112a72316a73}} 
\index{CPGFImage@{CPGFImage}!m\_levelLength@{m\_levelLength}}
\index{m\_levelLength@{m\_levelLength}!CPGFImage@{CPGFImage}}
\subsubsection{\texorpdfstring{m\_levelLength}{m\_levelLength}}
{\footnotesize\ttfamily U\+I\+N\+T32$\ast$ C\+P\+G\+F\+Image\+::m\+\_\+level\+Length\hspace{0.3cm}{\ttfamily [protected]}}



length of each level in bytes; first level starts immediately after this array 



Definition at line 525 of file P\+G\+Fimage.\+h.

\mbox{\Hypertarget{classCPGFImage_adc2499451b8f96483a892e53fe5849b1}\label{classCPGFImage_adc2499451b8f96483a892e53fe5849b1}} 
\index{CPGFImage@{CPGFImage}!m\_percent@{m\_percent}}
\index{m\_percent@{m\_percent}!CPGFImage@{CPGFImage}}
\subsubsection{\texorpdfstring{m\_percent}{m\_percent}}
{\footnotesize\ttfamily double C\+P\+G\+F\+Image\+::m\+\_\+percent\hspace{0.3cm}{\ttfamily [private]}}



progress \mbox{[}0..1\mbox{]} 



Definition at line 547 of file P\+G\+Fimage.\+h.

\mbox{\Hypertarget{classCPGFImage_ab8635df22839ffb68bada53e38b9ce73}\label{classCPGFImage_ab8635df22839ffb68bada53e38b9ce73}} 
\index{CPGFImage@{CPGFImage}!m\_postHeader@{m\_postHeader}}
\index{m\_postHeader@{m\_postHeader}!CPGFImage@{CPGFImage}}
\subsubsection{\texorpdfstring{m\_postHeader}{m\_postHeader}}
{\footnotesize\ttfamily \mbox{\hyperlink{structPGFPostHeader}{P\+G\+F\+Post\+Header}} C\+P\+G\+F\+Image\+::m\+\_\+post\+Header\hspace{0.3cm}{\ttfamily [protected]}}



P\+GF post-\/header. 



Definition at line 530 of file P\+G\+Fimage.\+h.

\mbox{\Hypertarget{classCPGFImage_ad5ed0ec587742ebf46f72be4abde305d}\label{classCPGFImage_ad5ed0ec587742ebf46f72be4abde305d}} 
\index{CPGFImage@{CPGFImage}!m\_preHeader@{m\_preHeader}}
\index{m\_preHeader@{m\_preHeader}!CPGFImage@{CPGFImage}}
\subsubsection{\texorpdfstring{m\_preHeader}{m\_preHeader}}
{\footnotesize\ttfamily \mbox{\hyperlink{structPGFPreHeader}{P\+G\+F\+Pre\+Header}} C\+P\+G\+F\+Image\+::m\+\_\+pre\+Header\hspace{0.3cm}{\ttfamily [protected]}}



P\+GF pre-\/header. 



Definition at line 528 of file P\+G\+Fimage.\+h.

\mbox{\Hypertarget{classCPGFImage_a8b4d6d5ef343f0f428b35c9bf1020569}\label{classCPGFImage_a8b4d6d5ef343f0f428b35c9bf1020569}} 
\index{CPGFImage@{CPGFImage}!m\_progressMode@{m\_progressMode}}
\index{m\_progressMode@{m\_progressMode}!CPGFImage@{CPGFImage}}
\subsubsection{\texorpdfstring{m\_progressMode}{m\_progressMode}}
{\footnotesize\ttfamily \mbox{\hyperlink{PGFtypes_8h_a04561479f4f8aa5a0775d8b541a1157e}{Progress\+Mode}} C\+P\+G\+F\+Image\+::m\+\_\+progress\+Mode\hspace{0.3cm}{\ttfamily [private]}}



progress mode used in Read and Write; P\+M\+\_\+\+Relative is default mode 



Definition at line 548 of file P\+G\+Fimage.\+h.

\mbox{\Hypertarget{classCPGFImage_a57cc024db6e510f95f3238f448a0fed5}\label{classCPGFImage_a57cc024db6e510f95f3238f448a0fed5}} 
\index{CPGFImage@{CPGFImage}!m\_quant@{m\_quant}}
\index{m\_quant@{m\_quant}!CPGFImage@{CPGFImage}}
\subsubsection{\texorpdfstring{m\_quant}{m\_quant}}
{\footnotesize\ttfamily B\+Y\+TE C\+P\+G\+F\+Image\+::m\+\_\+quant\hspace{0.3cm}{\ttfamily [protected]}}



quantization parameter 



Definition at line 534 of file P\+G\+Fimage.\+h.

\mbox{\Hypertarget{classCPGFImage_a79627ae9b19c69589eaa2ba7711ddd00}\label{classCPGFImage_a79627ae9b19c69589eaa2ba7711ddd00}} 
\index{CPGFImage@{CPGFImage}!m\_roi@{m\_roi}}
\index{m\_roi@{m\_roi}!CPGFImage@{CPGFImage}}
\subsubsection{\texorpdfstring{m\_roi}{m\_roi}}
{\footnotesize\ttfamily \mbox{\hyperlink{structPGFRect}{P\+G\+F\+Rect}} C\+P\+G\+F\+Image\+::m\+\_\+roi\hspace{0.3cm}{\ttfamily [protected]}}



region of interest 



Definition at line 541 of file P\+G\+Fimage.\+h.

\mbox{\Hypertarget{classCPGFImage_af6d3fe5a8622634d1d0faf56cde335ef}\label{classCPGFImage_af6d3fe5a8622634d1d0faf56cde335ef}} 
\index{CPGFImage@{CPGFImage}!m\_streamReinitialized@{m\_streamReinitialized}}
\index{m\_streamReinitialized@{m\_streamReinitialized}!CPGFImage@{CPGFImage}}
\subsubsection{\texorpdfstring{m\_streamReinitialized}{m\_streamReinitialized}}
{\footnotesize\ttfamily bool C\+P\+G\+F\+Image\+::m\+\_\+stream\+Reinitialized\hspace{0.3cm}{\ttfamily [protected]}}



stream has been reinitialized 



Definition at line 540 of file P\+G\+Fimage.\+h.

\mbox{\Hypertarget{classCPGFImage_a01d0752d97900040fa1db7f02d4770cb}\label{classCPGFImage_a01d0752d97900040fa1db7f02d4770cb}} 
\index{CPGFImage@{CPGFImage}!m\_useOMPinDecoder@{m\_useOMPinDecoder}}
\index{m\_useOMPinDecoder@{m\_useOMPinDecoder}!CPGFImage@{CPGFImage}}
\subsubsection{\texorpdfstring{m\_useOMPinDecoder}{m\_useOMPinDecoder}}
{\footnotesize\ttfamily bool C\+P\+G\+F\+Image\+::m\+\_\+use\+O\+M\+Pin\+Decoder\hspace{0.3cm}{\ttfamily [protected]}}



use Open MP in decoder 



Definition at line 538 of file P\+G\+Fimage.\+h.

\mbox{\Hypertarget{classCPGFImage_a140110570c6d492b23db50189d3f4d48}\label{classCPGFImage_a140110570c6d492b23db50189d3f4d48}} 
\index{CPGFImage@{CPGFImage}!m\_useOMPinEncoder@{m\_useOMPinEncoder}}
\index{m\_useOMPinEncoder@{m\_useOMPinEncoder}!CPGFImage@{CPGFImage}}
\subsubsection{\texorpdfstring{m\_useOMPinEncoder}{m\_useOMPinEncoder}}
{\footnotesize\ttfamily bool C\+P\+G\+F\+Image\+::m\+\_\+use\+O\+M\+Pin\+Encoder\hspace{0.3cm}{\ttfamily [protected]}}



use Open MP in encoder 



Definition at line 537 of file P\+G\+Fimage.\+h.

\mbox{\Hypertarget{classCPGFImage_a18e28eef51d17c3bd0be4d4f758a6a86}\label{classCPGFImage_a18e28eef51d17c3bd0be4d4f758a6a86}} 
\index{CPGFImage@{CPGFImage}!m\_userDataPolicy@{m\_userDataPolicy}}
\index{m\_userDataPolicy@{m\_userDataPolicy}!CPGFImage@{CPGFImage}}
\subsubsection{\texorpdfstring{m\_userDataPolicy}{m\_userDataPolicy}}
{\footnotesize\ttfamily U\+I\+N\+T32 C\+P\+G\+F\+Image\+::m\+\_\+user\+Data\+Policy\hspace{0.3cm}{\ttfamily [protected]}}



user data (metadata) policy during open 



Definition at line 533 of file P\+G\+Fimage.\+h.

\mbox{\Hypertarget{classCPGFImage_acf4ae6e169ddf84e32cf9b57a22800b3}\label{classCPGFImage_acf4ae6e169ddf84e32cf9b57a22800b3}} 
\index{CPGFImage@{CPGFImage}!m\_userDataPos@{m\_userDataPos}}
\index{m\_userDataPos@{m\_userDataPos}!CPGFImage@{CPGFImage}}
\subsubsection{\texorpdfstring{m\_userDataPos}{m\_userDataPos}}
{\footnotesize\ttfamily U\+I\+N\+T64 C\+P\+G\+F\+Image\+::m\+\_\+user\+Data\+Pos\hspace{0.3cm}{\ttfamily [protected]}}



stream position of user data 



Definition at line 531 of file P\+G\+Fimage.\+h.

\mbox{\Hypertarget{classCPGFImage_ab6d97aca28795fae697fdda4b8acd8f9}\label{classCPGFImage_ab6d97aca28795fae697fdda4b8acd8f9}} 
\index{CPGFImage@{CPGFImage}!m\_width@{m\_width}}
\index{m\_width@{m\_width}!CPGFImage@{CPGFImage}}
\subsubsection{\texorpdfstring{m\_width}{m\_width}}
{\footnotesize\ttfamily U\+I\+N\+T32 C\+P\+G\+F\+Image\+::m\+\_\+width\mbox{[}\mbox{\hyperlink{PGFtypes_8h_a94219182f88d4dbed1021ed04db75e41}{Max\+Channels}}\mbox{]}\hspace{0.3cm}{\ttfamily [protected]}}



width of each channel at current level 



Definition at line 526 of file P\+G\+Fimage.\+h.

\mbox{\Hypertarget{classCPGFImage_ae3901a689b7d1dd46d48b042c3d31d5c}\label{classCPGFImage_ae3901a689b7d1dd46d48b042c3d31d5c}} 
\index{CPGFImage@{CPGFImage}!m\_wtChannel@{m\_wtChannel}}
\index{m\_wtChannel@{m\_wtChannel}!CPGFImage@{CPGFImage}}
\subsubsection{\texorpdfstring{m\_wtChannel}{m\_wtChannel}}
{\footnotesize\ttfamily \mbox{\hyperlink{classCWaveletTransform}{C\+Wavelet\+Transform}}$\ast$ C\+P\+G\+F\+Image\+::m\+\_\+wt\+Channel\mbox{[}\mbox{\hyperlink{PGFtypes_8h_a94219182f88d4dbed1021ed04db75e41}{Max\+Channels}}\mbox{]}\hspace{0.3cm}{\ttfamily [protected]}}



wavelet transformed color channels 



Definition at line 521 of file P\+G\+Fimage.\+h.



The documentation for this class was generated from the following files\+:\begin{DoxyCompactItemize}
\item 
\mbox{\hyperlink{PGFimage_8h}{P\+G\+Fimage.\+h}}\item 
\mbox{\hyperlink{PGFimage_8cpp}{P\+G\+Fimage.\+cpp}}\end{DoxyCompactItemize}
