本文整理汇总了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)
示例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)
示例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)
示例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))
示例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')
示例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))
示例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)
示例8: map
def map(image, lookup, interpolation): # @ReservedAssignment
if not interpolation:
interpolation = 'average'
interpolation = enum_lookup(interpolation, interpolations)
c_call(image, 'clut', lookup, interpolation)
示例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)
示例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
示例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
示例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')
示例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')
示例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)
示例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)