Skip to content

Modules group shape #233

Answered by codemasher
Rastian95 asked this question in Q&A
Dec 27, 2023 · 3 comments · 7 replies
Discussion options

You must be logged in to vote

Hi, yes there is the QRMatrix::checkNeighbours() method:

/**
* Checks the status of the neighbouring modules for the module at ($x, $y) and returns a bitmask with the results.
*
* The 8 flags of the bitmask represent the status of each of the neighbouring fields,
* starting with the lowest bit for top left, going clockwise:
*
* 0 1 2
* 7 # 3
* 6 5 4
*/
public function checkNeighbours(int $x, int $y, int $M_TYPE = null):int{
$bits = 0;
foreach($this::neighbours as $bit => [$ix, $iy]){
$ix += $x;
$iy += $y;
// $M_TYPE is given…

Replies: 3 comments 7 replies

Comment options

You must be logged in to vote
3 replies
@Rastian95
Comment options

@codemasher
Comment options

@codemasher
Comment options

Answer selected by Rastian95
Comment options

You must be logged in to vote
1 reply
@codemasher
Comment options

Comment options

You must be logged in to vote
3 replies
@codemasher
Comment options

@Rastian95
Comment options

@codemasher
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants