"Fossies" - the Fresh Open Source Software Archive

Member "libgdiplus-6.0.2/src/region-bitmap.h" (31 Jul 2019, 3175 Bytes) of package /linux/misc/mono-sources/libgdiplus/libgdiplus-6.0.2.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "region-bitmap.h": 5.6.1_vs_6.0.2.

    1 /*
    2  * Copyright (C) 2006-2007 Novell, Inc (http://www.novell.com)
    3  *
    4  * Permission is hereby granted, free of charge, to any person obtaining a copy of this software
    5  * and associated documentation files (the "Software"), to deal in the Software without restriction,
    6  * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
    7  * and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
    8  * subject to the following conditions:
    9  *
   10  * The above copyright notice and this permission notice shall be included in all copies or substantial
   11  * portions of the Software.
   12  *
   13  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
   14  * NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
   15  * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
   16  * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
   17  * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
   18  *
   19  * Authors:
   20  *          Sebastien Pouliot  <sebastien@ximian.com>
   21  */
   22 
   23 /*
   24  * NOTE: This is a private header files and everything is subject to changes.
   25  */
   26 
   27 #ifndef __REGION_BITMAP_H__
   28 #define __REGION_BITMAP_H__
   29 
   30 #include "gdiplus-private.h"
   31 #include "bitmap-private.h"
   32 
   33 /*
   34  * REGION_MAX_BITMAP_SIZE defines the size limit of the region bitmap we keep
   35  * in memory. The current value is 2 megabits which should be enough for any 
   36  * on-screen region. Before changing this value remember that a "real", but 
   37  * temporary, ARGB32 bitmap (32 times bigger, i.e. 8MB) may be allocated when 
   38  * converting the path into the region bitmap.
   39  */
   40 #define REGION_MAX_BITMAP_SIZE      (2 * 1024 * 1024 >> 3)
   41 
   42 #define SHAPE_SIZE(shape)       (((shape)->Width * (shape)->Height) >> 3)
   43 
   44 
   45 typedef struct {
   46     int X;
   47     int Y;
   48     int Width;
   49     int Height;
   50     unsigned char *Mask;
   51     BOOL reduced;
   52 } GpRegionBitmap;
   53 
   54 
   55 void gdip_region_bitmap_ensure (GpRegion *region) GDIP_INTERNAL;
   56 GpRegionBitmap* gdip_region_bitmap_from_path (GpPath *path) GDIP_INTERNAL;
   57 GpRegionBitmap* gdip_region_bitmap_clone (GpRegionBitmap *bitmap) GDIP_INTERNAL;
   58 
   59 void gdip_region_bitmap_free (GpRegionBitmap *bitmap) GDIP_INTERNAL;
   60 void gdip_region_bitmap_invalidate (GpRegion *region) GDIP_INTERNAL;
   61 
   62 BOOL gdip_region_bitmap_compare (GpRegionBitmap *shape1, GpRegionBitmap *shape2) GDIP_INTERNAL;
   63 BOOL gdip_region_bitmap_is_point_visible (GpRegionBitmap *bitmap, int x, int y) GDIP_INTERNAL;
   64 BOOL gdip_region_bitmap_is_rect_visible (GpRegionBitmap *bitmap, GpRect *rect) GDIP_INTERNAL;
   65 
   66 int gdip_region_bitmap_get_scans (GpRegionBitmap *bitmap, GpRectF *rect) GDIP_INTERNAL;
   67 
   68 void gdip_region_bitmap_get_smallest_rect (GpRegionBitmap *bitmap, GpRect *rect) GDIP_INTERNAL;
   69 void gdip_region_bitmap_shrink (GpRegionBitmap *bitmap, BOOL always_shrink) GDIP_INTERNAL;
   70 
   71 cairo_surface_t *gdip_region_bitmap_to_cairo_surface (GpRegionBitmap *bitmap) GDIP_INTERNAL;
   72 
   73 GpRegionBitmap* gdip_region_bitmap_combine (GpRegionBitmap *bitmap1, GpRegionBitmap* bitmap2, CombineMode combineMode) GDIP_INTERNAL;
   74 
   75 #endif