Status
Not open for further replies.

_klamath_

Ars Scholae Palatinae
770
This is probably really obvious, but I'm looking for info on what a bitmap (i.e. the data structure) is, and what operations can be performed on it. It sounds like a pretty trivial concept, but none of my algorithms & data structures books contain any info on it, and web searches turn up docs on graphics files.

Any info or pointers to docs would be appreciated.
 

_klamath_

Ars Scholae Palatinae
770
Okay, maybe I'm totally misunderstanding something, but I thought _klamath_ is not asking about raster image formats.

Yes, that's correct. The particular application of bitmaps I'm looking at is for relational databases -- but in any case, my question has nothing to do with image formats.

A bitmap can also be a field of data where each bit is interpreted as a unique value.

Ah, that makes sense (I'm confused why it's called a "map" tho). If anyone has more information on this data structure, I'd appreciate it.
 

russ-iha

Ars Praefectus
4,407
Subscriptor
The bits are logically arranged in a 2-dimensional array (aka a "map").

This can be as simple as having a character (such as LF) denote the start of a new row, then fill the file with as many columns/rows as necessary, with each "x" being one unit (where x could be 1 bit, four bits, 1 byte, etc.)


Bitmap images are the same... a 2d array of "x", where it is usually dependent on the color-depth of the image (16-bit color means two bytes make up one "record", which corresponds to one pixel.)


the bitmap concept is applicable to a wide variety of problems.
 
It is called a "map" because each bit (or group of bits) maps to some unique value.

An example of this is a particular implementation of a file allocation table (FAT). For simplicity, let say I have a HDD of 1024 bytes in size. Suppose that one allocation unit (a block) is 4 bytes (that is, even if you only write 1 byte of data on disk, 4 byte is "occupied" by that ONE byte data). So, I have 256 such units on disk. In order to know which block is in use, I can reserve a block of 32 bytes (32 * 8 bit/byte = 256 bits), each bit of that 32 bytes would represent (or "map to") a block on disk. The bit corresponding to a block would be (1) if that block is in use, (0) if it is available/not in use.

Of course, in practice, 4 bytes per block is unrealistic, by this example conveys the general idea of a bitmap.
 
Status
Not open for further replies.