<commit_before>#include "test.h"
#ifdef HAVE_CONFIG_H
# include "elementary_config.h"
#endif
#include <Elementary.h>

typedef struct _Point
{
   Evas_Coord x, y, z, u, v;
} Point;

typedef struct _Side
{
   Evas_Object *o;
   Point pt[4];
} Side;

typedef struct _Cube
{
   Side side[6];
} Cube;

static Cube *cube;
static double rotx = 0.0, roty = 0.0, rotz = 0.0;
static double cxo = 0.0, cyo = 0.0, focv = 256.0, z0v = 0.0;
#define POINT(n, p, xx, yy, zz, uu, vv) \
   c->side[n].pt[p].x = xx; \
   c->side[n].pt[p].y = yy; \
   c->side[n].pt[p].z = zz; \
   c->side[n].pt[p].u = uu; \
   c->side[n].pt[p].v = vv

static Cube *
_cube_new(Evas *evas, Evas_Coord w, Evas_Coord h, Evas_Coord d)
{
   Cube *c;
   int i;

   w -= (w / 2);
   h -= (h / 2);
   d -= (d / 2);
   c = calloc(1, sizeof(Cube));
   for (i = 0; i < 6; i++)
     {
        Evas_Object *o;
        char buf[PATH_MAX];
        o = evas_object_image_filled_add(evas);
        c->side[i].o = o;
        snprintf(buf, sizeof(buf), "%s/images/%s",
                 elm_app_data_dir_get(), "twofish.jpg");
        evas_object_image_file_set(o, buf, NULL);
        evas_object_resize(o, 256, 256);
        evas_object_image_smooth_scale_set(o, EINA_FALSE);
        evas_object_pass_events_set(o, EINA_TRUE);
        evas_object_color_set(o, 235, 235, 235, 235);
        evas_object_show(o);
     }
   POINT(0, 0, -w, -h, -d,   0,   0);
   POINT(0, 1,  w, -h, -d, 256,   0);
   POINT(0, 2,  w,  h, -d, 256, 256);
   POINT(0, 3, -w,  h, -d,   0, 256);

   POINT(1, 0,  w, -h, -d,   0,   0);
   POINT(1, 1,  w, -h,  d, 256,   0);
   POINT(1, 2,  w,  h,  d, 256, 256);
   POINT(1, 3,  w,  h, -d,   0, 256);

   POINT(2, 0,  w, -h,  d,   0,   0);
   POINT(2, 1, -w, -h,  d, 256,   0);
   POINT(2, 2, -w,  h,  d, 256, 256);
   POINT(2, 3,  w,  h,  d,   0, 256);

   POINT(3, 0, -w, -h,  d,   0,   0);
   POINT(3, 1, -w, -h, -d, 256,   0);
   POINT(3, 2, -w,  h, -d, 256, 256);
   POINT(3, 3, -w,  h,  d,   0, 256);

   POINT(4, 0, -w, -h,  d,   0,   0);
   POINT(4, 1,  w, -h,  d, 256,   0);
   POINT(4, 2,  w, -h, -d, 256, 256);
   POINT(4, 3, -w, -h, -d,   0, 256);

   POINT(5, 0, -w,  h, -d,   0,   0);
   POINT(5, 1,  w,  h, -d, 256,   0);
   POINT(5, 2,  w,  h,  d, 256, 256);
   POINT(5, 3, -w,  h,  d,   0, 256);

   return c;
}

