Commit graph

3257 commits

Author SHA1 Message Date
Blake Thompson
dc931555d2 Added required include 2015-01-27 17:18:20 -06:00
Blake Thompson
bc28c12572 Found more situations where getRowSize should be used over multiplying the width by the pixel size. 2015-01-27 15:29:43 -06:00
Blake Thompson
b090882902 Added compare utility to python bindings and image_util, modified set_grayscale_to_alpha to take a color optionally. 2015-01-27 11:41:05 -06:00
Dane Springmeyer
48982c0619 Merge branch 'master' of github.com:mapnik/mapnik into release/image_data_any
Conflicts:
	tests/python_tests/image_tiff_test.py
2015-01-26 20:09:00 -08:00
artemp
2a3af1eb40 move boost.geometry <-- mapnik::box2d<double> into separate header for better modularity and code re-use 2015-01-26 10:37:09 +01:00
Blake Thompson
31a0caf2e4 Merge branch 'master' into release/image_data_any 2015-01-25 14:09:29 -06:00
Blake Thompson
f616367ac2 Including std library that was missing. 2015-01-24 21:16:36 -06:00
Blake Thompson
5d9f047002 Fixed some issues in color and bindings where you could create a color and premultiplied was not set and it was resulting in it being assigned randomly, causing some issues at runtime.
Updated some images in visual tests that were orginally set prior to all tiffs being premultiplied, this was causing a slight difference in a few pixels.

Updated the tiff tests a lot.

Fixed tiff reader so that it always considers everything read from RGB or RGBA as premultiplied. This is due to the fact that RGBA reader always premultiplies the alpha no matter its original form.

Put in a fix so that the file does not exist no longer shows up in the test running.

Fixed some failing tests in the c++ test due to tiffs now always being premultiplied for RGB(A)
2015-01-24 20:48:15 -06:00
Blake Thompson
a100b2fe1f Fixed the issues associated with TIFFs, now they always will return as premultiplied in the event they are rgba8 due to the way that the TIFF reader operates. Also added premultiply as a flag inside color class and exposed many of its components, made it so that setting and getting pixels took into consideration the state of the color and the image when dealing with the two. 2015-01-23 18:08:59 -06:00
artemp
7f0e77d172 Merge branch 'master' into large-geojson 2015-01-23 18:12:33 +01:00
Dane Springmeyer
ec111c8a27 add extra metadata to lyr desc + use for srid/keyfield in postgis - closes #2650 2015-01-22 18:44:56 -08:00
Blake Thompson
490645d2e3 Perhaps a solution to TIFF IO problems 2015-01-22 20:36:45 -06:00
Blake Thompson
51172c8fdf Move image_data.hpp to image.hpp and renamed most everything from image_data to image alone. This might lead to the need to clean up some variables that are currently named image through out the code at some time, but I think in the long term is much better as image is a better name for the base class. 2015-01-22 11:39:37 -06:00
Blake Thompson
e353225772 Modified the name of image_data_null to image_null. 2015-01-22 10:58:01 -06:00
Blake Thompson
e01ce5b7d6 Changed image_data_gray* to image_gray* Ref #2633. 2015-01-21 21:08:04 -06:00
Blake Thompson
22a384ef33 Moved image_data_rgba8 to image_rgba8. Ref #2633 2015-01-21 20:31:02 -06:00
Blake Thompson
e4a5424613 Merge branch 'release/image_data_any' of github.com:mapnik/mapnik into release/image_data_any 2015-01-21 19:40:23 -06:00
Blake Thompson
0f388ed68f Changed the name of image_data_any to image_any. Moved header file for image_data_any to image_any. Ref #2633 2015-01-21 19:40:12 -06:00
Dane Springmeyer
82bc43c76f fix stray include of graphics.hpp 2015-01-21 16:32:31 -08:00
Blake Thompson
93f835177b Removed all the code for the previous type of image and image_32. Ref #2633 2015-01-21 17:57:16 -06:00
Blake Thompson
b57b1c12d6 Some smaller fixes that cause the proper operator to be called in visitor_create_marker. All tests now passing. Ref #2633 2015-01-21 17:09:53 -06:00
Blake Thompson
9fda26f859 Merge branch 'release/image_data_any' of github.com:mapnik/mapnik into release/image_data_any 2015-01-20 18:33:50 -06:00
Blake Thompson
badb0c9a97 This is a complete removal of code that utilizes image_32 in the library. It is a sweeping change that does some of the following:
* Changes all agg_renderers to use a image_data_any variant (only image_data_rgba8 is implemented currently)
* Changes the marker and marker_cache to use image_data_any images
* Changes the symbolizers so that they must be aware of the source data type they are attempting to render and the render type that is expected to be rendered into.
* Moves many utilities into image_utils, that were previously in image_32.

