Archive for the 'fPic' Category

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/18 fPic and FreeType

a test of fPic's DrawText function with smoothing

05/17 FreeType2

FreeType2 is great. I suppose. Spent way too many hours trying to get it to work in my fPic class. Fink had its wires crossed somehow, and while it said I had FT2, I didn’t (XCode was whining about some missing header files. Sure…). After fixing that problem, I dove right in, er…, about-faced, read the docs, went back to work. fPic can now draw text, given a valid .ttf file and sumshit like that.

Do I have to mention that after a coupla hours, the test sentence was Didier is an ass? Grrr…

05/16 fPic

Hacked the night away on an article for RBDeveloper which was, as usual, overdue, but less than usual… :-) I have been playing in my column with graphics, trying to provide faster routines, or missing ones, or whatnot. This time, I am on the warpath, of sorts. I am building a Picture object from scratch, since it is missing for command-line applications. Part 1, which I sent off a few minutes ago, implements the framework and enough methods to be a good proof of concept. It can read and write JPEG files, and manipulate RGB bitmaps internally via a dynamic library I wrote for this purpose. The results are interesting so far, as I manage to speed up things quite a bit. Of course, the objective is twofold: speed is nice, but the ultimate goal is to provide an independent Picture class, dubbed fPic (f for fast :-) , see?), that’ll enable us to manipulate graphics in command-line applications.