64 double width = (b.
UR.
x - b.
LL.
x);
65 double height = (b.
UR.
y - b.
LL.
y);
66 double originx = (b.
UR.
x + b.
LL.
x - width) / 2;
67 double originy = (b.
UR.
y + b.
LL.
y + height) / 2;
72 gvputs(job,
"<image xlink:href=\"");
78 "\" width=\"%gpx\" height=\"%gpx\" preserveAspectRatio=\"xMidYMid "
79 "meet\" x=\"%g\" y=\"%g\"",
80 height, width, originx, -originy);
86 "\" width=\"%gpx\" height=\"%gpx\" preserveAspectRatio=\"xMinYMin "
87 "meet\" x=\"%g\" y=\"%g\"",
88 width, height, originx, -originy);
106 double style_val = 0.0;
110 int forward_arrow = 0;
111 int backward_arrow = 0;
119 gvprintf(job,
"%d %d %d %d %d %d %d %d %d %.1f %d %d %d %d %d %d\n %d %s\n",
120 object_code, sub_type, line_style, thickness, pen_color, fill_color,
121 depth, pen_style, area_fill, style_val, join_style, cap_style,
122 radius, forward_arrow, backward_arrow, npoints, flipped, us->
name);
123 gvprintf(job,
" %.0f %.0f %.0f %.0f %.0f %.0f %.0f %.0f %.0f %.0f\n", bf.
LL.
x,
138 assert(job->
obj->
u.
n);
141 gvprintf(job,
" appearance Appearance {\n");
142 gvprintf(job,
" material Material {\n");
143 gvprintf(job,
" ambientIntensity 0.33\n");
144 gvprintf(job,
" diffuseColor 1 1 1\n");
146 gvprintf(job,
" texture ImageTexture { url \"%s\" }\n", us->
name);
152#ifdef HAVE_SYS_MMAN_H
187 if (fstat(fd, &statbuf) < 0) {
191 us->
datasize = (size_t)statbuf.st_size;
192#ifdef HAVE_SYS_MMAN_H
193 us->
data = mmap(0, us->
datasize, PROT_READ, MAP_PRIVATE, fd, 0);
194 if (us->
data == MAP_FAILED)
199 read(fd, us->
data, statbuf.st_size);
212 gvprintf(job,
"gsave %g %g translate newpath\n", b.
LL.
x - us->
x,
234 for (
size_t i = 0; i <
sizeof(AF) /
sizeof(AF[0]); i++)
235 gvprintf(job,
"%g %g ", AF[i].x, AF[i].y);
236 gvprintf(job,
"%g %g ", AF[0].x, AF[0].y);
240 for (
size_t i = 0; i <
sizeof(AF) /
sizeof(AF[0]); i++)
241 gvprintf(job,
"%g %g ", AF[i].x, AF[i].y);
242 gvprintf(job,
"%g %g ", AF[0].x, AF[0].y);
251 gvprintf(job,
"image create photo \"photo_%s\" -file \"%s\"\n", us->
name,
253 gvprintf(job,
"$c create image %.2f %.2f -image \"photo_%s\"\n",
Dynamically expanding string buffers.
void core_loadimage_xdot(GVJ_t *, usershape_t *, boxf, bool)
void gvusershape_file_release(usershape_t *us)
bool gvusershape_file_access(usershape_t *us)
int gvputs(GVJ_t *job, const char *s)
void gvprintf(GVJ_t *job, const char *format,...)
static void core_loadimage_ps(GVJ_t *job, usershape_t *us, boxf b, bool filled)
static gvloadimage_engine_t engine_ps
static void core_loadimage_pslib(GVJ_t *job, usershape_t *us, boxf b, bool filled)
static gvloadimage_engine_t engine_null
static gvloadimage_engine_t engine_pslib
static void ps_freeimage(usershape_t *us)
static void core_loadimage_svg(GVJ_t *job, usershape_t *us, boxf b, bool filled)
static gvloadimage_engine_t engine_svg
static gvloadimage_engine_t engine_vrml
static gvloadimage_engine_t engine_xdot
static void core_loadimage_fig(GVJ_t *job, usershape_t *us, boxf bf, bool filled)
static gvloadimage_engine_t engine_fig
gvplugin_installed_t gvloadimage_core_types[]
static void core_loadimage_tk(GVJ_t *job, usershape_t *us, boxf b, bool filled)
shape_desc * find_user_shape(char *name)
static gvloadimage_engine_t engine_tk
static void core_loadimage_null(GVJ_t *gvc, usershape_t *us, boxf b, bool filled)
static void core_loadimage_vrml(GVJ_t *job, usershape_t *us, boxf b, bool filled)
void epsf_emit_body(GVJ_t *job, usershape_t *us)
void(* datafree)(usershape_t *us)