Thank you so much for your kind explanation. : )

> that only works in the 16bpp software enigne. unfortunately you will have
to
> live with argb8888 :) (it's better quality anyway!)

I'm now working on x86 host system and i have no problem now,
but i'll port my application onto embedded system later. it supports 16bpp
or 24bpp mode now... : (
it means my application is able to output only 16bpp or 24bpp data to draw
on evas image object.

What is the meaning of '16bpp software enigne' ?
Does it mean that ELF libs need to be built kind of 16 bit mode or something
to use this option?
What should i do to use this "EVAS_COLORSPACE_RGB565_A5P" colorspace option?


2010/7/16 Carsten Haitzler <ras...@rasterman.com>

> On Thu, 15 Jul 2010 18:25:37 +0900 Hyun Park <hyuny...@gmail.com> said:
>
> > This sample code is perfect one that i was finding and I checked it works
> > very well !  : )
> >
> > but I have one more question.
> >      :
> >    img = evas_object_image_filled_add(evas_object_evas_get(win));
> >    elm_win_resize_object_add(win, img);
> >    // tell evas that this image will have its content modified
> dynamically
> >    evas_object_image_content_hint_set(img,
> EVAS_IMAGE_CONTENT_HINT_DYNAMIC);
> >    // tell evas that we want argb8888 (32bit color) colorspace per pixel
> >    // i tried to chaned this to 16 bit rgb color space
> >    evas_object_image_colorspace_set(img, EVAS_COLORSPACE_RGB565_A5P
> > /*EVAS_COLORSPACE_ARGB8888*/);
> >
> >    // do this if you want the alpha channel to work (or fill it with 0xff
> >    // if you don't. this helps optimise rendering)
> >    evas_object_image_alpha_set(img, 1);
> >    // tell evas the size in pixels of the image data
> >    evas_object_image_size_set (img, 480, 640);   <<< i got "Aborted"
> stdout
> > around here!!!
> >    evas_object_show(img);
> >      :
> >
> > actually, i want to use 16bit coloer spaced evas object,
> > but i got some abort error around "evas_object_image_size_set()" after
> > changing. (EVAS_COLORSPACE_RGB565_A5P)
> > sorry for that i could't find exact reason because i just traced some
> logs
> > using printf() now...
>
> that only works in the 16bpp software enigne. unfortunately you will have
> to
> live with argb8888 :) (it's better quality anyway!)
>
> > do you have any idea for this?
> >
> >
> > 2010/7/15 Carsten Haitzler <ras...@rasterman.com>
> >
> > > On Thu, 15 Jul 2010 15:38:07 +0900 Hyun Park <hyuny...@gmail.com>
> said:
> > >
> > > in efl, evas offers some basic object types. rectangle, image, text,
> > > textblock,
> > > polygon, line and smart object. all of these are basic rendering
> > > primitives..
> > > except smart objects. smart objects are "collectors" of other basic
> object
> > > types. they can collect images, text, or other smart objects together
> in a
> > > tree-like structure. smart objects are parents of children. children
> can be
> > > any
> > > object type. edje objects are simply pre-made smart objects that
> libedje
> > > creates and fills with data from files etc. elementary objects are the
> > > same.
> > > each elm object is a smart object that contains more objects. what it
> > > contains
> > > and how they behave is determined by elementary, thus setting up
> "policy".
> > >
> > > what you want is a very low-level feature. you want to get the image
> buffer
> > > of
> > > an image object, play with its contents, then have that content updated
> on
> > > the
> > > screen.
> > >
> > > going by your example below, you want a bg anyway. a background. leave
> > > that,
> > > BUT add an image object. like this:
> > >
> > >    win = elm_win_add(NULL, "my application", ELM_WIN_BASIC);
> > >    elm_win_title_set(win, "my application");
> > >    evas_object_smart_callback_add(win, "delete,request", win_del,
> NULL);
> > >
> > >    bg = elm_bg_add(win);
> > >    elm_bg_file_set(bg, "sky_03.jpg", NULL);
> > >    evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND,
> > > EVAS_HINT_EXPAND);
> > >    elm_win_resize_object_add(win, bg);
> > >
> > >     img = evas_object_image_filled_add(evas_object_evas_get(win));
> > >    elm_win_resize_object_add(win, img);
> > >    // tell evas that this image will have its content modified
> dynamically
> > >    evas_object_image_content_hint_set(img,
> > > EVAS_IMAGE_CONTENT_HINT_DYNAMIC);
> > >    // tell evas that we want argb8888 (32bit color) colorspace per
> pixel
> > >    evas_object_image_colorspace_set(img, EVAS_COLORSPACE_ARGB8888);
> > >    // do this if you want the alpha channel to work (or fill it with
> 0xff
> > >    // if you don't. this helps optimise rendering)
> > >    evas_object_image_alpha_set(img, 1);
> > >    // tell evas the size in pixels of the image data
> > >    evas_object_image_size_set (img, 480, 640);
> > >    evas_object_show(img);
> > >
> > >    // to modify/fill pixels do this:
> > >    unsigned int *pixels, *p;
> > >    int stirde, x, y;
> > >    // get data - yes, we want to write to it
> > >    pixels = evas_object_image_data_get(img, 1);
> > >    // get stride. this is in pixel units. so 4 bytes (1 int)
> > >    stride = evas_object_image_stride_get(img);
> > >    // set all the pixels in the image. just fill pixel based on x & y
> coord
> > >    // with color values. notice we set alpha to 0xff (0xff000000). i
> assume
> > >    // you understand argb colorspace and pixel values here.
> > >    for (y = 0; y < 640; y++) {
> > >      // get p as the start of the pixel row - stride is the line length
> > >      p = pixels + (y * stride);
> > >      for (x = 0; x < 480; x++) {
> > >        // set each pixel
> > >        *p++ = 0xff000000 | ((y & 0xff) << 16) | (x & 0xff);
> > >      }
> > >    }
> > >    // put the data back as we are now done with it
> > >    evas_object_image_data_set(img, pixels);
> > >    // tell evas which area was changed in the pixels. here we tell it
> all
> > > of
> > >    // the pixels were changed
> > >    evas_object_image_data_update_add(img, 0, 0, 640, 480);
> > >
> > > repeat as needed filling/modifying any pixel in the image. you can
> modify
> > > 1, or
> > > small rects or the entire thing. if it has an alpha channel it will be
> > > blended
> > > per-pixel with the alpha value of that pixel. the above image will also
> get
> > > scaled as the image object is resized with standard smooth scaling.
> > > evas_object_image_smooth_scale_set() can enable or disable smooth
> scaling.
> > > you
> > > can change the image pixel size (this is the source image data - not
> the
> > > output
> > > size as evas will handle scaling for you you need to realize this).
> scaling
> > > in
> > > the software engine will come at a cost. smooth scaling is more costly
> than
> > > non-smooth. the gl engine will pretty much scale for free, but image
> > > updates
> > > come at a cost (texture upload). there is currently no zero-copy
> texture
> > > infrastructure in opengl that can avoid this.
> > >
> > > the above is the kind of mechanism things like emotion use to play
> video.
> > > it
> > > uses a yuv colorspace feature in evas to do video with planar setup.
> > >
> > > > Sorry for my unsufficient explanation, i'll explain more precisely
> below.
> > > >
> > > > My application will have some interfaces that are based on elementary
> > > widjet
> > > > and it has a core engine too, that processes something itself . If I
> > > could
> > > > give this core engine some methods, it'll draw its processing results
> on
> > > > that screen directly at any time it wants to update.
> > > >
> > > > > There are at least 2 solutions for your problem:
> > > > > 1) Use an evas image object as widget in elementary, and you set
> > > correctly
> > > > its bgra data
> > > > > 2) add API for elm_bg which gets and sets its bgra data
> > > >
> > > > I think 1) is the appropreate option for me.
> > > >
> > > > i'm confusing a little about what you said, "The Elementary widgets
> are
> > > evas
> > > > smart objects..." but you're saying
> > > > "1) Use an evas image object as widget in elementary..." also.  "Evas
> > > image"
> > > > is 'basic object', right?
> > > > How can I this basic object(image) as a widjet in Elementary?
> > > >
> > > > besides, I found a "elm_image_add()" api, but i'm not sure it's
> useful or
> > > > not...
> > > >
> > > >
> > > > - hyun
> > > >
> > > > 2010/7/15 Vincent Torri <vto...@univ-evry.fr>
> > > >
> > > > >
> > > > > Hey,
> > > > >
> > > > >
> > > > >  I tried to find some APIs from evas_image_* api in Evas.h and
> refered
> > > to
> > > > >> some sample codes concering this.
> > > > >> Finally, I wrote below test code, but it didn't work well that I
> > > intended.
> > > > >> It displays just only "sky_03.jpg" image on its entire window.
> > > > >>
> > > > >> Below source code seems looks weird, but I just wanted to test the
> > > > >> function
> > > > >> what I mentioned before.
> > > > >> (draw some rgb data directly on my elementry widget.)
> > > > >> Do you have any idea?
> > > > >>
> > > > >
> > > > > In Evas (the canvas used by elementary), you have basic objects
> (line,
> > > > > rectangle, image, etc...), and smart objects (consider them as a
> set of
> > > > > basic objects or smart objects, which behave correctly when you
> resize
> > > them,
> > > > > show them, etc...)
> > > > >
> > > > > The Elementary widgets are evas smart objects. You can't use the
> > > > > evas_object_image_* functions on them. These functions can only be
> used
> > > on
> > > > > the evas basic object 'image'. But you can use en evas object
> (basic or
> > > > > smart) as an elementary widget.
> > > > >
> > > > > There are at least 2 solutions for your problem:
> > > > >
> > > > > 1) Use an evas image object as widget in elementary, and you set
> > > correctly
> > > > > its bgra data
> > > > >
> > > > > 2) add API for elm_bg which gets and sets its bgra data
> > > > >
> > > > > Maybe it would be also useful for us if you explain precisely what
> you
> > > want
> > > > > to do before going further.
> > > > >
> > > > > Vincent
> > > > >
> > > > >
> > > > >>
> //==================================================================
> > > > >> #define MY_WIDTH  480
> > > > >> #define MY_HEIGHT 640
> > > > >>
> > > > >> static int buffer[MY_WIDTH * MY_HEIGHT] = {0,};
> > > > >>
> > > > >> EAPI int elm_main(int argc, char **argv)
> > > > >> {
> > > > >>   Evas_Object *win, *bg;
> > > > >>
> > > > >>   int w, h, *p;
> > > > >>   p = buffer;
> > > > >>   memset(buffer, sizeof(buffer), 0);
> > > > >>   for (w = 0; w < MY_HEIGHT / 2; w++) {
> > > > >>       for (h = 0; h < MY_WIDTH; h++) {
> > > > >>           // just some color to draw again on 'bg' object
> > > > >>           *p++ = (int) 0x00ff00ff;
> > > > >>       }
> > > > >>       printf("w=%d, h=%d\n",w, h);
> > > > >>   }
> > > > >>
> > > > >>   win = elm_win_add(NULL, "my application", ELM_WIN_BASIC);
> > > > >>   elm_win_title_set(win, "my application");
> > > > >>   evas_object_smart_callback_add(win, "delete,request", win_del,
> > > NULL);
> > > > >>
> > > > >>   bg = elm_bg_add(win);
> > > > >>   elm_bg_file_set(bg, "sky_03.jpg", NULL);
> > > > >>   evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND,
> > > > >> EVAS_HINT_EXPAND);
> > > > >>   elm_win_resize_object_add(win, bg);
> > > > >>
> > > > >>   evas_object_image_fill_set(bg, 0, 0, MY_WIDTH, MY_HEIGHT);
> > > > >>   evas_object_image_size_set(bg, MY_WIDTH, MY_HEIGHT);
> > > > >>   evas_object_image_data_copy_set(bg, buffer);
> > > > >>   evas_object_image_alpha_set(bg, 1);
> > > > >>   evas_object_show(bg);
> > > > >>
> > > > >>   evas_object_size_hint_min_set(bg, 100, 100);
> > > > >>   evas_object_size_hint_max_set(bg, MY_WIDTH, MY_HEIGHT);
> > > > >>   evas_object_resize(win, MY_WIDTH, MY_HEIGHT);
> > > > >>   evas_object_show(win);
> > > > >>
> > > > >>   elm_run();
> > > > >>   elm_shutdown();
> > > > >>   return 0;
> > > > >> }
> > > > >> ELM_MAIN()
> > > > >>
> //==================================================================
> > > > >>
> > > > >>
> > > > >>
> > > > >> 2010/7/14 Carsten Haitzler <ras...@rasterman.com>
> > > > >>
> > > > >>  On Wed, 14 Jul 2010 16:00:11 +0900 Hyun Park <hyuny...@gmail.com
> >
> > > said:
> > > > >>>
> > > > >>>  Hi,
> > > > >>>>
> > > > >>>> Firstly, English is not my native language, please understand
> this :
> > > )
> > > > >>>>
> > > > >>>> I'm now trying to re-write my GTK application by using
> "Elementary"
> > > > >>>>
> > > > >>> widget
> > > > >>>
> > > > >>>> library.
> > > > >>>> I already checked test application, 'elementary_test' but I
> couldn't
> > > > >>>> find
> > > > >>>> some appropriate APIs
> > > > >>>> like "gdk_draw_rgb_image()" in Evas or something.
> > > > >>>>
> > > > >>>> I just want to draw some rgb data directly on my window widget.
> > > > >>>> Where can i find this kind of API or some example?
> > > > >>>>
> > > > >>>
> > > > >>> plain evas images. you can access the RGBA pixels directly via
> > > pointer.
> > > > >>> expedite (benchmark suite) has tests for this (RGBA and ARGBA
> Alpha
> > > > >>> data).
> > > > >>> you
> > > > >>> can just stick an evas image into elementary and have fun.
> remember
> > > to
> > > > >>> set
> > > > >>> the
> > > > >>> data back when done and to add update rects. also use stride
> value
> > > > >>> return.
> > > > >>> see
> > > > >>> the evas_image_* api in Evas.h
> > > > >>>
> > > > >>> --
> > > > >>> ------------- Codito, ergo sum - "I code, therefore I am"
> > > --------------
> > > > >>> The Rasterman (Carsten Haitzler)    ras...@rasterman.com
> > > > >>>
> > > > >>>
> > > > >>>
> > >
> ------------------------------------------------------------------------------
> > > > >> This SF.net email is sponsored by Sprint
> > > > >> What will you do first with EVO, the first 4G phone?
> > > > >> Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
> > > > >> _______________________________________________
> > > > >> enlightenment-devel mailing list
> > > > >> enlightenment-devel@lists.sourceforge.net
> > > > >> https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
> > > > >>
> > > > >>
> > > > >>
> > > >
> > >
> ------------------------------------------------------------------------------
> > > > This SF.net email is sponsored by Sprint
> > > > What will you do first with EVO, the first 4G phone?
> > > > Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
> > > > _______________________________________________
> > > > enlightenment-devel mailing list
> > > > enlightenment-devel@lists.sourceforge.net
> > > > https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
> > > >
> > >
> > >
> > > --
> > > ------------- Codito, ergo sum - "I code, therefore I am"
> --------------
> > > The Rasterman (Carsten Haitzler)    ras...@rasterman.com
> > >
> > >
> >
> ------------------------------------------------------------------------------
> > This SF.net email is sponsored by Sprint
> > What will you do first with EVO, the first 4G phone?
> > Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
> > _______________________________________________
> > enlightenment-devel mailing list
> > enlightenment-devel@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
> >
>
>
> --
> ------------- Codito, ergo sum - "I code, therefore I am" --------------
> The Rasterman (Carsten Haitzler)    ras...@rasterman.com
>
>
------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to