Commit Graph

41 Commits

Author SHA1 Message Date
Vincent Torri 01fb3233eb Evas: add jxl loader and saver
add jxl loader and saver to Evas.

Entice for loading, animated jxl files or not some conformances files :
https://github.com/libjxl/conformance/tree/master/testcases
2022-04-28 17:00:40 +01:00
maxerba 0300853282 Updating Potfiles.in 2021-05-28 10:29:52 +02:00
Vincent Torri fd24e89144 Evas: add avif evas loader and saver
Summary:
Add AV1 image file loader and saver to Evas

The loader can be tested with this code :

```
#include <stdlib.h>
#include <stdio.h>

#include <Eina.h>
#include <Ecore.h>
#include <Evas.h>
#include <Ecore_Evas.h>

static int i = 0;

static unsigned char _timer(void *data)
{
  Evas_Object *o = (Evas_Object *)data;

  if (i < evas_object_image_animated_frame_count_get(o))
    {
      evas_object_image_animated_frame_set(o, i);
      i++;
      return ECORE_CALLBACK_RENEW;
    }

  return ECORE_CALLBACK_DONE;
}

static void _quit(Ecore_Evas *ee)
{
  ecore_main_loop_quit();
  (void)ee;
}

int main(int argc, char *argv[])
{
  Ecore_Evas *ee;
  Evas *evas;
  Evas_Object *o;
  int w,h;
  Evas_Load_Error err;

  if (argc < 2)
    {
      printf("usage : %s file\n", argv[0]);
      return 1;
    }

  ecore_evas_init();

  ee = ecore_evas_new(NULL, 0, 0, 1, 1, NULL);
  if (!ee)
    {
      printf("no ee\n");
      return 0;
    }

  evas = ecore_evas_get(ee);
  ecore_evas_title_set(ee, "avif test");
  ecore_evas_callback_delete_request_set(ee, _quit);

  o = evas_object_image_add(evas);
  evas_object_image_file_set(o, argv[1], NULL);
  err = evas_object_image_load_error_get(o);
  if (err != EVAS_LOAD_ERROR_NONE)
    {
      fprintf(stderr, "could not load image '%s'. error string is \"%s\"\n",
              argv[1], evas_load_error_str(err));
      return 1;
    }

  evas_object_image_size_get(o, &w, &h);
  evas_object_image_fill_set(o, 0, 0, w, h);
  evas_object_move(o, 0, 0);
  evas_object_resize(o, w, h);
      evas_object_show(o);

  printf("animated : %s\n", evas_object_image_animated_get(o) ? "yes" : "no");
  fflush(stdout);

  if (evas_object_image_animated_get(o))
    {
      Ecore_Timer *timer;
      printf("frame count : %d\n", evas_object_image_animated_frame_count_get(o));
      printf("duration    : %f\n", evas_object_image_animated_frame_duration_get(o,1,0));
      printf("loop count  : %d\n", evas_object_image_animated_loop_count_get(o));
      fflush(stdout);

      timer = ecore_timer_add(evas_object_image_animated_frame_duration_get(o,1,0), _timer, o);
    }

  ecore_evas_resize(ee, w,  h);
  ecore_evas_show(ee);

  ecore_main_loop_begin();

  ecore_evas_shutdown();

  return 0;
}
```

non animated files : https://github.com/AOMediaCodec/libavif/tree/master/tests/data/originals
animated files : https://github.com/AOMediaCodec/av1-avif/tree/master/testFiles/Netflix/avifs

to test the saver :

