Re: [Pharo-project] Athens replacement for ImageReadWriter?
What you can with Athens and the Cairo backend is: 1) create a surface in memory 2) draw to the surface 3) export that surface to a png 4) import that png into a form The main point is step 3, cairo can export any surface to a png. Then within Pharo, any form can be created from a png. Also, if you interested in drawing from Athens into a form directly, look at the AthensDemoExamples, and Igor's magic trick of matching the bits of the surface (step 1), directly to the bits of an "external" form. to avoid steps 3 and 4. He used the surface plugin for that. Hope i answered all your questions, though not sure because i've never used ImageReadWriter. Fernando On Wed, Jan 23, 2013 at 6:38 AM, Denis Kudriashov <dionisiydk@gmail.com>wrote:
I have same question :))
2013/1/23 Esteban Lorenzano <estebanlm@gmail.com<mailto: estebanlm@gmail.com>> Hi,
So, ImageReadWriter currently reads image files and retrieve Form objects, who can be displayed in world... anybody knows (cough, cough, Igor) what would be the Athens replacement for that?
thanks, Esteban
This is exactly what I would expect as a headless test case for Athens ;) On 2013-01-23, at 12:06, Fernando Olivero <fernando.olivero@usi.ch> wrote:
What you can with Athens and the Cairo backend is:
1) create a surface in memory 2) draw to the surface 3) export that surface to a png 4) import that png into a form
The main point is step 3, cairo can export any surface to a png. Then within Pharo, any form can be created from a png.
Also, if you interested in drawing from Athens into a form directly, look at the AthensDemoExamples, and Igor's magic trick of matching the bits of the surface (step 1), directly to the bits of an "external" form. to avoid steps 3 and 4. He used the surface plugin for that.
Hope i answered all your questions, though not sure because i've never used ImageReadWriter.
Fernando
On Wed, Jan 23, 2013 at 6:38 AM, Denis Kudriashov <dionisiydk@gmail.com>wrote:
I have same question :))
2013/1/23 Esteban Lorenzano <estebanlm@gmail.com<mailto: estebanlm@gmail.com>> Hi,
So, ImageReadWriter currently reads image files and retrieve Form objects, who can be displayed in world... anybody knows (cough, cough, Igor) what would be the Athens replacement for that?
thanks, Esteban
Hi Fernando, I don't want a Form... quitte the opposite! :) What I want is to have something equivalent to athens to what now is covered in morphic with ImageReadWriter. Or, better explained, I want an AthensImageReadWriter who answers me a surface (or something that I can draw with an athens canvas) with the image from a file :) Esteban On Jan 23, 2013, at 12:06 PM, Fernando Olivero <fernando.olivero@usi.ch> wrote:
What you can with Athens and the Cairo backend is:
1) create a surface in memory 2) draw to the surface 3) export that surface to a png 4) import that png into a form
The main point is step 3, cairo can export any surface to a png. Then within Pharo, any form can be created from a png.
Also, if you interested in drawing from Athens into a form directly, look at the AthensDemoExamples, and Igor's magic trick of matching the bits of the surface (step 1), directly to the bits of an "external" form. to avoid steps 3 and 4. He used the surface plugin for that.
Hope i answered all your questions, though not sure because i've never used ImageReadWriter.
Fernando
On Wed, Jan 23, 2013 at 6:38 AM, Denis Kudriashov <dionisiydk@gmail.com> wrote: I have same question :))
2013/1/23 Esteban Lorenzano <estebanlm@gmail.com<mailto:estebanlm@gmail.com>> Hi,
So, ImageReadWriter currently reads image files and retrieve Form objects, who can be displayed in world... anybody knows (cough, cough, Igor) what would be the Athens replacement for that?
thanks, Esteban
On 23 January 2013 12:58, Esteban Lorenzano <estebanlm@gmail.com> wrote:
Hi Fernando,
I don't want a Form... quitte the opposite! :) What I want is to have something equivalent to athens to what now is covered in morphic with ImageReadWriter.
Or, better explained, I want an AthensImageReadWriter who answers me a surface (or something that I can draw with an athens canvas) with the image from a file :)
You know that you can convert between forms and athens surface? Forms is actually not that bad, they simply contain bits. The bit format information is a bit obscure (comparing to OpenGL, for instance), but its enough. So, i suggest you to use form and ImageReadWriter.
Esteban
On Jan 23, 2013, at 12:06 PM, Fernando Olivero <fernando.olivero@usi.ch> wrote:
What you can with Athens and the Cairo backend is:
1) create a surface in memory 2) draw to the surface 3) export that surface to a png 4) import that png into a form
The main point is step 3, cairo can export any surface to a png. Then within Pharo, any form can be created from a png.
But that is private to cairo library.
Also, if you interested in drawing from Athens into a form directly, look at the AthensDemoExamples, and Igor's magic trick of matching the bits of the surface (step 1), directly to the bits of an "external" form. to avoid steps 3 and 4. He used the surface plugin for that.
Hope i answered all your questions, though not sure because i've never used ImageReadWriter.
Fernando
-- Best regards, Igor Stasenko.
On Jan 23, 2013, at 2:23 PM, Igor Stasenko <siguctua@gmail.com> wrote:
On 23 January 2013 12:58, Esteban Lorenzano <estebanlm@gmail.com> wrote:
Hi Fernando,
I don't want a Form... quitte the opposite! :) What I want is to have something equivalent to athens to what now is covered in morphic with ImageReadWriter.
Or, better explained, I want an AthensImageReadWriter who answers me a surface (or something that I can draw with an athens canvas) with the image from a file :)
You know that you can convert between forms and athens surface?
I know, but I want to get rid off morphic :)
Forms is actually not that bad, they simply contain bits.
I know, but then we will keep them even if we remove morphic?
The bit format information is a bit obscure (comparing to OpenGL, for instance), but its enough. So, i suggest you to use form and ImageReadWriter.
ok, I will use it.
Esteban
On Jan 23, 2013, at 12:06 PM, Fernando Olivero <fernando.olivero@usi.ch> wrote:
What you can with Athens and the Cairo backend is:
1) create a surface in memory 2) draw to the surface 3) export that surface to a png 4) import that png into a form
The main point is step 3, cairo can export any surface to a png. Then within Pharo, any form can be created from a png.
But that is private to cairo library.
Also, if you interested in drawing from Athens into a form directly, look at the AthensDemoExamples, and Igor's magic trick of matching the bits of the surface (step 1), directly to the bits of an "external" form. to avoid steps 3 and 4. He used the surface plugin for that.
Hope i answered all your questions, though not sure because i've never used ImageReadWriter.
Fernando
-- Best regards, Igor Stasenko.
On 23 January 2013 14:34, Esteban Lorenzano <estebanlm@gmail.com> wrote:
On Jan 23, 2013, at 2:23 PM, Igor Stasenko <siguctua@gmail.com> wrote:
On 23 January 2013 12:58, Esteban Lorenzano <estebanlm@gmail.com> wrote:
Hi Fernando,
I don't want a Form... quitte the opposite! :) What I want is to have something equivalent to athens to what now is covered in morphic with ImageReadWriter.
Or, better explained, I want an AthensImageReadWriter who answers me a surface (or something that I can draw with an athens canvas) with the image from a file :)
You know that you can convert between forms and athens surface?
I know, but I want to get rid off morphic :)
Forms is actually not that bad, they simply contain bits.
I know, but then we will keep them even if we remove morphic?
Why not? You will still need something which represents the bitmap bits, which you can directly manipulate (if you want to).
The bit format information is a bit obscure (comparing to OpenGL, for instance), but its enough. So, i suggest you to use form and ImageReadWriter.
ok, I will use it.
-- Best regards, Igor Stasenko.
2013/1/23 Igor Stasenko <siguctua@gmail.com>
On 23 January 2013 12:58, Esteban Lorenzano <estebanlm@gmail.com> wrote:
Hi Fernando,
I don't want a Form... quitte the opposite! :) What I want is to have something equivalent to athens to what now is covered in morphic with ImageReadWriter.
Or, better explained, I want an AthensImageReadWriter who answers me a surface (or something that I can draw with an athens canvas) with the image from a file :)
You know that you can convert between forms and athens surface? Forms is actually not that bad, they simply contain bits. The bit format information is a bit obscure (comparing to OpenGL, for instance), but its enough. So, i suggest you to use form and ImageReadWriter.
But reading image from file without smalltalk operations can be much more efficient. If your application works extensively with external images It is important. That's why I write question at user group about how to get Form efficiently from external memory which filled by FFI call. Unfortunately no answers. Now I think about optimisation of PNGImageReadWriter by NativeBoost.
Esteban
On Jan 23, 2013, at 12:06 PM, Fernando Olivero <fernando.olivero@usi.ch> wrote:
What you can with Athens and the Cairo backend is:
1) create a surface in memory 2) draw to the surface 3) export that surface to a png 4) import that png into a form
The main point is step 3, cairo can export any surface to a png. Then within Pharo, any form can be created from a png.
But that is private to cairo library.
Also, if you interested in drawing from Athens into a form directly, look at the AthensDemoExamples, and Igor's magic trick of matching the bits of the surface (step 1), directly to the bits of an "external" form. to avoid steps 3 and 4. He used the surface plugin for that.
Hope i answered all your questions, though not sure because i've never used ImageReadWriter.
Fernando
-- Best regards, Igor Stasenko.
On 23 January 2013 14:56, Denis Kudriashov <dionisiydk@gmail.com> wrote:
2013/1/23 Igor Stasenko <siguctua@gmail.com>
On 23 January 2013 12:58, Esteban Lorenzano <estebanlm@gmail.com> wrote:
Hi Fernando,
I don't want a Form... quitte the opposite! :) What I want is to have something equivalent to athens to what now is covered in morphic with ImageReadWriter.
Or, better explained, I want an AthensImageReadWriter who answers me a surface (or something that I can draw with an athens canvas) with the image from a file :)
You know that you can convert between forms and athens surface? Forms is actually not that bad, they simply contain bits. The bit format information is a bit obscure (comparing to OpenGL, for instance), but its enough. So, i suggest you to use form and ImageReadWriter.
But reading image from file without smalltalk operations can be much more efficient. If your application works extensively with external images It is important. That's why I write question at user group about how to get Form efficiently from external memory which filled by FFI call. Unfortunately no answers. Now I think about optimisation of PNGImageReadWriter by NativeBoost.
Well, Cairo uses libpng as dependency, and provides easy interface functions to create surfaces from png file(s). But then, what if tomorrow we will use something else than cairo? In the long run, i think, using libpng directly will be more reasonable. But i feel doubly, whether we should rely on it by default.
From other side, our VMs already includes jpeg library..
-- Best regards, Igor Stasenko.
2013/1/23 Igor Stasenko <siguctua@gmail.com>
On 23 January 2013 14:56, Denis Kudriashov <dionisiydk@gmail.com> wrote:
2013/1/23 Igor Stasenko <siguctua@gmail.com>
On 23 January 2013 12:58, Esteban Lorenzano <estebanlm@gmail.com>
wrote:
Hi Fernando,
I don't want a Form... quitte the opposite! :) What I want is to have something equivalent to athens to what now is covered in morphic with ImageReadWriter.
Or, better explained, I want an AthensImageReadWriter who answers me a surface (or something that I can draw with an athens canvas) with the image from a file :)
You know that you can convert between forms and athens surface? Forms is actually not that bad, they simply contain bits. The bit format information is a bit obscure (comparing to OpenGL, for instance), but its enough. So, i suggest you to use form and ImageReadWriter.
But reading image from file without smalltalk operations can be much more efficient. If your application works extensively with external images It is important. That's why I write question at user group about how to get Form efficiently from external memory which filled by FFI call. Unfortunately no answers. Now I think about optimisation of PNGImageReadWriter by NativeBoost.
Well, Cairo uses libpng as dependency, and provides easy interface functions to create surfaces from png file(s). But then, what if tomorrow we will use something else than cairo? In the long run, i think, using libpng directly will be more reasonable.
But i feel doubly, whether we should rely on it by default. From other side, our VMs already includes jpeg library..
I really like all solutions at image side. So I'm not talk about usage some library by default. I just want good option which get best performance and easy to use.
-- Best regards, Igor Stasenko.
On 23 January 2013 15:58, Denis Kudriashov <dionisiydk@gmail.com> wrote:
2013/1/23 Igor Stasenko <siguctua@gmail.com>
On 23 January 2013 14:56, Denis Kudriashov <dionisiydk@gmail.com> wrote:
2013/1/23 Igor Stasenko <siguctua@gmail.com>
On 23 January 2013 12:58, Esteban Lorenzano <estebanlm@gmail.com> wrote:
Hi Fernando,
I don't want a Form... quitte the opposite! :) What I want is to have something equivalent to athens to what now is covered in morphic with ImageReadWriter.
Or, better explained, I want an AthensImageReadWriter who answers me a surface (or something that I can draw with an athens canvas) with the image from a file :)
You know that you can convert between forms and athens surface? Forms is actually not that bad, they simply contain bits. The bit format information is a bit obscure (comparing to OpenGL, for instance), but its enough. So, i suggest you to use form and ImageReadWriter.
But reading image from file without smalltalk operations can be much more efficient. If your application works extensively with external images It is important. That's why I write question at user group about how to get Form efficiently from external memory which filled by FFI call. Unfortunately no answers. Now I think about optimisation of PNGImageReadWriter by NativeBoost.
Well, Cairo uses libpng as dependency, and provides easy interface functions to create surfaces from png file(s). But then, what if tomorrow we will use something else than cairo? In the long run, i think, using libpng directly will be more reasonable.
But i feel doubly, whether we should rely on it by default. From other side, our VMs already includes jpeg library..
I really like all solutions at image side. So I'm not talk about usage some library by default. I just want good option which get best performance and easy to use.
Then, perhaps, best option is to look into existing PNGReadWriter and see how we can improve its performance. -- Best regards, Igor Stasenko.
participants (5)
-
Camillo Bruni -
Denis Kudriashov -
Esteban Lorenzano -
Fernando Olivero -
Igor Stasenko