Friday, November 27, 2015

I hate Drupal

To the tune of Tigger's Song

The terrible thing about drupal
Is drupal's a terrible thing
It's frontend is sluggish and clunky
It's backend keeps making me scream
It's inconsistent, bugs persistent

What's doc-u-men-ta-tion?
But the most terrible thing about drupal
Is I am using it.

I

am using it.

Wednesday, August 26, 2015

Conversions between one dimensional pixel arrays and two dimensional coördinates

If you have an image as a one dimensional array of pixels, organised by width, you can calculate the x, y coördinate of a particular index like so:

x = index modulo width
y = index ÷ width

Where the division is an integer division.

To convert to an array index from an x, y coördinate:

index = x + (y × width)