24 Mar 2010, 1:54pm
Uncategorized
by

Comments Off on Write up on Website-in-a-weekend.net

Write up on Website-in-a-weekend.net

No Gravatar

Hi everyone! My friend, David, just had me write a guest post to his blog. It was quite an honor to be the gadget expert and provide some initial feedback upon the announcement of the Apple iPad device.

13 Oct 2009, 1:04pm
Honey:
by

Comments Off on Honey Harvest

Honey Harvest

No Gravatar

My friend, Anders and I raised bees this season.  We previously extracted about 4 lbs. of honey.  Last weekend, we had a full box of capped honey and extracted 2.5 gallons, or about 30lbs of honey.  That’s 40 1/2 pints of honey.  Christmas Presents = check.

Check out a couple pictures Anders took here.

31 Aug 2009, 4:58pm
Graphics:
by

leave a comment

Using DirectFB Part I – Prerequisites

No Gravatar

DirectFB is an open source lower level graphics framework that most likely lives below the graphics library you use in Linux (e.g. Cairo, GTK, etc). DirectFB has opened my eyes to the world of graphics programming and peaked my interest in how to apply my knowledge from other fields.
Prerequisites
1. Surface – Conceptually a piece of memory (RAM) which represents what is sent to the display for viewing. This means that every pixel in the width X height of the output is represented by a piece of memory related to how the color and alpha is encoded. By default, each pixel is 24 bits of color (8 red, 8 green and 8 blue) and 8 bits of alpha. The surface can be double buffered. This means that for every pixel shown on the display, there are two areas in RAM that are used to show that. This is a fun concept, actually. Picture a two sided chalk board, with one side facing a classroom full of people and you on the other side. While the class is looking at what you drew, you’re drawing something new. When you’re done, you flip it over and start over again. Double buffered surfaces work just like this.
2. Alpha blending – From Wikipedia: “In computer graphics, alpha [blending] is the process of combining an image with a background to create the appearance of partial transparency.” This is done at it’s most basic level by reading the pixel data behind the pixel that is about to drawn and then running it through this equation: a(color_front) + (1 – a)(color_back), where “a” is alpha value from 0->1.
3. Display Layer – A layer is highly dependent on the hardware being used. The easiest example I can give for layers is to have you picture CNN or a similar channel. The live television feed is on a layer that is behind the ticker bar, time and information at the bottom of the screen. This could easily be done with two layers, but there may be more necessary (e.g. picture in picture video).
4. Window – A window is a sub-surface (not a full screen surface) which has attributes that are necessary in more than one subsurface. This can be as simple as a button, where all of the interactions are the same, the image(s) is the same but the text is different. Windows also make it easy to optimize. By blitting everything into one window, the window only has to blit onto the surface, rather than all of the items in the window. Windows are also easy to hide, send behind other windows and move around the layer.
5. Blit – This should have been listed first, but I felt other appealing background information is necessary first. A “Bit Blit” or Bit Block Transfer is the framework around moving one piece of “surface” memory to another. This can be as simple as a blit of a colored shape, which was pre-blitted into a sub-surface, to the primary surface shown on the display. Blits are very expensive operations and most graphics hardware has advanced algorithms to accelerate blitting to get the fastest frame rate possible.
6. Flip – The concept of a flip has already been mentioned. There are a couple parameters which are important to flipping. One is when to flip, the other is how much to flip. When to flip is easily answered: Do you want to flip the surface going out to the display or not? If so, wait for a vertical sync from the display. This is a signal from the display telling the hardware “I’m about to refresh, do you have anything new you’d like to show?” We would usually say yes because we want to show as much as we can at the frame rate of the display. Specifying how much is called “clipping”.

25 Aug 2009, 10:38pm
Graphics
by

leave a comment

Graphics Programming

No Gravatar

It’s amazing how much history there is in computer graphics programming.  At a software design meeting a few weeks ago, I was able to talk about 2-D graphic algorithm design with some engineers who were around in the early 80s at companies that were developing windowing environments.  This completely blew me away and led to my fascination with the subject.

I immediately purchased the top three most recommended books based on recommendations from Amazon as well as the user experience team I work with. The apparent “Bible” of graphics programming (so says the UX wiz at work) is Computer Graphics: Principles and Practice in C (2nd Edition) (affiliate link), non-affiliate link.

The book focuses mainly on 3-D graphics algorithms, but the basics are described in 2-D. This is important in my journey using DirectFB. After taking a stab at algorithm design, it’s nice to know that I was mostly right in my assumptions. However, there is a lot for me to learn. Which leads to my excitement and writing about it.