regions.sgml

来自「linux下电话本所依赖的一些图形库」· SGML 代码 · 共 313 行

SGML
313
字号
<!-- ##### SECTION Title ##### -->Points, Rectangles and Regions<!-- ##### SECTION Short_Description ##### -->Simple graphical data types<!-- ##### SECTION Long_Description ##### --><para>GDK provides the #GdkPoint, #GdkRectangle, #GdkRegion and #GdkSpan data typesfor representing pixels and sets of pixels on the screen.</para><para>#GdkPoint is a simple structure containing an x and y coordinate of a point.</para><para>#GdkRectangle is a structure holding the position and size of a rectangle.The intersection of two rectangles can be computed withgdk_rectangle_intersect(). To find the union of two rectangles usegdk_rectangle_union().</para><para>#GdkRegion is an opaque data type holding a set of arbitrary pixels, and isusually used for clipping graphical operations (see gdk_gc_set_clip_region()).</para><para>#GdkSpan is a structure holding a spanline. A spanline is a horizontal line thatis one pixel wide. It is mainly used when rasterizing other graphics primitives.It can be intersected to regions by using gdk_region_spans_intersect_foreach().</para><!-- ##### SECTION See_Also ##### --><para></para><!-- ##### SECTION Stability_Level ##### --><!-- ##### STRUCT GdkPoint ##### --><para>Defines the x and y coordinates of a point.</para>@x: the x coordinate of the point.@y: the y coordinate of the point.<!-- ##### STRUCT GdkRectangle ##### --><para>Defines the position and size of a rectangle.</para>@x: the x coordinate of the left edge of the rectangle.@y: the y coordinate of the top of the rectangle.@width: the width of the rectangle.@height: the height of the rectangle.<!-- ##### FUNCTION gdk_rectangle_intersect ##### --><para>Calculates the intersection of two rectangles.</para>@src1: a #GdkRectangle.@src2: a #GdkRectangle.@dest: the intersection of @src1 and @src2.@Returns: %TRUE if the rectangles intersect.<!-- ##### FUNCTION gdk_rectangle_union ##### --><para>Calculates the union of two rectangles.The union of rectangles @src1 and @src2 is the smallest rectangle whichincludes both @src1 and @src2 within it.</para>@src1: a #GdkRectangle.@src2: a #GdkRectangle.@dest: the union of @src1 and @src2.<!-- ##### STRUCT GdkRegion ##### --><para>A GdkRegion represents a set of pixels on the screen.The only user-visible field of the structure is the user_data member, whichcan be used to attach arbitrary data to the #GdkRegion.</para><!-- ##### FUNCTION gdk_region_new ##### --><para>Creates a new empty #GdkRegion.</para>@Returns: a new empty #GdkRegion.<!-- ##### FUNCTION gdk_region_polygon ##### --><para>Creates a new #GdkRegion using the polygon defined by a number of points.</para>@points: an array of #GdkPoint structs.@npoints: the number of elements in the @points array.@fill_rule: specifies which pixels are included in the region when the polygonoverlaps itself.@Returns: a new #GdkRegion based on the given polygon.<!-- ##### ENUM GdkFillRule ##### --><para>The method for determining which pixels are included in a region, whencreating a #GdkRegion from a polygon.The fill rule is only relevant for polygons which overlap themselves.</para>@GDK_EVEN_ODD_RULE: areas which are overlapped an odd number of times areincluded in the region, while areas overlapped an even number of times are not.@GDK_WINDING_RULE: overlapping areas are always included.<!-- ##### FUNCTION gdk_region_copy ##### --><para></para>@region: @Returns: <!-- ##### FUNCTION gdk_region_rectangle ##### --><para></para>@rectangle: @Returns: <!-- ##### FUNCTION gdk_region_destroy ##### --><para>Destroys a #GdkRegion.</para>@region: a #GdkRegion.<!-- ##### FUNCTION gdk_region_get_clipbox ##### --><para>Returns the smallest rectangle which includes the entire #GdkRegion.</para>@region: a #GdkRegion.@rectangle: returns the smallest rectangle which includes all of @region.<!-- ##### FUNCTION gdk_region_get_rectangles ##### --><para></para>@region: @rectangles: @n_rectangles: <!-- ##### FUNCTION gdk_region_empty ##### --><para>Returns %TRUE if the #GdkRegion is empty.</para>@region: a #GdkRegion.@Returns: %TRUE if @region is empty.<!-- ##### FUNCTION gdk_region_equal ##### --><para>Returns %TRUE if the two regions are the same.</para>@region1: a #GdkRegion.@region2: a #GdkRegion.@Returns: %TRUE if @region1 and @region2 are equal.<!-- ##### FUNCTION gdk_region_point_in ##### --><para>Returns %TRUE if a point is in a region.</para>@region: a #GdkRegion.@x: the x coordinate of a point.@y: the y coordinate of a point.@Returns: %TRUE if the point is in @region.<!-- ##### FUNCTION gdk_region_rect_in ##### --><para>Tests whether a rectangle is within a region.</para>@region: a #GdkRegion.@rect: a #GdkRectangle.@Returns: %GDK_OVERLAP_RECTANGLE_IN, %GDK_OVERLAP_RECTANGLE_OUT, or%GDK_OVERLAP_RECTANGLE_PART, depending on whether the rectangle is inside,outside, or partly inside the #GdkRegion, respectively.<!-- ##### ENUM GdkOverlapType ##### --><para>Specifies the possible values returned by gdk_region_rect_in().</para>@GDK_OVERLAP_RECTANGLE_IN: if the rectangle is inside the #GdkRegion.@GDK_OVERLAP_RECTANGLE_OUT: if the rectangle is outside the #GdkRegion.@GDK_OVERLAP_RECTANGLE_PART: if the rectangle is partly inside the #GdkRegion.<!-- ##### FUNCTION gdk_region_offset ##### --><para>Moves a region the specified distance.</para>@region: a #GdkRegion.@dx: the distance to move the region horizontally.@dy: the distance to move the region vertically.<!-- ##### FUNCTION gdk_region_shrink ##### --><para>Resizes a region by the specified amount.Positive values shrink the region. Negative values expand it.</para>@region: a #GdkRegion.@dx: the number of pixels to shrink the region horizontally.@dy: the number of pixels to shrink the region vertically.<!-- ##### FUNCTION gdk_region_union_with_rect ##### --><para></para>@region: @rect: <!-- ##### FUNCTION gdk_region_intersect ##### --><para></para>@source1: @source2: <!-- ##### FUNCTION gdk_region_union ##### --><para></para>@source1: @source2: <!-- ##### FUNCTION gdk_region_subtract ##### --><para></para>@source1: @source2: <!-- ##### FUNCTION gdk_region_xor ##### --><para></para>@source1: @source2: <!-- ##### STRUCT GdkSpan ##### --><para>A GdkSpan represents a horizontal line of pixels startingat the pixel with coordinates @x, @y and ending before @x + @width, @y.</para>@x: x coordinate of the first pixel.@y: y coordinate of the first pixel.@width: number of pixels in the span.<!-- ##### USER_FUNCTION GdkSpanFunc ##### --><para>This defines the type of the function passed to gdk_region_spans_intersect_foreach(). </para>@span: a #GdkSpan.@data: the user data passed to gdk_region_spans_intersect_foreach().<!-- ##### FUNCTION gdk_region_spans_intersect_foreach ##### --><para>Calls a function on each span in the intersection of @region and@spans.</para>@region: a #GdkRegion.@spans: an array of #GdkSpans.@n_spans: the length of @spans.@sorted: %TRUE if @spans is sorted wrt. the y coordinate.@function: function to call on each span in the intersection.@data: data to pass to @function.

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?