/* Returns the difference between the union and the intersection of two * regions. This is a region containing the pixels that are in one of the * source regions, but which are not in both. */ int clip_GDK_REGIONXOR(ClipMachine * ClipMachineMemory) { C_object *creg = _fetch_co_arg(ClipMachineMemory); C_object *creg2 = _fetch_cobject(ClipMachineMemory, _clip_spar(ClipMachineMemory, 2)); C_object *cdest; CHECKCOBJ(creg, GDK_IS_REGION(creg->object)); CHECKARG2(2, MAP_type_of_ClipVarType, NUMERIC_type_of_ClipVarType); CHECKCOBJ(creg2, GDK_IS_REGION(creg->object)); gdk_region_xor(GDK_REGION(creg), GDK_REGION(creg2)); if (creg) { cdest = _register_object(ClipMachineMemory, GDK_REGION(creg), GDK_TYPE_REGION, NULL, NULL); if (cdest) _clip_mclone(ClipMachineMemory, RETPTR(ClipMachineMemory), &cdest->obj); } return 0; err: return 1; }
bool wxRegion::DoXor( const wxRegion& region ) { wxCHECK_MSG( region.Ok(), false, _T("invalid region") ); if (!m_refData) { return false; } AllocExclusive(); gdk_region_xor( M_REGIONDATA->m_region, region.GetRegion() ); return true; }
static void sCombineRegion(cdCtxCanvas *ctxcanvas, GdkRegion* rgn) { switch(ctxcanvas->canvas->combine_mode) { case CD_UNION: gdk_region_union(ctxcanvas->new_rgn, rgn); break; case CD_INTERSECT: gdk_region_intersect(ctxcanvas->new_rgn, rgn); break; case CD_DIFFERENCE: gdk_region_subtract(ctxcanvas->new_rgn, rgn); break; case CD_NOTINTERSECT: gdk_region_xor(ctxcanvas->new_rgn, rgn); break; } gdk_region_destroy(rgn); }
bool wxRegion::DoXor( const wxRegion& region ) { if (region.m_refData == NULL) { } else if (m_refData == NULL) { // XOR-ing with an invalid region is the same as XOR-ing with an empty // one, i.e. it is simply a copy. m_refData = new wxRegionRefData(*M_REGIONDATA_OF(region)); } else { AllocExclusive(); #ifdef __WXGTK3__ cairo_region_xor(M_REGIONDATA->m_region, M_REGIONDATA_OF(region)->m_region); #else gdk_region_xor( M_REGIONDATA->m_region, region.GetRegion() ); #endif } return true; }
static VALUE rg_xor(VALUE self, VALUE region) { gdk_region_xor(_SELF(self), _SELF(region)); return self; }