const wxBitmap& Pcsx2App::GetLogoBitmap() { std::unique_ptr <wxBitmap>& logo(GetResourceCache().Bitmap_Logo); if( logo ) return *logo; wxFileName themeDirectory; bool useTheme = (g_Conf->DeskTheme != L"default"); if( useTheme ) { themeDirectory.Assign(wxFileName(PathDefs::GetThemes().ToString()).GetFullPath(), g_Conf->DeskTheme); #if 0 wxFileName zipped(themeDirectory); zipped.SetExt( L"zip" ); if( zipped.FileExists() ) { // loading theme from zipfile. //wxFileInputStream stream( zipped.ToString() ) //wxZipInputStream zstream( stream ); Console.Error( "Loading themes from zipfile is not supported yet.\nFalling back on default theme." ); } #endif } wxImage img; EmbeddedImage<res_BackgroundLogo> temp; // because gcc can't allow non-const temporaries. LoadImageAny(img, useTheme, themeDirectory, L"BackgroundLogo", temp); float scale = MSW_GetDPIScale(); // 1.0 for non-Windows logo = std::unique_ptr<wxBitmap>(new wxBitmap(img.Scale(img.GetWidth() * scale, img.GetHeight() * scale, wxIMAGE_QUALITY_HIGH))); return *logo; }
const wxBitmap& Pcsx2App::GetLogoBitmap() { ScopedPtr<wxBitmap>& logo( GetResourceCache().Bitmap_Logo ); if( logo ) return *logo; wxFileName mess; bool useTheme = (g_Conf->DeskTheme != L"default"); if( useTheme ) { wxDirName theme( PathDefs::GetThemes() + g_Conf->DeskTheme ); wxFileName zipped( theme.GetFilename() ); zipped.SetExt( L"zip" ); if( zipped.FileExists() ) { // loading theme from zipfile. //wxFileInputStream stream( zipped.ToString() ) //wxZipInputStream zstream( stream ); Console.Error( "Loading themes from zipfile is not supported yet.\nFalling back on default theme." ); } // Overrides zipfile settings (fix when zipfile support added) mess = theme.ToString(); } wxImage img; EmbeddedImage<res_BackgroundLogo> temp; // because gcc can't allow non-const temporaries. LoadImageAny( img, useTheme, mess, L"BackgroundLogo", temp ); logo = new wxBitmap( img ); return *logo; }
boost::shared_ptr<std::istream> getStreamForFile(const std::string &dir, const std::string &basename) { bf::path zipped(dir + "/" + basename + ".gz"); if (bf::exists(zipped) && !::is_directory(zipped)) return getStreamForFile(zipped.string()); else return getStreamForFile(dir + "/" + basename); }
pcl::PointCloud<pcl::PointXYZINormal>::Ptr zipNormals( pcl::PointCloud<pcl::PointXYZI> & cloud, pcl::PointCloud<pcl::Normal> & normals){ pcl::PointCloud<pcl::PointXYZINormal>::Ptr zipped (new pcl::PointCloud<pcl::PointXYZINormal>()); zipped->resize(cloud.size()); for(uint i = 0; i < cloud.size(); i ++){ pcl::PointXYZI & p = cloud[i]; pcl::Normal & n = normals[i]; pcl::PointXYZINormal & pn = (*zipped)[i]; pn.getNormalVector4fMap() = n.getNormalVector4fMap(); pn.getVector4fMap() = p.getVector4fMap(); pn.intensity = p.intensity; } return zipped; }