Re: 1-Bit Bitmap



I recently wrote a window-placement-like algorithm for a 128x128 grid
using bit manipulation. You might find some of the code useful for writing
your own library code to do what you require. It does not have any
functions to set individual bits in the array, but it does have a function
to unset areas in the 2d array, and another function to locate an unset
area of width x height dimension, then set it, and return its coordinates.

http://jwm-art.net/boxyseq/freespace_grid.tar.bz2

There's probably being no license info within the archive, but please
assume GNU GPLv3.

James.


On Tue, June 1, 2010 03:45, Asad Jibran Ahmed wrote:
On Mon, 2010-05-31 at 20:59 +0200, Tadej Borovšak wrote:
Hello.

I'm looking to create an application that requires using 1-bit bitmaps
to store a monochrome printing pattern. But I've looked at both
Pixmaps
and Pixbufs, but Pixbufs doesn't offer direct access to the bits (I
need
to set and read them) and Pixmaps doesn't support 1-Bit pixels (at
least
that's what I understand from my reading of the docs).
Any suggestions?

cairo_image_surface_t can have a depth of one bit (CAIRO_FORMAT_A1)
and offers direct access to pixel values.

Tadej


Thanks for the info, but thats not what I was looking for. cairo
surface_t offers direct access to the data of the image, from which I'll
have to pick out the bits one by one. I'm hoping a library will be able
to do this for me.
Any library that you can think of that offers bit by bit access without
me needing to write a separate function to shift the bits out one by one
from a 32-Bit int? Kind of like a bitarray?

--
JB :: http://www.asadjb.com

_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]