Commit Graph

28 Commits

Author SHA1 Message Date
John Firebaugh
1d33790dc0 [core] Fix image type of Map::renderStill
It's a premultiplied image. This implies that we were misusing encodePNG
in most cases, as we were passing premultiplied pixels which were then
interpreted as unmultiplied. I changed encodePNG to accept premultipled
pixels, and unpremultiply in the implementations.
2015-11-25 15:57:37 -08:00
John Firebaugh
0c1e378bc9 [core] Rewrite image handling
* Consolidate Image and StillImage
* Typecheck unassociated vs premultiplied images
* Rewrite default platform image decoding implementation
2015-11-25 15:57:36 -08:00
Mike Morris
62595a9b39 [core] bump libuv to 1.7.5 across all platforms
UV_ASYNC_PARAMS and UV_TIMER_PARAMS for libuv <= 0.10 compatibility

use st_mtim.tv_sec in libuv > 0.10.x
2015-10-14 11:36:28 -04:00
John Firebaugh
aec145ded3 [osx] Fix build on Xcode 6.4 2015-09-28 13:34:00 -07:00
Mike Morris
142b59246e [osx] disable -Wunused-local-typedefs
Fixes OS X builds with Xcode 7, necessitated by
https://svn.boost.org/trac/boost/ticket/11240
2015-09-24 12:18:56 -04:00
Konstantin Käfer
675ddddee7 Make pixelRatio constant across a Map object lifetime
also moves framebuffer size out of TransformState into its own object
2015-07-08 10:40:05 +02:00
Konstantin Käfer
f4707f72e0 Replace mbgl::util::make_unique<> with std::make_unique<> 2015-05-26 17:57:38 +02:00
John Firebaugh
87b1da7611 DefaultFileSource has responsibility for handling mapbox:// URLs 2015-05-26 12:14:10 +02:00
Thiago Marcos P. Santos
da81211fea Add callback for error notifications on renderStill()
The callback will be called when any of the resources requested
from the network failed to load.

There is not recovery implemented yet, so the closest thing to
reseting the Map object and reloading all the resources would
be setting a new style.
2015-05-22 10:44:18 +03:00
Konstantin Käfer
3ec48b1030 allow passing --debug to view tile boundaries in mbgl-render 2015-05-13 10:39:22 +02:00
Thiago Marcos P. Santos
77795d4ee9 Update the 'render' to reflect recent API changes
We don't call start/stop anymore and the resize is done via the
map object.
2015-05-08 15:40:30 +03:00
Konstantin Käfer
71d127220b rename Mode::Static => Mode::Still 2015-04-17 17:55:24 +02:00
Konstantin Käfer
46bf226910 align static render mode and still image render mode
- static rendering now also runs in a separate thread; you have to start it with map.start(Map::Mode::Static) and join the thread with map.stop() before destructing the Map object
- map.renderStill() takes a callback with will be invoked on the *map* thread, so you'll have to figure out your own method of dispatching back to the main thread.
2015-04-17 13:40:42 +02:00
Konstantin Käfer
452d12e6e6 make implementation files private headers 2015-04-13 18:28:18 +02:00
Konstantin Käfer
16849a341b hide Thread<> and separate the Implementation object 2015-04-13 17:57:45 +02:00
Konstantin Käfer
bba3d9838a add Thread<T> and RunLoop
Thread<T> is a generic thread management object that starts a thread, creates an object T in that thread and calls its .start() function. When the Thread<T> object is destructed (which must happen in the thread that created it), it'll call the object's .stop() function, and wait for thread termination. The .stop() function must somehow get the thread to terminate. Note that object T's constructor/destructor/start()/stop() must be protected/private, and Thread<T> must be declared as a friend class. All public functions may be called from any thread and are exposed through operator->().

RunLoop encapsulates a libuv runloop and has a facility of dispatching function objects to the thread. It can be used either as a worker thread class by itself, or it can be derived from. This commit converts SQLiteCache to derive from RunLoop and removes the custom code used previously for managing the cache thread.
2015-04-10 15:36:32 +02:00
Thiago Marcos P. Santos
51bc265db3 Make the logging system static
No initialization is needed anymore and we can use the logging functions
safely at any point of the code (threading is not handled though, so you
might get multiplexed messages if you log from two threads
simultaneously).
2015-03-12 13:28:41 +02:00
Thiago Marcos P. Santos
71ccb7b013 Trivial build fix, do not call private method
Resize is internally called by the view now.
2015-03-11 14:40:05 +02:00
Thiago Marcos P. Santos
f3f8e348a1 Fix build warnings on GCC
Apperently boost has a few quirks on its headers.
2015-03-11 14:37:28 +02:00
Konstantin Käfer
8e42582c52 update static image rendering executable 2015-03-06 12:41:00 +01:00
Justin R. Miller
6e41664cb0 fixes #476 & #853: pixel/meter/latlng conversion routines in core & iOS 2015-02-16 09:52:36 -08:00
Konstantin Käfer
29baacf3a5 refactor makefile 2015-02-04 10:49:09 +01:00
Mike Morris
9b2c8d0391 update bin/render for recent changes 2015-01-16 11:42:42 -05:00
Konstantin Käfer
9082a83d6a don't assing nullptr to std::string 2014-12-16 11:42:58 +01:00
Konstantin Käfer
a4ce5152e8 don't provide a default value for the stylesheet file 2014-12-11 18:32:09 +01:00
Konstantin Käfer
343fd4bcac allow setting the cache database 2014-12-11 18:31:56 +01:00
Konstantin Käfer
8b5bba08b3 show default values and allow setting the output filename 2014-12-11 18:02:24 +01:00
Konstantin Käfer
a81e822ef0 add cli tool for rendering a map to an image 2014-12-11 17:58:36 +01:00