revert jeff's last commit since it breaks the build
[moon.git] / src / multiscalesubimage.cpp
blob219ba892ec2cd82546f5ae2ed43b2c2cc0da29a3
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 /*
3 * multiscalesubimage.cpp
5 * Contact:
6 * Moonlight List (moonlight-list@lists.ximian.com)
8 * Copyright 2007-2008 Novell, Inc. (http://www.novell.com)
10 * See the LICENSE file included with the distribution for details.
14 #include <config.h>
16 #include <glib.h>
18 #include "debug.h"
19 #include "runtime.h"
20 #include "deepzoomimagetilesource.h"
21 #include "multiscalesubimage.h"
23 MultiScaleSubImage::MultiScaleSubImage ()
25 SetObjectType (Type::MULTISCALESUBIMAGE);
26 source = NULL;
29 MultiScaleSubImage::MultiScaleSubImage (const Uri *parent_uri, MultiScaleTileSource *tsource, int _id, int _n)
31 LOG_MSI ("new MultiScaleSubImage ()\n");
32 SetObjectType (Type::MULTISCALESUBIMAGE);
33 source = tsource;
34 id = _id;
35 n = _n;
37 Uri *source_uri = ((DeepZoomImageTileSource*)source)->GetUriSource ();
38 if (source_uri->isAbsolute)
39 return;
41 LOG_MSI ("MSSI: UriSource changed from %s", source_uri->ToString());
42 Uri *original_uri = new Uri ();
43 Uri::Copy (source_uri, original_uri);
44 Uri::Copy (parent_uri, source_uri);
45 source_uri->Combine (original_uri);
46 delete original_uri;
47 LOG_MSI (" to %s\n", source_uri->ToString());
51 double
52 MultiScaleSubImage::GetViewportHeight ()
54 return GetAspectRatio () * GetViewportWidth ();