1. Creating Bitmaps: Documentation?

Short version:

Please update the OpenEuphoria manual to reflect the internal format of the bitmap, since it's pretty handy.

Long version:

I needed to create a bitmap in Euphoria, so I checked the documentation.

There is read_bitmap() and save_bitmap() routine, but no create_bitmap(), which seems an odd omission.

There's not enough information to figure out how to manipulate a bitmap, either.

Reading the documentation, save_bitmap() indicates that it takes:

palette_n_image : a {palette, image} pair, like read_bitmap() returns 

Now all I'd need is some sort of documentation of what palette and image expect, and I could create a bitmap of my own.

I'm sure a decade back I knew this information, but hey... that's what documentation is for, right?

Well, I could always read the source code, right?

The code for read_bitmap() indicated:

-- Comments: 
-- In the returned value, the first element is a list of mixtures, each of which defines  
-- a color, and the second, a list of point rows. Each pixel in a row is represented by its color index. 
-- 
-- The file should be in the bitmap format. The most common variations of the format are supported.  
-- 
-- Bitmaps of 2, 4, 16 or 256 colors are supported. If the file is not in a good format, an error 
-- code (atom) is returned instead 

So I could glean what image looked like from the comments, something like:

{{row1}, {row2} ... {row n}} 

But the documentation didn't get me any closer to understanding what palette should look like.

Grumble...

Looking further into the code, putColorTable() states:

-- Write color table information to the .BMP file.  
-- palette data is given as a sequence {{r,g,b},..,{r,g,b}}, where each 
-- r, g, or b value is 0 to 255.  

Hurrah! I now have enough information to create, and even modify a bitmap!

Please update the OpenEuphoria manual to reflect the internal format of the bitmap, since it's pretty handy.

Having to dig through source code isn't optimal.

Thanks! smile

- David

new topic     » topic index » view message » categorize

2. What is graphics_point?

The documentation for graphics_point() is:

include std/image.e 
namespace image 
public type graphics_point(object p) 

I have no clue what this is supposed to be used for. Obviously it's a type, but what does that type look like? Is it a duple of integers, atoms, or something else entirely?

- David

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu