August 1st, 2002

sleepy

(no subject)

LunaticFringe> dmwright: tell me how i can make a class that behaves just like int in every way, without overloading every operator.
LunaticFringe> i've been asking everyone in the room.
ZorbaTHut> lunatic, in C++?
LunaticFringe> ZorbaTHut: that's right!
ZorbaTHut> overload *almost* every operator! ^^
ZorbaTHut> you don't need operator-> for example.
ZorbaTHut> or operator[]. :)
LunaticFringe> ZorbaTHut: ......i think i hate you ;)
  • Current Mood
    amused amused
sleepy

(no subject)

My algorithm just informed me that it succeeded compressing an image with zero bits per pixel.

After some work I finally figured out what it was doing.

The image in question is entirely black. So it generated the palette and observed that there was a grand total of one item in it.

Well, the basic formula is "possible_items = 2^bits". If possible_items = 1, bits = 0.

So it concluded that it could encode all the visible data in zero bits per pixel.

The ironic thing is, it's *right*. If there's only one palette entry then it obviously doesn't need to branch to find out which it is - it *knows*. It's that palette entry! There's only one value that's *possible*!

End result . . . it encodes the picture with zero bits per pixel.

Plus the palette, of course.

(It makes sense . . . it's just kind of disturbing when you see it for the first time :P)

Incidentally, it's generally holding at under 2 bits per pixel overall, which isn't bad compression at all.