Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(12)  |  Call(12)  |  Derive(0)  |  Import(0)
Transforms the `src_img` between the source and destination SRS
of this ``ImageTransformer`` instance.

When the ``src_srs`` and ``dst_srs`` are equal the image will be cropped
and not transformed. If the `src_bbox` and `dst_bbox` are equal,
the `src_img` itself will be returned.

:param src_img: the source image for the transformation
:param src_bbox: the bbox of the src_img
:param dst_size: the size of the result image (in pizel)(more...)

src/m/a/MapProxy-1.6.0/mapproxy/image/tile.py   MapProxy(Download)
        transformer = ImageTransformer(self.src_srs, req_srs)
        src_img = self.image(image_opts)
        return transformer.transform(src_img, self.src_bbox, out_size, req_bbox,
            image_opts)
 

src/m/a/mapproxy-HEAD/mapproxy/image/tile.py   mapproxy(Download)
        transformer = ImageTransformer(self.src_srs, req_srs)
        src_img = self.image(image_opts)
        return transformer.transform(src_img, self.src_bbox, out_size, req_bbox,
            image_opts)
 

src/m/a/MapProxy-1.6.0/mapproxy/test/unit/test_image.py   MapProxy(Download)
    def test_perfect_match(self):
        bbox = (-10, -5, 30, 35)
        transformer = ImageTransformer(SRS(4326), SRS(4326))
        result = transformer.transform(self.img, bbox, (100, 100), bbox, image_opts=None)
        assert self.img == result
 
    def test_simple_resize_nearest(self):
        bbox = (-10, -5, 30, 35)
        transformer = ImageTransformer(SRS(4326), SRS(4326))
        result = transformer.transform(self.img, bbox, (200, 200), bbox,
    def test_simple_resize_bilinear(self):
        bbox = (-10, -5, 30, 35)
        transformer = ImageTransformer(SRS(4326), SRS(4326))
        result = transformer.transform(self.img, bbox, (200, 200), bbox,
            image_opts=ImageOptions(resampling='bilinear'))
    def test_transform(self, mesh_div=4):
        transformer = ImageTransformer(self.src_srs, self.dst_srs, mesh_div=mesh_div)
        result = transformer.transform(self.src_img, self.src_bbox, self.dst_size, self.dst_bbox,
            image_opts=ImageOptions(resampling='nearest'))
        assert isinstance(result, ImageSource)
        for div in [1, 2, 4, 6, 8, 12, 16]:
            transformer = ImageTransformer(self.src_srs, self.dst_srs, mesh_div=div)
            result = transformer.transform(self.src_img, self.src_bbox,
                                           self.dst_size, self.dst_bbox)
            result.as_image().save('/tmp/transform-%d.png' % (div,))

src/m/a/mapproxy-HEAD/mapproxy/test/unit/test_image.py   mapproxy(Download)
    def test_perfect_match(self):
        bbox = (-10, -5, 30, 35)
        transformer = ImageTransformer(SRS(4326), SRS(4326))
        result = transformer.transform(self.img, bbox, (100, 100), bbox, image_opts=None)
        assert self.img == result
 
    def test_simple_resize_nearest(self):
        bbox = (-10, -5, 30, 35)
        transformer = ImageTransformer(SRS(4326), SRS(4326))
        result = transformer.transform(self.img, bbox, (200, 200), bbox,
    def test_simple_resize_bilinear(self):
        bbox = (-10, -5, 30, 35)
        transformer = ImageTransformer(SRS(4326), SRS(4326))
        result = transformer.transform(self.img, bbox, (200, 200), bbox,
            image_opts=ImageOptions(resampling='bilinear'))
    def test_transform(self, mesh_div=4):
        transformer = ImageTransformer(self.src_srs, self.dst_srs, mesh_div=mesh_div)
        result = transformer.transform(self.src_img, self.src_bbox, self.dst_size, self.dst_bbox,
            image_opts=ImageOptions(resampling='nearest'))
        assert isinstance(result, ImageSource)
        for div in [1, 2, 4, 6, 8, 12, 16]:
            transformer = ImageTransformer(self.src_srs, self.dst_srs, mesh_div=div)
            result = transformer.transform(self.src_img, self.src_bbox,
                                           self.dst_size, self.dst_bbox)
            result.as_image().save('/tmp/transform-%d.png' % (div,))