User:Nrp/Weekly updates/20080726

From OLPC
< User:Nrp‎ | Weekly updates
Revision as of 21:56, 21 July 2008 by Nrp (talk | contribs)
Jump to: navigation, search

Saturday

  • Wrote a function to create a mask of the collisions between two masks.
  • Wrote wrappers for all of the code that was sitting unused in bitmask.c, fill, clear, draw, erase, scale.
  • Fixed a potential flaw in invert and used the same code to make fill faster.

Sunday

  • Changed set_controls to use keywords.
  • Changed get_controls to make way for use of non-boolean controls.
  • Looked at v4l2 spec in preparation for a function to enumerate available controls.
  • Started writing code to get the second moments of a mask, to find its angle.
  • Started working on how to separate v4l2 specific code and allow for other interfaces.

Monday

  • Wrote Mask.angle(), which calculates the zeroth through second moments of a mask to find the approximate orientation of an object with respect to the x axis
  • Wrote Mask.count(), which uses the very fast bitcount() function in bitmask.c to get the total pixels set in the image.
  • Made Mask.centroid() stop returning total pixels set since count() exists. This is an API change that breaks some of the scripts I've written, but its better to do it sooner than never.
  • Fixed a bug in Mask.get_bounding_rects() that made it calculate the width of the rect incorrectly.