static void
_cube_pos(Cube *c,
          Evas_Coord x, Evas_Coord y, Evas_Coord z,
          double dx, double dy, double dz,
          Evas_Coord cx, Evas_Coord cy, Evas_Coord foc, Evas_Coord z0)
{
   Evas_Map *m;
   int i, j, order[6], sorted;
   Evas_Coord mz[6];

   m = evas_map_new(4);
   evas_map_smooth_set(m, EINA_FALSE);

   for (i = 0; i < 6; i++)
     {
        Evas_Coord tz[4];

        for (j = 0; j < 4; j++)
          {
             evas_map_point_coord_set(m, j,
                                      c->side[i].pt[j].x + x,
                                      c->side[i].pt[j].y + y,
                                      c->side[i].pt[j].z + z);
             evas_map_point_image_uv_set(m, j,
                                         c->side[i].pt[j].u,
                                         c->side[i].pt[j].v);
             evas_map_point_color_set(m, j, 255, 255, 255, 255);
          }
        evas_map_util_3d_rotate(m, dx, dy, dz, x, y, z);
        evas_map_util_3d_lighting(m, -1000, -1000, -1000,
                                  255, 255, 255,<commit_msg>test/evasmap3d: let better quality as default.<commit_after>#include "test.h"
#ifdef HAVE_CONFIG_H
# include "elementary_config.h"
#endif
#include <Elementary.h>

typedef struct _Point
{
   Evas_Coord x, y, z, u, v;
} Point;

typedef struct _Side
{
   Evas_Object *o;
   Point pt[4];
} Side;

typedef struct _Cube
{
   Side side[6];
} Cube;

static Cube *cube;
static double rotx = 0.0, roty = 0.0, rotz = 0.0;
static double cxo = 0.0, cyo = 0.0, focv = 256.0, z0v = 0.0;
#define POINT(n, p, xx, yy, zz, uu, vv) \
   c->side[n].pt[p].x = xx; \
   c->side[n].pt[p].y = yy; \
   c->side[n].pt[p].z = zz; \
   c->side[n].pt[p].u = uu; \
   c->side[n].pt[p].v = vv

static Cube *
_cube_new(Evas *evas, Evas_Coord w, Evas_Coord h, Evas_Coord d)
{
   Cube *c;
   int i;

   w -= (w / 2);
   h -= (h / 2);
   d -= (d / 2);
   c = calloc(1, sizeof(Cube));
   for (i = 0; i < 6; i++)
     {
        Evas_Object *o;
        char buf[PATH_MAX];
        o = evas_object_image_filled_add(evas);
        c->side[i].o = o;
        snprintf(buf, sizeof(buf), "%s/images/%s",
                 elm_app_data_dir_get(), "twofish.jpg");
        evas_object_image_file_set(o, buf, NULL);
        evas_object_resize(o, 256, 256);
        evas_object_pass_events_set(o, EINA_TRUE);
        evas_object_color_set(o, 235, 235, 235, 235);
        evas_object_show(o);
     }
   POINT(0, 0, -w, -h, -d,   0,   0);
   POINT(0, 1,  w, -h, -d, 256,   0);
   POINT(0, 2,  w,  h, -d, 256, 256);
   POINT(0, 3, -w,  h, -d,   0, 256);

   POINT(1, 0,  w, -h, -d,   0,   0);
   POINT(1, 1,  w, -h,  d, 256,   0);
   POINT(1, 2,  w,  h,  d, 256, 256);
   POINT(1, 3,  w,  h, -d,   0, 256);

   POINT(2, 0,  w, -h,  d,   0,   0);
   POINT(2, 1, -w, -h,  d, 256,   0);
   POINT(2, 2, -w,  h,  d, 256, 256);
   POINT(2, 3,  w,  h,  d,   0, 256);

   POINT(3, 0, -w, -h,  d,   0,   0);
   POINT(3, 1, -w, -h, -d, 256,   0);
   POINT(3, 2, -w,  h, -d, 256, 256);
   POINT(3, 3, -w,  h,  d,   0, 256);

   POINT(4, 0, -w, -h,  d,   0,   0);
   POINT(4, 1,  w, -h,  d, 256,   0);
   POINT(4, 2,  w, -h, -d, 256, 256);
   POINT(4, 3, -w, -h, -d,   0, 256);

   POINT(5, 0, -w,  h, -d,   0,   0);
   POINT(5, 1,  w,  h, -d, 256,   0);
   POINT(5, 2,  w,  h,  d, 256, 256);
   POINT(5, 3, -w,  h,  d,   0, 256);

   return c;
}

static void
_cube_pos(Cube *c,
          Evas_Coord x, Evas_Coord y, Evas_Coord z,
          double dx, double dy, double dz,
          Evas_Coord cx, Evas_Coord cy, Evas_Coord foc, Evas_Coord z0)
{
   Evas_Map *m;
   int i, j, order[6], sorted;
   Evas_Coord mz[6];

   m = evas_map_new(4);

   for (i = 0; i < 6; i++)
     {
        Evas_Coord tz[4];

        for (j = 0; j < 4; j++)
          {
             evas_map_point_coord_set(m, j,
                                      c->side[i].pt[j].x + x,
                                      c->side[i].pt[j].y + y,
                                      c->side[i].pt[j].z + z);
             evas_map_point_image_uv_set(m, j,
                                         c->side[i].pt[j].u,
                                         c->side[i].pt[j].v);
             evas_map_point_color_set(m, j, 255, 255, 255, 255);
          }
        evas_map_util_3d_rotate(m, dx, dy, dz, x, y, z);
        evas_map_util_3d_lighting(m, -1000, -1000, -1000,
                                  255, 255, 255,
{'fraction_non_alphanumeric': 0.18652154465483822, 'fraction_numerical': 0.06903235425674668, 'mean_word_length': 1.7037484885126966, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 27, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 20, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7274578', 'n_tokens_mistral': 3451, 'n_tokens_neox': 3026, 'n_words': 772}