However the resource compiler gets more downloads than Baby X itself.
Regs will be familiar with the Baby X resource compiler.
Now Baby X treats all raster images as 32 bit rgbas. There are no other >formats. So the output function is extremely simple. Given 32 bit
binary, just dump as 32 bit C rgba. But if peop;le are using it for
non-Baby X, they may require other formats, like 16 bit images.
On 14/02/2024 16:05, Scott Lurndal wrote:
Malcolm McLean <malcolm.arthur.mclean@gmail.com> writes:
Regs will be familiar with the Baby X resource compiler.
With the name, perhaps.
netpbm would support the use of more image file formats. But you'd have
to ship a lot of programs. And most of those formats are little used.
And the entire system would only deal with one type of data the Baby X >resource compiler handles, though admittedly the most important.
On 14/02/2024 16:05, Scott Lurndal wrote:
Malcolm McLean <malcolm.arthur.mclean@gmail.com> writes:A resource compiler is a recognised type of program that takes usually
Regs will be familiar with the Baby X resource compiler.
With the name, perhaps.
Now Baby X treats all raster images as 32 bit rgbas. There are no other
formats. So the output function is extremely simple. Given 32 bit
binary, just dump as 32 bit C rgba. But if peop;le are using it for
non-Baby X, they may require other formats, like 16 bit images.
And again, the answer is netpbm. Don't try to build everything
into a single application - netpbm can convert any image format
to any other image format.
binary data and packages it into an executable so that it can be passed
to functions.
It's generally provided as single standalone program.
The
Baby X resource compiler works in the same way. However because I can't easily modify the executable to add the data, it converts the data to C source. Formally C source files. But actually just big arrays and other
data structures described in C.
netpbm would support the use of more image file formats. But you'd have
to ship a lot of programs. And most of those formats are little used.
On 14/02/2024 19:44, David Brown wrote:
On 14/02/2024 19:22, Malcolm McLean wrote:For most resource compilers, yes. It comes packaged with the IDE and so
It's generally provided as single standalone program.
That is completely and utterly arbitrary.
ships with a suite of related programs, so if it ran one of those it
would scarely matter. However in fact resource compilers rarely do so
and are single, self-contained programs which can be run independently,
and the Baby X resource compiler therefore has the conventional design.
For Baby X, this does matter, because Baby X has no dedicated IDE.
It's not a show stopper. But it starts to dilute the point. Baby X is a
netpbm would support the use of more image file formats. But you'd
have to ship a lot of programs. And most of those formats are little
used.
Yes. So? Lots of developers already have netpbm programs - or at
least have them easily available. You don't have to ship them - you
just have to list them as a requirement for using the program - just
like you might say you require a particular OS version, or particular
dotnet libraries, or whatever. It can be /convenient/ to have fewer
requirements, but it is certainly not a show-stopper.
baby GUI system. Everything is meant to be easy.
And babies don't have
dependents.
The user is not meant to fiddle about with specific versions
of libraries.
I have to link to xlib on Linux. But I tried to add audio
to Baby X on Linux and this was one of the serious problems. You just
can't get hold of an audio library which is guaranteed to be there and
will allow you to submit stereo ppm samples to standard speaker.
Personally I would not recommend netpbm for this task. It is ratherThe vast majority of the code is not specific to the resource compiler
old-fashioned and not particularly Windows-friendly.
Two obvious choices are imagemagick for stand-alone image conversion
utilities, and Python PIL. Your entire resource compiler could
probably have been written in a couple of hundred lines of Python,
with the dependencies being simply and easily installed on any
reasonable development computer. People could then run the resource
compiler whether they use Windows, Linux, a Raspberry Pi, or whatever
they like.
and is highly resusable loaders or parsers for common file formats. And Python went from Python 2 to Python 3 in 2008. So it broke.
But the Baby
X resource compiler won't break because it is written in a conservative subset of C which is stable. And it has no dependencies other than the standard library. Everything you need is there, and can't need an
update. It will work for as long as C is available as a development
language.
I do all my resource compiling for my systems using Python scripts -Sure. But your job is to write the program, so you can set up the Python scripts and customise them, and it's all part of what you do. But my
some general, some application-specific.
users just write one xml script.
They're not going to be writing Baby X
programs for their job, but to get a short program which needs graphics
up and running quickly, and then to be able to move it between Linux and Windows. And yes, writing the Baby X resource compiler is rather an extravagant way to save a few minutes, when they could write a Python
script to get binaries into the executable. But making it just that bit easier makes all the difference.
However Baby X is bit much to chew, and in fact I don't know what people
are using the resource compiler for. Whilst Baby X is usable, it needs someone to choose the fonts and polish the widgets and make it look
nice, and I don't have those skills. So most of the resource compiler downloaders are either using it for something else, or they just want to
mine it for source. Which I specifically invited them to do, so I can't complain. Or maybe they are just bots.
Regs will be familiar with the Baby X resource compiler.
For anyone who is new, Baby X is cross platform GUI / widget set for
Windows and Linux designed for small programs, and the Bayy X resource compiler packages fonts, audio, text and images into C source so they
can be incorporated into Baby X programs.
However the resource compiler gets more downloads than Baby X itself.
Now the problem with putting things on github is that whilst people will download the program, they will very seldom get back to you to tell you
what their experience was. So you don't know if it was useful or what it
was used for. But probably people are using it to convert images to C
for non-Baby X programs.
Now Baby X treats all raster images as 32 bit rgbas. There are no other formats. So the output function is extremely simple. Given 32 bit
binary, just dump as 32 bit C rgba. But if peop;le are using it for
non-Baby X, they may require other formats, like 16 bit images.
So the first question is, is it worth doing? It's the Baby X resource compiler. Currently there is nothing in the program which is not
intended for use with Baby X. It cannot be all things to all men. Should
I add something which is explictly designed to support non-Baby X programmers?
The second question is, if I am going to support mre than 32 bit rgba
output, were should I stop? It's pretty clear that the C needs to be arbitrary. But should I be content with just specifying a 32 bit rgba
value in a slightly different format? Or do I need to supprt conversion
to different colour spaces? Or imterleaved data? Or indexed paletted
images? The problem of reducing a 24 bit rgb image to a paletted image
is te sort of problem that interest me so I am motivated to add this to
the program. But it entails major restructuring. Some of the source
images will already be paletted. Currently they are just converted to 32
bit rgba and passed through. That would need to change. But is there
actually any demand?
So how to approach this? Is it worth doing at all? And how best to
specify the function which converts an image to C source, so that the
user can enter it easily but it remains flexible?
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 299 |
Nodes: | 16 (2 / 14) |
Uptime: | 56:53:16 |
Calls: | 6,690 |
Files: | 12,225 |
Messages: | 5,345,151 |