Commit graph

73 commits

Author SHA1 Message Date
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
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
12eb56d96a better names + unbuffered io + use image_data_xxx for allocating strip
e#	2x2.png
2014-12-17 18:34:47 +01:00
Blake Thompson
0d2eb9cb5f Updates for Ref #2594 and #2592 (Related to #2491)
* Added support for scanline, stripped and tiled
 * Added new configuration options for TIFF:
   - method
   - tile_height (Default 0)
   - tile_width (Default 0)
   - rows_per_strip (Default 0)
 * Removed 'scanline' configuration option for TIFF.
 * Changed RGBA TIFFs to be ASSOCALPHA rather then UNASSOCALPHA
2014-12-15 02:52:32 +00:00
artemp
72f437c52a tiff_reader - fix
( "...where the -Sy is due the reversal of direction from J increasing- down in raster space to Y increasing-up in model space.")
2014-12-12 10:18:34 +01:00
artemp
218b22fba9 remove cast 2014-12-11 09:38:58 +01:00
artemp
5021a4e122 tiff_reader - fix end_y calc in read_stripped 2014-12-10 18:11:41 +01:00
artemp
74c96f0bda make bounding_box return optional<box2d<double>> to be consistent with current behavour 2014-12-10 12:53:39 +01:00
artemp
2efde962aa image_reader - add bounding_box virtual method 2014-12-10 10:44:51 +01:00
Dane Springmeyer
93c6207153 repack tiff_reader to avoid slop (saves 16 bytes) 2014-12-09 08:34:13 -05:00
artemp
303d625b7c tiff_reader - fix reading tiled tiffs + flip vertically output from TIFFReadRGBATile + cleaups 2014-12-09 12:25:21 +01:00
Dane Springmeyer
36d7e455ed tiff io: disable strip chopping to ensure we fail fast on 'tiff_dos_strip_chop.tif' from gdal autotests 2014-12-09 00:39:19 -05:00
Dane Springmeyer
fcf71c36d9 tiff io: avoid over-allocation + add more tests 2014-12-09 00:17:02 -05:00
Dane Springmeyer
8b0ba79d2a more debugging output for failed read_tile 2014-12-08 20:39:44 -05:00
Dane Springmeyer
24a9816913 test tiff photometric setting 2014-12-08 17:16:56 -05:00
Dane Springmeyer
f121d805a9 no need for TIFFRGBAImageOK 2014-12-08 17:12:44 -05:00
Dane Springmeyer
6ca1cd6c74 avoid crashing on images with alpha 2014-12-08 16:43:32 -05:00
Dane Springmeyer
cb3771fbe5 fix reading of tiled tiff tile dimensions for gray32f 2014-12-08 15:23:06 -05:00
Dane Springmeyer
bc3f59af12 new c++ tiff tests - refs #2491 2014-12-08 14:52:52 -05:00
artemp
7fcc4a0846 use TIFFReadTile (or TIFFReadEncodedTile) instead of TIFFReadRGBATile to have consistent orientation
(FIXME: python tests failures)
2014-12-08 18:55:40 +01:00
artemp
912771b8fd generic read_tiled<ImageData> initial implementation + read PHOTOMETRIC_RGB using high-level RGBA expanding interface 2014-12-08 15:51:00 +01:00
Dane Springmeyer
96baff431f use c++ style casts im tiff_reader 2014-12-05 13:59:20 -05:00
artemp
ce605e3982 use RAII for resource management 2014-12-05 18:01:45 +01:00
artemp
902858e55f tiff_reader: initial support for reading gray8/gray16/gray32f/rgba8/rgba16/rgba32f data
Note: current code only works with image data organized in strips. Tile-orientated reading needs implementing
2014-12-05 17:35:26 +01:00
artemp
38da080f82 make concrete image_data type names more expressive and explicit about color channels/depth:
image_data_32 -> image_data_rgba8
image_data_8  -> image_data_gray8
image_data_16 -> image_data_gray16
image_data_float32  -> image_data_gray32f

NOTE: currently image_data_gray16::pixel_type = std::int16_t (signed 16 bit int) to match GDAL
should we support unsigned types?
2014-12-04 11:02:42 +01:00
Dane Springmeyer
f82d57f497 work in progress: start enhancing tiff reader to handle bits per sample 2014-12-03 18:37:27 -05:00
artemp
802428712e initial image_data_any read(...) implementation - always read into image_data_32 2014-12-03 10:56:19 +01:00
artemp
1df9d89a70 add to image_reader and implement empty (placeholder)
```image_data_any read(unsigned x, unsigned y, unsigned width, unsigned height) final```
in png/jpeg/webp/tiff readers
2014-12-03 10:44:56 +01:00
artemp
333965b588 update copyright year 2014-11-20 15:25:50 +01:00
Dane Springmeyer
83588937b9 silence boost warnings 2014-10-21 16:37:27 -07:00
Dane Springmeyer
91ee910ad2 remove debugging line 2014-09-11 15:46:49 -07:00
Dane Springmeyer
519149087e add support to tiff reader for reporting alpha 2014-09-11 15:44:48 -07:00
artemp
3cb047fc5c avoid callling TIFFs global structures ref #2391 2014-09-05 12:30:33 +01:00
artemp
fe215a684e c++11 style : replace (almost) all typedef with type alias's 2014-07-07 18:23:15 +01:00
Dane Springmeyer
8bb77bce92 image readers: ability to check if image has alpha before full read
Conflicts:
	src/webp_reader.cpp
