Archive for the 'C' Category

05/30 fPic digs Tiff

Added TIFF support via libtiff, which was easy enough. Is it just me, or TIFF is a dang bizarre format? Not only the byte order is way up the yahzoo scale (ABGR, wdf?), but in the end I had to rot180 and hMirror the image buffer in order to get a correct image… Damn weird. Lucky I had those fast square-angle rotation routines up and running already!

an oddly resized screenshot of a TIFF file displayed in fPic tester

(lib)PNG is still escaping me, I am down now to producing my own. Grrr.


If you wonder what the image represents, it’s a Jurchen character. Reads “tasha” and means Tiger. Yup.

05/29 Almost a year…

It’s been almost a year since the death of the European patent EP0,129,439 [our local version of the UniSys GiF tax]. This weekend, I thought I’d celebrate, so I added odds and ends of the old GiFLib to fPic. It now can read single-frame .gif files [no plans to support output, as it *is* a vile format, stained by corporate greed and way too many animated abominations]. Doing this I learned a lot on the format, much more than I ever did in the past trying to read the specs. Funny how I relate more to code than docs…

Now back to our regular programming: adding decent formats like .png… :-)

05/23 fPic update

This is obviously going well :-)

This image was saved by fPic. We have here free rotation (merci vImage), layering with translucency, text drawing (FreeType), DrawOval, FillOval, and FillRoundRect, hmmm, oh and OpenJpeg, too… Complete list of features, so far:

  • clearRect [with or sans translucency]
  • FillRoundRect
  • ContrastStretch
  • Uniformity control
  • CopyRect (x2, within on fPic instances, or between two)
  • DrawOval, FillOval
  • DrawText
  • Equalization
  • Greyscale
  • hMirror, vMirror
  • Rotate (90, 180, 270, free)
  • Invert
  • Merge
  • stegEncode, stegDecode
  • SaveAsJpeg
  • Constructor (x3, from a Picture object — soon to go, from a Jpeg file, and from a geometry)
  • Pixel(x,y) As Color
  • Red(x,y), Green(x,y), Blue(x,y) As Integer
  • Width, Height

Todo

  • Arc (start angle, end angle)
  • DrawRoundRect
  • Constructor, from PNG
  • Constructor, from TIF
  • Constructor, from GIF (maybe)
  • Constructor, from PDF [that would be rock’n'roll]
  • ???

05/20 Not me

See this:

/* An [sic] rotation filter. Uses bressemham algorithm combined with dda to rotate
* image around center

Hardly the case: dda is looking for some code to rotate an image, not the contrary or some derivation thereof… :-)

Update

D’uh. The Accelerate framework, or more accurately the vImage library inside Accelerate, provided me everything I needed. And friggin’ way much more than I care to understand. I mean, I am a tolerant guy, but things like vImageVerticalShear_ARGB8888 have me reachings for my nuts in a knee-jerk protective reflex…

05/18 fPic and FreeType

a test of fPic's DrawText function with smoothing