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

All Samples(24)  |  Call(13)  |  Derive(0)  |  Import(11)
ImageSource for transparent or solid-color images.
Implements optimized as_buffer() method.

src/m/a/mapproxy-HEAD/mapproxy/service/wms.py   mapproxy(Download)
from mapproxy.source import SourceError
from mapproxy.exception import RequestError
from mapproxy.image import bbox_position_in_image, SubImageSource, BlankImageSource
from mapproxy.image.merge import concat_legends, LayerMerger
from mapproxy.image.opts import ImageOptions
                    img_opts.bgcolor = params.bgcolor
                    img_opts.transparent = params.transparent
                    img = BlankImageSource(size=params.size, image_opts=img_opts, cacheable=True)
                    return Response(img.as_buffer(), content_type=img_opts.format.mime_type)
                sub_size, offset, sub_bbox = bbox_position_in_image(params.bbox, params.size, limited_extent.bbox)

src/m/a/MapProxy-1.6.0/mapproxy/image/merge.py   MapProxy(Download)
from mapproxy.platform.image import Image, ImageColor, ImageChops
from mapproxy.platform.image import has_alpha_composite_support
from mapproxy.image import BlankImageSource, ImageSource
from mapproxy.image.opts import create_image, ImageOptions
from mapproxy.image.mask import mask_image
        """
        if not self.layers:
            return BlankImageSource(size=size, image_opts=image_opts, cacheable=True)
        if len(self.layers) == 1:
            layer_img, layer = self.layers[0]
    """
    if not legends:
        return BlankImageSource(size=(1,1), image_opts=ImageOptions(bgcolor=bgcolor, transparent=transparent))
    if len(legends) == 1:
        return legends[0]

src/m/a/mapproxy-HEAD/mapproxy/image/merge.py   mapproxy(Download)
from mapproxy.platform.image import Image, ImageColor, ImageChops
from mapproxy.platform.image import has_alpha_composite_support
from mapproxy.image import BlankImageSource, ImageSource
from mapproxy.image.opts import create_image, ImageOptions
from mapproxy.image.mask import mask_image
        """
        if not self.layers:
            return BlankImageSource(size=size, image_opts=image_opts, cacheable=True)
        if len(self.layers) == 1:
            layer_img, layer = self.layers[0]
    """
    if not legends:
        return BlankImageSource(size=(1,1), image_opts=ImageOptions(bgcolor=bgcolor, transparent=transparent))
    if len(legends) == 1:
        return legends[0]

src/m/a/MapProxy-1.6.0/mapproxy/service/tile.py   MapProxy(Download)
from mapproxy.srs import SRS
from mapproxy.grid import default_bboxs
from mapproxy.image import BlankImageSource
from mapproxy.image.opts import ImageOptions
from mapproxy.image.mask import mask_image_source_from_coverage
            format = self.format
        if not self._empty_tile:
            img = BlankImageSource(size=self.grid.tile_size,
                image_opts=ImageOptions(format=format, transparent=True))
            self._empty_tile = img.as_buffer().read()

src/m/a/mapproxy-HEAD/mapproxy/service/tile.py   mapproxy(Download)
from mapproxy.srs import SRS
from mapproxy.grid import default_bboxs
from mapproxy.image import BlankImageSource
from mapproxy.image.opts import ImageOptions
from mapproxy.image.mask import mask_image_source_from_coverage
            format = self.format
        if not self._empty_tile:
            img = BlankImageSource(size=self.grid.tile_size,
                image_opts=ImageOptions(format=format, transparent=True))
            self._empty_tile = img.as_buffer().read()

src/m/a/MapProxy-1.6.0/mapproxy/source/error.py   MapProxy(Download)
 
from mapproxy.image.opts import ImageOptions
from mapproxy.image import BlankImageSource
 
class HTTPSourceErrorHandler(object):
		transparent = len(color) == 4
		image_opts = ImageOptions(bgcolor=color, transparent=transparent)
		img_source = BlankImageSource(query.size, image_opts, cacheable=cacheable)
		return img_source

src/m/a/mapproxy-HEAD/mapproxy/source/error.py   mapproxy(Download)
 
from mapproxy.image.opts import ImageOptions
from mapproxy.image import BlankImageSource
 
class HTTPSourceErrorHandler(object):
		transparent = len(color) == 4
		image_opts = ImageOptions(bgcolor=color, transparent=transparent)
		img_source = BlankImageSource(query.size, image_opts, cacheable=cacheable)
		return img_source

src/m/a/MapProxy-1.6.0/mapproxy/test/unit/test_decorate_img.py   MapProxy(Download)
from mapproxy.grid import tile_grid
from mapproxy.image import BlankImageSource
from mapproxy.image import ImageSource
from mapproxy.image.opts import ImageOptions
from mapproxy.layer import MapLayer, DefaultMapExtent
    def render(self, tile_request, use_profiles=None, coverage=None, decorate_img=None):
        self.requested = True
        resp = BlankImageSource((256, 256), image_opts=ImageOptions(format='image/png'))
        resp.timestamp = 0
        return resp

src/m/a/mapproxy-HEAD/mapproxy/test/unit/test_decorate_img.py   mapproxy(Download)
from mapproxy.grid import tile_grid
from mapproxy.image import BlankImageSource
from mapproxy.image import ImageSource
from mapproxy.image.opts import ImageOptions
from mapproxy.layer import MapLayer, DefaultMapExtent
    def render(self, tile_request, use_profiles=None, coverage=None, decorate_img=None):
        self.requested = True
        resp = BlankImageSource((256, 256), image_opts=ImageOptions(format='image/png'))
        resp.timestamp = 0
        return resp

src/m/a/MapProxy-1.6.0/mapproxy/test/unit/test_auth.py   MapProxy(Download)
from mapproxy.grid import tile_grid
from mapproxy.layer import MapLayer, DefaultMapExtent
from mapproxy.image import BlankImageSource
from mapproxy.image.opts import ImageOptions
from mapproxy.request.base import Request
    def render(self, tile_request, use_profiles=None, coverage=None, decorate_img=None):
        self.requested = True
        resp = BlankImageSource((256, 256), image_opts=ImageOptions(format='image/png'))
        resp.timestamp = 0
        return resp

  1 | 2  Next