2014-06-16 09:52:26 -07:00
artemp
62af2e6765 + replace <boost/shared_ptr.hpp> with <memory> 2013-09-20 14:13:23 +01:00
artemp
b315eb2167 + use std::shared_ptr and std::make_shared 2013-09-20 14:01:27 +01:00
artemp
4f4e2b001e Merge branch 'master' into c++11
Conflicts:
	SConstruct
	benchmark/run.cpp
	bindings/python/mapnik_datasource.cpp
	bindings/python/mapnik_feature.cpp
	bindings/python/python_optional.hpp
	include/mapnik/css_color_grammar.hpp
	include/mapnik/expression_grammar.hpp
	include/mapnik/feature.hpp
	include/mapnik/feature_style_processor_impl.hpp
	include/mapnik/image_filter_types.hpp
	include/mapnik/image_util.hpp
	include/mapnik/json/geometry_generator_grammar.hpp
	include/mapnik/json/geometry_grammar.hpp
	include/mapnik/processed_text.hpp
	include/mapnik/tiff_io.hpp
	include/mapnik/util/geometry_svg_generator.hpp
	include/mapnik/util/geometry_wkt_generator.hpp
	include/mapnik/utils.hpp
	include/mapnik/webp_io.hpp
	include/mapnik/wkt/wkt_grammar.hpp
	plugins/input/shape/shape_datasource.cpp
	plugins/input/shape/shapefile.hpp
	src/expression_grammar.cpp
	src/expression_string.cpp
	src/image_util.cpp
	src/json/feature_collection_parser.cpp
	src/json/feature_parser.cpp
	src/miniz.c
	src/symbolizer_helpers.cpp
	src/tiff_reader.cpp
	src/webp_reader.cpp
	tests/cpp_tests/geometry_converters_test.cpp
	tests/cpp_tests/image_io_test.cpp
	tests/cpp_tests/map_request_test.cpp
	tests/python_tests/image_test.py
	tests/visual_tests/test.py
2013-08-30 09:46:09 +01:00
Dane Springmeyer
cfc977e6cd deal with various -Wunused-parameter warnings that are not important 2013-07-23 18:46:54 -04:00
Dane Springmeyer
0365d3e081 start centralizing filesystem operations in mapnik::util::fs - refs #1177 2013-06-02 19:28:24 -07:00
Dane Springmeyer
2ec04ab9e3 fix tiff compile against older than tiff 4.x 2013-05-13 11:00:21 -07:00
artemp
15ff3dcec4 TIFF I/O
+ use generic std::istream
+ add open from char const* and size factory method
2013-05-13 07:31:41 -07:00
artemp
245e71d735 TIFF I/O
+ use generic std::istream
+ add open from char const* and size factory method
2013-05-13 10:26:28 +01:00
Dane Springmeyer
a8e2ef7cc7 set TIFFSetErrorHandler to null to start to avoid tiff from printing to stderr on fail - refs #1783 2013-04-09 19:16:05 -07:00
Dane Springmeyer
771cbb11bf fix memory leak when reading invalid tiff - refs #1783 2013-04-09 19:08:50 -07:00
Dane Springmeyer
412aa510a1 fix jpeg/tiff error handling on failed reads - closes #1775 2013-03-25 18:29:29 -07:00
Dane Springmeyer
c0021d0760 remove unused iostream includes and unnecessary usage of ostringstream - refs #1055 2012-12-06 23:06:12 -08:00
artemp
77e585895f + add premultiplied_alpha method to image_reader
* tiff - TIFFTAG_EXTRASAMPLES
  * png  - non-premultiplied alpha (http://www.libpng.org/pub/png/spec/1.1/PNG-Rationale.html)
  * jpeg - no-alpha channel, ensure pre-multiplied model
2012-09-28 16:37:21 +01:00
artemp
8fe932b7d1 + tiff_reader: make TIFF* 'cacheable', to avoid initialization under
certain conditions.
2012-09-24 13:35:22 +01:00
Dane Springmeyer
a12b8f1d2f c++ style 2012-09-03 10:27:48 -07:00