```
#include <stdlib.h>
#include <stdio.h>
#include <math.h>

#include <Eina.h>
#include <Ecore.h>
#include <Evas.h>
#include <Ecore_Evas.h>

void _quit(Ecore_Evas *ee)
{
  ecore_main_loop_quit();
  (void)ee;
}

static Evas_Object *
display_data(int w, int h, const char *title, unsigned int *data)
{
  Ecore_Evas *ee;
  Evas *evas;
  Evas_Object *o;
  unsigned int *d;

  ee = ecore_evas_new(NULL, 0, 0, w, h, NULL);
  if (!ee)
    return NULL;

  evas = ecore_evas_get(ee);
  ecore_evas_title_set(ee, title);
  ecore_evas_callback_delete_request_set(ee, _quit);

  o = evas_object_image_add(evas);
  evas_object_image_fill_set(o, 0, 0, w, h);
  evas_object_image_size_set(o, w, h);

  d = evas_object_image_data_get(o, 1);
  for (int i = 0; i < w*h; i++)
    d[i] = data[i];
  evas_object_image_data_set(o, d);
  evas_object_image_data_update_add(o, 0, 0, w, h);
  evas_object_move(o, 0, 0);
  evas_object_resize(o, w, h);
  evas_object_show(o);

  ecore_evas_show(ee);

  return o;
}

static unsigned int *
display_file(const char *title, const char *filename, int *w, int *h)
{
  Ecore_Evas *ee;
  Evas *evas;
  Evas_Object *o;
  Evas_Load_Error err;
  unsigned int *data;

  ee = ecore_evas_new(NULL, 0, 0, 1, 1, NULL);
  if (!ee)
    return NULL;

  evas = ecore_evas_get(ee);
  ecore_evas_title_set(ee, title);
  ecore_evas_callback_delete_request_set(ee, _quit);

  o = evas_object_image_add(evas);
  evas_object_image_file_set(o, filename, NULL);
  err = evas_object_image_load_error_get(o);
  if (err != EVAS_LOAD_ERROR_NONE)
    {
      fprintf(stderr, "could not load image '%s'. error string is \"%s\"\n",
              filename, evas_load_error_str(err));
      fflush(stderr);
      return NULL;
    }

  evas_object_image_size_get(o, w, h);
  evas_object_image_fill_set(o, 0, 0, *w, *h);
  evas_object_image_size_set(o, *w, *h);
  evas_object_move(o, 0, 0);
  evas_object_resize(o, *w, *h);
  evas_object_show(o);

  ecore_evas_resize(ee, *w, *h);
  ecore_evas_show(ee);

  data = evas_object_image_data_get(o, 1);

  return data;
}

double psnr(int w, int h, unsigned int *data_orig, unsigned int *data)
{
  unsigned char *iter_orig;
  unsigned char *iter;
  double psnr;

  psnr = 0.0;
  iter_orig = (unsigned char *)data_orig;
  iter = (unsigned char *)data;
  for (int i = 0; i < 4 * w * h; i++, iter_orig++, iter++)
    psnr += (*iter_orig - *iter) * (*iter_orig - *iter);
  psnr /= 4 * w * h;
  psnr = 10 * log10(255.0 * 255.0 / psnr);
  return psnr;
}

void compare(int quality, int w, int h, unsigned int *data_orig)
{
  char title[1024];
  char filename[1024];
  unsigned char *data;
  unsigned int *data_jpeg;
  unsigned int *data_avif;
  unsigned char *iter_orig;
  unsigned char *iter_jpeg;
  unsigned char *iter_avif;
  double psnr_jpeg;
  double psnr_avif;
  Eina_File *f_jpeg;
  Eina_File *f_avif;
  size_t size_jpeg;
  size_t size_avif;

  /* jpeg */

  snprintf(title, sizeof(title), "jpeg test quality %d", quality);
  snprintf(filename, sizeof(filename), "test_%d.jpg", quality);
  data_jpeg = display_file(title, filename, &w, &h);
  if (!data_jpeg)
    return;

  f_jpeg = eina_file_open(filename, EINA_FALSE);
  size_jpeg = eina_file_size_get(f_jpeg);
  eina_file_close(f_jpeg);
  fprintf(stderr, "size : %u\n", (unsigned int)size_jpeg);
  fflush(stderr);

  /* avif */

  snprintf(title, sizeof(title), "avif test quality %d", quality);
  snprintf(filename, sizeof(filename), "test_%d.avif", quality);
  data_avif = display_file(title, filename, &w, &h);
  if (!data_avif)
    return;

  f_avif = eina_file_open(filename, EINA_FALSE);
  size_avif = eina_file_size_get(f_avif);
  eina_file_close(f_avif);
  fprintf(stderr, "size : %u\n", (unsigned int)size_avif);
  fflush(stderr);

  psnr_jpeg = psnr(w, h, data_orig, data_jpeg);
  fprintf(stderr, "psnr jpeg : %f\n", psnr_jpeg);
  fflush(stderr);

  snprintf(title, sizeof(title), "jpeg vs orig (psnr: %.2f, size: %u b)", psnr_jpeg, (unsigned int)size_jpeg);
  iter_orig = (unsigned char *)data_orig;
  iter_jpeg = (unsigned char *)data_jpeg;
  data = malloc(4*w*h);
  for (int i = 0; i < 4*w*h; i++, iter_orig++, iter_jpeg++)
    data[i] = abs(*iter_jpeg - *iter_orig);
  display_data(w, h, title, (unsigned int *)data);

  psnr_avif = psnr(w, h, data_orig, data_avif);
  fprintf(stderr, "psnr avif : %f\n", psnr_avif);
  fflush(stderr);

  snprintf(title, sizeof(title), "avif vs orig (psnr: %.2f, size: %u b)", psnr_avif, (unsigned int)size_avif);
  iter_orig = (unsigned char *)data_orig;
  iter_avif = (unsigned char *)data_avif;
  data = malloc(4*w*h);
  for (int i = 0; i < 4*w*h; i++, iter_orig++, iter_avif++)
    data[i] = abs(*iter_avif - *iter_orig);
  display_data(w, h, title, (unsigned int *)data);
}

int main()
{
  Ecore_Evas *ee;
  Evas *evas;
  Evas_Object *o;
  Evas_Load_Error err;
  unsigned int *data;
  int w,h;

  ecore_evas_init();

  ee = ecore_evas_new(NULL, 0, 0, 1, 1, NULL);
  if (!ee)
    return 1;

  evas = ecore_evas_get(ee);
  ecore_evas_title_set(ee, "original");
  ecore_evas_callback_delete_request_set(ee, _quit);

  o = evas_object_image_add(evas);
  evas_object_image_file_set(o, "x1d-II-sample-02.fff", NULL);
  err = evas_object_image_load_error_get(o);
  if (err != EVAS_LOAD_ERROR_NONE)
    {
      fprintf(stderr, "could not load image '%s'. error string is \"%s\"\n",
              "x1d-II-sample-02.fff", evas_load_error_str(err));
      fflush(stderr);
      return 1;
    }

  evas_object_image_size_get(o, &w, &h);
  evas_object_image_fill_set(o, 0, 0, w, h);
  evas_object_image_size_set(o, w, h);
  evas_object_move(o, 0, 0);
  evas_object_resize(o, w, h);
  evas_object_show(o);

  data = evas_object_image_data_get(o, 1);

  ecore_evas_resize(ee, w, h);
  ecore_evas_show(ee);

  /* evas_object_image_save(o, "test_100.jpg", NULL, "quality=100"); */

  evas_object_image_save(o, "test_90.jpg", NULL, "quality=90");
  /* evas_object_image_save(o, "test_70.jpg", NULL, "quality=70"); */
  /* evas_object_image_save(o, "test_50.jpg", NULL, "quality=50"); */

  /* evas_object_image_save(o, "test_100.avif", NULL, "quality=100"); */

  evas_object_image_save(o, "test_90.avif", NULL, "quality=90");
  /* evas_object_image_save(o, "test_70.avif", NULL, "quality=70"); */
  /* evas_object_image_save(o, "test_50.avif", NULL, "quality=50"); */

  compare(90, w, h, data);

  ecore_main_loop_begin();

  ecore_evas_shutdown();

  return 0;
}
```

