bool ReadImage( PngReader _png ) { /* ImageLine line = pngr.ReadRowInt( y ); int[] scanline = line.Scanline; string l = ""; for( int x=0; x<scanline.Length; x++ ) { int ci = scanline[ x ]; l += ci.ToString() + ","; } Debug.Log ("line " + y + ": " + l ); */ int x,y; for( y=0; y<m_height; y++ ) { ImageLine line = _png.ReadRowByte( y ); //byte[] lineBytes = _png.ReadRowByte( y ); byte[] lineBytes = line.ScanlineB;// GetScanlineInt(); for( x=0; x<m_width; x++ ) { byte src_c = lineBytes[ x ]; byte remapped_c = src_c; if( m_config.m_colorRemapSourceToDest.ContainsKey( (int)src_c )) remapped_c = (byte)m_config.m_colorRemapSourceToDest[ src_c ]; m_colorUsed[ remapped_c ] = true; int dst_i = (y*m_width)+x; m_image[ dst_i ] = remapped_c; } } return true; }