本文整理汇总了C++中cairo_pattern_set_filter函数的典型用法代码示例。如果您正苦于以下问题:C++ cairo_pattern_set_filter函数的具体用法?C++ cairo_pattern_set_filter怎么用?C++ cairo_pattern_set_filter使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了cairo_pattern_set_filter函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: draw
static cairo_test_status_t
draw (cairo_t *cr, int width, int height)
{
cairo_surface_t *image;
cairo_t *cr2;
image = cairo_image_surface_create (CAIRO_FORMAT_RGB24, 2, 2);
/* Fill with an opaque background to avoid a separate rgb24 ref image */
cairo_set_source_rgb (cr, 0, 0, 0);
cairo_paint (cr);
/* First check handling of pattern extents > surface extents */
cairo_save (cr);
cairo_scale (cr, width/2., height/2.);
/* Create a solid black source to merge with the background */
cr2 = cairo_create (image);
cairo_set_source_rgb (cr2, 0, 0 ,0);
cairo_paint (cr2);
cairo_set_source_surface (cr, cairo_get_target (cr2), 0, 0);
cairo_destroy (cr2);
cairo_pattern_set_filter (cairo_get_source (cr), CAIRO_FILTER_BILINEAR);
cairo_paint (cr);
cairo_restore (cr);
/* Then scale to smaller so we can see the full bilinear extents */
cairo_save (cr);
cairo_translate (cr, PAD, PAD);
cairo_scale (cr, SCALE, SCALE);
cairo_translate (cr, 0.5, 0.5);
/* Create a 2x2 blue+red checkerboard source */
cr2 = cairo_create (image);
cairo_set_source_rgb (cr2, 1, 0 ,0); /* red */
cairo_paint (cr2);
cairo_set_source_rgb (cr2, 0, 0, 1); /* blue */
cairo_rectangle (cr2, 0, 1, 1, 1);
cairo_rectangle (cr2, 1, 0, 1, 1);
cairo_fill (cr2);
cairo_set_source_surface (cr, cairo_get_target (cr2), 0, 0);
cairo_destroy (cr2);
cairo_pattern_set_filter (cairo_get_source (cr), CAIRO_FILTER_BILINEAR);
cairo_paint (cr);
cairo_restore (cr);
cairo_surface_destroy (image);
return CAIRO_TEST_SUCCESS;
}
开发者ID:ghub,项目名称:NVprSDK,代码行数:51,代码来源:filter-bilinear-extents.c
示例2: srcRect
void BitmapImage::draw(GraphicsContext* context, const FloatRect& dst, const FloatRect& src, CompositeOperator op)
{
FloatRect srcRect(src);
FloatRect dstRect(dst);
if (dstRect.width() == 0.0f || dstRect.height() == 0.0f ||
srcRect.width() == 0.0f || srcRect.height() == 0.0f)
return;
startAnimation();
cairo_surface_t* image = frameAtIndex(m_currentFrame);
if (!image) // If it's too early we won't have an image yet.
return;
if (mayFillWithSolidColor()) {
fillWithSolidColor(context, dstRect, solidColor(), op);
return;
}
IntSize selfSize = size();
cairo_t* cr = context->platformContext();
cairo_save(cr);
// Set the compositing operation.
if (op == CompositeSourceOver && !frameHasAlphaAtIndex(m_currentFrame))
context->setCompositeOperation(CompositeCopy);
else
context->setCompositeOperation(op);
// If we're drawing a sub portion of the image or scaling then create
// a pattern transformation on the image and draw the transformed pattern.
// Test using example site at http://www.meyerweb.com/eric/css/edge/complexspiral/demo.html
cairo_pattern_t* pattern = cairo_pattern_create_for_surface(image);
// To avoid the unwanted gradient effect (#14017) we use
// CAIRO_FILTER_NEAREST now, but the real fix will be to have
// CAIRO_EXTEND_PAD implemented for surfaces in Cairo allowing us to still
// use bilinear filtering
cairo_pattern_set_filter(pattern, CAIRO_FILTER_NEAREST);
float scaleX = srcRect.width() / dstRect.width();
float scaleY = srcRect.height() / dstRect.height();
cairo_matrix_t matrix = { scaleX, 0, 0, scaleY, srcRect.x(), srcRect.y() };
cairo_pattern_set_matrix(pattern, &matrix);
// Draw the image.
cairo_translate(cr, dstRect.x(), dstRect.y());
cairo_set_source(cr, pattern);
cairo_pattern_destroy(pattern);
cairo_rectangle(cr, 0, 0, dstRect.width(), dstRect.height());
cairo_clip(cr);
cairo_paint_with_alpha(cr, context->getAlpha());
cairo_restore(cr);
if (imageObserver())
imageObserver()->didDraw(this);
}
开发者ID:jackiekaon,项目名称:owb-mirror,代码行数:60,代码来源:BCImageCairo.cpp
示例3: draw
static cairo_test_status_t
draw (cairo_t *cr, int width, int height)
{
cairo_surface_t *surface;
uint32_t data[16] = {
0xffffffff, 0xffffffff, 0xffff0000, 0xffff0000,
0xffffffff, 0xffffffff, 0xffff0000, 0xffff0000,
0xff00ff00, 0xff00ff00, 0xff0000ff, 0xff0000ff,
0xff00ff00, 0xff00ff00, 0xff0000ff, 0xff0000ff
};
surface = cairo_image_surface_create_for_data ((unsigned char *) data,
CAIRO_FORMAT_RGB24, 4, 4, 16);
/* We use a non-zero offset larger than the source surface size to
* stress cairo out a bit more. */
cairo_set_source_surface (cr, surface, 10, 10);
cairo_pattern_set_filter (cairo_get_source (cr), CAIRO_FILTER_NEAREST);
cairo_pattern_set_extend (cairo_get_source (cr), CAIRO_EXTEND_REPEAT);
cairo_paint (cr);
cairo_surface_destroy (surface);
return CAIRO_TEST_SUCCESS;
}
开发者ID:redheli,项目名称:cairo-gral,代码行数:26,代码来源:paint-repeat.c
示例4: _cairo_film_pattern_create
static cairo_pattern_t *
_cairo_film_pattern_create (void)
{
static cairo_pattern_t *film_pattern = NULL;
cairo_pattern_t *pattern;
static GMutex mutex;
g_mutex_lock (&mutex);
if (film_pattern == NULL) {
char *filename;
cairo_surface_t *surface;
filename = g_build_filename (GTHUMB_ICON_DIR, "filmholes.png", NULL);
surface = cairo_image_surface_create_from_png (filename);
film_pattern = cairo_pattern_create_for_surface (surface);
cairo_pattern_set_filter (film_pattern, CAIRO_FILTER_GOOD);
cairo_pattern_set_extend (film_pattern, CAIRO_EXTEND_REPEAT);
cairo_surface_destroy (surface);
g_free (filename);
}
pattern = cairo_pattern_reference (film_pattern);
g_mutex_unlock (&mutex);
return pattern;
}
开发者ID:GNOME,项目名称:gthumb,代码行数:27,代码来源:cairo-utils.c
示例5: ink_cairo_pattern_create_checkerboard
cairo_pattern_t *
ink_cairo_pattern_create_checkerboard()
{
int const w = 6;
int const h = 6;
cairo_surface_t *s = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, 2*w, 2*h);
cairo_t *ct = cairo_create(s);
cairo_set_operator(ct, CAIRO_OPERATOR_SOURCE);
cairo_set_source_rgb(ct, 0.75, 0.75, 0.75);
cairo_paint(ct);
cairo_set_source_rgb(ct, 0.5, 0.5, 0.5);
cairo_rectangle(ct, 0, 0, w, h);
cairo_rectangle(ct, w, h, w, h);
cairo_fill(ct);
cairo_destroy(ct);
cairo_pattern_t *p = cairo_pattern_create_for_surface(s);
cairo_pattern_set_extend(p, CAIRO_EXTEND_REPEAT);
cairo_pattern_set_filter(p, CAIRO_FILTER_NEAREST);
cairo_surface_destroy(s);
return p;
}
开发者ID:Spin0za,项目名称:inkscape,代码行数:25,代码来源:cairo-utils.cpp
示例6: _cairo_image_surface_scale_bilinear_2x2
static cairo_surface_t *
_cairo_image_surface_scale_bilinear_2x2 (cairo_surface_t *image,
int new_width,
int new_height)
{
cairo_surface_t *output;
cairo_t *cr;
output = cairo_image_surface_create (CAIRO_FORMAT_ARGB32,
new_width,
new_height);
cr = cairo_create (output);
cairo_scale (cr,
(double) new_width / cairo_image_surface_get_width (image),
(double) new_height / cairo_image_surface_get_height (image));
cairo_set_source_surface (cr, image, 0.0, 0.0);
cairo_pattern_set_filter (cairo_get_source (cr), CAIRO_FILTER_BILINEAR);
cairo_rectangle (cr, 0.0, 0.0, cairo_image_surface_get_width (image), cairo_image_surface_get_height (image));
cairo_fill (cr);
cairo_surface_flush (output);
cairo_destroy (cr);
return output;
}
开发者ID:cristiklein,项目名称:gthumb,代码行数:25,代码来源:cairo-scale.c
示例7: render_border
static void
render_border (cairo_t *cr,
cairo_surface_t *surface,
guint side,
gdouble x,
gdouble y,
gdouble width,
gdouble height,
GtkSliceSideModifier modifier)
{
cairo_pattern_t *pattern;
cairo_matrix_t matrix;
cairo_save (cr);
cairo_rectangle (cr, x, y, width, height);
cairo_clip (cr);
pattern = cairo_pattern_create_for_surface (surface);
if (modifier == GTK_SLICE_REPEAT)
{
cairo_matrix_init_translate (&matrix, - x, - y);
cairo_pattern_set_extend (pattern, CAIRO_EXTEND_REPEAT);
cairo_pattern_set_matrix (pattern, &matrix);
cairo_set_source (cr, pattern);
cairo_rectangle (cr, x, y, width, height);
cairo_fill (cr);
}
else
{
/* Use nearest filter so borders aren't blurred */
cairo_pattern_set_filter (pattern, CAIRO_FILTER_NEAREST);
if (side == SIDE_TOP || side == SIDE_BOTTOM)
{
gint w = cairo_image_surface_get_width (surface);
cairo_translate (cr, x, y);
cairo_scale (cr, width / w, 1.0);
}
else
{
gint h = cairo_image_surface_get_height (surface);
cairo_translate (cr, x, y);
cairo_scale (cr, 1.0, height / h);
}
cairo_set_source (cr, pattern);
cairo_rectangle (cr, x, y, width, height);
cairo_paint (cr);
}
cairo_restore (cr);
cairo_pattern_destroy (pattern);
}
开发者ID:BYC,项目名称:gtk,代码行数:60,代码来源:gtk9slice.c
示例8: draw
static cairo_test_status_t
draw (cairo_t *cr, int width, int height)
{
cairo_pattern_t *source;
int surface_size = sqrt ((SIZE - 2*PAD)*(SIZE - 2*PAD)/2);
/* Use a gray (neutral) background, so we can spot if the backend pads
* with any other colour.
*/
cairo_set_source_rgb (cr, .5, .5, .5);
cairo_paint (cr);
cairo_translate(cr, SIZE/2, SIZE/2);
cairo_rotate (cr, M_PI / 4.0);
cairo_translate (cr, -surface_size/2, -surface_size/2);
source = create_image_source (surface_size);
cairo_pattern_set_filter (source, CAIRO_FILTER_NEAREST);
cairo_set_source(cr, source);
cairo_pattern_destroy (source);
cairo_paint (cr);
return CAIRO_TEST_SUCCESS;
}
开发者ID:499940913,项目名称:moon,代码行数:25,代码来源:rotate-image-surface-paint.c
示例9: byzanz_layer_cursor_render
static void
byzanz_layer_cursor_render (ByzanzLayer *layer,
cairo_t * cr)
{
ByzanzLayerCursor *clayer = BYZANZ_LAYER_CURSOR (layer);
XFixesCursorImage *cursor = clayer->cursor;
cairo_surface_t *cursor_surface;
if (clayer->cursor == NULL)
return;
cursor_surface = cairo_image_surface_create_for_data ((guchar *) cursor->pixels,
CAIRO_FORMAT_ARGB32, cursor->width * sizeof (unsigned long) / 4, cursor->height,
cursor->width * sizeof (unsigned long));
cairo_save (cr);
cairo_translate (cr, clayer->cursor_x - cursor->xhot, clayer->cursor_y - cursor->yhot);
/* This is neeed to map an unsigned long array to a uint32_t array */
cairo_scale (cr, 4.0 / sizeof (unsigned long), 1);
#if G_BYTE_ORDER == G_BIG_ENDIAN
cairo_translate (cr, (4.0 - sizeof (unsigned long)) / sizeof (unsigned long), 0);
#endif
cairo_set_source_surface (cr, cursor_surface, 0, 0);
/* Next line is also neeed for mapping the unsigned long array to a uint32_t array */
cairo_pattern_set_filter (cairo_get_source (cr), CAIRO_FILTER_NEAREST);
cairo_paint (cr);
cairo_restore (cr);
cairo_surface_destroy (cursor_surface);
}
开发者ID:smtechnocrat,项目名称:byzanz,代码行数:33,代码来源:byzanzlayercursor.c
示例10: pp_piksl_draw
static gboolean pp_piksl_draw(GtkWidget* widget, cairo_t* cr) {
ppPiksl* piksl = PP_PIKSL(widget);
cairo_set_source(cr, PP_APP->checker);
cairo_rectangle(cr, 0, 0,
piksl->img_width*piksl->zoom,
piksl->img_height*piksl->zoom);
cairo_fill(cr);
// Render the graphics data...
// Zoom the surface
cairo_scale(cr, piksl->zoom, piksl->zoom);
// Render each layer
guint i;
ppLayer* layer = NULL;
for (i = 0; i < piksl->layers->len; ++i) {
layer = g_ptr_array_index(piksl->layers, i);
cairo_set_source_surface(cr, layer->surface, layer->x, layer->y);
// Disable the gaussian filtering to preserve pixels
cairo_pattern_set_filter(cairo_get_source(cr), CAIRO_FILTER_NEAREST);
cairo_paint(cr);
}
return FALSE;
}
开发者ID:pyrated,项目名称:pikslpro,代码行数:31,代码来源:pppiksl.c
示例11: draw
static cairo_test_status_t
draw (cairo_t *cr, int width, int height)
{
const cairo_test_context_t *ctx = cairo_test_get_context (cr);
char *filename;
cairo_surface_t *surface;
xasprintf (&filename, "%s/%s", ctx->srcdir,
"create-from-png.ref.png");
surface = cairo_image_surface_create_from_png (filename);
if (cairo_surface_status (surface)) {
cairo_test_status_t result;
result = cairo_test_status_from_status (ctx,
cairo_surface_status (surface));
if (result == CAIRO_TEST_FAILURE) {
cairo_test_log (ctx, "Error reading PNG image %s: %s\n",
filename,
cairo_status_to_string (cairo_surface_status (surface)));
}
free (filename);
return result;
}
cairo_set_source_surface (cr, surface, 0, 0);
cairo_pattern_set_filter (cairo_get_source (cr), CAIRO_FILTER_NEAREST);
cairo_paint (cr);
cairo_surface_destroy (surface);
free (filename);
return CAIRO_TEST_SUCCESS;
}
开发者ID:499940913,项目名称:moon,代码行数:35,代码来源:create-from-png.c
示例12: draw
static cairo_test_status_t
draw (cairo_t *cr, int width, int height)
{
cairo_surface_t *source;
cairo_pattern_t *pattern;
cairo_paint (cr);
source = create_source (cairo_get_target (cr), 2560, 1280);
pattern = cairo_pattern_create_for_surface (source);
cairo_surface_destroy (source);
cairo_pattern_set_filter (pattern, CAIRO_FILTER_NEAREST);
cairo_pattern_set_extend (pattern, CAIRO_EXTEND_NONE);
draw_grid (cr, pattern, 50, 0);
draw_grid (cr, pattern, 130, 0);
draw_grid (cr, pattern, 210, 0);
draw_grid (cr, pattern, 290, 0);
draw_grid (cr, pattern, 50, 230);
draw_grid (cr, pattern, 130, 230);
draw_grid (cr, pattern, 210, 230);
draw_grid (cr, pattern, 290, 230);
cairo_pattern_destroy (pattern);
return CAIRO_TEST_SUCCESS;
}
开发者ID:AliYousuf,项目名称:cairo,代码行数:29,代码来源:scale-offset-similar.c
示例13: draw
static cairo_test_status_t
draw (cairo_t *cr, int width, int height)
{
cairo_surface_t *surface;
uint32_t data[16] = {
0x80808080, 0x80808080, 0x80800000, 0x80800000,
0x80808080, 0x80808080, 0x80800000, 0x80800000,
0x80008000, 0x80008000, 0x80000080, 0x80000080,
0x80008000, 0x80008000, 0x80000080, 0x80000080
};
surface = cairo_image_surface_create_for_data ((unsigned char *) data,
CAIRO_FORMAT_ARGB32, 4, 4, 16);
cairo_test_paint_checkered (cr);
cairo_scale (cr, 4, 4);
cairo_set_source_surface (cr, surface, 2 , 2);
cairo_pattern_set_filter (cairo_get_source (cr), CAIRO_FILTER_NEAREST);
cairo_paint (cr);
cairo_surface_destroy (surface);
return CAIRO_TEST_SUCCESS;
}
开发者ID:jaglass,项目名称:WinCairoRequirements,代码行数:27,代码来源:paint-source-alpha.c
示例14: cairo_matrix_init_scale
cairo_surface_t* Win32UIBinding::ScaleCairoSurface(
cairo_surface_t* oldSurface, int newWidth, int newHeight)
{
cairo_matrix_t scaleMatrix;
cairo_matrix_init_scale(&scaleMatrix,
(double) cairo_image_surface_get_width(oldSurface) / (double) newWidth,
(double) cairo_image_surface_get_height(oldSurface) / (double) newHeight);
cairo_pattern_t* surfacePattern = cairo_pattern_create_for_surface(oldSurface);
cairo_pattern_set_matrix(surfacePattern, &scaleMatrix);
cairo_pattern_set_filter(surfacePattern, CAIRO_FILTER_BEST);
cairo_surface_t* newSurface = cairo_surface_create_similar(
oldSurface, CAIRO_CONTENT_COLOR_ALPHA, newWidth, newHeight);
cairo_t* cr = cairo_create(newSurface);
cairo_set_source(cr, surfacePattern);
/* To avoid getting the edge pixels blended with 0 alpha, which would
* occur with the default EXTEND_NONE. Use EXTEND_PAD for 1.2 or newer (2) */
cairo_pattern_set_extend(cairo_get_source(cr), CAIRO_EXTEND_REFLECT);
/* Replace the destination with the source instead of overlaying */
cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE);
/* Do the actual drawing */
cairo_paint(cr);
cairo_destroy(cr);
return newSurface;
}
开发者ID:JamesHayton,项目名称:titanium_desktop,代码行数:30,代码来源:win32_ui_binding.cpp
示例15: draw
static cairo_test_status_t
draw (cairo_t *cr, int width, int height)
{
int i, j;
cairo_surface_t *surface;
surface = cairo_image_surface_create_for_data ((unsigned char *) &black_pixel,
CAIRO_FORMAT_ARGB32,
1, 1, 4);
/* Fill background white */
cairo_set_source_rgb (cr, 1, 1, 1);
cairo_paint (cr);
/* Draw in black */
cairo_set_source_rgb (cr, 0, 0, 0);
cairo_translate (cr, PAD, PAD);
cairo_set_antialias (cr, CAIRO_ANTIALIAS_NONE);
for (i = 0; i < POINTS; i++)
for (j = 0; j < POINTS; j++) {
cairo_set_source_surface (cr, surface,
2 * i + i * STEP, 2 * j + j * STEP);
cairo_pattern_set_filter (cairo_get_source (cr),
CAIRO_FILTER_NEAREST);
cairo_paint (cr);
}
cairo_surface_destroy (surface);
return CAIRO_TEST_SUCCESS;
}
开发者ID:AliYousuf,项目名称:cairo,代码行数:33,代码来源:a1-image-sample.c
示例16: cr_pattern_set_filter
static VALUE
cr_pattern_set_filter (VALUE self, VALUE filter)
{
cairo_pattern_set_filter (_SELF (self), RVAL2CRFILTER (filter));
cr_pattern_check_status (_SELF (self));
return self;
}
开发者ID:jdlehman,项目名称:rcairo,代码行数:7,代码来源:rb_cairo_pattern.c
示例17: ev_document_misc_surface_rotate_and_scale
cairo_surface_t *
ev_document_misc_surface_rotate_and_scale (cairo_surface_t *surface,
gint dest_width,
gint dest_height,
gint dest_rotation)
{
cairo_surface_t *new_surface;
cairo_t *cr;
gint width, height;
gint new_width = dest_width;
gint new_height = dest_height;
width = cairo_image_surface_get_width (surface);
height = cairo_image_surface_get_height (surface);
if (dest_width == width &&
dest_height == height &&
dest_rotation == 0) {
return cairo_surface_reference (surface);
}
if (dest_rotation == 90 || dest_rotation == 270) {
new_width = dest_height;
new_height = dest_width;
}
new_surface = cairo_surface_create_similar (surface,
cairo_surface_get_content (surface),
new_width, new_height);
cr = cairo_create (new_surface);
switch (dest_rotation) {
case 90:
cairo_translate (cr, new_width, 0);
break;
case 180:
cairo_translate (cr, new_width, new_height);
break;
case 270:
cairo_translate (cr, 0, new_height);
break;
default:
cairo_translate (cr, 0, 0);
}
cairo_rotate (cr, dest_rotation * G_PI / 180.0);
if (dest_width != width || dest_height != height) {
cairo_pattern_set_filter (cairo_get_source (cr), CAIRO_FILTER_BILINEAR);
cairo_scale (cr,
(gdouble)dest_width / width,
(gdouble)dest_height / height);
}
cairo_set_source_surface (cr, surface, 0, 0);
cairo_paint (cr);
cairo_destroy (cr);
return new_surface;
}
开发者ID:hashken,项目名称:evince,代码行数:59,代码来源:ev-document-misc.c
示例18: draw
static cairo_test_status_t
draw (cairo_t *cr, int width, int height)
{
cairo_surface_t *surface;
uint32_t data[STAMP_WIDTH * STAMP_HEIGHT] = {
0xffffffff, 0xffffffff, 0xffff0000, 0xffff0000,
0xffffffff, 0xffffffff, 0xffff0000, 0xffff0000,
0xff00ff00, 0xff00ff00, 0xff0000ff, 0xff0000ff,
0xff00ff00, 0xff00ff00, 0xff0000ff, 0xff0000ff
};
int i, j;
/* Draw reference lines where the jump should be. */
cairo_move_to (cr, PAD + STEPS / 2 * (STAMP_WIDTH + PAD), 0);
cairo_rel_line_to (cr, 0, IMAGE_HEIGHT);
cairo_move_to (cr, 0, PAD + STEPS / 2 * (STAMP_HEIGHT + PAD));
cairo_rel_line_to (cr, IMAGE_WIDTH, 0);
cairo_set_line_width (cr, 2.0);
cairo_stroke (cr);
surface = cairo_image_surface_create_for_data ((unsigned char *) data,
CAIRO_FORMAT_RGB24,
STAMP_WIDTH,
STAMP_HEIGHT,
STAMP_WIDTH * 4);
for (j=0; j < STEPS; j++) {
double j_step;
for (i=0; i < STEPS; i++) {
double i_step;
#define GENERATE_REFERENCE_IMAGE 0
#if GENERATE_REFERENCE_IMAGE
i_step = i >= STEPS / 2 ? 1 : 0;
j_step = j >= STEPS / 2 ? 1 : 0;
#else
i_step = i * 1.0 / STEPS;
j_step = j * 1.0 / STEPS;
#endif
cairo_save (cr);
cairo_set_source_surface (cr, surface,
PAD + i * (STAMP_WIDTH + PAD) + i_step,
PAD + j * (STAMP_HEIGHT + PAD) + j_step);
cairo_pattern_set_filter (cairo_get_source (cr), CAIRO_FILTER_NEAREST);
cairo_paint (cr);
cairo_restore (cr);
}
}
cairo_surface_destroy (surface);
return CAIRO_TEST_SUCCESS;
}
开发者ID:soubok,项目名称:libset,代码行数:58,代码来源:filter-nearest-offset.c
示例19: m_pattern_set_filter
static int m_pattern_set_filter(lua_State * L)
{
struct lpattern_t * pattern = luaL_checkudata(L, 1, MT_PATTERN);
cairo_filter_t filter = (cairo_filter_t)luaL_checkinteger(L, 2);
cairo_pattern_set_filter(pattern->pattern, filter);
lua_pushlightuserdata(L, pattern);
luaL_setmetatable(L, MT_PATTERN);
return 1;
}
开发者ID:IngenicC,项目名称:xboot,代码行数:9,代码来源:l-pattern.c
示例20: lcairo_pattern_set_filter
/* cairo pattern */
static int lcairo_pattern_set_filter(lua_State *L){
cairo_pattern_t *p=luaT_checkudata(L,1,tPattern_id);
/* enum... */
cairo_pattern_set_filter(p, CAIRO_FILTER_NEAREST);
lua_settop(L,1);
return 1;
}
开发者ID:elq,项目名称:torch5,代码行数:10,代码来源:lcairo.c
注:本文中的cairo_pattern_set_filter函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论