the raw file canbe found here : https://www.hasselblad.com/learn/sample-images/

Test Plan: test executable with avif files found in libavif project

Reviewers: raster, q66

Reviewed By: q66

Subscribers: q66, cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D12051
2020-07-15 18:51:27 +01:00
Carsten Haitzler f620e0edd1 Revert "Evas: add avif evas loader"
This reverts commit dd23a6c84a.

i didn't mean to push this yet...
2020-07-14 10:55:44 +01:00
Vincent Torri dd23a6c84a Evas: add avif evas loader
Summary: Add AV1 image file loader to Evas

Test Plan: test executable with avif files found in libavif project

Reviewers: raster

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D12051
2020-07-14 10:09:22 +01:00
Stefan Schmidt cac95313c7 benchmark: eina: remove outdated ecore_hash
Ecore_hash is an ancestor of eina_hash and not used anywhere anymore.
We simply forgot to remove it from our benchmark utility.

Together with ecore_hash we are removing ecore_strings, which uses it,
and the corresponding benchmark files.

Signed-off-by: Stefan Schmidt <s.schmidt@samsung.com>
Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D12042
2020-07-06 17:14:36 +02:00
maxerba 821f9bc57c Fixing POTFILES and updating italian translation 2020-04-18 17:06:23 +02:00
Jaehyun Cho 2d460e52e4 elementary: remove Efl.Ui.Layout namespace
Summary:
Efl.Ui.Layout namespace is removed to keep consistency with other
widgets.
Consequently, "Efl.Ui.Layout.Object" is renamed to "Efl.Ui.Layout" and
"Efl.Ui.Layout." is renamed to "Efl.Ui.Layout_".

