Game Development Reference
In-Depth Information
{
std::string Fmt = "";
if ( ImgSizeType == PHOTO_SIZE_128 )
{ Fmt = "/s128/"; }
else if ( ImgSizeType == PHOTO_SIZE_256 )
{ Fmt = "/s256/"; }
else if ( ImgSizeType == PHOTO_SIZE_512 )
{ Fmt = "/s512/"; }
else if ( ImgSizeType == PHOTO_SIZE_1024 )
{ Fmt = "/s1024/"; }
else if ( ImgSizeType == PHOTO_SIZE_ORIGINAL )
{ Fmt = "/s1600/"; };
size_t spos = InURL.find( "/s1600/" );
if ( spos == std::string::npos ) { return ""; }
const size_t Len = strlen("/s1600/");
return InURL.substr( 0, spos ) + Fmt +
InURL.substr( spos+Len, InURL.length()-spos-Len );
}
13. When we need the same image in different resolutions, we provide the
ImgSizeType parameter of the type PhotoSize , which can take the following
values:
enum PhotoSize
{
PHOTO_SIZE_128 = 0,
PHOTO_SIZE_256 = 1,
PHOTO_SIZE_512 = 2,
PHOTO_SIZE_1024 = 3,
PHOTO_SIZE_ORIGINAL = 4
};
14. These values are not related to Flickr or Picasa naming conventions and are used
internally for our convenience (and API independence).
How it works…
We have the list of images from the previous recipe:
std::vector<std::string> Images;
void Picasa_ParseXMLResponse( Response, Images);
 
Search WWH ::




Custom Search