ICSV - Image Color Similarity Visualization
Vienna Technical University - Course 'Visualization 2'. Author: Stefan Spelitz (0925601)
ICSV.Server.ImageProvider Class Reference

This class is responsible for searching images on the web (i.e. on Flickr) or loading local images. After loading, signatures are created, which can be then used to calculate the Earth Mover's Distance. More...

Public Member Functions

void searchImages (Flickr flickr, PhotoSearchOptions options, int photoCount, ImageProviderCallback callback, CancellationToken cancelToken)
 Search Flickr with the given options and maximum count. A callback needs to be provided for progress and status report. This method works asynchronously. More...
 
ImageContainer loadRemoteImage (string remoteURL, WebClient webClient, ImageProviderCallback callback)
 Loads an image from the given remote URL, using the web client and providing status reports to the callback. More...
 
ImageContainer getLocalImage (string localURL)
 Synchronously loads a local image from the given local server url. More...
 

Static Public Attributes

static readonly ImageProvider Instance
 The singleton instance of this class. More...
 

Detailed Description

This class is responsible for searching images on the web (i.e. on Flickr) or loading local images. After loading, signatures are created, which can be then used to calculate the Earth Mover's Distance.

This class uses a cache to allow fast access to previously loaded images. Images are cached according to their unique ids. This class is a singleton. The only instance is available through ImageProvider.Instance.

Member Function Documentation

ImageContainer ICSV.Server.ImageProvider.getLocalImage ( string  localURL)

Synchronously loads a local image from the given local server url.

Parameters
localURLthe URL to load from
Returns
the fully initialized image container
ImageContainer ICSV.Server.ImageProvider.loadRemoteImage ( string  remoteURL,
WebClient  webClient,
ImageProviderCallback  callback 
)

Loads an image from the given remote URL, using the web client and providing status reports to the callback.

Parameters
remoteURLfrom where to load
webClientthe client to use for loading
callbackthe callback for status updates
Returns
the loaded image with all necessary fields initialized
void ICSV.Server.ImageProvider.searchImages ( Flickr  flickr,
PhotoSearchOptions  options,
int  photoCount,
ImageProviderCallback  callback,
CancellationToken  cancelToken 
)

Search Flickr with the given options and maximum count. A callback needs to be provided for progress and status report. This method works asynchronously.

Parameters
flickrthe Flickr API object
optionscontains all relevant settings for searching. E.g. sort order
photoCountthe maximum number of photos to retrieve
callbackthe callback for status updates
cancelTokenthe cancellation token, in case the search needs to be cancelled

Member Data Documentation

readonly ImageProvider ICSV.Server.ImageProvider.Instance
static

The singleton instance of this class.