当前位置: 首页>>代码示例>>Python>>正文


Python func.c_call函数代码示例

本文整理汇总了Python中pystacia.api.func.c_call函数的典型用法代码示例。如果您正苦于以下问题:Python c_call函数的具体用法?Python c_call怎么用?Python c_call使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了c_call函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: overlay

def overlay(image, other, x, y, composite):
    if not composite:
        composite = composites.over

    composite = enum_lookup(composite, composites)

    c_call(image, 'composite', other, composite, x, y)
开发者ID:ppawlak,项目名称:pystacia,代码行数:7,代码来源:pixel.py

示例2: add_noise

def add_noise(image, attenuate, noise_type):
    if not noise_type:
        noise_type = 'gaussian'

    noise_type = enum_lookup(noise_type, noises)

    c_call(image, 'add_noise', noise_type, attenuate)
开发者ID:ppawlak,项目名称:pystacia,代码行数:7,代码来源:special.py

示例3: charcoal

def charcoal(image, radius, strength, bias):
    if strength is None:
        strength = radius
    if bias is None:
        bias = 0

    c_call(image, 'charcoal', radius, strength, bias)
开发者ID:ppawlak,项目名称:pystacia,代码行数:7,代码来源:special.py

示例4: init_dll

def init_dll(dll):
    def shutdown():
        logger.debug('Cleaning up traced instances')
        _cleanup()

        c_call(None, 'terminus')

        if jython:
            from java.lang import System  # @UnresolvedImport
            System.exit(0)

    logger.debug('Critical section - init MagickWand')
    with __lock:
        if not dll.__inited:
            c_call(None, 'genesis', __init=False)

            logger.debug('Registering atexit handler')
            atexit.register(shutdown)

            dll.__inited = True

    version = magick.get_version()
    if version < min_version:
        msg = formattable('Unsupported version of MagickWand {0}')
        warn(msg.format(version))
开发者ID:ppawlak,项目名称:pystacia,代码行数:25,代码来源:__init__.py

示例5: flip

def flip(image, axis):
    if axis.name == 'x':
        c_call(image, 'flip')
    elif axis.name == 'y':
        c_call(image, 'flop')
    else:
        raise PystaciaException('axis must be X or Y')
开发者ID:ppawlak,项目名称:pystacia,代码行数:7,代码来源:geometry.py

示例6: get_range

def get_range(image):
    minimum, maximum = c_double(), c_double()

    c_call(image, ('get', 'range'), byref(minimum), byref(maximum))

    return tuple(x.value / (2 ** magick.get_depth() - 1)
                 for x in (minimum, maximum))
开发者ID:squeaky-pl,项目名称:pystacia,代码行数:7,代码来源:color.py

示例7: sepia

def sepia(image, threshold, saturation):
    threshold = (2 ** magick.get_depth() - 1) * threshold

    c_call(image, 'sepia_tone', threshold)

    if saturation:
        modulate(image, 0, saturation, 0)
开发者ID:squeaky-pl,项目名称:pystacia,代码行数:7,代码来源:color.py

示例8: map

def map(image, lookup, interpolation):  # @ReservedAssignment
    if not interpolation:
        interpolation = 'average'

    interpolation = enum_lookup(interpolation, interpolations)

    c_call(image, 'clut', lookup, interpolation)
开发者ID:squeaky-pl,项目名称:pystacia,代码行数:7,代码来源:color.py

示例9: fill

def fill(image, fill, blend):
    # image magick ignores alpha setting of color
    # let's incorporate it into blend
    blend *= fill.alpha

    blend = from_rgb(blend, blend, blend)

    c_call(image, 'colorize', fill, blend)
开发者ID:ppawlak,项目名称:pystacia,代码行数:8,代码来源:pixel.py

示例10: read

def read(spec, width=None, height=None, factory=None):
    image = _instantiate(factory)

    if width and height:
        c_call('magick', 'set_size', image, width, height)

    c_call(image, 'read', spec)

    return image
开发者ID:ppawlak,项目名称:pystacia,代码行数:9,代码来源:io.py

示例11: get_options

def get_options():
    options = {}

    size = c_size_t()
    keys = c_call('magick_', 'query_configure_options', '*', byref(size))
    for key in [native_str(keys[i]) for i in range(size.value)]:
        options[key] = c_call('magick_', 'query_configure_option', key)

    return options
开发者ID:ppawlak,项目名称:pystacia,代码行数:9,代码来源:_impl.py

示例12: despeckle

def despeckle(image):
    """Attempt to remove speckle preserving edges.

       Resulting image almost solid color areas are smoothed preserving
       edges.

       This method can be chained.
    """
    c_call(image, 'despeckle')
开发者ID:ppawlak,项目名称:pystacia,代码行数:9,代码来源:blur.py

示例13: denoise

def denoise(image):
    """Attempt to remove noise preserving edges.

       Applies a digital filter that improves the quality of a
       noisy image.

       This method can be chained.
    """
    c_call(image, 'enhance')
开发者ID:ppawlak,项目名称:pystacia,代码行数:9,代码来源:blur.py

示例14: shutdown

    def shutdown():
        logger.debug('Cleaning up traced instances')
        _cleanup()

        c_call(None, 'terminus')

        if jython:
            from java.lang import System  # @UnresolvedImport
            System.exit(0)
开发者ID:ppawlak,项目名称:pystacia,代码行数:9,代码来源:__init__.py

示例15: set_string

def set_string(color, value):
    try:
        c_call(color, 'set_color', value)
    except PystaciaException:
        info = exc_info()
        matches = info[1].args[0].startswith
        if matches('unrecognized color') or matches('UnrecognizedColor'):
            raise PystaciaException('Unknown color string representation')

        reraise(*info)
开发者ID:squeaky-pl,项目名称:pystacia,代码行数:10,代码来源:_impl.py


注:本文中的pystacia.api.func.c_call函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。