The kicker is that this still isn't working perfectly yet, but I am commiting so I don't have tears in case everything is lost on my computer.

Ref #2633
2015-01-20 18:30:10 -06:00
Dane Springmeyer
97869f7dc1 minor include cleanup for image_utils 2015-01-20 09:06:21 -08:00
Blake Thompson
2439f1b298 A whole lot of changes. #Ref 2633 2015-01-20 10:48:33 -06:00
artemp
5a7a285216 extraxt_bounding_box_grammar - add generic json support to deal with arbitary key:value's in GeoJSON 2015-01-20 12:05:35 +01:00
artemp
9a74a55dd6 formatting 2015-01-20 11:29:58 +01:00
artemp
a408a84fb0 ignore invalid bounding boxes from "geometry": null 2015-01-19 22:04:21 +01:00
artemp
15a83ff54d extract bounding boxes from GeoJSON - re-implement grammar to store offset and size of "Feature" elements 2015-01-19 18:09:23 +01:00
Blake Thompson
aa03cf4f7c Implemented a new get_pixel method to go along with the set_pixel method in image_util. Ref #2633 2015-01-16 22:15:33 -06:00
Blake Thompson
a002139e18 Added set_pixel to visitor pattern and moved it to image_util. Added exception throwing in composite only if debug flags are on.
Ref #2633
2015-01-16 18:26:56 -06:00
Blake Thompson
1470bea9cb Migrated composite_pixel out of image_32, it is now in image_utils. Ref #2633 2015-01-16 16:48:43 -06:00
Blake Thompson
0b2c4e57cf Merge_rectangle has met the wood chipper. Ref #2633 2015-01-16 16:04:02 -06:00
Blake Thompson
a7b8ca2888 Moved set_rectangle out of image_32 into image_util.
Ref #2633
2015-01-16 15:36:53 -06:00
Blake Thompson
35be6117c8 Merge branch 'master' into release/image_data_any 2015-01-16 13:09:25 -06:00
Blake Thompson
aebb6fee58 Removed the background and set/get background from image_32 class. Removed clear method from image_32. Added new fill method for image_data_any, that allows many generic types to fill an image.
Ref #2633
2015-01-16 13:06:52 -06:00
artemp
b15224af1b add <iomanip> for std::setprecision 2015-01-16 17:19:17 +01:00
artemp
da960fea33 use std::advance to work with std::iterators 2015-01-16 16:40:28 +01:00
artemp
b6cd3b37ef store {bbox, offset} to match boost.geometry rtree instantiation 2015-01-16 16:24:31 +01:00
artemp
8b19793dc8 fix grammar (use iter_pos parser instead of hacking raw[] directive) + cleanups 2015-01-16 10:05:02 +01:00
artemp
785cf5c09f extract_bounding_box grammar initial impl 2015-01-16 09:48:57 +01:00
Blake Thompson
33ccc12355 Moved set_color_to_alpha and set_grayscale_to_alpha to image_util.
Ref # 2633
2015-01-15 20:26:20 -06:00
Blake Thompson
3b1c99ff1b Moved set_alpha to src/image_util.cpp and out of image_32. Added a boolean response to premultiply_alpha and demultiply_alpha so that if it is changed in set_alpha and other locations like the python bindings for composite that the image can be restored to its original state. Removed blend from python bindings.
Ref #2633
2015-01-15 17:57:21 -06:00
Blake Thompson
1f540b42c6 Removed the set_rectangle_alpha code from image_32. Added new blend using composite to python bindings to replace it by doing src_over with composite.
Ref #2633
2015-01-15 13:01:32 -06:00
Dane Springmeyer
cf646030f3 move is_solid to hpp for now to avoid linking errors 2015-01-15 10:21:11 -06:00
Dane Springmeyer
61bc705117 fix linking error with saving image 2015-01-15 10:14:01 -06:00
Blake Thompson
7ce7416999 Added is_solid to image_utils. It is currently built to support the eventual use of image_view_any and image_data_any, but for a limited time supports the passing of image_view_rgba8 and image_data_rgba8.
Ref #2633
2015-01-15 10:14:00 -06:00
Dane Springmeyer
364fb4961b fix handling of premultiplied pixels during rendering 2015-01-14 21:04:05 -08:00
Dane Springmeyer
b55d5def0d sync with latest master/3.x 2015-01-14 18:35:40 -08:00
Blake Thompson
202a0e8e5f Added a lot of premultiply_alpha functions to attempt to have proper premultiplication of data prior to compositing. There still seem to be some errors in the resulting images, but I am not quite sure what they are yet. 2015-01-14 18:29:00 -06:00
Blake Thompson
42c7d7ddf2 Merge branch 'release/image_data_any' into feature/premultiply_demultiply_move 2015-01-14 15:37:06 -06:00
Blake Thompson
03440c0108 Merge branch 'master' into release/image_data_any 2015-01-14 15:36:03 -06:00
Blake Thompson
cbc76f7361 Some minor corrections to allow for the source to build properly with out linking errors with vis to hidden. 2015-01-14 15:24:16 -06:00
Blake Thompson
4184f75011 Moved premultiply and demultiply out of image_32 and other parts of the code. The image_data object is now responsible for keeping track of its own premultiplied_alpha status. Created a new utility method in image_util to preform premultiplication.
Added visitor pattern to several different methods as well to prepare for image_data_any including compositing.

