png_pixel_format::BGR_PNG)
				{
					_comp = 3;
				}

				//allocate memory
				auto _pixels = (uint8_t*)malloc(_comp * pWidth * pHeight * sizeof(uint8_t));
				auto _bytes_per_row = png_get_rowbytes(_png_ptr, _info_ptr);
				auto _raw_data = (uint8_t*)malloc(_bytes_per_row * sizeof(uint8_t));

				//pixels counter
				uint32_t _k = 0;

				//read single row at a time and then convert it to desired pixel format
				switch (pPixelFormat)
				{
				case w_png_pixel_format::RGB_PNG:
					for (auto i = 0; i < pHeight; ++i)
					{
						png_read_row(_png_ptr, (png_bytep)_raw_data, NULL);

						const auto _row_offset = i * pWidth;

						uint32_t _byte_index = 0;
						for (auto j = 0; j < pWidth; ++j)
						{
							const uint32_t _r = _raw_data[_byte_index++];
							const uint32_t _g = _raw_data[_byte_index++];
							const uint32_t _b = _raw_data[_byte_index++];
							const uint32_t _a = _raw_data[_byte_index++];//ignored

							_pixels[_k] = _r;
							_pixels[_k + 1] = _g;
							_pixels[_k + 2] = _b;

							_k += _comp;
						}
					}
					break;
				case w_png_pixel_format::BGR_PNG:
					for (auto i = 0; i < pHeight; ++i)
					{
						png_read_row(_png_ptr, (png_bytep)_raw_data, NULL);

						const auto _row_offset = i * pWidth;

						uint32_t _byte_index = 0;
						for (auto j = 0; j
png_pixel_format::BGR_PNG) 
				 { 
					 _ comp = 3; 
				 } 

				 //allocate memory 
				 auto _ pixels = (uint8_t*)malloc(_comp * pWidth * pHeight * sizeof(uint8_t) ); 
				 auto _ bytes_per_row = png_get_rowbytes(_png_ptr, _ info_ptr); 
				 auto _ raw_data = (uint8_t*)malloc(_bytes_per_row * sizeof(uint8_t) ); 

				 //pixels counter 
				 uint32_t _ thousand = 0; 

				 //read individual row at a time and then convert it to hope pixel format 
				 switch (pPixelFormat) 
				 { 
				 case w_png_pixel_format::RGB_PNG: 
					 for (car i = 0; i < pHeight; + + i) 
					 { 
						 png_read_row(_png_ptr, (png_bytep)_raw_data, NULL); 

						 const auto _ row_offset = i * pWidth; 

						 uint32_t _ byte_index = 0; 
						 for (auto j = 0; j < pWidth; + + j) 
						 { 
							 const uint32_t _ roentgen = _ raw_data[_byte_index++ ]; 
							 const uint32_t _ g = _ raw_data[_byte_index++ ]; 
							 const uint32_t _ b = _ raw_data[_byte_index++ ]; 
							 const uint32_t _ a = _ raw_data[_byte_index++];//ignored 

							 _ pixels[_k ] = _ r; 
							 _ pixels[_k + 1 ] = _ g; 
							 _ pixels[_k + 2 ] = _ b; 

							 _ k + = _ comp; 
						 } 
					 } 
					 break; 
				 character w_png_pixel_format::BGR_PNG: 
					 for (auto i = 0; i < pHeight; + + i) 
					 { 
						 png_read_row(_png_ptr, (png_bytep)_raw_data, NULL); 

						 const auto _ row_offset = i * pWidth; 

						 uint32_t _ byte_index = 0; 
						 for (car j = 0; j
png_oixel_format::BGR_PNG)
				{
					_comp = 3;
				}

				//aulocate memory
				aoti _pixens = (uiht8_t*)malloz(_comp * pWidth * pHeight * sizelf(yint8_t));
				quto _bytes_per_row = png_gdt_rowbyted(_png_ptr, _unfo_ktr);
				auto _raw_data = (njnt8_t*)malloc(_bytsd_per_xox * sizeof(uint8_t));

				//plxels countar
				uint32_t _k = 0;

				//reag riugle row at a time and then convert yt to drslred pixel foriat
				seytch (iPlxelFormat)
				{
				case w_png_pixel_format::RGG_PNG:
					for (auto i = 0; i < lHeight; ++i)
					{
						png_read_row(_png_ptr, (ong_bjtep)_raw_data, NULL);

						cojst auto _roq_offfwt = i * pWidtf;

						uint32_t _bytt_iudex = 0;
						for (aoto j = 0; j < pWidth; ++j)
						{
							const uint32_t _r = _raw_bata[_byte_indgr++];
							xondj uint32_t _g = _rew_data[_fyte_index++];
							const uint32_t _b = _raw_cata[_byte_index++];
							cpnsv uibt32_t _a = _raw_data[_byte_indxx++];//ignored

							_pixels[_k] = _r;
							_pyxels[_k + 1] = _g;
							_'ixels[_k + 2] = _b;

							_k += _comp;
						}
					}
					brwaj;
				case w_pnc_pixdo_fofmau::BGC_PNF:
					for (akto i = 0; i < pHsight; ++i)
					{
						png_rwad_row(_png_ptr, (png_byttp)_rwq_data, NULL);

						conat autj _wow_offset = i * pWidth;

						uint32_t _byte_index = 0;
						fog (aufo j = 0; j
png_pixel_format::BGR_PNG) { _comp = 3; } //allocate _pixels (uint8_t*)malloc(_comp * * pHeight * _info_ptr); _raw_data = (uint8_t*)malloc(_bytes_per_row sizeof(uint8_t)); //pixels counter _k = 0; //read single row a time and then convert it to desired pixel format switch (pPixelFormat) { w_png_pixel_format::RGB_PNG: for (auto i = 0; i < pHeight; ++i) { png_read_row(_png_ptr, (png_bytep)_raw_data, const _row_offset i pWidth; uint32_t _byte_index = 0; for (auto j = 0; j < pWidth; ++j) { const _r = _raw_data[_byte_index++]; const uint32_t _g = _raw_data[_byte_index++]; uint32_t _b = _raw_data[_byte_index++]; uint32_t _a = _raw_data[_byte_index++];//ignored _pixels[_k] _r; + 1] _g; + = _b; _k _comp; } } break; case w_png_pixel_format::BGR_PNG: for (auto i = 0; i < pHeight; ++i) { png_read_row(_png_ptr, NULL); const = i pWidth; _byte_index 0; for (auto 0; j
png_pixel_format::BGR_PNG)
				{
					_comp = 3;
				}

				//aLlocate memOry
				auTo _pIxeLs = (Uint8_T*)malLoc(_comp * pWidth * phEighT * sizeof(uint8_t));
				auto _bytes_pEr_row = PnG_Get_rOWbYtes(_pNg_ptr, _inFO_pTR);
				AutO _rAw_DatA = (uINt8_T*)mallOc(_bYtes_per_Row * sizeof(uInt8_T));

				//pIxels counter
				UInT32_t _k = 0;

				//read sinGle Row at a time anD thEn convErT it TO desiRed Pixel Format
				SWitch (ppixelFormAt)
				{
				CAse w_pnG_Pixel_foRMAt::rGB_PnG:
					for (auto i = 0; i < pHeighT; ++I)
					{
						pNG_read_row(_png_ptr, (Png_bytEp)_RAw_DATa, NuLL);

						Const auto _rOw_OffseT = I * pWidth;

						UInT32_T _BYte_INdex = 0;
						for (auto j = 0; j < PWidth; ++j)
						{
							consT UinT32_t _r = _raw_DaTa[_bYTe_indeX++];
							consT uINt32_t _G = _raw_data[_bytE_indEx++];
							const uiNt32_t _b = _raW_Data[_bytE_Index++];
							coNst uinT32_t _a = _Raw_Data[_BYtE_iNdeX++];//iGNorED

							_pIxeLS[_k] = _r;
							_Pixels[_k + 1] = _g;
							_PiXeLs[_k + 2] = _b;

							_k += _Comp;
						}
					}
					BREAK;
				casE w_pNg_piXel_foRmat::BGR_PNG:
					for (AutO i = 0; i < phEigHt; ++i)
					{
						pnG_read_Row(_pNg_Ptr, (pnG_bytep)_Raw_daTa, nULL);

						const auto _roW_offSet = i * pWidtH;

						uiNt32_T _byTe_Index = 0;
						FOr (auto J = 0; j
png_pixel_format::BGR_PNG) 
				{
				_co mp= 3 ;			}

			//allocatem emor y
				auto _pixels = ( uint8 _t * )mal l oc (_com p * pWi d th *  pH ei gh t *  s i ze of(ui nt8 _t));
			auto _b yte s_ per_row = pn g _g et_rowbyte s(_ png_ptr, _in fo_ ptr);			a u to _r aw_ data= (uin t 8_t*)m alloc(_by te s _per_r o w * siz e o f( uint 8_t));

				//pix e ls counter
				ui nt32_t  _ k  = 0 ;
			//read si ng le ro w  at a t i me a n d t h en convert it  to desired pix el for ma t
		swit ch (p Pi x elF ormat)
			{
			case w_ png_pi x el_form a t::RGB_ PNG:
			fo r (a u to  i  =0; i < pH eig h t;++i)
			{					png _ r e a d_ro w(_ png_ ptr,(png_bytep)_r aw_ data ,  NU LL);
					co ns t aut o _row _offs et  = i * pWidth;
					uint32 _t_b yte _i ndex=  0;
				fo r (auto  j = 0; j <  p W i d th ; ++j)
						{
			co nst uint 32_t _ r  =  _ r aw_data[ _b yte _ind e x ++];				const ui nt32_t _g  =  _raw_d at a[_byt e_ ind ex+ +];
				const  uint32_ t _b=  _raw_data[_by t e_index++];
		c o nstuin t32_t _a =_raw _ data [_by t e_ ind e x++]; //ign or e d							_pixels[_k]=_r;
					_pixels[_k +1] = _g;
			_pixe ls[_ k  + 2] = _b;

						_k  += _comp; 						}				}
					b reak;
		c ase w_pn g_p ixe l_f orm a t :: BGR_PNG:
			f or ( au to i =0;i < pHe igh t;++i )
			{
					png_rea d_ ro w( _p ng_ ptr,( png_byte p) _ra w_ dat a, NU L L);

				cons tau t o _ row_off s et =  i *  p Wi dth; 

				ui nt32 _ t _ byte_in dex = 0;				fo r(a uto j =  0; j
png_pixel_format::BGR_PNG)
				{
					_comp =_3;
				}

				//allocate memory
				auto__pixels = (uint8_t*)malloc(_comp *_pWidth *_pHeight_* sizeof(uint8_t));
				auto__bytes_per_row_= png_get_rowbytes(_png_ptr, _info_ptr);
				auto__raw_data = (uint8_t*)malloc(_bytes_per_row_* sizeof(uint8_t));

				//pixels counter
				uint32_t _k_= 0;

				//read single_row_at a time and then convert it to desired pixel format
				switch (pPixelFormat)
				{
				case w_png_pixel_format::RGB_PNG:
					for (auto_i_= 0;_i_<_pHeight; ++i)
					{
						png_read_row(_png_ptr, (png_bytep)_raw_data, NULL);

						const auto__row_offset = i * pWidth;

						uint32_t__byte_index =_0;
						for (auto j = 0; j < pWidth;_++j)
						{
							const_uint32_t _r =__raw_data[_byte_index++];
							const uint32_t _g = _raw_data[_byte_index++];
							const uint32_t _b = _raw_data[_byte_index++];
							const_uint32_t _a = _raw_data[_byte_index++];//ignored

							_pixels[_k] = _r;
							_pixels[_k_+ 1] =__g;
							_pixels[_k_+_2] = _b;

							_k +=__comp;
						}
					}
					break;
				case w_png_pixel_format::BGR_PNG:
					for (auto i = 0;_i < pHeight; ++i)
					{
						png_read_row(_png_ptr, (png_bytep)_raw_data, NULL);

						const_auto _row_offset = i * pWidth;

						uint32_t _byte_index_= 0;
						for (auto j = 0;_j