cairo-surface: cairo_surface_t

Description Methods and Functions Detailed Description Structures Convenient Construction Enums and Flags Author(s) References

Description

Base class for surfaces

Methods and Functions

cairoSurfaceCreateSimilar(other, content, width, height)
cairoSurfaceDestroy(surface)
cairoSurfaceStatus(surface)
cairoSurfaceFinish(surface)
cairoSurfaceFlush(surface)
cairoSurfaceGetFontOptions(surface)
cairoSurfaceGetContent(surface)
cairoSurfaceMarkDirty(surface)
cairoSurfaceMarkDirtyRectangle(surface, x, y, width, height)
cairoSurfaceSetDeviceOffset(surface, x.offset, y.offset)
cairoSurfaceGetDeviceOffset(surface)
cairoSurfaceSetFallbackResolution(surface, x.pixels.per.inch, y.pixels.per.inch)
cairoSurfaceGetFallbackResolution(surface)
cairoSurfaceGetType(surface)
cairoSurfaceSetUserData(surface, key, user.data)
cairoSurfaceGetUserData(surface, key)
cairoSurfaceCopyPage(surface)
cairoSurfaceShowPage(surface)
cairoSurfaceHasShowTextGlyphs(surface)
cairoSurface(width, height, format, other, content, data, stride, filename, con)

Detailed Description

CairoSurface is the abstract type representing all different drawing targets that cairo can render to. The actual drawings are performed using a cairo context.

A cairo surface is created by using backend-specific constructors, typically of the form cairo_backendsurfaceCreate().

Structures

CairoSurface

A CairoSurface represents an image, either as the destination of a drawing operation or as source when drawing onto another surface. To draw to a CairoSurface, create a cairo context with the surface as the target, using cairoCreate.

There are different subtypes of CairoSurface for different drawing backends; for example, cairoImageSurfaceCreate creates a bitmap image in memory. The type of a surface can be queried with cairoSurfaceGetType.

Memory management of CairoSurface is done with cairoSurfaceReference() and cairoSurfaceDestroy.

Convenient Construction

cairoSurface is the result of collapsing the constructors of cairo_surface_t (cairoSurfaceCreateSimilar, cairoImageSurfaceCreate, cairoImageSurfaceCreateForData, cairoImageSurfaceCreateFromPng, cairoImageSurfaceCreateFromPngStream, cairoPdfSurfaceCreate, cairoPdfSurfaceCreateForStream, cairoPsSurfaceCreate, cairoPsSurfaceCreateForStream, cairoSvgSurfaceCreate, cairoSvgSurfaceCreateForStream) and accepts a subset of its arguments matching the required arguments of one of its delegate constructors.

Enums and Flags

CairoContent

CairoContent is used to describe the content that a surface will contain, whether color information, alpha information (translucence vs. opacity), or both.

Note: The large values here are designed to keep CairoContent values distinct from CairoFormat values so that the implementation can detect the error if users confuse the two types.

color

The surface will hold color content only.

alpha

The surface will hold alpha content only.

color-alpha

The surface will hold color and alpha content.

CairoSurfaceType

CairoSurfaceType is used to describe the type of a given surface. The surface types are also known as "backends" or "surface backends" within cairo.

The type of a surface is determined by the function used to create it, which will generally be of the form cairo_typesurfaceCreate(), (though see cairoSurfaceCreateSimilar as well).

The surface type can be queried with cairoSurfaceGetType

The various CairoSurface functions can be used with surfaces of any type, but some backends also provide type-specific functions that must only be called with a surface of the appropriate type. These functions have names that begin with cairo_type_surface such as cairoImageSurfaceGetWidth.

The behavior of calling a type-specific function with a surface of the wrong type is undefined.

New entries may be added in future versions. Since 1.2

image

The surface is of type image

pdf

The surface is of type pdf

ps

The surface is of type ps

xlib

The surface is of type xlib

xcb

The surface is of type xcb

glitz

The surface is of type glitz

quartz

The surface is of type quartz

win32

The surface is of type win32

beos

The surface is of type beos

directfb

The surface is of type directfb

svg

The surface is of type svg

Author(s)

Derived by RGtkGen from GTK+ documentation

References

https://www.cairographics.org/manual/cairo-cairo-surface-t.html


RGtk2 documentation built on Oct. 14, 2021, 5:08 p.m.

Related to cairo-surface in RGtk2...