Ref #2633
2015-01-14 12:42:30 -06:00
artemp
235326c8db image_32 : add image_32(image_data_rgba8 &&) ctor 2015-01-13 11:44:24 +01:00
Dane Springmeyer
056feb4daa add text-transform:reverse + full test coverage for text-transform uppercase/lowercase/capitalize - closes #2634 2015-01-12 15:38:21 -08:00
Blake Thompson
f58f65ee4c Merge branch 'master' into release/image_data_any 2015-01-12 15:07:00 -06:00
Blake Thompson
2379c396c3 Removed unrequired save_as_jpeg in image_util.hpp 2015-01-12 15:06:39 -06:00
Blake Thompson
7a16ebe7fa Merge remote-tracking branch 'origin/image' into release/image_data_any 2015-01-12 14:51:08 -06:00
Blake Thompson
42ee4ec90d Moved cairo out of the image_util.*pp files and now have created a cairo_io.*pp files.
Ref #2622
2015-01-09 16:49:31 -05:00
Dane Springmeyer
c7bb16fcd9 amend/partially revert #2609 2015-01-09 12:11:41 -08:00
Dane Springmeyer
014af51d95 repack svg::path_attributes - drops 387 -> 376 (then 360 with gradient packing) - refs #2631 2015-01-09 11:56:52 -08:00
Dane Springmeyer
2a5dd5e924 pack mapnik::gradient to save 8 bytes (128 -> 120) - refs #2631 2015-01-09 11:43:17 -08:00
Blake Thompson
08c675e1a4 Merge branch 'master' into bugfix/image_util_impl
Conflicts:
	include/mapnik/image_view.hpp
	src/image_util.cpp
2015-01-08 20:25:15 -05:00
Blake Thompson
094d0ec3e1 Another large set of modifications, finally allow this branch to build. Mostly modifications to the image_util_* files. Different processing based on the image type is now possible, and save_to_stream now could possibly accept grayscale with out breaking existing code. 2015-01-08 19:31:14 -05:00
Blake Thompson
035557450d Split out the process for tiff, webp, and jpeg into their own util folders. Added the intial concepts for an image_view_any variant. 2015-01-08 16:55:51 -05:00
Dane Springmeyer
d22ad11b09 remove unneeded image_32 signatures for save_to_string/file after fbecd5f 2015-01-08 13:55:25 -08:00
Dane Springmeyer
acb3bb0821 trim down image_32 - refs #2627 2015-01-08 13:16:32 -08:00
Dane Springmeyer
e4cb1b33a0 remove getData and getBytes on image_view (they are unused) - refs #2627 2015-01-08 10:52:40 -08:00
Blake Thompson
472e41966d Added new scaling trait for image_32 as it is a part of image_data_any 2015-01-08 11:52:44 -05:00
Blake Thompson
81ef4225ac Continuing to modify various areas of image_util so that save_to_stream will be provided an image_data_any object. 2015-01-08 11:30:02 -05:00
Blake Thompson
847682d783 Some more minor changes 2015-01-08 10:17:07 -05:00
Blake Thompson
cc0a27f2f0 More stuff to break it all 2015-01-08 10:17:07 -05:00
Blake Thompson
454326df17 An intial commit of a large set of changes attempting to clean up the way that saving images is processed in image_util.hpp and image_util.cpp.
* Changed the passing of rgba_palette to a shared_ptr in order to better facilitate the use of a visitor pattern.
 * Moved PNG util processing into its own set of files so that image_util_impl.hpp would not have to depend on HAVE_PNG.
