1. bitmaps

Have read_bitmap() and related functions been deprecated from 4.1 beta 2?

Not that I have any use for them, but I tried both on Linux and on Windows, and get an error code of 4 returned when trying read_bitmap on known-good .bmp images.

new topic     » topic index » view message » categorize

2. Re: bitmaps

According to the docs, "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."

Do your bitmaps fit this criteria?

-Greg

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

3. Re: bitmaps

The 4.1 docs include this:

public constant 
    BMP_OPEN_FAILED = 1, 
    BMP_UNEXPECTED_EOF = 2, 
    BMP_UNSUPPORTED_FORMAT = 3 

But std/graphcst.e includes this:

public enum 
    BMP_SUCCESS, 
    BMP_OPEN_FAILED, 
    BMP_UNEXPECTED_EOF, 
    BMP_UNSUPPORTED_FORMAT, 
    BMP_INVALID_MODE 

So your result of 4 is indeed BMP_UNSUPPORTED_FORMAT.

-Greg

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

4. Re: bitmaps

ghaberek said...

The 4.1 docs include this:

public constant 
    BMP_OPEN_FAILED = 1, 
    BMP_UNEXPECTED_EOF = 2, 
    BMP_UNSUPPORTED_FORMAT = 3 

But std/graphcst.e includes this:

public enum 
    BMP_SUCCESS, 
    BMP_OPEN_FAILED, 
    BMP_UNEXPECTED_EOF, 
    BMP_UNSUPPORTED_FORMAT, 
    BMP_INVALID_MODE 

So your result of 4 is indeed BMP_UNSUPPORTED_FORMAT.

-Greg

So either the docs are wrong, as BMP_SUCCESS is now 1, BMP_OPEN_FAILED is now 2, etc, or that enum should begin with BMP_SUCCESS=0

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

5. Re: bitmaps

Erm.. the bitmaps I used to test with were from Windows 7 - WindowsOutlookExpress.bmp, for example, as well as some from the web and some generated by Gimp (converted mongoose for example). All return 4

add: all are visible using the respective platforms' image viewer(s).

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

6. Re: bitmaps

irv said...

the bitmaps I used to test with were from Windows 7 - WindowsOutlookExpress.bmp, for example,

256-color images are "8-bit" and yours is 32.

  1. Browse to C:\Windows\System32\migwiz\PostMigRes\Web\base_images
  2. Right-click WindowsOutlookExpress.bmp
  3. Click Properties
  4. Select Details tab
  5. Observe Bit depth is 32
irv said...

add: all are visible using the respective platforms' image viewer(s).

This is not an indicative test of compatibility. Euphoria's bitmap routines are extremely limited.

-Greg

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

7. Re: bitmaps

petelomax said...

So either the docs are wrong, as BMP_SUCCESS is now 1, BMP_OPEN_FAILED is now 2, etc, or that enum should begin with BMP_SUCCESS=0

I believe you are correct in that BMP_SUCCESS should be 0:

the docs said...

read_bitmap

Returns:

An object, on success, a sequence of the form {palette,image}. On failure, an error code is returned.

save_bitmap

Returns

An integer, 0 on success.

-Greg

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

8. Re: bitmaps

ghaberek said...
irv said...

the bitmaps I used to test with were from Windows 7 - WindowsOutlookExpress.bmp, for example,

256-color images are "8-bit" and yours is 32.

  1. Browse to C:\Windows\System32\migwiz\PostMigRes\Web\base_images
  2. Right-click WindowsOutlookExpress.bmp
  3. Click Properties
  4. Select Details tab
  5. Observe Bit depth is 32
irv said...

add: all are visible using the respective platforms' image viewer(s).

This is not an indicative test of compatibility. Euphoria's bitmap routines are extremely limited.

-Greg

So they are. Isn't that just another thing that detracts from Euphoria's popularity?

Not that Eu should support *any* kind of images, that's not my point. Anyone interested in working with images is very unlikely to be doing so in a text mode, I suspect.

Therefore, since the Eu user will probably be using either wxWindows, EuGTK, or something similar, those libraries already have a lot of support for images built in. Euphoria itself needs none at all.

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

9. Re: bitmaps

irv said...

So they are. Isn't that just another thing that detracts from Euphoria's popularity?

Not that Eu should support *any* kind of images, that's not my point. Anyone interested in working with images is very unlikely to be doing so in a text mode, I suspect.

Therefore, since the Eu user will probably be using either wxWindows, EuGTK, or something similar, those libraries already have a lot of support for images built in. Euphoria itself needs none at all.

This is true. I'm pretty sure these bitmap routines are a holdout from the days of DOS graphics mode support. They're still hanging around because they were still "cross-platform" without DOS graphics.

-Greg

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

10. Re: bitmaps

I've updated my version of the docs with:

Deprecated. Most graphics are now 24 or 32 bit which this routine does not support. However, as long as 256 colours (8-bit) or less is acceptable, this routine remains perfectly useable, and may still be the right choice for simple cross-platform applications.

and replaced "The most common variations of the format are supported." with "Only low-res uncompressed variations of the format are supported."

Pete

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

11. Re: bitmaps

how hard would it be to upgrade the bitmap-function(s) to 32 and even 64 bits?

For me that would be the way to go in making bulky 'Win-emulators' not necessary,

Using Winlibs is making the same error MSoft does
i.e. including vast .dll-files from which only 6 or 7 'sub-routines' are actually used.

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

12. Re: bitmaps

Ekhnat0n said...

how hard would it be to upgrade the bitmap-function(s) to 32 and even 64 bits?

While it's probably not super difficult, I think the language would be better off in the long term integrating with GIMP or a library which provides similar functionality. Otherwise, someone will just complain about lack of PNG/TIFF/JPG/GIF/MNG/etc support....

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

13. Re: bitmaps

jimcbrown said...
Ekhnat0n said...

how hard would it be to upgrade the bitmap-function(s) to 32 and even 64 bits?

While it's probably not super difficult, I think the language would be better off in the long term integrating with GIMP or a library which provides similar functionality. Otherwise, someone will just complain about lack of PNG/TIFF/JPG/GIF/MNG/etc support....

We need to step back and think about this rationally.

How many people will want to work with images without using any GUI library (GTK, wxWindows, Windows...)?

I submit that there are a few, - very few - and they will use ImageMagik or similar. Euphoria could never match those capabilities.

The rest of us will use a GUI, and AFAIK, all of those have the capability of loading, displaying, and resizing images of most types.

Any needs beyond those simple ones are probably best left to actual image editing programs, such as Gimp. Euphoria could never equal those capabilities either, and shouldn't try, since it is a programming language, not an image editor.

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

14. Re: bitmaps

There is plenty of support in Euphoria for images in the archive.

http://rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=image

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

Search



Quick Links

User menu

Not signed in.

Misc Menu