Reviewers: segfaultxavi, bu5hm4n, cedric

Reviewed By: segfaultxavi

Subscribers: #reviewers, #committers, SanghyeonLee, woohyun

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D7291
2018-11-16 11:11:13 +01:00
Carsten Haitzler 3d6c72438d build break - fix - potfiles.in missing file rename
fix build to work again (from a clean tree).
2018-04-25 14:24:37 +09:00
Woochan Lee 939690a8a9 Revert Efl.Ui.Multibuttonentry to create new one.
Summary:
Revert e02b2f04c2945ad60fab5612af1e02b0838b7ff5.

I couldnt make a revert commit for many commit has been related with above commit.

I will create a new MBE eo class ASAP. (https://phab.enlightenment.org/T5358)

Reviewers: cedric, woohyun, Jaehyun_Cho, SanghyeonLee, herb

Reviewed By: Jaehyun_Cho

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D5954
2018-04-19 22:22:01 +09:00
Amitesh Singh c99b37ad47 Efl.Ui.Progressbar: implement range min max 2018-01-31 17:44:20 +09:00
Carsten Haitzler 33ea8a2cfa potfiles.in - remove src files no longer in tree 2018-01-12 22:32:39 +09:00
Amitesh Singh 44d3227beb widget: rename elm widget to Efl.Ui.Widget. 2018-01-08 21:28:10 +09:00
WooHyun Jung 9442f4687c efl_ui_calendar: create new efl_ui_calendar
Summary:
This calendar widget will support basic functionality of calendar.
I've separated this widget from elm_calendar since elm_calendar had
lots of unuseful things inside.

Reviewers: jpeg, singh.amitesh, cedric, CHAN, Jaehyun_Cho

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D5346
2017-10-25 16:50:01 +09:00
Woochan Lee 6c3bc915df elm: rename elm_multibuttonentry to Efl.Ui.Multibuttonentry
Summary: @ref T5358

Reviewers: woohyun, jpeg, cedric, Jaehyun_Cho

Reviewed By: Jaehyun_Cho

Subscribers: Jaehyun, bu5hm4n, cedric, jpeg

Maniphest Tasks: T5358

Differential Revision: https://phab.enlightenment.org/D5169

JP's note:
MBE currently has quite a few issues, probably related to focus
handling. This needs to be fixed.
2017-10-24 16:20:09 +09:00
Amitesh Singh 92eb5d1962 elm test: rename test_slider_interval.c to test_ui_slider_interval.c 2017-09-29 13:37:56 +09:00
Sungtaek Hong ebff5e8639 elm_bg: rename elm_bg to Efl.Ui.Bg
Summary:
elm_bg was supposed to be used only in legacy,
but since we need a common object to be used as a background of widgets,
it is now renamed as efl_ui_bg and supports EO APIs.

Reviewers: cedric, jpeg, woohyun

Differential Revision: https://phab.enlightenment.org/D5147
2017-09-26 17:58:07 +09:00
Amitesh Singh 9348094220 interval slider: Add new interval slider widget
This widget is a slider with two indicators which allows
to have interval of value.
2017-09-12 18:08:42 +09:00
Amitesh Singh ef1c178a28 Revert "elm: rename elm spinner to Efl.Ui.Spinner"
This reverts commit 9836116cab.

This is based on discussion today i had.
There would be a separate minimal spinner class instead
which facilates ways to extend it.
2017-09-07 11:18:08 +09:00
Amitesh Singh 9836116cab elm: rename elm spinner to Efl.Ui.Spinner
Ref T5900
2017-09-01 14:08:21 +09:00
Jean-Philippe Andre 9a2d4928f0 elm: Rename elm_layout to Efl.Ui.Layout
Some names have not been changed, hopefully making a distinction
between legacy APIs and internal code (elm_layout_blah) and valid EO
usages.

This means many internal functions are still elm_layout_ as their
sole purpose is to support the legacy API.

Ref T5315
2017-08-08 13:25:58 +09:00
Amitesh Singh 40945d9859 elm: rename elm panes to Efl.Ui.Panes 2017-08-07 15:49:11 +09:00
Amitesh Singh e5922c0720 elm: rename elm slider to Efl.Ui.Slider
ref T5361
2017-06-12 16:45:47 +09:00
Amitesh Singh 6fe568d9ac elm: rename elm_photocam to Efl.Ui.Image.Zoomable
Signed-off-by: Amitesh Singh <amitesh.sh@samsung.com>
2017-05-29 14:52:36 +09:00
Amitesh Singh f6b81f0a1e elm: rename elm_progressbar to Efl.Ui.Progressbar
ref T5360

Signed-off-by: Amitesh Singh <amitesh.sh@samsung.com>
2017-05-23 19:05:48 +09:00
Amitesh Singh 12b862f8d1 rename elm_radio to Efl.Ui.Radio
Signed-off-by: Amitesh Singh <amitesh.sh@samsung.com>
2017-05-22 19:21:28 +09:00
Amitesh Singh 850498e977 rename elm_button to Efl.Ui.Button
ref T5323

Signed-off-by: Amitesh Singh <amitesh.sh@samsung.com>
2017-05-22 17:28:47 +09:00
Amitesh Singh bd743d93ac rename elm_check to Efl.Ui.Check
Signed-off-by: Amitesh Singh <amitesh.sh@samsung.com>
2017-05-22 12:13:13 +09:00
Chidambar Zinnoury 886efbfc29 efl ui frame: Update the file name for translation purposes.
This unbreaks build.

 See 53035f23e6.
2016-07-04 21:00:36 +02:00
Stefan Schmidt 350306c5ea po: catchup with file rename to efl_ui_video in POTFILES.in
In commit 549e274acb this file was renamed but
POTFILES.in not updated.
2016-06-23 23:27:43 +02:00
Ji-Youn Park 8cf9ee67bd efl_ui_win: rename elm_win to efl_ui_win 2016-06-07 23:11:48 +08:30
Stefan Schmidt 9b170a2602 po: follow file rename for elm_flip to efl_ui_flip change 2016-06-07 11:26:51 +02:00
Stefan Schmidt c00d6cae25 po: update POTFILE.in after file rename of elm_image.c
Follwoing a0ec05cd8f we also rename the file
here to fix the po file generation.
2016-05-31 14:11:27 +02:00
Stefan Schmidt 49dde632bc po: elm_container.c is removewd from the tree thus also remove it from POTFILES
File was removed in 902950018b.
2016-04-26 08:56:29 +02:00
Cedric Bail 998adbb312 Revert "po: disable edje_external files from elementary until they are integrated"
This reverts commit 5517a23cde.

edje_external are back in, so this is not needed anymore.
2016-03-31 19:45:26 -07:00
Stefan Schmidt 5517a23cde po: disable edje_external files from elementary until they are integrated
The edje_external module from elementary is not integrated into the build
system yet and having these files enabled here confuses our po rules.

Cedric will enable these again when he enables them in the build.
2016-03-31 20:11:59 +02:00
Cedric BAIL 71482d63ba elementary: let's try to get the right files back in.
Strange enough, if I still try to update po files, half of their content
disapear as if we are unable to find the text to translate in the .c files
when it is still there and the file is processed...
2016-03-30 15:55:06 -07:00
Massimo Maiurana a8dc247108 reverting last commit
SVN revision: 82288
2013-01-05 22:44:52 +00:00
Massimo Maiurana 68c7b8265e missing file from POTFILES.in
SVN revision: 82285
2013-01-05 19:51:29 +00:00
Massimo Maiurana a57d4e8418 updating all po files merging translations from efreet. I've also removed a stale directory.
SVN revision: 81956
2013-01-01 10:02:55 +00:00
Vincent Torri 7d6010b12c merge: add escape ecore, fix several bugs
SVN revision: 79995
2012-12-02 22:35:45 +00:00