2015-01-08 10:13:06 -05:00
artemp
8db7f58e8f image_compositing - fix composite method signature to composite(T & dst, T const& src,...) via providing const_rendering_buffer adapter 2015-01-08 12:45:04 +01:00
artemp
515491ab70 image_compositing - fix composite method signature to composite(T & dst, T const& src,...) via providing const_rendering_buffer adapter 2015-01-08 12:42:38 +01:00
artemp
b53430110a Merge branch 'master' into image 2015-01-08 10:27:21 +01:00
Blake Thompson
6df688160c More stuff to break it all 2015-01-07 18:16:38 -05:00
Dane Springmeyer
481b6b7958 remove uneeded/unused nonconst access to image_view - amends 0d2eb9cb5f 2015-01-07 15:12:11 -08:00
Blake Thompson
a3f6a989de An intial commit of a large set of changes attempting to clean up the way that saving images is processed in image_util.hpp and image_util.cpp.
* Changed the passing of rgba_palette to a shared_ptr in order to better facilitate the use of a visitor pattern.
 * Moved PNG util processing into its own set of files so that image_util_impl.hpp would not have to depend on HAVE_PNG.
2015-01-07 15:44:31 -05:00
artemp
00a20b78da add initial support for writing image_data_gray16 ( only TIFF supported ) 2015-01-07 18:17:44 +01:00
artemp
cd0ac2d0f6 Merge branch 'master' into image 2015-01-07 17:49:51 +01:00
artemp
5361d21beb move mapnik::noncopyable to mapnik::util::noncopyable where it belongs 2015-01-07 13:11:09 +01:00
artemp
18554ec0b1 remove static_visitor usage and rely on automatic result type deduction
(NOTE: expression_evaluator requires  ```using result_type = T1;``` )

Conflicts:
	src/image.cpp
2015-01-07 11:39:06 +01:00
artemp
affc5ee7c1 update variant to the latest version 2015-01-07 11:38:10 +01:00
artemp
c2ea32feac remove static_visitor usage and rely on automatic result type deduction
(NOTE: expression_evaluator requires  ```using result_type = T1;``` )
2015-01-07 11:35:21 +01:00
artemp
b28aadcf41 update variant to the latest version 2015-01-07 10:51:59 +01:00
artemp
b0b89e76d1 image class - containing image_data_any and initial basic python interface 2015-01-06 12:44:28 +01:00
Dane Springmeyer
2a33ead4cc finish centralizing boost::filesystem usage to single cpp file - refs #1177 2015-01-06 00:33:33 -08:00
Dane Springmeyer
b396db54dd fix -Wsign-compare warning in image_data.hpp 2015-01-05 14:21:59 -08:00
Dane Springmeyer
14015fefe4 fix json output escaping to match json spec 2015-01-05 12:03:16 -08:00
artemp
c9672b6a9d escaped_string - fix output encoding 2015-01-05 14:23:10 +01:00
artemp
fa8feea603 remove unused utf8 phoenix function 2015-01-05 12:39:18 +01:00
artemp
bb9b9ff031 feature_generator_grammar - template get_id on FeatureType 2014-12-23 09:07:31 +01:00
artemp
132507571b template feature_generator_grammar on FeatureType - ref #2546 2014-12-22 15:56:46 +01:00
artemp
14b497d236 use boost::phoenix v3 style declaring return types 2014-12-22 11:58:11 +01:00
artemp
f1373883c2 json feature_generator_grammar - re-factor properties_generator_grammar into separate compilation unit - ref #2546 2014-12-22 11:52:13 +01:00
Dane Springmeyer
dc8253ec2a support expressions in text-placements - closes #2597 2014-12-19 19:05:54 -08:00
artemp
008168f75c image_data - ref #1927
* store image width and height in dimensions object
* allow specifying max_size for width and height (default 0xffff)
* throw if width or height are out of range - 0...max_size
2014-12-19 11:52:40 +01:00
Dane Springmeyer
c051f61646 dont set nodata for image_data_rgba8: fixes tiff_reprojection-1 visual test 2014-12-17 12:26:23 -08:00