Retrieve information about a region
int PhRegionQuery( PhRid_t rid, PhRegion_t *region, PhRect_t *rect, void *data, unsigned data_len );
This function returns information about the region identified by rid. Upon completion, region and rect contain a description of the region.
If the region has data attached to it, then the data, up to data_len bytes, is copied into data. This data may consist of smaller blocks of data of different types, each preceded by a PhRegionDataHdr_t structure. To find a specific type of data in the region's data, call PhRegionDataFindType().
The following example gets information about the device region:
PhRegion_t region; PhRect_t rect; if( !PhRegionQuery( Ph_DEV_RID, ®ion, &rect, NULL, 0 ) ) { printf( "Sensitive to: %.8x Opaque to: %.8x\n", region.events_sense, region.events_opaque ); printf( "Located at: {(%d,%d),(%d,%d)}\n", region.origin.x + rect.ul.x, region.origin.y + rect.ul.y, region.origin.x + rect.lr.x, region.origin.y + rect.lr.y ); }
Photon
Safety: | |
---|---|
Interrupt handler | No |
Signal handler | No |
Thread | No |
PhRegion_t, PhRegionChange(), PhRegionOpen()