Mercurial > octave
comparison src/octave-svgconvert.cc @ 27277:db687716fed6
style fixes: generally aim to break long lines before operators, not after
Files affected: Table.cc, dw-main-window.cc, file-editor-tab.cc,
file-editor.cc, main-window.cc, build-env.in.cc, __ichol__.cc,
__magick_read__.cc, besselj.cc, bsxfun.cc, cellfun.cc, data.cc,
dlmread.cc, error.cc, fcn-info.cc, file-io.cc, gl-render.cc,
gl2ps-print.cc, graphics.cc, load-save.cc, ls-mat4.cc, ls-mat5.cc,
matrix_type.cc, mex.cc, oct-stream.cc, pr-output.cc, quadcc.cc,
rand.cc, sparse-xpow.cc, syscalls.cc, sysdep.cc, utils.cc,
__init_fltk__.cc, __init_gnuplot__.cc, chol.cc, fftw.cc, qr.cc,
cdef-class.cc, cdef-object.cc, ov-bool-sparse.cc, ov-cell.cc,
ov-class.cc, ov-cx-diag.cc, ov-cx-sparse.cc, ov-fcn-handle.cc,
ov-flt-cx-diag.cc, ov-flt-re-diag.cc, ov-str-mat.cc, ov-struct.cc,
ov.cc, op-b-sbm.cc, op-bm-sbm.cc, op-cdm-cdm.cc, op-scm-scm.cc,
op-sm-scm.cc, op-sm-sm.cc, jit-typeinfo.cc, pt-cbinop.cc, pt-cbinop.h,
pt-eval.cc, CSparse.cc, MatrixType.cc, dSparse.cc, eigs-base.cc,
lo-specfun.cc, oct-fftw.cc, cmd-edit.cc, lo-regexp.cc, oct-inttypes.h,
url-transfer.cc, mkoctfile.in.cc, and octave-svgconvert.cc.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Sun, 21 Jul 2019 10:21:01 -0400 |
parents | 119353eb6b38 |
children | b442ec6dda5c |
comparison
equal
deleted
inserted
replaced
27276:7455523fdf01 | 27277:db687716fed6 |
---|---|
249 } | 249 } |
250 | 250 |
251 static inline | 251 static inline |
252 bool eq (QPointF p1, QPointF p2) | 252 bool eq (QPointF p1, QPointF p2) |
253 { | 253 { |
254 return ((qAbs (p1.x () - p2.x ()) <= | 254 return ((qAbs (p1.x () - p2.x ()) |
255 0.00001 * qMin (qAbs (p1.x ()), qAbs (p2.x ()))) | 255 <= 0.00001 * qMin (qAbs (p1.x ()), qAbs (p2.x ()))) |
256 && (qAbs (p1.y () - p2.y ()) <= | 256 && (qAbs (p1.y () - p2.y ()) |
257 0.00001 * qMin (qAbs (p1.y ()), qAbs (p2.y ())))); | 257 <= 0.00001 * qMin (qAbs (p1.y ()), qAbs (p2.y ())))); |
258 } | 258 } |
259 | 259 |
260 static | 260 static |
261 QPolygonF mergepoly (QPolygonF poly1, QPolygonF poly2) | 261 QPolygonF mergepoly (QPolygonF poly1, QPolygonF poly2) |
262 { | 262 { |
531 else if (elt.tagName () == "image") | 531 else if (elt.tagName () == "image") |
532 { | 532 { |
533 // Images are represented as a base64 stream of png formated data | 533 // Images are represented as a base64 stream of png formated data |
534 QString href_att = elt.attribute ("xlink:href"); | 534 QString href_att = elt.attribute ("xlink:href"); |
535 QString prefix ("data:image/png;base64,"); | 535 QString prefix ("data:image/png;base64,"); |
536 QByteArray data = | 536 QByteArray data |
537 QByteArray::fromBase64(href_att.mid (prefix.length ()) | 537 = QByteArray::fromBase64 (href_att.mid (prefix.length ()).toLatin1 ()); |
538 .toLatin1 ()); | |
539 QImage img; | 538 QImage img; |
540 if (img.loadFromData (data, "PNG")) | 539 if (img.loadFromData (data, "PNG")) |
541 { | 540 { |
542 QRect pos(elt.attribute ("x").toInt (), | 541 QRect pos(elt.attribute ("x").toInt (), |
543 elt.attribute ("y").toInt (), | 542 elt.attribute ("y").toInt (), |
705 } | 704 } |
706 | 705 |
707 int main(int argc, char *argv[]) | 706 int main(int argc, char *argv[]) |
708 { | 707 { |
709 const char *doc = "See \"octave-svgconvert -h\""; | 708 const char *doc = "See \"octave-svgconvert -h\""; |
710 const char *help = | 709 const char *help = "Usage:\n\ |
711 "Usage:\n\ | |
712 octave-svgconvert infile fmt dpi font reconstruct outfile\n\n\ | 710 octave-svgconvert infile fmt dpi font reconstruct outfile\n\n\ |
713 Convert svg file to pdf, or svg. All arguments are mandatory:\n\ | 711 Convert svg file to pdf, or svg. All arguments are mandatory:\n\ |
714 * infile: input svg file or \"-\" to indicate that the input svg file should be \ | 712 * infile: input svg file or \"-\" to indicate that the input svg file should be \ |
715 read from stdin\n\ | 713 read from stdin\n\ |
716 * fmt: format of the output file. May be one of pdf or svg\n\ | 714 * fmt: format of the output file. May be one of pdf or svg\n\ |