Cairo Imagesurface Example

Multiple backends for Cairo are available, to allow rendering to images, to PDF files, and to the screen on X and on other windowing systems. The surface returned will be as compatible as possible to the input surface. This little article will take the fast train of "quick and dirty" to. svg', write_to='image. related function name here() add a note User Contributed Notes. Printing so it seems that the best way to go about doing this is using GtkSharp. Tutorial for the cl-cairo2 package Tam´as K Papp July 29, 2008 1 Introduction Cairo is a 2D graphics library with support for multiple output devices. It provides powerful drawing operations to create a graphical experience that you desire, including stroking, filling, compositing images, and any affine transforms (such as scale, rotation, and shear). Example #1 cairo_image_surface_get_format() example. in this example, we use transparency effect to create a waiting demo. Make sure Cairo/pixman support the image formats that GPUs generally prefer. However, what happens at the level of typechecking in ATS is far more sophisticated than in C. About: TeX Live provides a comprehensive TeX system including all the major TeX-related programs, macro packages, and fonts that are free software. EDIT(2): Ok, I have traced this down to PNG problems with cairo and discovered that cairo_surface_write_to_png does not behave as expected either. source: MGET / Branches / Jason / Libraries / gdal / win32 / release-1310 / include / cairo. pdf), Text File (. You might remember, surfaces are the cairo equivalent to a canvas. 9 and later now include the wx. Searching Google for its name is poor because its source code seems to be contained inside the “gnome-python-desktop” Gnome project GIT repository. Initially the surface contents are all 0. Some fun recipes to spice up your Cairo based drawing! C# version created by Or Dvory ()Simple Working with a Cairo Context. Suggestions cannot be applied while the pull request is closed. Along the path of the line, the source is copied to the destination. c $(pkg-config -cflags -libs cairo)编译还是不可以 0 2013-08-15 16:45:24 查看全部楼层 引用 举报 #2 得分 0. While nothing was really broken thanks to having @comment in the plist with the option off. For on screen display, we can have cairo translate our graphics into something glitz can understand for hardware accelerated rendering! It has many more important and useful target back ends. Load Multiple Image Formats Into Cairo Surfaces (Python) This drove me up the wall trying to figure it out, but loading jpg's or tiff's into a Cairo surface with Python really isn't all that hard. LinearGradient(20. I want to use Mono. Any text that describes the purpose of the example, or what goes on in the example should be here. png image file. There are several things we can note in this source code listing: The barChart function will create a bar chart and save it to a png file; The information shown in the chart is takes from the lines. Dynamic Drawing with Cairo and wxPython. The surface returned will be as compatible as possible to the input surface. They are from open source Python projects. Image_Surface; use Cairo. Image surfaces provide the ability to render to memory buffers either allocated by cairo or by the calling code. lg3 = cairo. The governate of Cairo (Al Qāhirah) is the largest of these jurisdictions. Any text that describes the purpose of the example, or what goes on in the example should be here. such effects are often used to inform users, that a lengthy task is going on behind the scenes. graphics/cairomm: Fix DOCS option There is no opt_CONFIGURE_ARGS_OFF helper. (Feel free to ignore, fix, or tell me). Ofcourse GTK API can be in the functions too, but CAIRO will not be inside main() normally. Examples; Cairo Functions. The following are code examples for showing how to use cairo. ImageSurface(cairo. The initial contents of data will be used as the initial image contents; you must explicitly clear the buffer, using, for example, cairoRectangle and cairoFill if you want it cleared. However, the cairo. It really isn't though it's just painfully easy to fall onto slow paths, and not obvious how not to. In this part of the Cairo graphics tutorial, we will talk about the images. In CAIRO + GTK programming. quilt_patches (+1/-0). Context, we set its target back end, supplying a few details (such as colour depth and size), as in the example below. The intent of this project is to help you "Learn Java by Example" TM. package image Alpha16 is an in-memory image whose At…. LinearGradient(20. such effects are often used to inform users, that a lengthy task is going on behind the scenes. Using Cairo and LGI. version (+1/-0). Context extracted from open source projects. Ensure that a Cairo image surface can be created with the GPU's preferred format. LinearGradient(0. public ImageSurface (Format format, int width, int height) public ImageSurface. Ofcourse GTK API can be in the functions too, but CAIRO will not be inside main() normally. Draw things. IP Server: 103. A GtkButton or a GtkEventBox (as in this example) will work. 2 as given by cairo_version_string(). source: MGET / Branches / Jason / Libraries / gdal / win32 / release-1310 / include / cairo. The output buffer must be kept around until the cairo_surface_t is destroyed or Surface. •Fix possible value truncation of handles passed to Win32Surface and Win32PrintingSurface on. addImage() and the virtual filesystem provided by PhysFS. VB6 QR-Encoding+Decoding and IME-Window-Positioning This but also due to the quite powerful Cairo-ImageSurface-Objects, which are used in the for example, the. CairoContext::copyPath cairo_copy_path (PECL cairo >= 0. C# (CSharp) Cairo. Images need to be stored in PNG format. get_data() to a char*, but I could work out how to get an ImageSurface to wrap (“proxy”) a buffer the cython code allocated. In an earlier post, converting an existing cv2 matrix to cairo surface using cairo. These are the top rated real world C# (CSharp) examples of Cairo. Context - 30 examples found. The given examples are quite simple, they don’t demonstrate the full scope of what’s possible to achieve by integrating the EFL, Glib and Cairo, they should however serve as a good starting point, that demonstrates the underlying ideas. Examples Example #1 cairo_image_surface_get_data() example Any text that describes the purpose of the example, or what goes on in the example should be here. Cairo is a library for creating 2D vector graphics. Are there tutorials for AutoCAD Civil 3D 2012 that assumes that the user never use AutoCAD Civil 3D 2012? Maybe a step-by-step tutorial. 2/19/13 The Cairo graphics library zetcode. The following example shows a simple TIFF output routine using the LZW compression scheme with the help of LIBTIFF: void crtep_save_tiff(cairo_surface_t *surface, const char. source: MGET / Branches / Jason / Libraries / gdal / win32 / release-1310 / include / cairo. create_for_data method takes in a bytearray where every four bytes represent a single pixel. Context extracted from open source projects. After this call the current point will be (x, y). EDIT: Forgot to provide version info. Instead, everyone that wants to have shadows has to roll their own blur function. If the user did not supply a context or a surface in "new", a new Cairo::ImageSurface object is generated. I copied the Cairo DLLs and dependencies into the "Binaries/Win64" folder. If the user supplied a context with "new", So, for example, if you have an SVG line element, you can parse its attributes with an XML parser, then send the hash of key/value pairs in the attributes to "line". I have no evidence of whether it actually learns general shapes of text, or just is able to recognize all the different fonts thrown at itthe purpose is more to demonstrate CTC. Gnome-Do defaults to its own DPI setting (96 DPI?) and will not render using the DPI set for system if it is different. WriteToPng - 21 examples found. If you draw nothing, nothing is transfered. Does anyone have an experience of creating Win32 Bitmap with cairo? The below example is working just fine except one thing: the resulting Bitmap is not antialiased. ImageSurface. I am experimenting with Cairo to draw vector images. To draw to a cairo_surface_t, create a cairo context with the surface as the target, using cairo_create(). 52 Running on Ubuntu 11. pdf), Text File (. However, the object construction order is pretty puzzling. I'm no Cairo master, so it took me a bit to figure out how. FORMAT_ARGB32, 390, 60) cr = cairo. Note that this is relatively slow, this is mainly due to converting the cairo surface data to the appropriate rgb values and putting each pixel in the PhotoImage class. Add this suggestion to a batch that can be applied as a single commit. cairo-image-surface. such effects are often used to inform users, that a lengthy task is going on behind the scenes. quartz-cglayers. This example uses a convolutional stack followed by a recurrent stack and a CTC logloss function to perform optical character recognition of generated text images. config/fontconfig mv ~/. 1 /* 2 * Copyright © 2010 Intel Corporation: 3 * 4 * This library is free software; you can. Context, we set its target back end, supplying a few details (such as colour depth and size), as in the example below. On initializing the cairo. Designing a library that's easy to use. Comment 2. 序言 入门指引 简介 PHP 是什么? PHP 能做什么? 简明教程 需要些什么? 第一个 PHP 页面 实用的脚本 处理表单. The current clip region affects all drawing operations by effectively masking out any changes to the surface that are outside the current clip region. to refresh your session. png image file. Learn more about Teams. However, the bytearray that we concatenated earlier has every three bytes representing a pixel. 31 by Michael Lawrence. Displaying text is an important function of any application. quartz-cglayers. Science Sundays is a free lecture series open to the public that provides a wide range of current and emerging topics and issues in science that touch our everyday lives. There is an Ubuntu python-rsvg package providing it. Return the user data previously attached to self with the given key, if any, without incrementing the reference count. As a valued partner and proud supporter of MetaCPAN, StickerYou is happy to offer a 10% discount on all Custom Stickers, Business Labels, Roll Labels, Vinyl Lettering or Custom Decals. graphics/cairomm: Fix DOCS option There is no opt_CONFIGURE_ARGS_OFF helper. > > Yes, we definitely need a new question answered there: > > I've been using cairo_show_text, but I want to start doing more > complex things than it can do. The surface is a 390x60px image. Q&A for Work. The values have been selected to allow multiple events to trigger a selection. It has such features as anti-aliased primitives, alpha-compositing, and gradients. wxPython has a new wxGraphicsContext ("wxGC") class (and related classes) which provide a nice, modern paths-based drawing API. Note that the bug does not appear when rendering to a cairo image surface. For example, you select a source and draw a line. that'd be a real test of skills. Package cairo wraps the Cairo graphics library. For example, a cairo context is build on a cairo surface. For instance, text is automatically converted to paths. in the PrintDocument's PrintPage event. cairo-image-surface-create-from-png と cairo-surface-write-to-png が ストリームを引数に取ることができるようになりました。 従来どおりファイル名を引数に指定することも可能です. The details are explained in the create_similar function on a cairo surface. Currently supported output targets include the X Window System, Quartz, Win32, image buffers, PostScript, PDF, and SVG file output. PDFSurfaceでPDFのオブジェクトを作成します。他にも、cairo. However, from what I've been able to gather from the documentation cairo_image_surface_create uses a CPU-based renderer and writes the output to main memory. Code: Select all ' textshake. So I made a nice little class that plots to an array of pixel data, and has an ImageSurface proxy. Along the path of the line, the source is copied to the destination. They are from open source Python projects. The interface of Awesome is mostly based on a library called LGI. Hello I try to draw a wx. dll (specific for Mac) in the Plugins folder. I have tested the code example successfully in PB 5. As previously mentionned, the code was (save as fibonacci. We will show how to display an image on the GTK window. and cairo API will be in the functions that GTK calls. com), 专注于IT课程的研发和培训,课程分为:实战课程、 免费教程、中文文档、博客和在线工具 形成了五. Switching to an image surface gives about a 10% increase in win32 performance, and about 25% increase on mac. Create a ImageSurface from a existing cairo_surface_t*. public ImageSurface (Format format, int width, int height) public ImageSurface. Hi, what is the best way to use Skia in a toy native Windows application? I've built Skia using Visual Studio and can use it as a lib, but I don't know how to get from an SkCanvas to the screen. Description. from_png ( string filename). Using OpenGL ES to Accelerate Apps with Legacy 2D GUIs Published on November 1, 2012 One of the best ways to update an application with a tired two-dimensional (2D) graphical user interface (GUI) is to update its legacy look and feel with some three-dimensional (3D) effects to get more of an Apple* iPhone*–like user experience. RETURN VALUES Returns the width of the CairoImageSurface object EXAMPLES Example #1 CairoImageSurface::getWidth example Exemplul de mai sus va afișa ceva similar cu: A se vedea și. There are several tools to use to acomplish such surface finish. cairo_create — Returns a new CairoContext object on the requested surface; cairo_font_options_create — Description; cairo_image_surface_get_stride — Description; cairo_image_surface_get_width — Description; cairo_matrix_create_scale — Alias of CairoMatrix::initScale;. (12:19:23 PM) laszlok: if your drawing is complex, it probably will (12:19:51 PM) laszlok: but cairo is quite efficient, and allows you flexibility for caching drawings (12:20:27 PM) laszlok: for example if you have a background which requires a long time to draw, you can draw it to an ImageSurface in memory instead (12:20:39 PM) laszlok: and. 0 is not available checking for cairo's image surface backend feature. The details are explained in the create_similar function on a cairo surface. ImageSurface imgsrf = new Cairo. This view is supposed to get. c accesses the image surface parameters directly, eg cairo_image_surface_get_data (surf) is replaced by surf->data, but otherwise its almost exactly what you're asking for. class cairo. 1 Answers 1 ---Accepted---Accepted---Accepted---Here is a short example of cairo + opencv usage, hope it'll be userful: Recommend:c++ - How to convert an OpenCV Mat that has been written in an xml file back into an image. Dismiss Join GitHub today. Scan0, Cairo. An additional problem is that GtkGLExt, which I'll need to use to create cairo-gl surfaces for onscreen drawing, doesn't work on OSX. A GtkButton or a GtkEventBox (as in this example) will work. GitHub Gist: instantly share code, notes, and snippets. Errors/Exceptions. Any text that describes the purpose of the example, or what goes on in the example should be here. com Blogger 26 1 25 tag:blogger. Example #1 cairo_image_surface_get_format() example. I would suggest you draw a big rectangle the size of the image. from_png ( string filename). Learn more about Teams. that'd be a real test of skills. For example, it will likely be of the same surface type as the input. What this is. Dynamic Drawing with Cairo and wxPython. Context extracted from open source projects. We will show how to display an image on the GTK window. If a Cairo context is supplied, the value of surface is ignored, and the image is drawn using the context value. Cairo & PNG. Maybe you don't have enough memory to make a surface the size that you requested for example. This function is like CairoContext::copyPath() except that any curves in the path will be approximated with piecewise-linear approximations, (accurate to within the current tolerance value). Pycairo Installation: • pip3 install pycairo Installing Pycairo requires pkg-config and cairo including its headers. Trouble converting to pascal sample examples of cairo. This method allows Cairo to use the same block of memory for the surface as pygame does. Also, the bug is present with at least both of "Liberation Sans" and "Bitstream Vera Sans". Context, we set its target back end, supplying a few details (such as colour depth and size), as in the example below. This tutorial will. Actually passing --disable-documentation to configure should save a tiny bit of build time during builds with DOCS=off. As a valued partner and proud supporter of MetaCPAN, StickerYou is happy to offer a 10% discount on all Custom Stickers, Business Labels, Roll Labels, Vinyl Lettering or Custom Decals. The following are code examples for showing how to use cairo. They are from open source Python projects. 今回は PNG 画像として出力するため、サーフェスには Cairo::ImageSurface を使います。Cairo::ImageSurface を作るには 画像の幅と高さが必要でした。これらは変換元の SVG 画像の幅と高 さ、それと拡大率がわかれば求めることができます。. The output buffer must be kept around until the cairo_surface_t is destroyed or Surface. For other uses, see Belgrade (disambiguation). bas ' FreeBASIC cairo example ' created by lizard #include once "cairo/cairo. version (+1/-0). You can vote up the examples you like or vote down the ones you don't like. For example, Gtk2Hs provides a binding to the backend for X11 (and win32 on Windows). Bug 575521; add a way to get the image surface associated with a surface. Other links. The following are code examples for showing how to use cairo. chromium / chromiumos / third_party / cairo / master /. Create a new surface that is as compatible as possible with an existing surface. C# (CSharp) Cairo ImageSurface. Example #1 cairo_image_surface_get_format() example. There are several things we can note in this source code listing: The barChart function will create a bar chart and save it to a png file; The information shown in the chart is takes from the lines. YA-webdesign provides to you 20 free drawing shell shaded clip arts. Along the path of the line, the source is copied to the destination. ImageSurface (format, width, height) ¶. Any idea ?. Creates an image surface for the provided pixel data. VB6 QR-Encoding+Decoding and IME-Window-Positioning This but also due to the quite powerful Cairo-ImageSurface-Objects, which are used in the for example, the. 4Working with threads in test code The standard TestCase class doesn’t collect errors and failures that occurred in other threads than the main one. We need to bump up every three bytes into four bytes, where the one extra byte is suffice to be an empty, or should I say. odt), PDF File (. While nothing was really broken thanks to having @comment in the plist with the option off. Just a brief post, partly to record this for my own use. However, there are Quartz surfaces in Cairo, which we might be able to use in the Aqua port. Cairo to PIL This article/section is a stub — probably a pile of half-sorted notes, is not well-checked so may have incorrect bits. For a simple drawing task, use the surface generated by the module, the return value from "render". You can rate examples to help us improve the quality of examples. RGB24, 120, 120); Context cr = new Context(surface); The cairo context in this example is tied to an image surface of dimension 120 x 120 and 32 bits per pixel to store RGB and Alpha information. As a valued partner and proud supporter of MetaCPAN, StickerYou is happy to offer a 10% discount on all Custom Stickers, Business Labels, Roll Labels, Vinyl Lettering or Custom Decals. Trouble converting to pascal sample examples of cairo. get_data() to a char*, but I could work out how to get an ImageSurface to wrap (“proxy”) a buffer the cython code allocated. pc/01_build_perf_utils. WriteToPng - 21 examples found. I want to use Mono. I think that the best way is to use the first approaching because we save one transfer operation each time. Is it possible to convert a Cairo ImageSurface into a Texture2D? I am exploring this in order to create textures with test dinamically, so I got this code from an example:. Cairo is a library for creating 2D vector graphics. So I import it on my Mac and change the Mono. Gets the width of the CairoImageSurface PARAMETERS This function has no parameters. ImageSurface(). GTK3 Cairo Animation example using threads. [ch] The script will first save backup copies of each file (renamed with a cairo_set_target_drawable appears in your program foo. Any text that describes the purpose of the example, or what goes on in the example should be here. png image file. The reason some images are included here is to show how the display should look when running the example programs. The initial contents of data will be used as the initial image contents; you must explicitly clear the buffer, using, for example, cairo_rectangle() and cairo_fill() if you want it cleared. The code snippet below shows an example how you can use Pango with Cairo and Freetype font rasterization. This is a piece of code that I've came up with: surface = cairo. h, using various #ifdef blocks to account for endian-type and the "flavour" of TeX you are compiling. py module, which, basically is a python module with a dataset composed of the number of lines that some Pycha modules have. C++ (Cpp) cairo_image_surface_create_from_png - 29 examples found. Instead, I moved it all across into cython. This is a simple example of how to connect to a ScripTouch device and output a PNG image using the Cairo drawing library. It works on Linux, BSDs, OSX. This function is like CairoContext::copyPath() except that any curves in the path will be approximated with piecewise-linear approximations, (accurate to within the current tolerance value). On initializing the cairo. The answer is “pyrsvg” – a Python binding for librsvg. PrintOperation. I'm not an expert in cairo, but I believe you need a "mask". It is designed to provide primitives. There are different subtypes of cairo_surface_t for * different drawing backends; for example, cairo_image_surface_create() * creates a bitmap image in memory. This chapter contains a few selected images of the test and example applications listed above. Returns the image data of this surface or NULL if surface is not an image surface, or if CairoContext::finish(), procedural : cairo_surface_finish(), has been called. checking whether cairo's SVG surface backend feature could be enabled yes checking for LIBRSVG no configure: WARNING: SVG backend will not be tested since librsvg >= 2. The same font type drawn using the gnome-font-viewer program, for example, is a bit "fatter", this font drawn using my program is "thinner" and doesn't look as good. and cairo API will be in the functions that GTK calls. 0) CairoImageSurface::getHeight — Retrieves the height of the CairoImageSurface. Free software. •Fix possible value truncation of handles passed to Win32Surface and Win32PrintingSurface on. You always follow the same 5 simple steps: Create a Cairo surface to draw the chart on; Build a list of data sets from which your chart will be created. This is most likely the fastest method of the ones listed here, since it doesn't use an extra buffer. config/fontconfig mv ~/. As a valued partner and proud supporter of MetaCPAN, StickerYou is happy to offer a 10% discount on all Custom Stickers, Business Labels, Roll Labels, Vinyl Lettering or Custom Decals. ImageSurface() Examples The following are code examples for showing how to use cairo. It provides access to C libraries such as GTK, GLib, Cairo, Pango, PangoCairo and RSVG using Lua code without having to write actual "glue" C code. However, sometimes the user wants to load a specific image as the background in a semi-transparent manner in the cairo surface, like the image below. Image surfaces provide the ability to render to memory buffers either allocated by cairo or by the calling code. 4 for proper rendering. patch: add support for cairo surfaces backed by CGLayers 8. GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together. This allows to do animations or change the picture displayed to show the current status. 第一个示例 (example-1. cairo_surface_t typedef struct _cairo_surface cairo_surface_t; A cairo_surface_t represents an image, either as the destination of a drawing operation or as source when drawing onto another surface. PHP cairo_image_surface_create - 3 examples found. In the future we should add more options (for example, a small vertical histogram on the plot). This function is like CairoContext::copyPath() except that any curves in the path will be approximated with piecewise-linear approximations, (accurate to within the current tolerance value). Add this suggestion to a batch that can be applied as a single commit. Cairo 2D graphics library with support for multiple output devices. However, from what I've been able to gather from the documentation cairo_image_surface_create uses a CPU-based renderer and writes the output to main memory. Cairo is a library for creating 2D vector graphics. * The type of a surface can be queried with cairo_surface_get_type(). This method allows Cairo to use the same block of memory for the surface as pygame does. Return the user data previously attached to self with the given key, if any, without incrementing the reference count. WriteToPng - 21 examples found. It is not meant to be complete or a full reference. clip – Whether to clip/cut content outside the page. Learn more about Teams. As a valued partner and proud supporter of MetaCPAN, StickerYou is happy to offer a 10% discount on all Custom Stickers, Business Labels, Roll Labels, Vinyl Lettering or Custom Decals. About: TeX Live provides a comprehensive TeX system including all the major TeX-related programs, macro packages, and fonts that are free software. The caption of such a figure is supposed to contain exactly one literal Python expression, marked up with double back-ticks, which evaluates to a cairo image surface, and its referenced image is used as the test expectation. ImageSurface provides the ability to render to memory buffers either allocated by cairo or by the calling code. Эти фигуры мы будем заливать сплошным цветом, а также применять узоры и градиенты. YA-webdesign provides to you 20 free drawing shell shaded clip arts. Pasting a png image on another through CAIRO library I could easily paste images on each other in Python through PIL (Python Imaging Library) Now I need to use Cairo with C++ for the above purpose. So it appears to be a fairly generic cairo-xlib or X server bug. It can be used to draw on multiple different surfaces, such as the FB graphics window, in-memory pixel buffers, a GTK+ widget or a Win32 window or device context. It may seem that using cairo functions in ATS is nearly identical to using them in C (modulo syntatical difference). Q&A for Work. What this is. I'm not an expert in cairo, but I believe you need a "mask". pixbuf first. Browse the source code of gtk/gdk/wayland/gdkwindow-wayland. A GtkButton or a GtkEventBox (as in this example) will work. Examples Example #1 cairo_image_surface_get_data() example Any text that describes the purpose of the example, or what goes on in the example should be here. cairo_image_surface_get_data () unsigned char * cairo_image_surface_get_data (cairo_surface_t *surface); Get a pointer to the data of the image surface, for direct inspection or modification. WriteToPng - 21 examples found. php中文网为您准备了php中文手册,在线手册阅读,让您快速了解php中文手册,本章节为php中文手册的cairo_image_surface_create_for. This ensures that flags that need additional computations (example: is_rectilinear for the fill case) are always used correctly. It provides powerful drawing operations to create a graphical experience that you desire, including stroking, filling, compositing images, and any affine transforms (such as scale, rotation, and shear). The answer is “pyrsvg” – a Python binding for librsvg. Gets a flattened copy of the current path and returns it to the user as a CairoPath. Python Code Snippets. cairo_test. I'm using openbox, conky-lua (from AUR), compmgr (from official repos) and a custom background script (code below). It is written in the C programming language. config/fontconfig mv ~/. For example, a cairo_ft_size node must reference + * its parent cairo_ft_face when it becomes USED, and unreference it + * when it becomes FREE + */ +typedef void. This example uses the gtk3 toolkit the same toolkit used by popular software like gimp and inkscape, it should be quite easy to convert to gtk2 if required the advantage of using gtk is that the libraries are cross platform so you should be able to print on all platform however i have only tested this on ubuntu 15. in the PrintDocument's PrintPage event. class ImageSurface(Surface)¶ A cairo. Package cairo wraps the Cairo graphics library. 今回は PNG 画像として出力するため、サーフェスには Cairo::ImageSurface を使います。Cairo::ImageSurface を作るには 画像の幅と高さが必要でした。これらは変換元の SVG 画像の幅と高 さ、それと拡大率がわかれば求めることができます。. The surface returned will be as compatible as possible to the input surface.