16bpp is just available (and the default) for software16 engines, but
this engine is not as complete: no smooth scale, no
perspective/rotation/3d transform, no image preload. Usually they do
not matter much in embedded systems, the focus of this engine, but
could be given some effort.

On Thursday, July 15, 2010, Hyun Park <hyuny...@gmail.com> wrote:
> 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...
>
> 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 sc

-- 
Gustavo Sverzut Barbieri
http://profusion.mobi embedded systems
--------------------------------------
MSN: barbi...@gmail.com
Skype: gsbarbieri
Mobile: +55 (19) 9225-2202

------------------------------------------------------------------------------
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