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ACL,MAAM,IAAI3U,EAAW,0BAIrB,YAAAoU,QAAR,SAAgBlqB,EAAUoqB,EAAiBO,EAAWC,EAAWL,EAAcC,GAC3E,IAAMjL,EAAM,IAAIsL,EAAW7qB,GAC3Buf,EAAIG,eAAeiL,EAAGC,GACtBrL,EAAIK,iBAAiB2K,EAAMC,GAC3BjL,EAAIC,WAAW4K,GACfnR,EAAOvV,IAAI,iCACX/G,KAAK8tB,KAAKT,OAAOzK,GACjBtG,EAAOvV,IAAI,8BAEnB,EAvDA,GAyDA,aAII,WAAYsT,EAAcuD,GACtB5d,KAAKmuB,SAAWvQ,EAChB5d,KAAKwiB,SAAW,IAAI4L,EAAW/T,EAAQra,KAAKmuB,UAMpD,OAHW,YAAAd,OAAP,SAAczK,GACV5iB,KAAKwiB,SAASkD,KAAK9C,IAE3B,EAZA,G","sources":["webpack://rtfjs/webpack/universalModuleDefinition","webpack://rtfjs/webpack/bootstrap","webpack://rtfjs/webpack/runtime/define property getters","webpack://rtfjs/webpack/runtime/hasOwnProperty shorthand","webpack://rtfjs/webpack/runtime/make namespace object","webpack://rtfjs/./src/util/SVG.ts","webpack://rtfjs/./src/emfjs/Helper.ts","webpack://rtfjs/./src/emfjs/Blob.ts","webpack://rtfjs/./src/emfjs/Primitives.ts","webpack://rtfjs/./src/emfjs/Region.ts","webpack://rtfjs/./src/emfjs/Bitmap.ts","webpack://rtfjs/./src/emfjs/Style.ts","webpack://rtfjs/./src/emfjs/EMFRecords.ts","webpack://rtfjs/./src/emfjs/GDIContext.ts","webpack://rtfjs/./src/emfjs/Renderer.ts"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"EMFJS\"] = factory();\n\telse\n\t\troot[\"EMFJS\"] = factory();\n})(this, () => {\nreturn ","// The require scope\nvar __webpack_require__ = {};\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","/*\n\nThe MIT License (MIT)\n\nCopyright (c) 2020 Ynse Hoornenborg\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n*/\n\nexport class SVGFilters {\n\n public flood(filter: SVGFilterElement, resultId: string, color: string, opacity: number, _settings?: any): void {\n const floodElement = document.createElementNS(\"http://www.w3.org/2000/svg\", \"feFlood\");\n if (resultId) {\n floodElement.setAttribute(\"id\", resultId);\n }\n floodElement.setAttribute(\"flood-color\", color);\n floodElement.setAttribute(\"flood-opacity\", opacity.toString());\n filter.appendChild(floodElement);\n }\n\n public composite(filter: SVGFilterElement,\n resultId: string,\n in1: string,\n in2: string,\n k1?: number,\n k2?: number,\n k3?: number,\n k4?: number,\n _settings?: any): void {\n const compositeElement = document.createElementNS(\"http://www.w3.org/2000/svg\", \"feComposite\");\n if (resultId) {\n compositeElement.setAttribute(\"id\", resultId);\n }\n compositeElement.setAttribute(\"in\", in1);\n compositeElement.setAttribute(\"in2\", in2);\n filter.appendChild(compositeElement);\n }\n}\n\nexport class SVGPathBuilder {\n private _path = \"\";\n\n public move(x: number, y: number): void {\n this._path += ` M ${x} ${y}`;\n }\n\n public path(): string {\n return this._path.substr(1);\n }\n\n public line(pts: number[][]): void {\n pts.forEach((point) => {\n this._path += ` L ${point[0]} ${point[1]}`;\n });\n }\n\n public curveC(x1: number, y1: number, x2: number, y2: number, x: number, y: number): void {\n this._path += ` C ${x1} ${y1}, ${x2} ${y2}, ${x} ${y}`;\n }\n\n public close(): void {\n this._path += ` Z`;\n }\n}\n\nexport class SVG {\n public filters = new SVGFilters();\n private _svg: SVGElement;\n private _defs: SVGDefsElement | undefined = undefined;\n\n constructor(svg: SVGElement) {\n this._svg = svg;\n }\n\n public svg(parent: Element,\n x: number,\n y: number,\n width: number,\n height: number,\n settings?: any): SVGElement {\n const svgElement = document.createElementNS(\"http://www.w3.org/2000/svg\", \"svg\");\n svgElement.setAttribute(\"x\", x.toString());\n svgElement.setAttribute(\"y\", y.toString());\n svgElement.setAttribute(\"width\", width.toString());\n svgElement.setAttribute(\"height\", height.toString());\n this._appendSettings(settings, svgElement);\n\n if (parent != null) {\n parent.appendChild(svgElement);\n } else {\n this._svg.appendChild(svgElement);\n }\n\n return svgElement;\n }\n\n public image(parent: Element,\n x: number,\n y: number,\n width: number,\n height: number,\n url: string,\n settings?: any): SVGImageElement {\n const imageElement = document.createElementNS(\"http://www.w3.org/2000/svg\", \"image\");\n imageElement.setAttribute(\"x\", x.toString());\n imageElement.setAttribute(\"y\", y.toString());\n imageElement.setAttribute(\"width\", width.toString());\n imageElement.setAttribute(\"height\", height.toString());\n imageElement.setAttributeNS(\"http://www.w3.org/1999/xlink\", \"href\", url);\n this._appendSettings(settings, imageElement);\n parent.appendChild(imageElement);\n return imageElement;\n }\n\n public rect(parent: Element,\n x: number,\n y: number,\n width: number,\n height: number,\n rx?: number,\n ry?: number,\n settings?: any): SVGRectElement;\n public rect(parent: Element, x: number, y: number, width: number, height: number, settings?: any): SVGRectElement;\n public rect(parent: Element,\n x: number,\n y: number,\n width: number,\n height: number,\n rx?: number | any,\n ry?: number,\n settings?: any): SVGRectElement {\n const rectElement = document.createElementNS(\"http://www.w3.org/2000/svg\", \"rect\");\n rectElement.setAttribute(\"x\", x.toString());\n rectElement.setAttribute(\"y\", y.toString());\n rectElement.setAttribute(\"width\", width.toString());\n rectElement.setAttribute(\"height\", height.toString());\n if (rx !== undefined) {\n if (rx instanceof Number) {\n rectElement.setAttribute(\"rx\", rx.toString());\n } else if (rx instanceof Object) {\n this._appendSettings(rx, rectElement);\n }\n }\n if (ry !== undefined) {\n rectElement.setAttribute(\"ry\", ry.toString());\n }\n this._appendSettings(settings, rectElement);\n parent.appendChild(rectElement);\n return rectElement;\n }\n\n public line(parent: Element, x1: number, y1: number, x2: number, y2: number, settings?: any): SVGLineElement {\n const lineElement = document.createElementNS(\"http://www.w3.org/2000/svg\", \"line\");\n lineElement.setAttribute(\"x1\", x1.toString());\n lineElement.setAttribute(\"y1\", y1.toString());\n lineElement.setAttribute(\"x2\", x2.toString());\n lineElement.setAttribute(\"y2\", y2.toString());\n this._appendSettings(settings, lineElement);\n parent.appendChild(lineElement);\n return lineElement;\n }\n\n public polygon(parent: Element, points: number[][], settings?: any): SVGPolygonElement {\n const polygonElement = document.createElementNS(\"http://www.w3.org/2000/svg\", \"polygon\");\n polygonElement.setAttribute(\"points\", points.map((point) => point.join(\",\")).join(\" \"));\n this._appendSettings(settings, polygonElement);\n parent.appendChild(polygonElement);\n return polygonElement;\n }\n\n public polyline(parent: Element, points: number[][], settings?: any): SVGPolylineElement {\n const polylineElement = document.createElementNS(\"http://www.w3.org/2000/svg\", \"polyline\");\n polylineElement.setAttribute(\"points\", points.map((point) => point.join(\",\")).join(\" \"));\n this._appendSettings(settings, polylineElement);\n parent.appendChild(polylineElement);\n return polylineElement;\n }\n\n public ellipse(parent: Element, cx: number, cy: number, rx: number, ry: number, settings?: any): SVGEllipseElement {\n const ellipseElement = document.createElementNS(\"http://www.w3.org/2000/svg\", \"ellipse\");\n ellipseElement.setAttribute(\"cx\", cx.toString());\n ellipseElement.setAttribute(\"cy\", cy.toString());\n ellipseElement.setAttribute(\"rx\", rx.toString());\n ellipseElement.setAttribute(\"ry\", ry.toString());\n this._appendSettings(settings, ellipseElement);\n parent.appendChild(ellipseElement);\n return ellipseElement;\n }\n\n public path(parent: SVGElement, builder: SVGPathBuilder, settings?: any): SVGPathElement {\n const pathElement = document.createElementNS(\"http://www.w3.org/2000/svg\", \"path\");\n pathElement.setAttribute(\"d\", builder.path());\n this._appendSettings(settings, pathElement);\n parent.appendChild(pathElement);\n return pathElement;\n }\n\n public text(parent: Element, x: number, y: number, value: string, settings?: any): SVGTextElement {\n const textElement = document.createElementNS(\"http://www.w3.org/2000/svg\", \"text\");\n textElement.setAttribute(\"x\", x.toString());\n textElement.setAttribute(\"y\", y.toString());\n this._appendSettings(settings, textElement);\n const textNode = document.createTextNode(value);\n textElement.appendChild(textNode);\n parent.appendChild(textElement);\n return textElement;\n }\n\n public filter(parent: Element,\n id: string,\n x: number,\n y: number,\n width: number,\n height: number,\n settings?: any): SVGFilterElement {\n const filterElement = document.createElementNS(\"http://www.w3.org/2000/svg\", \"filter\");\n filterElement.setAttribute(\"x\", x.toString());\n filterElement.setAttribute(\"y\", y.toString());\n filterElement.setAttribute(\"width\", width.toString());\n filterElement.setAttribute(\"height\", height.toString());\n this._appendSettings(settings, filterElement);\n parent.appendChild(filterElement);\n return filterElement;\n }\n\n public pattern(parent: Element,\n resultId: string,\n x: number,\n y: number,\n width: number,\n height: number,\n settings?: any): SVGPatternElement {\n const patternElement = document.createElementNS(\"http://www.w3.org/2000/svg\", \"pattern\");\n if (resultId) {\n patternElement.setAttribute(\"id\", resultId);\n }\n patternElement.setAttribute(\"x\", x.toString());\n patternElement.setAttribute(\"y\", y.toString());\n patternElement.setAttribute(\"width\", width.toString());\n patternElement.setAttribute(\"height\", height.toString());\n this._appendSettings(settings, patternElement);\n parent.appendChild(patternElement);\n return patternElement;\n }\n\n public defs(): SVGDefsElement {\n if (this._defs === undefined) {\n const defsElement = document.createElementNS(\"http://www.w3.org/2000/svg\", \"defs\");\n this._svg.appendChild(defsElement);\n this._defs = defsElement;\n }\n return this._defs;\n }\n\n public clipPath(parent: Element, resultId: string, units?: string, settings?: any): SVGClipPathElement {\n const clipElement = document.createElementNS(\"http://www.w3.org/2000/svg\", \"clipPath\");\n if (resultId) {\n clipElement.setAttribute(\"id\", resultId);\n }\n if (units === undefined) {\n units = \"userSpaceOnUse\";\n }\n clipElement.setAttribute(\"clipPathUnits\", units);\n this._appendSettings(settings, clipElement);\n parent.appendChild(clipElement);\n return clipElement;\n }\n\n public createPath(): SVGPathBuilder {\n return new SVGPathBuilder();\n }\n\n private _appendSettings(settings: any | undefined, element: Element): void {\n if (settings !== undefined) {\n Object.keys(settings).forEach((key) => {\n element.setAttribute(key, settings[key]);\n });\n }\n }\n\n}\n","/*\n\nThe MIT License (MIT)\n\nCopyright (c) 2016 Tom Zoehner\nCopyright (c) 2018 Thomas Bluemel\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n*/\n\nexport class EMFJSError extends Error {\n constructor(message: string) {\n super(message); // 'Error' breaks prototype chain here\n Object.setPrototypeOf(this, new.target.prototype); // restore prototype chain\n }\n}\n\nlet isLoggingEnabled = true;\n\nexport function loggingEnabled(enabled: boolean): void {\n isLoggingEnabled = enabled;\n}\n\nexport class Helper {\n public static GDI = {\n FormatSignature: {\n ENHMETA_SIGNATURE: 0x464D4520,\n EPS_SIGNATURE: 0x46535045,\n },\n BITMAPINFOHEADER_SIZE: 40,\n BITMAPCOREHEADER_SIZE: 12,\n RecordType: {\n EMR_POLYBEZIER: 0x00000002,\n EMR_POLYGON: 0x00000003,\n EMR_POLYLINE: 0x00000004,\n EMR_POLYBEZIERTO: 0x00000005,\n EMR_POLYLINETO: 0x00000006,\n EMR_POLYPOLYLINE: 0x00000007,\n EMR_POLYPOLYGON: 0x00000008,\n EMR_SETWINDOWEXTEX: 0x00000009,\n EMR_SETWINDOWORGEX: 0x0000000A,\n EMR_SETVIEWPORTEXTEX: 0x0000000B,\n EMR_SETVIEWPORTORGEX: 0x0000000C,\n EMR_SETBRUSHORGEX: 0x0000000D,\n EMR_EOF: 0x0000000E,\n EMR_SETPIXELV: 0x0000000F,\n EMR_SETMAPPERFLAGS: 0x00000010,\n EMR_SETMAPMODE: 0x00000011,\n EMR_SETBKMODE: 0x00000012,\n EMR_SETPOLYFILLMODE: 0x00000013,\n EMR_SETROP2: 0x00000014,\n EMR_SETSTRETCHBLTMODE: 0x00000015,\n EMR_SETTEXTALIGN: 0x00000016,\n EMR_SETCOLORADJUSTMENT: 0x00000017,\n EMR_SETTEXTCOLOR: 0x00000018,\n EMR_SETBKCOLOR: 0x00000019,\n EMR_OFFSETCLIPRGN: 0x0000001A,\n EMR_MOVETOEX: 0x0000001B,\n EMR_SETMETARGN: 0x0000001C,\n EMR_EXCLUDECLIPRECT: 0x0000001D,\n EMR_INTERSECTCLIPRECT: 0x0000001E,\n EMR_SCALEVIEWPORTEXTEX: 0x0000001F,\n EMR_SCALEWINDOWEXTEX: 0x00000020,\n EMR_SAVEDC: 0x00000021,\n EMR_RESTOREDC: 0x00000022,\n EMR_SETWORLDTRANSFORM: 0x00000023,\n EMR_MODIFYWORLDTRANSFORM: 0x00000024,\n EMR_SELECTOBJECT: 0x00000025,\n EMR_CREATEPEN: 0x00000026,\n EMR_CREATEBRUSHINDIRECT: 0x00000027,\n EMR_DELETEOBJECT: 0x00000028,\n EMR_ANGLEARC: 0x00000029,\n EMR_ELLIPSE: 0x0000002A,\n EMR_RECTANGLE: 0x0000002B,\n EMR_ROUNDRECT: 0x0000002C,\n EMR_ARC: 0x0000002D,\n EMR_CHORD: 0x0000002E,\n EMR_PIE: 0x0000002F,\n EMR_SELECTPALETTE: 0x00000030,\n EMR_CREATEPALETTE: 0x00000031,\n EMR_SETPALETTEENTRIES: 0x00000032,\n EMR_RESIZEPALETTE: 0x00000033,\n EMR_REALIZEPALETTE: 0x00000034,\n EMR_EXTFLOODFILL: 0x00000035,\n EMR_LINETO: 0x00000036,\n EMR_ARCTO: 0x00000037,\n EMR_POLYDRAW: 0x00000038,\n EMR_SETARCDIRECTION: 0x00000039,\n EMR_SETMITERLIMIT: 0x0000003A,\n EMR_BEGINPATH: 0x0000003B,\n EMR_ENDPATH: 0x0000003C,\n EMR_CLOSEFIGURE: 0x0000003D,\n EMR_FILLPATH: 0x0000003E,\n EMR_STROKEANDFILLPATH: 0x0000003F,\n EMR_STROKEPATH: 0x00000040,\n EMR_FLATTENPATH: 0x00000041,\n EMR_WIDENPATH: 0x00000042,\n EMR_SELECTCLIPPATH: 0x00000043,\n EMR_ABORTPATH: 0x00000044,\n EMR_COMMENT: 0x00000046,\n EMR_FILLRGN: 0x00000047,\n EMR_FRAMERGN: 0x00000048,\n EMR_INVERTRGN: 0x00000049,\n EMR_PAINTRGN: 0x0000004A,\n EMR_EXTSELECTCLIPRGN: 0x0000004B,\n EMR_BITBLT: 0x0000004C,\n EMR_STRETCHBLT: 0x0000004D,\n EMR_MASKBLT: 0x0000004E,\n EMR_PLGBLT: 0x0000004F,\n EMR_SETDIBITSTODEVICE: 0x00000050,\n EMR_STRETCHDIBITS: 0x00000051,\n EMR_EXTCREATEFONTINDIRECTW: 0x00000052,\n EMR_EXTTEXTOUTA: 0x00000053,\n EMR_EXTTEXTOUTW: 0x00000054,\n EMR_POLYBEZIER16: 0x00000055,\n EMR_POLYGON16: 0x00000056,\n EMR_POLYLINE16: 0x00000057,\n EMR_POLYBEZIERTO16: 0x00000058,\n EMR_POLYLINETO16: 0x00000059,\n EMR_POLYPOLYLINE16: 0x0000005A,\n EMR_POLYPOLYGON16: 0x0000005B,\n EMR_POLYDRAW16: 0x0000005C,\n EMR_CREATEMONOBRUSH: 0x0000005D,\n EMR_CREATEDIBPATTERNBRUSHPT: 0x0000005E,\n EMR_EXTCREATEPEN: 0x0000005F,\n EMR_POLYTEXTOUTA: 0x00000060,\n EMR_POLYTEXTOUTW: 0x00000061,\n EMR_SETICMMODE: 0x00000062,\n EMR_CREATECOLORSPACE: 0x00000063,\n EMR_SETCOLORSPACE: 0x00000064,\n EMR_DELETECOLORSPACE: 0x00000065,\n EMR_GLSRECORD: 0x00000066,\n EMR_GLSBOUNDEDRECORD: 0x00000067,\n EMR_PIXELFORMAT: 0x00000068,\n EMR_DRAWESCAPE: 0x00000069,\n EMR_EXTESCAPE: 0x0000006A,\n EMR_SMALLTEXTOUT: 0x0000006C,\n EMR_FORCEUFIMAPPING: 0x0000006D,\n EMR_NAMEDESCAPE: 0x0000006E,\n EMR_COLORCORRECTPALETTE: 0x0000006F,\n EMR_SETICMPROFILEA: 0x00000070,\n EMR_SETICMPROFILEW: 0x00000071,\n EMR_ALPHABLEND: 0x00000072,\n EMR_SETLAYOUT: 0x00000073,\n EMR_TRANSPARENTBLT: 0x00000074,\n EMR_GRADIENTFILL: 0x00000076,\n EMR_SETLINKEDUFIS: 0x00000077,\n EMR_SETTEXTJUSTIFICATION: 0x00000078,\n EMR_COLORMATCHTOTARGETW: 0x00000079,\n EMR_CREATECOLORSPACEW: 0x0000007A,\n },\n MetafileEscapes: {\n NEWFRAME: 0x0001,\n ABORTDOC: 0x0002,\n NEXTBAND: 0x0003,\n SETCOLORTABLE: 0x0004,\n GETCOLORTABLE: 0x0005,\n FLUSHOUT: 0x0006,\n DRAFTMODE: 0x0007,\n QUERYESCSUPPORT: 0x0008,\n SETABORTPROC: 0x0009,\n STARTDOC: 0x000a,\n ENDDOC: 0x000b,\n GETPHYSPAGESIZE: 0x000c,\n GETPRINTINGOFFSET: 0x000d,\n GETSCALINGFACTOR: 0x000e,\n META_ESCAPE_ENHANCED_METAFILE: 0x000f,\n SETPENWIDTH: 0x0010,\n SETCOPYCOUNT: 0x0011,\n SETPAPERSOURCE: 0x0012,\n PASSTHROUGH: 0x0013,\n GETTECHNOLOGY: 0x0014,\n SETLINECAP: 0x0015,\n SETLINEJOIN: 0x0016,\n SETMITERLIMIT: 0x0017,\n BANDINFO: 0x0018,\n DRAWPATTERNRECT: 0x0019,\n GETVECTORPENSIZE: 0x001a,\n GETVECTORBRUSHSIZE: 0x001b,\n ENABLEDUPLEX: 0x001c,\n GETSETPAPERBINS: 0x001d,\n GETSETPRINTORIENT: 0x001e,\n ENUMPAPERBINS: 0x001f,\n SETDIBSCALING: 0x0020,\n EPSPRINTING: 0x0021,\n ENUMPAPERMETRICS: 0x0022,\n GETSETPAPERMETRICS: 0x0023,\n POSTSCRIPT_DATA: 0x0025,\n POSTSCRIPT_IGNORE: 0x0026,\n GETDEVICEUNITS: 0x002a,\n GETEXTENDEDTEXTMETRICS: 0x0100,\n GETPAIRKERNTABLE: 0x0102,\n EXTTEXTOUT: 0x0200,\n GETFACENAME: 0x0201,\n DOWNLOADFACE: 0x0202,\n METAFILE_DRIVER: 0x0801,\n QUERYDIBSUPPORT: 0x0c01,\n BEGIN_PATH: 0x1000,\n CLIP_TO_PATH: 0x1001,\n END_PATH: 0x1002,\n OPEN_CHANNEL: 0x100e,\n DOWNLOADHEADER: 0x100f,\n CLOSE_CHANNEL: 0x1010,\n POSTSCRIPT_PASSTHROUGH: 0x1013,\n ENCAPSULATED_POSTSCRIPT: 0x1014,\n POSTSCRIPT_IDENTIFY: 0x1015,\n POSTSCRIPT_INJECTION: 0x1016,\n CHECKJPEGFORMAT: 0x1017,\n CHECKPNGFORMAT: 0x1018,\n GET_PS_FEATURESETTING: 0x1019,\n MXDC_ESCAPE: 0x101a,\n SPCLPASSTHROUGH2: 0x11d8,\n },\n MapMode: {\n MM_TEXT: 1,\n MM_LOMETRIC: 2,\n MM_HIMETRIC: 3,\n MM_LOENGLISH: 4,\n MM_HIENGLISH: 5,\n MM_TWIPS: 6,\n MM_ISOTROPIC: 7,\n MM_ANISOTROPIC: 8,\n },\n StretchMode: {\n BLACKONWHITE: 1,\n WHITEONBLACK: 2,\n COLORONCOLOR: 3,\n HALFTONE: 4,\n },\n MixMode: {\n TRANSPARENT: 1,\n OPAQUE: 2,\n },\n BrushStyle: {\n BS_SOLID: 0,\n BS_NULL: 1,\n BS_HATCHED: 2,\n BS_PATTERN: 3,\n BS_INDEXED: 4,\n BS_DIBPATTERN: 5,\n BS_DIBPATTERNPT: 6,\n BS_PATTERN8X8: 7,\n BS_DIBPATTERN8X8: 8,\n BS_MONOPATTERN: 9,\n },\n PenStyle: {\n PS_COSMETIC: 0x00000000,\n PS_ENDCAP_ROUND: 0x00000000,\n PS_JOIN_ROUND: 0x00000000,\n PS_SOLID: 0x00000000,\n PS_DASH: 0x00000001,\n PS_DOT: 0x00000002,\n PS_DASHDOT: 0x00000003,\n PS_DASHDOTDOT: 0x00000004,\n PS_NULL: 0x00000005,\n PS_INSIDEFRAME: 0x00000006,\n PS_USERSTYLE: 0x00000007,\n PS_ALTERNATE: 0x00000008,\n PS_ENDCAP_SQUARE: 0x00000100,\n PS_ENDCAP_FLAT: 0x00000200,\n PS_JOIN_BEVEL: 0x00001000,\n PS_JOIN_MITER: 0x00002000,\n PS_GEOMETRIC: 0x00010000,\n },\n PolygonFillMode: {\n ALTERNATE: 1,\n WINDING: 2,\n },\n BitmapCompression: {\n BI_RGB: 0,\n BI_RLE8: 1,\n BI_RLE4: 2,\n BI_BITFIELDS: 3,\n BI_JPEG: 4,\n BI_PNG: 5,\n },\n RegionMode: {\n RGN_AND: 1,\n RGN_OR: 2,\n RGN_XOR: 3,\n RGN_DIFF: 4,\n RGN_COPY: 5,\n },\n StockObject: {\n WHITE_BRUSH: 0x80000000,\n LTGRAY_BRUSH: 0x80000001,\n GRAY_BRUSH: 0x80000002,\n DKGRAY_BRUSH: 0x80000003,\n BLACK_BRUSH: 0x80000004,\n NULL_BRUSH: 0x80000005,\n WHITE_PEN: 0x80000006,\n BLACK_PEN: 0x80000007,\n NULL_PEN: 0x80000008,\n OEM_FIXED_FONT: 0x8000000A,\n ANSI_FIXED_FONT: 0x8000000B,\n ANSI_VAR_FONT: 0x8000000C,\n SYSTEM_FONT: 0x8000000D,\n DEVICE_DEFAULT_FONT: 0x8000000E,\n DEFAULT_PALETTE: 0x8000000F,\n SYSTEM_FIXED_FONT: 0x80000010,\n DEFAULT_GUI_FONT: 0x80000011,\n DC_BRUSH: 0x80000012,\n DC_PEN: 0x80000013,\n },\n };\n\n public static _uniqueId = 0;\n\n public static log(message: string): void {\n if (isLoggingEnabled) {\n console.log(message);\n }\n }\n\n public static _makeUniqueId(prefix: string): string {\n return \"EMFJS_\" + prefix + (this._uniqueId++);\n }\n\n public static _writeUint32Val(uint8arr: Uint8Array, pos: number, val: number): void {\n uint8arr[pos++] = val & 0xff;\n uint8arr[pos++] = (val >>> 8) & 0xff;\n uint8arr[pos++] = (val >>> 16) & 0xff;\n uint8arr[pos++] = (val >>> 24) & 0xff;\n }\n\n public static _blobToBinary(blob: Uint8Array): string {\n let ret = \"\";\n const len = blob.length;\n for (let i = 0; i < len; i++) {\n ret += String.fromCharCode(blob[i]);\n }\n return ret;\n }\n}\n","/*\n\nThe MIT License (MIT)\n\nCopyright (c) 2016 Tom Zoehner\nCopyright (c) 2018 Thomas Bluemel\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n*/\n\nimport { EMFJSError } from \"./Helper\";\n\nexport class Blob {\n public pos: number;\n private blob: Blob | ArrayBuffer;\n private data: Uint8Array;\n\n constructor(blob: Blob | ArrayBuffer, offset?: number) {\n if (blob instanceof Blob) {\n this.blob = blob.blob;\n this.data = blob.data;\n this.pos = offset || blob.pos;\n } else {\n this.blob = blob;\n this.data = new Uint8Array(blob);\n this.pos = offset || 0;\n }\n }\n\n public eof(): boolean {\n return this.pos >= this.data.length;\n }\n\n public seek(newpos: number): void {\n if (newpos < 0 || newpos > this.data.length) {\n throw new EMFJSError(\"Invalid seek position\");\n }\n this.pos = newpos;\n }\n\n public skip(cnt: number): void {\n const newPos = this.pos + cnt;\n if (newPos > this.data.length) {\n throw new EMFJSError(\"Unexpected end of file\");\n }\n this.pos = newPos;\n }\n\n public readBinary(cnt: number): string {\n const end = this.pos + cnt;\n if (end > this.data.length) {\n throw new EMFJSError(\"Unexpected end of file\");\n }\n let ret = \"\";\n while (cnt-- > 0) {\n ret += String.fromCharCode(this.data[this.pos++]);\n }\n return ret;\n }\n\n public readInt8(): number {\n if (this.pos + 1 > this.data.length) {\n throw new EMFJSError(\"Unexpected end of file\");\n }\n return this.data[this.pos++];\n }\n\n public readUint8(): number {\n return this.readInt8() >>> 0;\n }\n\n public readInt32(): number {\n if (this.pos + 4 > this.data.length) {\n throw new EMFJSError(\"Unexpected end of file\");\n }\n let val = this.data[this.pos++];\n val |= this.data[this.pos++] << 8;\n val |= this.data[this.pos++] << 16;\n val |= this.data[this.pos++] << 24;\n return val;\n }\n\n public readUint32(): number {\n return this.readInt32() >>> 0;\n }\n\n public readUint16(): number {\n if (this.pos + 2 > this.data.length) {\n throw new EMFJSError(\"Unexpected end of file\");\n }\n let val = this.data[this.pos++];\n val |= this.data[this.pos++] << 8;\n return val;\n }\n\n public readInt16(): number {\n let val = this.readUint16();\n if (val > 32767) {\n val -= 65536;\n }\n return val;\n }\n\n public readString(length: number): string {\n if (this.pos + length > this.data.length) {\n throw new EMFJSError(\"Unexpected end of file\");\n }\n let ret = \"\";\n for (let i = 0; i < length; i++) {\n ret += String.fromCharCode(this.data[this.pos++] >>> 0);\n }\n return ret;\n }\n\n public readNullTermString(maxSize: number): string {\n let ret = \"\";\n if (maxSize > 0) {\n maxSize--;\n for (let i = 0; i < maxSize; i++) {\n if (this.pos + i + 1 > this.data.length) {\n throw new EMFJSError(\"Unexpected end of file\");\n }\n const byte = this.data[this.pos + i] >>> 0;\n if (byte === 0) {\n break;\n }\n ret += String.fromCharCode(byte);\n }\n }\n return ret;\n }\n\n public readFixedSizeUnicodeString(fixedSizeChars: number): string {\n let ret = \"\";\n for (let i = 0; i < fixedSizeChars; i++) {\n const charCode = this.readUint16();\n if (charCode === 0) {\n if (++i < fixedSizeChars) {\n this.skip((fixedSizeChars - i) * 2);\n }\n break;\n }\n ret += String.fromCharCode(charCode);\n }\n return ret;\n }\n}\n","/*\n\nThe MIT License (MIT)\n\nCopyright (c) 2016 Tom Zoehner\nCopyright (c) 2018 Thomas Bluemel\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n*/\n\nimport { Blob } from \"./Blob\";\nimport { EMFJSError } from \"./Helper\";\n\nexport class PointS {\n public x: number;\n public y: number;\n\n constructor(reader: Blob, x?: number, y?: number) {\n if (reader != null) {\n this.x = reader.readInt16();\n this.y = reader.readInt16();\n } else {\n this.x = x;\n this.y = y;\n }\n }\n\n public clone(): PointS {\n return new PointS(null, this.x, this.y);\n }\n\n public toString(): string {\n return \"{x: \" + this.x + \", y: \" + this.y + \"}\";\n }\n}\n\nexport class PointL {\n public x: number;\n public y: number;\n\n constructor(reader: Blob, x?: number, y?: number) {\n if (reader != null) {\n this.x = reader.readInt32();\n this.y = reader.readInt32();\n } else {\n this.x = x;\n this.y = y;\n }\n }\n\n public clone(): PointL {\n return new PointL(null, this.x, this.y);\n }\n\n public toString(): string {\n return \"{x: \" + this.x + \", y: \" + this.y + \"}\";\n }\n}\n\nexport class RectL {\n public left: number;\n public top: number;\n public right: number;\n public bottom: number;\n\n constructor(reader: Blob, left?: number, top?: number, right?: number, bottom?: number) {\n if (reader != null) {\n this.left = reader.readInt32();\n this.top = reader.readInt32();\n this.right = reader.readInt32();\n this.bottom = reader.readInt32();\n } else {\n this.bottom = bottom;\n this.right = right;\n this.top = top;\n this.left = left;\n }\n }\n\n public clone(): RectL {\n return new RectL(null, this.left, this.top, this.right, this.bottom);\n }\n\n public toString(): string {\n return \"{left: \" + this.left + \", top: \" + this.top + \", right: \" + this.right\n + \", bottom: \" + this.bottom + \"}\";\n }\n\n public empty(): boolean {\n return this.left >= this.right || this.top >= this.bottom;\n }\n\n public intersect(rectL: RectL): null | RectL {\n if (this.empty() || rectL.empty()) {\n return null;\n }\n if (this.left >= rectL.right || this.top >= rectL.bottom ||\n this.right <= rectL.left || this.bottom <= rectL.top) {\n return null;\n }\n return new RectL(null, Math.max(this.left, rectL.left), Math.max(this.top, rectL.top),\n Math.min(this.right, rectL.right), Math.min(this.bottom, rectL.bottom));\n }\n}\n\nexport class SizeL {\n public cx: number;\n public cy: number;\n\n constructor(reader: Blob, cx?: number, cy?: number) {\n if (reader != null) {\n this.cx = reader.readUint32();\n this.cy = reader.readUint32();\n } else {\n this.cx = cx;\n this.cy = cy;\n }\n }\n\n public clone(): SizeL {\n return new SizeL(null, this.cx, this.cy);\n }\n\n public toString(): string {\n return \"{cx: \" + this.cx + \", cy: \" + this.cy + \"}\";\n }\n}\n\nexport class Obj {\n public type: string;\n\n constructor(type: string) {\n this.type = type;\n }\n\n public clone(): Obj {\n throw new EMFJSError(\"clone not implemented\");\n }\n\n public toString(): string {\n throw new EMFJSError(\"toString not implemented\");\n }\n}\n","/*\n\nThe MIT License (MIT)\n\nCopyright (c) 2016 Tom Zoehner\nCopyright (c) 2018 Thomas Bluemel\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n*/\n\nimport { Blob } from \"./Blob\";\nimport { EMFJSError, Helper } from \"./Helper\";\nimport { Obj, RectL } from \"./Primitives\";\n\nexport class Region extends Obj {\n public bounds: RectL;\n public scans: Scan[];\n public complexity: number;\n\n constructor(reader: Blob, copy?: Region) {\n super(\"region\");\n if (reader != null) {\n const hdrSize = reader.readUint32();\n if (hdrSize !== 32) {\n throw new EMFJSError(\"Invalid region header\");\n }\n reader.skip(4);\n const rectCnt = reader.readUint32();\n const rgnSize = reader.readUint32();\n if (rectCnt * 16 !== rgnSize) {\n throw new EMFJSError(\"Invalid region data\");\n }\n\n this.bounds = new RectL(reader);\n this.scans = [];\n let scanLine;\n for (let i = 0; i < rectCnt; i++) {\n const r = new RectL(reader);\n if (!!scanLine || scanLine.top !== r.top || scanLine.bottom !== r.bottom) {\n scanLine = new Scan(r);\n this.scans.push(scanLine);\n } else {\n scanLine.append(r);\n }\n }\n this._updateComplexity();\n } else if (copy != null) {\n this.bounds = copy.bounds != null ? copy.bounds.clone() : null;\n if (copy.scans != null) {\n this.scans = [];\n for (let i = 0; i < copy.scans.length; i++) {\n this.scans.push(copy.scans[i].clone());\n }\n } else {\n this.scans = null;\n }\n this.complexity = copy.complexity;\n } else {\n this.bounds = null;\n this.scans = null;\n this.complexity = 0;\n }\n }\n\n public clone(): Region {\n return new Region(null, this);\n }\n\n public toString(): string {\n const _complexity = [\"null\", \"simple\", \"complex\"];\n return \"{complexity: \" + _complexity[this.complexity]\n + \" bounds: \" + (this.bounds != null ? this.bounds.toString() : \"[none]\")\n + \" #scans: \" + (this.scans != null ? this.scans.length : \"[none]\") + \"}\";\n }\n\n public _updateComplexity(): void {\n if (this.bounds == null) {\n this.complexity = 0;\n this.scans = null;\n } else if (this.bounds.empty()) {\n this.complexity = 0;\n this.scans = null;\n this.bounds = null;\n } else if (this.scans == null) {\n this.complexity = 1;\n } else {\n this.complexity = 2;\n if (this.scans.length === 1) {\n const scan = this.scans[0];\n if (scan.top === this.bounds.top && scan.bottom === this.bounds.bottom && scan.scanlines.length === 1) {\n const scanline = scan.scanlines[0];\n if (scanline.left === this.bounds.left && scanline.right === this.bounds.right) {\n this.scans = null;\n this.complexity = 1;\n }\n }\n }\n }\n }\n\n public subtract(rect: RectL): void {\n Helper.log(\"[emf] Region \" + this.toString() + \" subtract \" + rect.toString());\n\n if (this.bounds != null) {\n const isect = this.bounds.intersect(rect);\n if (isect != null) { // Only need to do anything if there is any chance of an overlap\n if (this.scans == null) {\n // We currently have a simple region and there is some kind of an overlap.\n // We need to create scanlines now. Simplest method is to fake one scan line\n // that equals the simple region and re-use the same logic as for complex regions\n this.scans = [];\n this.scans.push(new Scan(new RectL(null, this.bounds.left, this.bounds.top,\n this.bounds.right, this.bounds.bottom)));\n this.complexity = 2;\n }\n\n // We (now) have a complex region. First we skip any scans that are entirely above rect.top\n // The first scan that falls partially below rect.top needs to be split into two scans.\n let si = 0;\n while (si < this.scans.length) {\n const scan = this.scans[si];\n if (scan.bottom >= rect.top) {\n // We need to clone this scan into two so that we can subtract from the second one\n const cloned = scan.clone();\n scan.bottom = rect.top - 1;\n cloned.top = rect.top;\n if (scan.top >= scan.bottom) {\n this.scans[si] = cloned;\n } else {\n Helper.log(\"[emf] Region split top scan \" + si + \" for substraction\");\n this.scans.splice(++si, 0, cloned);\n }\n break;\n }\n si++;\n }\n\n // Now find the first one that falls at least partially below rect.bottom, which needs to be\n // split if it is only partially below rect.bottom\n const first = si;\n while (si < this.scans.length) {\n const scan = this.scans[si];\n if (scan.top > rect.bottom) {\n break;\n }\n if (scan.bottom > rect.bottom) {\n // We need to clone this scan into two so that we can subtract from the first one\n const cloned = scan.clone();\n scan.bottom = rect.bottom;\n cloned.top = rect.bottom + 1;\n if (scan.top >= scan.bottom) {\n this.scans[si] = cloned;\n } else {\n Helper.log(\"[emf] Region split bottom scan \" + si + \" for substraction\");\n this.scans.splice(++si, 0, cloned);\n }\n break;\n }\n si++;\n }\n\n // Now perform a subtraction on each scan in between rect.top and rect.bottom. Because we\n // cloned scans that partially overlapped rect.top and rect.bottom, we don't have to\n // account for this anymore.\n if (first < this.scans.length) {\n let last = si;\n si = first;\n while (si < last) {\n const scan = this.scans[si];\n if (!scan.subtract(rect.left, rect.right)) {\n Helper.log(\"[emf] Region remove now empty scan \" + si + \" due to subtraction\");\n this.scans.splice(si, 1);\n last--;\n continue;\n }\n\n si++;\n }\n }\n\n // Update bounds\n if (this.scans != null) {\n let left;\n let top;\n let right;\n let bottom;\n const len = this.scans.length;\n for (let i = 0; i < len; i++) {\n const scan = this.scans[i];\n if (i === 0) {\n top = scan.top;\n }\n if (i === len - 1) {\n bottom = scan.bottom;\n }\n\n const slen = scan.scanlines.length;\n if (slen > 0) {\n let scanline = scan.scanlines[0];\n if (left == null || scanline.left < left) {\n left = scanline.left;\n }\n scanline = scan.scanlines[slen - 1];\n if (right == null || scanline.right > right) {\n right = scanline.right;\n }\n }\n }\n\n if (left != null && top != null && right != null && bottom != null) {\n this.bounds = new RectL(null, left, top, right, bottom);\n this._updateComplexity();\n } else {\n // This has to be a null region now\n this.bounds = null;\n this.scans = null;\n this.complexity = 0;\n }\n } else {\n this._updateComplexity();\n }\n }\n }\n\n Helper.log(\"[emf] Region subtraction -> \" + this.toString());\n }\n\n public intersect(rect: RectL): void {\n Helper.log(\"[emf] Region \" + this.toString() + \" intersect with \" + rect.toString());\n if (this.bounds != null) {\n this.bounds = this.bounds.intersect(rect);\n if (this.bounds != null) {\n if (this.scans != null) {\n let si = 0;\n // Remove any scans that are entirely above the new bounds.top\n while (si < this.scans.length) {\n const scan = this.scans[si];\n if (scan.bottom < this.bounds.top) {\n si++;\n } else {\n break;\n }\n }\n if (si > 0) {\n Helper.log(\"[emf] Region remove \" + si + \" scans from top\");\n this.scans.splice(0, si);\n\n // Adjust the first scan's top to match the new bounds.top\n if (this.scans.length > 0) {\n this.scans[0].top = this.bounds.top;\n }\n }\n\n // Get rid of anything that falls outside the new bounds.left/bounds.right\n si = 0;\n while (si < this.scans.length) {\n const scan = this.scans[si];\n if (scan.top > this.bounds.bottom) {\n // Remove this and all remaining scans that fall entirely below the new bounds.bottom\n Helper.log(\"[emf] Region remove \" + (this.scans.length - si) + \" scans from bottom\");\n this.scans.splice(si, this.scans.length - si);\n break;\n }\n if (!scan.intersect(this.bounds.left, this.bounds.right)) {\n // Remove now empty scan\n Helper.log(\"[emf] Region remove now empty scan \" + si + \" due to intersection\");\n this.scans.splice(si, 1);\n continue;\n }\n si++;\n }\n\n // If there are any scans left, adjust the last one's bottom to the new bounds.bottom\n if (this.scans.length > 0) {\n this.scans[this.scans.length - 1].bottom = this.bounds.bottom;\n }\n\n this._updateComplexity();\n }\n } else {\n this.scans = null;\n this.complexity = 0;\n }\n }\n Helper.log(\"[emf] Region intersection -> \" + this.toString());\n }\n\n public offset(offX: number, offY: number): void {\n if (this.bounds != null) {\n this.bounds.left += offX;\n this.bounds.top += offY;\n this.bounds.right += offX;\n this.bounds.bottom += offY;\n }\n\n if (this.scans != null) {\n const slen = this.scans.length;\n for (let si = 0; si < slen; si++) {\n const scan = this.scans[si];\n scan.top += offY;\n scan.bottom += offY;\n\n const len = scan.scanlines.length;\n for (let i = 0; i < len; i++) {\n const scanline = scan.scanlines[i];\n scanline.left += offX;\n scanline.right += offX;\n }\n }\n }\n }\n}\n\nexport function CreateSimpleRegion(left: number, top: number, right: number, bottom: number): Region {\n const rgn = new Region(null, null);\n rgn.bounds = new RectL(null, left, top, right, bottom);\n rgn._updateComplexity();\n return rgn;\n}\n\nexport class Scan {\n public top: number;\n public bottom: number;\n public scanlines: { left: number, right: number }[];\n\n constructor(r: RectL, copy?: Scan) {\n if (r != null) {\n this.top = r.top;\n this.bottom = r.bottom;\n this.scanlines = [{left: r.left, right: r.right}];\n } else if (copy != null) {\n this.top = copy.top;\n this.bottom = copy.bottom;\n this.scanlines = [];\n for (let i = 0; i < copy.scanlines.length; i++) {\n const scanline = copy.scanlines[i];\n this.scanlines.push({left: scanline.left, right: scanline.right});\n }\n }\n }\n\n public clone(): Scan {\n return new Scan(null, this);\n }\n\n public append(r: RectL): void {\n this.scanlines.push({left: r.left, right: r.right});\n }\n\n public subtract(left: number, right: number): boolean {\n let i;\n\n // Keep everything on the left side\n i = 0;\n while (i < this.scanlines.length) {\n const scanline = this.scanlines[i];\n if (scanline.left <= left) {\n if (scanline.right >= left) {\n scanline.right = left - 1;\n if (scanline.left >= scanline.right) {\n this.scanlines.splice(i, 1);\n continue;\n }\n }\n i++;\n } else {\n break;\n }\n }\n\n // Find the first one that may exceed to the right side\n const first = i;\n let cnt = 0;\n while (i < this.scanlines.length) {\n const scanline = this.scanlines[i];\n if (scanline.right > right) {\n scanline.left = right;\n cnt = i - first;\n if (scanline.left >= scanline.right) {\n cnt++;\n }\n break;\n }\n i++;\n }\n\n // Delete everything we're subtracting\n if (cnt > 0 && first < this.scanlines.length) {\n this.scanlines.splice(first, cnt);\n }\n\n return this.scanlines.length > 0;\n }\n\n public intersect(left: number, right: number): boolean {\n // Get rid of anything that falls entirely outside to the left\n for (let i = 0; i < this.scanlines.length; i++) {\n const scanline = this.scanlines[i];\n if (scanline.left >= left || scanline.right >= left) {\n if (i > 0) {\n this.scanlines.splice(0, i);\n }\n break;\n }\n }\n\n if (this.scanlines.length > 0) {\n // Adjust the first to match the left, if needed\n let scanline = this.scanlines[0];\n if (scanline.left < left) {\n scanline.left = left;\n }\n\n // Get rid of anything that falls entirely outside to the right\n for (let i = 0; i < this.scanlines.length; i++) {\n scanline = this.scanlines[i];\n if (scanline.left > right) {\n this.scanlines.splice(i, this.scanlines.length - i);\n break;\n }\n }\n\n if (this.scanlines.length > 0) {\n // Adjust the last to match the right, if needed\n scanline = this.scanlines[this.scanlines.length - 1];\n if (scanline.right > right) {\n scanline.right = right;\n }\n }\n }\n return this.scanlines.length > 0;\n }\n}\n","/*\n\nThe MIT License (MIT)\n\nCopyright (c) 2016 Tom Zoehner\nCopyright (c) 2018 Thomas Bluemel\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n*/\n\nimport { Blob } from \"./Blob\";\nimport { Helper } from \"./Helper\";\n\ninterface Bitmap {\n getWidth(): number\n\n getHeight(): number\n}\n\nclass BitmapCoreHeader {\n public width: number;\n public height: number;\n public planes: number;\n public bitcount: number;\n\n constructor(reader: Blob, skipsize: boolean) {\n if (skipsize) {\n reader.skip(4);\n }\n this.width = reader.readUint16();\n this.height = reader.readUint16();\n this.planes = reader.readUint16();\n this.bitcount = reader.readUint16();\n }\n\n public colors(): number {\n return this.bitcount <= 8 ? 1 << this.bitcount : 0;\n }\n}\n\nclass BitmapInfoHeader {\n public width: number;\n public height: number;\n public planes: number;\n public bitcount: number;\n public compression: number;\n public sizeimage: number;\n public xpelspermeter: number;\n public ypelspermeter: number;\n public clrused: number;\n public clrimportant: number;\n\n constructor(reader: Blob, skipsize: boolean) {\n if (skipsize) {\n reader.skip(4);\n }\n this.width = reader.readInt32();\n this.height = reader.readInt32();\n this.planes = reader.readUint16();\n this.bitcount = reader.readUint16();\n this.compression = reader.readUint32();\n this.sizeimage = reader.readUint32();\n this.xpelspermeter = reader.readInt32();\n this.ypelspermeter = reader.readInt32();\n this.clrused = reader.readUint32();\n this.clrimportant = reader.readUint32();\n }\n\n public colors(): number {\n if (this.clrused !== 0) {\n return this.clrused < 256 ? this.clrused : 256;\n } else {\n return this.bitcount > 8 ? 0 : 1 << this.bitcount;\n }\n }\n}\n\nexport class BitmapInfo implements Bitmap {\n private _usergb: boolean;\n private _infosize: number;\n private _header: BitmapCoreHeader | BitmapInfoHeader;\n\n constructor(reader: Blob, usergb: boolean) {\n this._usergb = usergb;\n const hdrsize = reader.readUint32();\n this._infosize = hdrsize;\n if (hdrsize === Helper.GDI.BITMAPCOREHEADER_SIZE) {\n this._header = new BitmapCoreHeader(reader, false);\n this._infosize += this._header.colors() * (usergb ? 3 : 2);\n } else {\n this._header = new BitmapInfoHeader(reader, false);\n const masks = (this._header as BitmapInfoHeader).compression\n === Helper.GDI.BitmapCompression.BI_BITFIELDS ? 3 : 0;\n if (hdrsize <= Helper.GDI.BITMAPINFOHEADER_SIZE + (masks * 4)) {\n this._infosize = Helper.GDI.BITMAPINFOHEADER_SIZE + (masks * 4);\n }\n this._infosize += this._header.colors() * (usergb ? 4 : 2);\n }\n }\n\n public getWidth(): number {\n return this._header.width;\n }\n\n public getHeight(): number {\n return Math.abs(this._header.height);\n }\n\n public infosize(): number {\n return this._infosize;\n }\n\n public header(): BitmapCoreHeader | BitmapInfoHeader {\n return this._header;\n }\n}\n\nexport class DIBitmap implements Bitmap {\n private _reader: Blob;\n private _offset: number;\n private _location: any;\n private _info: BitmapInfo;\n\n constructor(reader: Blob, bitmapInfo?: any) {\n this._reader = reader;\n this._offset = reader.pos;\n this._location = bitmapInfo;\n this._info = new BitmapInfo(reader, true);\n }\n\n public getWidth(): number {\n return this._info.getWidth();\n }\n\n public getHeight(): number {\n return this._info.getHeight();\n }\n\n public totalSize(): number {\n return this._location.header.size + this._location.data.size;\n }\n\n public makeBitmapFileHeader(): string {\n const buf = new ArrayBuffer(14);\n const view = new Uint8Array(buf);\n view[0] = 0x42;\n view[1] = 0x4d;\n Helper._writeUint32Val(view, 2, this.totalSize() + 14);\n Helper._writeUint32Val(view, 10, this._info.infosize() + 14);\n return Helper._blobToBinary(view);\n }\n\n public base64ref(): string {\n const prevpos = this._reader.pos;\n this._reader.seek(this._offset);\n let mime = \"image/bmp\";\n const header = this._info.header();\n let data;\n if (header instanceof BitmapInfoHeader && header.compression != null) {\n switch (header.compression) {\n case Helper.GDI.BitmapCompression.BI_JPEG:\n mime = \"data:image/jpeg\";\n break;\n case Helper.GDI.BitmapCompression.BI_PNG:\n mime = \"data:image/png\";\n break;\n default:\n data = this.makeBitmapFileHeader();\n break;\n }\n } else {\n data = this.makeBitmapFileHeader();\n }\n\n this._reader.seek(this._location.header.offset);\n if (data != null) {\n data += this._reader.readBinary(this._location.header.size);\n } else {\n data = this._reader.readBinary(this._location.header.size);\n }\n\n this._reader.seek(this._location.data.offset);\n data += this._reader.readBinary(this._location.data.size);\n\n const ref = \"data:\" + mime + \";base64,\" + btoa(data);\n this._reader.seek(prevpos);\n return ref;\n }\n}\n","/*\n\nThe MIT License (MIT)\n\nCopyright (c) 2016 Tom Zoehner\nCopyright (c) 2018 Thomas Bluemel\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n*/\n\nimport { DIBitmap } from \"./Bitmap\";\nimport { Blob } from \"./Blob\";\nimport { Helper } from \"./Helper\";\nimport { Obj, PointL } from \"./Primitives\";\n\nexport class ColorRef {\n public r: number;\n public g: number;\n public b: number;\n\n constructor(reader: Blob, r?: number, g?: number, b?: number) {\n if (reader != null) {\n this.r = reader.readUint8();\n this.g = reader.readUint8();\n this.b = reader.readUint8();\n reader.skip(1);\n } else {\n this.r = r;\n this.g = g;\n this.b = b;\n }\n }\n\n public clone(): ColorRef {\n return new ColorRef(null, this.r, this.g, this.b);\n }\n\n public toHex(): string {\n const rgb = (this.r << 16) | (this.g << 8) | this.b;\n return (0x1000000 + rgb).toString(16).slice(1);\n }\n\n public toString(): string {\n return \"{r: \" + this.r + \", g: \" + this.g + \", b: \" + this.b + \"}\";\n }\n}\n\nexport class Font extends Obj {\n public height: number;\n public width: number;\n public escapement: number;\n public orientation: number;\n public weight: number;\n public italic: number;\n public underline: number;\n public strikeout: number;\n public charset: number;\n public outprecision: number;\n public clipprecision: number;\n public quality: number;\n public pitch: number;\n public family: number;\n public facename: string;\n\n constructor(reader: Blob, copy: Font | number) {\n super(\"font\");\n if (reader != null) {\n this.height = reader.readInt32();\n this.width = reader.readInt32();\n this.escapement = reader.readInt32();\n this.orientation = reader.readInt32();\n this.weight = reader.readInt32();\n this.italic = reader.readUint8();\n this.underline = reader.readUint8();\n this.strikeout = reader.readUint8();\n this.charset = reader.readUint8();\n this.outprecision = reader.readUint8();\n this.clipprecision = reader.readUint8();\n this.quality = reader.readUint8();\n const pitchAndFamily = reader.readUint8();\n this.pitch = pitchAndFamily & 0xf; // TODO: double check\n this.family = (pitchAndFamily >> 6) & 0x3; // TODO: double check\n\n const dataLength = copy as number;\n const start = reader.pos;\n this.facename = reader.readFixedSizeUnicodeString(Math.min(dataLength - (reader.pos - start), 32));\n } else if (copy != null) {\n copy = copy as Font;\n this.height = copy.height;\n this.width = copy.width;\n this.escapement = copy.escapement;\n this.orientation = copy.orientation;\n this.weight = copy.weight;\n this.italic = copy.italic;\n this.underline = copy.underline;\n this.strikeout = copy.strikeout;\n this.charset = copy.charset;\n this.outprecision = copy.outprecision;\n this.clipprecision = copy.clipprecision;\n this.quality = copy.quality;\n this.pitch = copy.pitch;\n this.family = copy.family;\n this.facename = copy.facename;\n } else {\n // TODO: Values for a default font?\n this.height = -80;\n this.width = 0;\n this.escapement = 0;\n this.orientation = 0;\n this.weight = 400;\n this.italic = 0;\n this.underline = 0;\n this.strikeout = 0;\n this.charset = 0;\n this.outprecision = 0;\n this.clipprecision = 0;\n this.quality = 0;\n this.pitch = 0;\n this.family = 0;\n this.facename = \"Helvetica\";\n }\n }\n\n public clone(): Font {\n return new Font(null, this);\n }\n\n public toString(): string {\n return JSON.stringify(this);\n }\n}\n\nexport class Brush extends Obj {\n public style: number;\n public color: ColorRef;\n public pattern: DIBitmap;\n public dibpatternpt: DIBitmap;\n public hatchstyle: number;\n\n constructor(reader: Blob, copy?: {\n style?: number, color?: ColorRef, pattern?: DIBitmap,\n dibpatternpt?: DIBitmap, hatchstyle?: number\n }) {\n super(\"brush\");\n if (reader != null) {\n const start = reader.pos;\n\n this.style = reader.readUint32();\n switch (this.style) {\n case Helper.GDI.BrushStyle.BS_SOLID:\n this.color = new ColorRef(reader);\n break;\n case Helper.GDI.BrushStyle.BS_PATTERN:\n this.pattern = new DIBitmap(reader);\n break;\n case Helper.GDI.BrushStyle.BS_DIBPATTERNPT:\n this.dibpatternpt = new DIBitmap(reader);\n break;\n case Helper.GDI.BrushStyle.BS_HATCHED:\n this.color = new ColorRef(reader);\n this.hatchstyle = reader.readUint32();\n break;\n }\n\n reader.seek(start + 12);\n } else {\n this.style = copy.style;\n switch (this.style) {\n case Helper.GDI.BrushStyle.BS_SOLID:\n this.color = copy.color.clone();\n break;\n case Helper.GDI.BrushStyle.BS_PATTERN:\n this.pattern = copy.pattern;\n break;\n case Helper.GDI.BrushStyle.BS_DIBPATTERNPT:\n this.dibpatternpt = copy.dibpatternpt;\n break;\n case Helper.GDI.BrushStyle.BS_HATCHED:\n this.color = copy.color.clone();\n this.hatchstyle = copy.hatchstyle;\n break;\n }\n }\n }\n\n public clone(): Brush {\n return new Brush(null, this);\n }\n\n public toString(): string {\n let ret = \"{style: \" + this.style;\n switch (this.style) {\n case Helper.GDI.BrushStyle.BS_SOLID:\n ret += \", color: \" + this.color.toString();\n break;\n case Helper.GDI.BrushStyle.BS_HATCHED:\n ret += \", color: \" + this.color.toString() + \", hatchstyle: \" + this.hatchstyle;\n break;\n }\n return ret + \"}\";\n }\n}\n\nexport class Pen extends Obj {\n public style: number | { header: { off: number, size: number }, data: { off: number, size: number } };\n public width: number;\n public brush: Brush;\n public color: ColorRef;\n\n constructor(reader: Blob, style?: number | { header: { off: number, size: number }, data: { off: number, size: number } },\n width?: number, color?: ColorRef, brush?: Brush) {\n super(\"pen\");\n if (reader != null) {\n if (style != null) {\n // LogPenEx\n this.style = reader.readUint32() & 0xFF;\n this.width = reader.readUint32();\n this.brush = new Brush(reader);\n this.color = this.brush.color != null ? this.brush.color.clone() : new ColorRef(null, 0, 0, 0);\n // TODO: NumStyleEntries, StyleEntry\n } else {\n // LogPen\n this.style = reader.readUint32() & 0xFF;\n this.width = (new PointL(reader)).x;\n this.color = new ColorRef(reader);\n }\n } else {\n this.style = style;\n this.width = width;\n if (color != null) {\n this.color = color;\n }\n if (brush != null) {\n this.brush = brush;\n }\n }\n }\n\n public clone(): Pen {\n return new Pen(null, this.style, this.width, this.color != null ? this.color.clone() : null,\n this.brush != null ? this.brush.clone() : null);\n }\n\n public toString(): string {\n return \"{style: \" + this.style + \", width: \" + this.width\n + \", color: \" + (this.color != null ? this.color.toString() : \"none\") + \"}\";\n }\n}\n","/*\n\nThe MIT License (MIT)\n\nCopyright (c) 2016 Tom Zoehner\nCopyright (c) 2018 Thomas Bluemel\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n*/\n\nimport { Blob } from \"./Blob\";\nimport { GDIContext } from \"./GDIContext\";\nimport { EMFJSError, Helper } from \"./Helper\";\nimport { PointL, PointS, RectL, SizeL } from \"./Primitives\";\nimport { Region } from \"./Region\";\nimport { Brush, ColorRef, Pen } from \"./Style\";\n\nclass EmfHeader {\n private size: number;\n private bounds: RectL;\n private frame: RectL;\n private nPalEntries: number;\n private refDevCx: number;\n private refDevCy: number;\n private refDevCxMm: number;\n private refDevCyMm: number;\n private description: string;\n private displayDevCxUm: number;\n private displayDevCyUm: number;\n\n constructor(reader: Blob, headerSize: number) {\n const recordStart = reader.pos - 8;\n\n this.size = headerSize;\n this.bounds = new RectL(reader);\n this.frame = new RectL(reader);\n if (reader.readUint32() !== Helper.GDI.FormatSignature.ENHMETA_SIGNATURE) {\n throw new EMFJSError(\"Invalid header signature\");\n }\n reader.skip(4); // version\n reader.skip(4); // bytes (size of metafile)\n reader.skip(4); // number of records\n reader.skip(2); // number of handles\n reader.skip(2); // reserved\n const descriptionLen = reader.readUint32();\n const descriptionOff = reader.readUint32();\n this.nPalEntries = reader.readUint32();\n this.refDevCx = reader.readUint32();\n this.refDevCy = reader.readUint32();\n this.refDevCxMm = reader.readUint32();\n this.refDevCyMm = reader.readUint32();\n\n let hdrSize = headerSize;\n if (descriptionLen > 0) {\n if (descriptionOff < 88) {\n throw new EMFJSError(\"Invalid header description offset\");\n }\n\n hdrSize = descriptionOff + (descriptionLen * 2);\n if (hdrSize > headerSize) {\n throw new EMFJSError(\"Invalid header description length\");\n }\n\n const prevPos = reader.pos;\n reader.seek(recordStart + descriptionOff);\n this.description = reader.readFixedSizeUnicodeString(descriptionLen);\n reader.seek(prevPos);\n } else {\n this.description = \"\";\n }\n\n if (hdrSize >= 100) {\n // We have a EmfMetafileHeaderExtension1 record\n const pixelFormatSize = reader.readUint32();\n const pixelFormatOff = reader.readUint32();\n const haveOpenGl = reader.readUint32();\n if (haveOpenGl !== 0) {\n throw new EMFJSError(\"OpenGL records are not yet supported\");\n }\n\n if (pixelFormatOff !== 0) {\n if (pixelFormatOff < 100 || pixelFormatOff < hdrSize) {\n throw new EMFJSError(\"Invalid pixel format offset\");\n }\n\n hdrSize = pixelFormatOff + pixelFormatSize;\n if (hdrSize > headerSize) {\n throw new EMFJSError(\"Invalid pixel format size\");\n }\n\n // TODO: read pixel format blob\n }\n\n if (hdrSize >= 108) {\n // We have a EmfMetafileHeaderExtension2 record\n this.displayDevCxUm = reader.readUint32(); // in micrometers\n this.displayDevCyUm = reader.readUint32(); // in micrometers\n }\n }\n }\n\n public toString(): string {\n return \"{bounds: \" + this.bounds.toString() + \", frame: \" + this.frame.toString()\n + \", description: \" + this.description + \"}\";\n }\n}\n\nexport class EMFRecords {\n private _records: ((gdi: GDIContext) => void)[];\n private _header: EmfHeader;\n\n constructor(reader: Blob, first: number) {\n this._records = [];\n\n this._header = new EmfHeader(reader, first);\n\n let all = false;\n let curpos = first;\n main_loop: while (!all) {\n reader.seek(curpos);\n const type = reader.readUint32();\n const size = reader.readUint32();\n if (size < 8) {\n throw new EMFJSError(\"Invalid record size\");\n }\n switch (type) {\n case Helper.GDI.RecordType.EMR_EOF:\n all = true;\n break main_loop;\n case Helper.GDI.RecordType.EMR_SETMAPMODE: {\n const mapMode = reader.readInt32();\n this._records.push((gdi) => {\n gdi.setMapMode(mapMode);\n });\n break;\n }\n case Helper.GDI.RecordType.EMR_SETWINDOWORGEX: {\n const x = reader.readInt32();\n const y = reader.readInt32();\n this._records.push((gdi) => {\n gdi.setWindowOrgEx(x, y);\n });\n break;\n }\n case Helper.GDI.RecordType.EMR_SETWINDOWEXTEX: {\n const x = reader.readUint32();\n const y = reader.readUint32();\n this._records.push((gdi) => {\n gdi.setWindowExtEx(x, y);\n });\n break;\n }\n case Helper.GDI.RecordType.EMR_SETVIEWPORTORGEX: {\n const x = reader.readInt32();\n const y = reader.readInt32();\n this._records.push((gdi) => {\n gdi.setViewportOrgEx(x, y);\n });\n break;\n }\n case Helper.GDI.RecordType.EMR_SETVIEWPORTEXTEX: {\n const x = reader.readUint32();\n const y = reader.readUint32();\n this._records.push((gdi) => {\n gdi.setViewportExtEx(x, y);\n });\n break;\n }\n case Helper.GDI.RecordType.EMR_SAVEDC: {\n this._records.push((gdi) => {\n gdi.saveDC();\n });\n break;\n }\n case Helper.GDI.RecordType.EMR_RESTOREDC: {\n const saved = reader.readInt32();\n this._records.push((gdi) => {\n gdi.restoreDC(saved);\n });\n break;\n }\n case Helper.GDI.RecordType.EMR_SETBKMODE: {\n const bkMode = reader.readUint32();\n this._records.push((gdi) => {\n gdi.setBkMode(bkMode);\n });\n break;\n }\n case Helper.GDI.RecordType.EMR_SETBKCOLOR: {\n const bkColor = new ColorRef(reader);\n this._records.push((gdi) => {\n gdi.setBkColor(bkColor);\n });\n break;\n }\n case Helper.GDI.RecordType.EMR_CREATEBRUSHINDIRECT: {\n const index = reader.readUint32();\n const brush = new Brush(reader);\n this._records.push((gdi) => {\n gdi.createBrush(index, brush);\n });\n break;\n }\n case Helper.GDI.RecordType.EMR_CREATEPEN: {\n const index = reader.readUint32();\n const pen = new Pen(reader, null);\n this._records.push((gdi) => {\n gdi.createPen(index, pen);\n });\n break;\n }\n case Helper.GDI.RecordType.EMR_EXTCREATEPEN: {\n const index = reader.readUint32();\n const offBmi = reader.readUint32();\n const cbBmi = reader.readUint32();\n const offBits = reader.readUint32();\n const cbBits = reader.readUint32();\n const pen = new Pen(reader, {\n header: {\n off: offBmi,\n size: cbBmi,\n },\n data: {\n off: offBits,\n size: cbBits,\n },\n });\n this._records.push((gdi) => {\n gdi.createPen(index, pen);\n });\n break;\n }\n case Helper.GDI.RecordType.EMR_SELECTOBJECT: {\n const idx = reader.readUint32();\n this._records.push((gdi) => {\n gdi.selectObject(idx, null);\n });\n break;\n }\n case Helper.GDI.RecordType.EMR_DELETEOBJECT: {\n const idx = reader.readUint32();\n this._records.push((gdi) => {\n gdi.deleteObject(idx);\n });\n break;\n }\n case Helper.GDI.RecordType.EMR_RECTANGLE: {\n const rect = new RectL(reader);\n this._records.push((gdi) => {\n gdi.rectangle(rect, 0, 0);\n });\n break;\n }\n case Helper.GDI.RecordType.EMR_ROUNDRECT: {\n const rect = new RectL(reader);\n const corner = new SizeL(reader);\n this._records.push((gdi) => {\n gdi.rectangle(rect, corner.cx, corner.cy);\n });\n break;\n }\n case Helper.GDI.RecordType.EMR_LINETO: {\n const x = reader.readInt32();\n const y = reader.readInt32();\n this._records.push((gdi) => {\n gdi.lineTo(x, y);\n });\n break;\n }\n case Helper.GDI.RecordType.EMR_MOVETOEX: {\n const x = reader.readInt32();\n const y = reader.readInt32();\n this._records.push((gdi) => {\n gdi.moveToEx(x, y);\n });\n break;\n }\n case Helper.GDI.RecordType.EMR_POLYGON:\n case Helper.GDI.RecordType.EMR_POLYGON16: {\n const isSmall = (type === Helper.GDI.RecordType.EMR_POLYGON16);\n const bounds = new RectL(reader);\n let cnt = reader.readUint32();\n const points: PointS[] | PointL[] = [];\n while (cnt > 0) {\n points.push(isSmall ? new PointS(reader) : new PointL(reader));\n cnt--;\n }\n this._records.push((gdi) => {\n gdi.polygon(points, bounds, true);\n });\n break;\n }\n case Helper.GDI.RecordType.EMR_POLYPOLYGON:\n case Helper.GDI.RecordType.EMR_POLYPOLYGON16: {\n const isSmall = (type === Helper.GDI.RecordType.EMR_POLYPOLYGON16);\n const bounds = new RectL(reader);\n const polyCnt = reader.readUint32();\n reader.skip(4); // count\n const polygonsPtCnts = [];\n for (let i = 0; i < polyCnt; i++) {\n polygonsPtCnts.push(reader.readUint32());\n }\n\n const polygons: PointS[][] | PointL[][] = [];\n for (let i = 0; i < polyCnt; i++) {\n const ptCnt = polygonsPtCnts[i];\n\n const p = [];\n for (let ip = 0; ip < ptCnt; ip++) {\n p.push(isSmall ? new PointS(reader) : new PointL(reader));\n }\n polygons.push(p);\n }\n this._records.push((gdi) => {\n gdi.polyPolygon(polygons, bounds);\n });\n break;\n }\n case Helper.GDI.RecordType.EMR_SETPOLYFILLMODE: {\n const polyfillmode = reader.readUint32();\n this._records.push((gdi) => {\n gdi.setPolyFillMode(polyfillmode);\n });\n break;\n }\n case Helper.GDI.RecordType.EMR_POLYLINE16:\n case Helper.GDI.RecordType.EMR_POLYLINETO16: {\n const isLineTo = (type === Helper.GDI.RecordType.EMR_POLYLINETO16);\n const bounds = new RectL(reader);\n let cnt = reader.readUint32();\n const points: PointS[] = [];\n while (cnt > 0) {\n points.push(new PointS(reader));\n cnt--;\n }\n this._records.push((gdi) => {\n gdi.polyline(isLineTo, points, bounds);\n });\n break;\n }\n case Helper.GDI.RecordType.EMR_POLYBEZIER:\n case Helper.GDI.RecordType.EMR_POLYBEZIERTO: {\n const isPolyBezierTo = (type === Helper.GDI.RecordType.EMR_POLYBEZIERTO);\n const bounds = new RectL(reader);\n let cnt = reader.readUint32();\n const points: PointL[] = [];\n while (cnt > 0) {\n points.push(new PointL(reader));\n cnt--;\n }\n this._records.push((gdi) => {\n gdi.polybezier(isPolyBezierTo, points, bounds);\n });\n break;\n }\n case Helper.GDI.RecordType.EMR_POLYBEZIER16: {\n const bounds = new RectL(reader);\n const start = new PointL(reader);\n let cnt = reader.readUint32();\n const points = [start];\n while (cnt > 0) {\n points.push(new PointS(reader));\n cnt--;\n }\n this._records.push((gdi) => {\n gdi.polybezier(false, points, bounds);\n });\n break;\n }\n case Helper.GDI.RecordType.EMR_POLYBEZIERTO16: {\n const bounds = new RectL(reader);\n let cnt = reader.readUint32();\n const points: PointS[] = [];\n while (cnt > 0) {\n points.push(new PointS(reader));\n cnt--;\n }\n this._records.push((gdi) => {\n gdi.polybezier(true, points, bounds);\n });\n break;\n }\n case Helper.GDI.RecordType.EMR_SETTEXTALIGN: {\n const textAlign = reader.readUint32();\n this._records.push((gdi) => {\n gdi.setTextAlign(textAlign);\n });\n break;\n }\n case Helper.GDI.RecordType.EMR_SETSTRETCHBLTMODE: {\n const stretchMode = reader.readUint32();\n this._records.push((gdi) => {\n gdi.setStretchBltMode(stretchMode);\n });\n break;\n }\n case Helper.GDI.RecordType.EMR_SETBRUSHORGEX: {\n const origin = new PointL(reader);\n this._records.push((gdi) => {\n gdi.setBrushOrgEx(origin);\n });\n break;\n }\n case Helper.GDI.RecordType.EMR_BEGINPATH: {\n this._records.push((gdi) => {\n gdi.beginPath();\n });\n break;\n }\n case Helper.GDI.RecordType.EMR_ENDPATH: {\n this._records.push((gdi) => {\n gdi.endPath();\n });\n break;\n }\n case Helper.GDI.RecordType.EMR_ABORTPATH: {\n this._records.push((gdi) => {\n gdi.abortPath();\n });\n break;\n }\n case Helper.GDI.RecordType.EMR_CLOSEFIGURE: {\n this._records.push((gdi) => {\n gdi.closeFigure();\n });\n break;\n }\n case Helper.GDI.RecordType.EMR_FILLPATH: {\n const bounds = new RectL(reader);\n this._records.push((gdi) => {\n gdi.fillPath(bounds);\n });\n break;\n }\n case Helper.GDI.RecordType.EMR_STROKEPATH: {\n const bounds = new RectL(reader);\n this._records.push((gdi) => {\n gdi.strokePath(bounds);\n });\n break;\n }\n case Helper.GDI.RecordType.EMR_SELECTCLIPPATH: {\n const rgnMode = reader.readUint32();\n this._records.push((gdi) => {\n gdi.selectClipPath(rgnMode);\n });\n break;\n }\n case Helper.GDI.RecordType.EMR_EXTSELECTCLIPRGN: {\n reader.skip(4);\n const rgnMode = reader.readUint32();\n const region = rgnMode !== Helper.GDI.RegionMode.RGN_COPY ? new Region(reader) : null;\n this._records.push((gdi) => {\n gdi.selectClipRgn(rgnMode, region);\n });\n break;\n }\n case Helper.GDI.RecordType.EMR_OFFSETCLIPRGN: {\n const offset = new PointL(reader);\n this._records.push((gdi) => {\n gdi.offsetClipRgn(offset);\n });\n break;\n }\n case Helper.GDI.RecordType.EMR_SETMITERLIMIT: {\n const miterLimit = reader.readUint32();\n this._records.push((gdi) => {\n gdi.setMiterLimit(miterLimit);\n });\n break;\n }\n case Helper.GDI.RecordType.EMR_POLYLINE:\n case Helper.GDI.RecordType.EMR_POLYLINETO:\n case Helper.GDI.RecordType.EMR_POLYPOLYLINE:\n case Helper.GDI.RecordType.EMR_SETPIXELV:\n case Helper.GDI.RecordType.EMR_SETMAPPERFLAGS:\n case Helper.GDI.RecordType.EMR_SETROP2:\n case Helper.GDI.RecordType.EMR_SETCOLORADJUSTMENT:\n case Helper.GDI.RecordType.EMR_SETTEXTCOLOR:\n case Helper.GDI.RecordType.EMR_SETMETARGN:\n case Helper.GDI.RecordType.EMR_EXCLUDECLIPRECT:\n case Helper.GDI.RecordType.EMR_INTERSECTCLIPRECT:\n case Helper.GDI.RecordType.EMR_SCALEVIEWPORTEXTEX:\n case Helper.GDI.RecordType.EMR_SCALEWINDOWEXTEX:\n case Helper.GDI.RecordType.EMR_SETWORLDTRANSFORM:\n case Helper.GDI.RecordType.EMR_MODIFYWORLDTRANSFORM:\n case Helper.GDI.RecordType.EMR_ANGLEARC:\n case Helper.GDI.RecordType.EMR_ELLIPSE:\n case Helper.GDI.RecordType.EMR_ARC:\n case Helper.GDI.RecordType.EMR_CHORD:\n case Helper.GDI.RecordType.EMR_PIE:\n case Helper.GDI.RecordType.EMR_SELECTPALETTE:\n case Helper.GDI.RecordType.EMR_CREATEPALETTE:\n case Helper.GDI.RecordType.EMR_SETPALETTEENTRIES:\n case Helper.GDI.RecordType.EMR_RESIZEPALETTE:\n case Helper.GDI.RecordType.EMR_REALIZEPALETTE:\n case Helper.GDI.RecordType.EMR_EXTFLOODFILL:\n case Helper.GDI.RecordType.EMR_ARCTO:\n case Helper.GDI.RecordType.EMR_POLYDRAW:\n case Helper.GDI.RecordType.EMR_SETARCDIRECTION:\n case Helper.GDI.RecordType.EMR_STROKEANDFILLPATH:\n case Helper.GDI.RecordType.EMR_FLATTENPATH:\n case Helper.GDI.RecordType.EMR_WIDENPATH:\n case Helper.GDI.RecordType.EMR_COMMENT:\n case Helper.GDI.RecordType.EMR_FILLRGN:\n case Helper.GDI.RecordType.EMR_FRAMERGN:\n case Helper.GDI.RecordType.EMR_INVERTRGN:\n case Helper.GDI.RecordType.EMR_PAINTRGN:\n case Helper.GDI.RecordType.EMR_BITBLT:\n case Helper.GDI.RecordType.EMR_STRETCHBLT:\n case Helper.GDI.RecordType.EMR_MASKBLT:\n case Helper.GDI.RecordType.EMR_PLGBLT:\n case Helper.GDI.RecordType.EMR_SETDIBITSTODEVICE:\n case Helper.GDI.RecordType.EMR_STRETCHDIBITS:\n case Helper.GDI.RecordType.EMR_EXTCREATEFONTINDIRECTW:\n case Helper.GDI.RecordType.EMR_EXTTEXTOUTA:\n case Helper.GDI.RecordType.EMR_EXTTEXTOUTW:\n case Helper.GDI.RecordType.EMR_POLYPOLYLINE16:\n case Helper.GDI.RecordType.EMR_POLYDRAW16:\n case Helper.GDI.RecordType.EMR_CREATEMONOBRUSH:\n case Helper.GDI.RecordType.EMR_CREATEDIBPATTERNBRUSHPT:\n case Helper.GDI.RecordType.EMR_POLYTEXTOUTA:\n case Helper.GDI.RecordType.EMR_POLYTEXTOUTW:\n case Helper.GDI.RecordType.EMR_SETICMMODE:\n case Helper.GDI.RecordType.EMR_CREATECOLORSPACE:\n case Helper.GDI.RecordType.EMR_SETCOLORSPACE:\n case Helper.GDI.RecordType.EMR_DELETECOLORSPACE:\n case Helper.GDI.RecordType.EMR_GLSRECORD:\n case Helper.GDI.RecordType.EMR_GLSBOUNDEDRECORD:\n case Helper.GDI.RecordType.EMR_PIXELFORMAT:\n case Helper.GDI.RecordType.EMR_DRAWESCAPE:\n case Helper.GDI.RecordType.EMR_EXTESCAPE:\n case Helper.GDI.RecordType.EMR_SMALLTEXTOUT:\n case Helper.GDI.RecordType.EMR_FORCEUFIMAPPING:\n case Helper.GDI.RecordType.EMR_NAMEDESCAPE:\n case Helper.GDI.RecordType.EMR_COLORCORRECTPALETTE:\n case Helper.GDI.RecordType.EMR_SETICMPROFILEA:\n case Helper.GDI.RecordType.EMR_SETICMPROFILEW:\n case Helper.GDI.RecordType.EMR_ALPHABLEND:\n case Helper.GDI.RecordType.EMR_SETLAYOUT:\n case Helper.GDI.RecordType.EMR_TRANSPARENTBLT:\n case Helper.GDI.RecordType.EMR_GRADIENTFILL:\n case Helper.GDI.RecordType.EMR_SETLINKEDUFIS:\n case Helper.GDI.RecordType.EMR_SETTEXTJUSTIFICATION:\n case Helper.GDI.RecordType.EMR_COLORMATCHTOTARGETW:\n case Helper.GDI.RecordType.EMR_CREATECOLORSPACEW:\n default: {\n let recordName = \"UNKNOWN\";\n for (const name in Helper.GDI.RecordType) {\n const recordTypes: any = Helper.GDI.RecordType;\n if (recordTypes[name] === type) {\n recordName = name;\n break;\n }\n }\n Helper.log(\"[EMF] \" + recordName + \" record (0x\" + type.toString(16) + \") at offset 0x\"\n + curpos.toString(16) + \" with \" + size + \" bytes\");\n break;\n }\n }\n\n curpos += size;\n }\n\n if (!all) {\n throw new EMFJSError(\"Could not read all records\");\n }\n }\n\n public play(gdi: GDIContext): void {\n const len = this._records.length;\n for (let i = 0; i < len; i++) {\n this._records[i](gdi);\n }\n }\n}\n","/*\n\nThe MIT License (MIT)\n\nCopyright (c) 2016 Tom Zoehner\nCopyright (c) 2018 Thomas Bluemel\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n*/\n\nimport { SVG } from \"../util\";\nimport { SVGPathBuilder } from \"../util/SVG\";\nimport { EMFJSError, Helper } from \"./Helper\";\nimport { Obj, PointL, PointS, RectL } from \"./Primitives\";\nimport { CreateSimpleRegion, Region } from \"./Region\";\nimport { Brush, ColorRef, Font, Pen } from \"./Style\";\n\ninterface ISelectedStyle {\n brush?: Brush;\n pen?: Pen;\n font?: Font;\n region?: Region;\n path?: Path;\n\n [key: string]: Obj | undefined;\n}\n\nclass Path extends Obj {\n public svgPath: SVGPathBuilder;\n\n constructor(svgPath: SVGPathBuilder, copy?: Path) {\n super(\"path\");\n if (svgPath != null) {\n this.svgPath = svgPath;\n } else {\n this.svgPath = copy.svgPath;\n }\n }\n\n public clone(): Path {\n return new Path(null, this);\n }\n\n public toString(): string {\n return \"{[path]}\";\n }\n}\n\nfunction createStockObjects(): { [key: string]: Obj } {\n // Create global stock objects\n const createSolidBrush = (r: number, g: number, b: number) => {\n return new Brush(null, {\n style: Helper.GDI.BrushStyle.BS_SOLID,\n color: new ColorRef(null, r, g, b),\n });\n };\n const createSolidPen = (r: number, g: number, b: number) => {\n return new Pen(null, Helper.GDI.PenStyle.PS_SOLID, 1, new ColorRef(null, r, g, b), null);\n };\n const stockObjs: { [key: string]: Obj } = {\n WHITE_BRUSH: createSolidBrush(255, 255, 255),\n LTGRAY_BRUSH: createSolidBrush(212, 208, 200),\n GRAY_BRUSH: createSolidBrush(128, 128, 128),\n DKGRAY_BRUSH: createSolidBrush(64, 64, 64),\n BLACK_BRUSH: createSolidBrush(0, 0, 0),\n NULL_BRUSH: new Brush(null, {\n style: Helper.GDI.BrushStyle.BS_NULL,\n }),\n WHITE_PEN: createSolidPen(255, 255, 255),\n BLACK_PEN: createSolidPen(0, 0, 0),\n NULL_PEN: new Pen(null, Helper.GDI.PenStyle.PS_NULL, 0, null, null),\n OEM_FIXED_FONT: null, // TODO\n ANSI_FIXED_FONT: null, // TODO\n ANSI_VAR_FONT: null, // TODO\n SYSTEM_FONT: null, // TODO\n DEVICE_DEFAULT_FONT: null, // TODO\n DEFAULT_PALETTE: null, // TODO\n SYSTEM_FIXED_FONT: null, // TODO\n DEFAULT_GUI_FONT: null, // TODO\n };\n\n const objs: { [key: string]: Obj } = {};\n for (const t in stockObjs) {\n const stockObjects: { [key: string]: number } = Helper.GDI.StockObject as { [key: string]: number };\n const idx = stockObjects[t] - 0x80000000;\n objs[idx.toString()] = stockObjs[t];\n }\n return objs;\n}\n\nconst _StockObjects = createStockObjects();\n\nclass GDIContextState {\n public _svggroup: SVGElement;\n public _svgclipChanged: boolean;\n public _svgtextbkfilter: SVGFilterElement;\n public mapmode: number;\n public stretchmode: number;\n public textalign: number;\n public bkmode: number;\n public textcolor: ColorRef;\n public bkcolor: ColorRef;\n public polyfillmode: number;\n public miterlimit: number;\n public wx: number;\n public wy: number;\n public ww: number;\n public wh: number;\n public vx: number;\n public vy: number;\n public vw: number;\n public vh: number;\n public x: number;\n public y: number;\n public nextbrx: number;\n public nextbry: number;\n public brx: number;\n public bry: number;\n public clip: Region;\n public ownclip: boolean;\n public selected: ISelectedStyle;\n\n constructor(copy: GDIContextState, defObjects?: ISelectedStyle) {\n if (copy != null) {\n this._svggroup = copy._svggroup;\n this._svgclipChanged = copy._svgclipChanged;\n this._svgtextbkfilter = copy._svgtextbkfilter;\n this.mapmode = copy.mapmode;\n this.stretchmode = copy.stretchmode;\n this.textalign = copy.textalign;\n this.bkmode = copy.bkmode;\n this.textcolor = copy.textcolor.clone();\n this.bkcolor = copy.bkcolor.clone();\n this.polyfillmode = copy.polyfillmode;\n this.miterlimit = copy.miterlimit;\n this.wx = copy.wx;\n this.wy = copy.wy;\n this.ww = copy.ww;\n this.wh = copy.wh;\n this.vx = copy.vx;\n this.vy = copy.vy;\n this.vw = copy.vw;\n this.vh = copy.vh;\n this.x = copy.x;\n this.y = copy.y;\n this.nextbrx = copy.nextbrx;\n this.nextbry = copy.nextbry;\n this.brx = copy.brx;\n this.bry = copy.bry;\n\n this.clip = copy.clip;\n this.ownclip = false;\n\n this.selected = {};\n for (const type in copy.selected) {\n this.selected[type] = copy.selected[type];\n }\n } else {\n this._svggroup = null;\n this._svgclipChanged = false;\n this._svgtextbkfilter = null;\n this.mapmode = Helper.GDI.MapMode.MM_ANISOTROPIC;\n this.stretchmode = Helper.GDI.StretchMode.COLORONCOLOR;\n this.textalign = 0; // TA_LEFT | TA_TOP | TA_NOUPDATECP\n this.bkmode = Helper.GDI.MixMode.OPAQUE;\n this.textcolor = new ColorRef(null, 0, 0, 0);\n this.bkcolor = new ColorRef(null, 255, 255, 255);\n this.polyfillmode = Helper.GDI.PolygonFillMode.ALTERNATE;\n this.miterlimit = 10;\n this.wx = 0;\n this.wy = 0;\n this.ww = 0;\n this.wh = 0;\n this.vx = 0;\n this.vy = 0;\n this.vw = 0;\n this.vh = 0;\n this.x = 0;\n this.y = 0;\n this.nextbrx = 0;\n this.nextbry = 0;\n this.brx = 0;\n this.bry = 0;\n\n this.clip = null;\n this.ownclip = false;\n\n this.selected = {};\n for (const type in defObjects) {\n const defObj = defObjects[type];\n this.selected[type] = defObj != null ? defObj.clone() : null;\n }\n }\n }\n}\n\nexport class GDIContext {\n private _svg: SVG;\n private _svgdefs: SVGDefsElement;\n private _svgPatterns: { [key: string]: Brush };\n private _svgClipPaths: { [key: string]: Region };\n private _svgPath: SVGPathBuilder;\n private defObjects: ISelectedStyle;\n private state: GDIContextState;\n private statestack: GDIContextState[];\n private objects: { [key: string]: Obj };\n\n constructor(svg: SVG) {\n this._svg = svg;\n this._svgdefs = null;\n this._svgPatterns = {};\n this._svgClipPaths = {};\n this._svgPath = null;\n\n this.defObjects = {\n brush: new Brush(null, {\n style: Helper.GDI.BrushStyle.BS_SOLID,\n color: new ColorRef(null, 0, 0, 0),\n }),\n pen: new Pen(null, Helper.GDI.PenStyle.PS_SOLID, 1, new ColorRef(null, 0, 0, 0), null),\n font: new Font(null, null),\n palette: null,\n region: null,\n };\n\n this.state = new GDIContextState(null, this.defObjects);\n this.statestack = [this.state];\n this.objects = {};\n }\n\n public setMapMode(mode: number): void {\n Helper.log(\"[gdi] setMapMode: mode=\" + mode);\n this.state.mapmode = mode;\n this.state._svggroup = null;\n }\n\n public setWindowOrgEx(x: number, y: number): void {\n Helper.log(\"[gdi] setWindowOrgEx: x=\" + x + \" y=\" + y);\n this.state.wx = x;\n this.state.wy = y;\n this.state._svggroup = null;\n }\n\n public setWindowExtEx(x: number, y: number): void {\n Helper.log(\"[gdi] setWindowExtEx: x=\" + x + \" y=\" + y);\n this.state.ww = x;\n this.state.wh = y;\n this.state._svggroup = null;\n }\n\n public setViewportOrgEx(x: number, y: number): void {\n Helper.log(\"[gdi] setViewportOrgEx: x=\" + x + \" y=\" + y);\n this.state.vx = x;\n this.state.vy = y;\n this.state._svggroup = null;\n }\n\n public setViewportExtEx(x: number, y: number): void {\n Helper.log(\"[gdi] setViewportExtEx: x=\" + x + \" y=\" + y);\n this.state.vw = x;\n this.state.vh = y;\n this.state._svggroup = null;\n }\n\n public setBrushOrgEx(origin: PointL): void {\n Helper.log(\"[gdi] setBrushOrgEx: x=\" + origin.x + \" y=\" + origin.y);\n this.state.nextbrx = origin.x;\n this.state.nextbry = origin.y;\n }\n\n public saveDC(): void {\n Helper.log(\"[gdi] saveDC\");\n const prevstate = this.state;\n this.state = new GDIContextState(this.state);\n this.statestack.push(prevstate);\n this.state._svggroup = null;\n }\n\n public restoreDC(saved: number): void {\n Helper.log(\"[gdi] restoreDC: saved=\" + saved);\n if (this.statestack.length > 1) {\n if (saved === -1) {\n this.state = this.statestack.pop();\n } else if (saved < -1) {\n throw new EMFJSError(\"restoreDC: relative restore not implemented\");\n } else if (saved > 1) {\n throw new EMFJSError(\"restoreDC: absolute restore not implemented\");\n }\n } else {\n throw new EMFJSError(\"No saved contexts\");\n }\n\n this.state._svggroup = null;\n }\n\n public setStretchBltMode(stretchMode: number): void {\n Helper.log(\"[gdi] setStretchBltMode: stretchMode=\" + stretchMode);\n }\n\n public rectangle(rect: RectL, rw: number, rh: number): void {\n Helper.log(\"[gdi] rectangle: rect=\" + rect.toString() + \" with pen \" + this.state.selected.pen.toString()\n + \" and brush \" + this.state.selected.brush.toString());\n const bottom = this._todevY(rect.bottom);\n const right = this._todevX(rect.right);\n const top = this._todevY(rect.top);\n const left = this._todevX(rect.left);\n rw = this._todevH(rw);\n rh = this._todevH(rh);\n Helper.log(\"[gdi] rectangle: TRANSLATED: bottom=\" + bottom + \" right=\" + right + \" top=\" + top\n + \" left=\" + left + \" rh=\" + rh + \" rw=\" + rw);\n this._pushGroup();\n\n const opts = this._applyOpts(null, true, true, false);\n this._svg.rect(this.state._svggroup, left, top, right - left, bottom - top, rw / 2, rh / 2, opts);\n }\n\n public lineTo(x: number, y: number): void {\n Helper.log(\"[gdi] lineTo: x=\" + x + \" y=\" + y + \" with pen \" + this.state.selected.pen.toString());\n const toX = this._todevX(x);\n const toY = this._todevY(y);\n const fromX = this._todevX(this.state.x);\n const fromY = this._todevY(this.state.y);\n\n // Update position\n this.state.x = x;\n this.state.y = y;\n\n Helper.log(\"[gdi] lineTo: TRANSLATED: toX=\" + toX + \" toY=\" + toY + \" fromX=\" + fromX + \" fromY=\" + fromY);\n this._pushGroup();\n\n const opts = this._applyOpts(null, true, false, false);\n this._svg.line(this.state._svggroup, fromX, fromY, toX, toY, opts);\n }\n\n public moveToEx(x: number, y: number): void {\n Helper.log(\"[gdi] moveToEx: x=\" + x + \" y=\" + y);\n this.state.x = x;\n this.state.y = y;\n if (this._svgPath != null) {\n this._svgPath.move(this.state.x, this.state.y);\n Helper.log(\"[gdi] new path: \" + this._svgPath.path());\n }\n }\n\n public polygon(points: PointS[] | PointL[], bounds: RectL, first: boolean): void {\n Helper.log(\"[gdi] polygon: points=\" + points + \" with pen \" + this.state.selected.pen.toString()\n + \" and brush \" + this.state.selected.brush.toString());\n const pts = [];\n for (let i = 0; i < points.length; i++) {\n const point = points[i];\n pts.push([this._todevX(point.x), this._todevY(point.y)]);\n }\n if (first) {\n this._pushGroup();\n }\n const opts = {\n \"fill-rule\": this.state.polyfillmode === Helper.GDI.PolygonFillMode.ALTERNATE ? \"evenodd\" : \"nonzero\",\n };\n this._applyOpts(opts, true, true, false);\n this._svg.polygon(this.state._svggroup, pts, opts);\n }\n\n public polyPolygon(polygons: PointS[][] | PointL[][], bounds: RectL): void {\n Helper.log(\"[gdi] polyPolygon: polygons.length=\" + polygons.length\n + \" with pen \" + this.state.selected.pen.toString() + \" and brush \" + this.state.selected.brush.toString());\n\n const cnt = polygons.length;\n for (let i = 0; i < cnt; i++) {\n this.polygon(polygons[i], bounds, i === 0);\n }\n }\n\n public polyline(isLineTo: boolean, points: PointS[], bounds: RectL): void {\n Helper.log(\"[gdi] polyline: isLineTo=\" + isLineTo.toString() + \", points=\" + points\n + \", bounds=\" + bounds.toString() + \" with pen \" + this.state.selected.pen.toString());\n const pts: number[][] = [];\n for (let i = 0; i < points.length; i++) {\n const point = points[i];\n pts.push([this._todevX(point.x), this._todevY(point.y)]);\n }\n\n if (this._svgPath != null) {\n if (!isLineTo || pts.length === 0) {\n this._svgPath.move(this._todevX(this.state.x), this._todevY(this.state.y));\n } else {\n const firstPts = pts[0];\n this._svgPath.move(firstPts[0], firstPts[1]);\n }\n this._svgPath.line(pts);\n Helper.log(\"[gdi] new path: \" + this._svgPath.path());\n } else {\n this._pushGroup();\n const opts = this._applyOpts(null, true, false, false);\n if (isLineTo && points.length > 0) {\n const firstPt = points[0];\n if (firstPt.x !== this.state.x || firstPt.y !== this.state.y) {\n pts.unshift([this._todevX(this.state.x), this._todevY(this.state.y)]);\n }\n }\n this._svg.polyline(this.state._svggroup, pts, opts);\n }\n\n if (points.length > 0) {\n const lastPt = points[points.length - 1];\n this.state.x = lastPt.x;\n this.state.y = lastPt.y;\n }\n }\n\n public polybezier(isPolyBezierTo: boolean, points: PointS[], bounds: RectL): void {\n Helper.log(\"[gdi] polybezier: isPolyBezierTo=\" + isPolyBezierTo.toString() + \", points=\" + points\n + \", bounds=\" + bounds.toString() + \" with pen \" + this.state.selected.pen.toString());\n const pts = [];\n for (let i = 0; i < points.length; i++) {\n const point = points[i];\n pts.push({x: this._todevX(point.x), y: this._todevY(point.y)});\n }\n\n if (this._svgPath != null) {\n if (isPolyBezierTo && pts.length > 0) {\n const firstPts = pts[0];\n this._svgPath.move(firstPts.x, firstPts.y);\n } else {\n this._svgPath.move(this._todevX(this.state.x), this._todevY(this.state.y));\n }\n\n if (pts.length < (isPolyBezierTo ? 3 : 4)) {\n throw new EMFJSError(\"Not enough points to draw bezier\");\n }\n\n for (let i = isPolyBezierTo ? 1 : 0; i + 3 <= pts.length; i += 3) {\n const cp1 = pts[i];\n const cp2 = pts[i + 1];\n const ep = pts[i + 2];\n this._svgPath.curveC(cp1.x, cp1.y, cp2.x, cp2.y, ep.x, ep.y);\n }\n\n Helper.log(\"[gdi] new path: \" + this._svgPath.path());\n } else {\n throw new EMFJSError(\"polybezier not implemented (not a path)\");\n }\n\n if (points.length > 0) {\n const lastPt = points[points.length - 1];\n this.state.x = lastPt.x;\n this.state.y = lastPt.y;\n }\n }\n\n public selectClipPath(rgnMode: number): void {\n Helper.log(\"[gdi] selectClipPath: rgnMode=0x\" + rgnMode.toString(16));\n }\n\n public selectClipRgn(rgnMode: number, region: Region): void {\n Helper.log(\"[gdi] selectClipRgn: rgnMode=0x\" + rgnMode.toString(16));\n if (rgnMode === Helper.GDI.RegionMode.RGN_COPY) {\n this.state.selected.region = region;\n this.state.clip = null;\n this.state.ownclip = false;\n } else {\n if (region == null) {\n throw new EMFJSError(\"No clip region to select\");\n }\n\n throw new EMFJSError(\"Not implemented: rgnMode=0x\" + rgnMode.toString(16));\n }\n this.state._svgclipChanged = true;\n }\n\n public offsetClipRgn(offset: PointL): void {\n Helper.log(\"[gdi] offsetClipRgn: offset=\" + offset.toString());\n this._getClipRgn().offset(offset.x, offset.y);\n }\n\n public setTextAlign(textAlignmentMode: number): void {\n Helper.log(\"[gdi] setTextAlign: textAlignmentMode=0x\" + textAlignmentMode.toString(16));\n this.state.textalign = textAlignmentMode;\n }\n\n public setMiterLimit(miterLimit: number): void {\n Helper.log(\"[gdi] setMiterLimit: miterLimit=\" + miterLimit);\n this.state.miterlimit = miterLimit;\n }\n\n public setBkMode(bkMode: number): void {\n Helper.log(\"[gdi] setBkMode: bkMode=0x\" + bkMode.toString(16));\n this.state.bkmode = bkMode;\n }\n\n public setBkColor(bkColor: ColorRef): void {\n Helper.log(\"[gdi] setBkColor: bkColor=\" + bkColor.toString());\n this.state.bkcolor = bkColor;\n this.state._svgtextbkfilter = null;\n }\n\n public setPolyFillMode(polyFillMode: number): void {\n Helper.log(\"[gdi] setPolyFillMode: polyFillMode=\" + polyFillMode);\n this.state.polyfillmode = polyFillMode;\n }\n\n public createBrush(index: number, brush: Brush): void {\n const idx = this._storeObject(brush, index);\n Helper.log(\"[gdi] createBrush: brush=\" + brush.toString() + \" with handle \" + idx);\n }\n\n public createPen(index: number, pen: Pen): void {\n const idx = this._storeObject(pen, index);\n Helper.log(\"[gdi] createPen: pen=\" + pen.toString() + \" width handle \" + idx);\n }\n\n public createPenEx(index: number, pen: Pen): void {\n const idx = this._storeObject(pen, index);\n Helper.log(\"[gdi] createPenEx: pen=\" + pen.toString() + \" width handle \" + idx);\n }\n\n public selectObject(objIdx: number, checkType: string): void {\n const obj = this._getObject(objIdx);\n if (obj != null && (checkType == null || obj.type === checkType)) {\n this._selectObject(obj);\n Helper.log(\"[gdi] selectObject: objIdx=\" + objIdx\n + (obj ? \" selected \" + obj.type + \": \" + obj.toString() : \"[invalid index]\"));\n } else {\n Helper.log(\"[gdi] selectObject: objIdx=\" + objIdx\n + (obj ? \" invalid object type: \" + obj.type : \"[invalid index]\"));\n }\n }\n\n public abortPath(): void {\n Helper.log(\"[gdi] abortPath\");\n if (this._svgPath != null) {\n this._svgPath = null;\n }\n }\n\n public beginPath(): void {\n Helper.log(\"[gdi] beginPath\");\n\n if (this._svgPath != null) {\n this._svgPath = null;\n }\n\n this._svgPath = this._svg.createPath();\n }\n\n public closeFigure(): void {\n Helper.log(\"[gdi] closeFigure\");\n if (this._svgPath == null) {\n throw new EMFJSError(\"No path bracket: cannot close figure\");\n }\n\n this._svgPath.close();\n }\n\n public fillPath(bounds: RectL): void {\n Helper.log(\"[gdi] fillPath\");\n if (this.state.selected.path == null) {\n throw new EMFJSError(\"No path selected\");\n }\n\n const selPath = this.state.selected.path;\n const opts = this._applyOpts(null, true, true, false);\n this._svg.path(this.state._svggroup, selPath.svgPath, opts);\n\n this._pushGroup();\n this.state.selected.path = null;\n }\n\n public strokePath(bounds: RectL): void {\n Helper.log(\"[gdi] strokePath\");\n if (this.state.selected.path == null) {\n throw new EMFJSError(\"No path selected\");\n }\n\n const selPath = this.state.selected.path;\n const opts = this._applyOpts({fill: \"none\"}, true, false, false);\n this._svg.path(this.state._svggroup, selPath.svgPath, opts);\n\n this._pushGroup();\n this.state.selected.path = null;\n }\n\n public endPath(): void {\n Helper.log(\"[gdi] endPath\");\n if (this._svgPath == null) {\n throw new EMFJSError(\"No path bracket: cannot end path\");\n }\n\n this._pushGroup();\n this._selectObject(new Path(this._svgPath));\n this._svgPath = null;\n }\n\n public deleteObject(objIdx: number): void {\n const ret = this._deleteObject(objIdx);\n Helper.log(\"[gdi] deleteObject: objIdx=\" + objIdx + (ret ? \" deleted object\" : \"[invalid index]\"));\n }\n\n private _pushGroup(): void {\n if (this.state._svggroup == null || this.state._svgclipChanged) {\n this.state._svgclipChanged = false;\n this.state._svgtextbkfilter = null;\n\n const settings: any = {\n viewBox: [this.state.vx, this.state.vy, this.state.vw, this.state.vh].join(\" \"),\n preserveAspectRatio: \"none\",\n };\n if (this.state.clip != null) {\n Helper.log(\"[gdi] new svg x=\" + this.state.vx + \" y=\" + this.state.vy + \" width=\" + this.state.vw\n + \" height=\" + this.state.vh + \" with clipping\");\n settings[\"clip-path\"] = \"url(#\" + this._getSvgClipPathForRegion(this.state.clip) + \")\";\n } else {\n Helper.log(\"[gdi] new svg x=\" + this.state.vx + \" y=\" + this.state.vy + \" width=\" + this.state.vw\n + \" height=\" + this.state.vh + \" without clipping\");\n }\n this.state._svggroup = this._svg.svg(this.state._svggroup,\n this.state.vx, this.state.vy, this.state.vw, this.state.vh, settings);\n }\n }\n\n private _getStockObject(idx: number) {\n if (idx >= 0x80000000 && idx <= 0x80000011) {\n return _StockObjects[(idx - 0x80000000).toString()];\n } else if (idx === Helper.GDI.StockObject.DC_BRUSH) {\n return this.state.selected.brush;\n } else if (idx === Helper.GDI.StockObject.DC_PEN) {\n return this.state.selected.pen;\n }\n return null;\n }\n\n private _storeObject(obj: Obj, idx: number) {\n if (!idx) {\n idx = 0;\n while (this.objects[idx.toString()] != null && idx <= 65535) {\n idx++;\n }\n if (idx > 65535) {\n Helper.log(\"[gdi] Too many objects!\");\n return -1;\n }\n }\n\n this.objects[idx.toString()] = obj;\n return idx;\n }\n\n private _getObject(objIdx: number) {\n let obj = this.objects[objIdx.toString()];\n if (obj == null) {\n obj = this._getStockObject(objIdx);\n if (obj == null) {\n Helper.log(\"[gdi] No object with handle \" + objIdx);\n }\n }\n return obj;\n }\n\n private _getSvgDef() {\n if (this._svgdefs == null) {\n this._svgdefs = this._svg.defs();\n }\n return this._svgdefs;\n }\n\n private _getSvgClipPathForRegion(region: Region) {\n for (const existingId in this._svgClipPaths) {\n const rgn = this._svgClipPaths[existingId];\n if (rgn === region) {\n return existingId;\n }\n }\n\n const id = Helper._makeUniqueId(\"c\");\n const sclip = this._svg.clipPath(this._getSvgDef(), id, \"userSpaceOnUse\");\n switch (region.complexity) {\n case 1:\n this._svg.rect(sclip,\n this._todevX(region.bounds.left),\n this._todevY(region.bounds.top),\n this._todevW(region.bounds.right - region.bounds.left),\n this._todevH(region.bounds.bottom - region.bounds.top),\n {\"fill\": \"black\", \"stroke-width\": 0});\n break;\n case 2:\n for (let i = 0; i < region.scans.length; i++) {\n const scan = region.scans[i];\n for (let j = 0; j < scan.scanlines.length; j++) {\n const scanline = scan.scanlines[j];\n this._svg.rect(sclip, this._todevX(scanline.left), this._todevY(scan.top),\n this._todevW(scanline.right - scanline.left), this._todevH(scan.bottom - scan.top),\n {\"fill\": \"black\", \"stroke-width\": 0});\n }\n }\n break;\n }\n this._svgClipPaths[id] = region;\n return id;\n }\n\n private _getSvgPatternForBrush(brush: Brush) {\n for (const existingId in this._svgPatterns) {\n const pat = this._svgPatterns[existingId];\n if (pat === brush) {\n return existingId;\n }\n }\n\n let width;\n let height;\n let img;\n switch (brush.style) {\n case Helper.GDI.BrushStyle.BS_PATTERN:\n width = brush.pattern.getWidth();\n height = brush.pattern.getHeight();\n break;\n case Helper.GDI.BrushStyle.BS_DIBPATTERNPT:\n width = brush.dibpatternpt.getWidth();\n height = brush.dibpatternpt.getHeight();\n img = brush.dibpatternpt.base64ref();\n break;\n default:\n throw new EMFJSError(\"Invalid brush style\");\n }\n\n const id = Helper._makeUniqueId(\"p\");\n const spat = this._svg.pattern(this._getSvgDef(), id, this.state.brx, this.state.bry, width, height,\n {patternUnits: \"userSpaceOnUse\"});\n this._svg.image(spat, 0, 0, width, height, img);\n this._svgPatterns[id] = brush;\n return id;\n }\n\n private _selectObject(obj: Obj) {\n this.state.selected[obj.type] = obj;\n switch (obj.type) {\n case \"region\":\n this.state._svgclipChanged = true;\n break;\n case \"brush\":\n this.state.brx = this.state.nextbrx;\n this.state.bry = this.state.nextbry;\n break;\n }\n }\n\n private _deleteObject(objIdx: number) {\n const obj = this.objects[objIdx.toString()];\n if (obj != null) {\n for (let i = 0; i < this.statestack.length; i++) {\n const state = this.statestack[i];\n if (state.selected[obj.type] === obj) {\n state.selected[obj.type] = this.defObjects[obj.type].clone();\n }\n }\n delete this.objects[objIdx.toString()];\n return true;\n }\n\n Helper.log(\"[gdi] Cannot delete object with invalid handle \" + objIdx);\n return false;\n }\n\n private _getClipRgn() {\n if (this.state.clip != null) {\n if (!this.state.ownclip) {\n this.state.clip = this.state.clip.clone();\n }\n } else {\n if (this.state.selected.region != null) {\n this.state.clip = this.state.selected.region.clone();\n } else {\n this.state.clip = CreateSimpleRegion(this.state.wx, this.state.wy, this.state.wx + this.state.ww,\n this.state.wy + this.state.wh);\n }\n }\n this.state.ownclip = true;\n return this.state.clip;\n }\n\n private _todevX(val: number) {\n // http://wvware.sourceforge.net/caolan/mapmode.html\n // logical -> device\n return Math.floor((val - this.state.wx) * (this.state.vw / this.state.ww)) + this.state.vx;\n }\n\n private _todevY(val: number) {\n // http://wvware.sourceforge.net/caolan/mapmode.html\n // logical -> device\n return Math.floor((val - this.state.wy) * (this.state.vh / this.state.wh)) + this.state.vy;\n }\n\n private _todevW(val: number) {\n // http://wvware.sourceforge.net/caolan/mapmode.html\n // logical -> device\n return Math.floor(val * (this.state.vw / this.state.ww)) + this.state.vx;\n }\n\n private _todevH(val: number) {\n // http://wvware.sourceforge.net/caolan/mapmode.html\n // logical -> device\n return Math.floor(val * (this.state.vh / this.state.wh)) + this.state.vy;\n }\n\n private _tologicalX(val: number) {\n // http://wvware.sourceforge.net/caolan/mapmode.html\n // logical -> device\n return Math.floor((val - this.state.vx) / (this.state.vw / this.state.ww)) + this.state.wx;\n }\n\n private _tologicalY(val: number) {\n // http://wvware.sourceforge.net/caolan/mapmode.html\n // logical -> device\n return Math.floor((val - this.state.vy) / (this.state.vh / this.state.wh)) + this.state.wy;\n }\n\n private _tologicalW(val: number) {\n // http://wvware.sourceforge.net/caolan/mapmode.html\n // logical -> device\n return Math.floor(val / (this.state.vw / this.state.ww)) + this.state.wx;\n }\n\n private _tologicalH(val: number) {\n // http://wvware.sourceforge.net/caolan/mapmode.html\n // logical -> device\n return Math.floor(val / (this.state.vh / this.state.wh)) + this.state.wy;\n }\n\n private _applyOpts(opts: any, usePen: boolean, useBrush: boolean, useFont: boolean) {\n if (opts == null) {\n opts = {};\n }\n if (usePen) {\n const pen = this.state.selected.pen;\n if (pen.style !== Helper.GDI.PenStyle.PS_NULL) {\n opts.stroke = \"#\" + pen.color.toHex(); // TODO: pen style\n opts[\"stroke-width\"] = pen.width;\n\n opts[\"stroke-miterlimit\"] = this.state.miterlimit;\n\n opts[\"stroke-linecap\"] = \"round\";\n const dotWidth = 1;\n\n opts[\"stroke-linejoin\"] = \"round\";\n\n const dashWidth = opts[\"stroke-width\"] * 4;\n const dotSpacing = opts[\"stroke-width\"] * 2;\n switch (pen.style) {\n case Helper.GDI.PenStyle.PS_DASH:\n opts[\"stroke-dasharray\"] = [dashWidth, dotSpacing].toString();\n break;\n case Helper.GDI.PenStyle.PS_DOT:\n opts[\"stroke-dasharray\"] = [dotWidth, dotSpacing].toString();\n break;\n case Helper.GDI.PenStyle.PS_DASHDOT:\n opts[\"stroke-dasharray\"] = [dashWidth, dotSpacing, dotWidth, dotSpacing].toString();\n break;\n case Helper.GDI.PenStyle.PS_DASHDOTDOT:\n opts[\"stroke-dasharray\"] =\n [dashWidth, dotSpacing, dotWidth, dotSpacing, dotWidth, dotSpacing].toString();\n break;\n }\n }\n }\n if (useBrush) {\n const brush = this.state.selected.brush;\n switch (brush.style) {\n case Helper.GDI.BrushStyle.BS_SOLID:\n opts.fill = \"#\" + brush.color.toHex();\n break;\n case Helper.GDI.BrushStyle.BS_PATTERN:\n case Helper.GDI.BrushStyle.BS_DIBPATTERNPT:\n opts.fill = \"url(#\" + this._getSvgPatternForBrush(brush) + \")\";\n break;\n case Helper.GDI.BrushStyle.BS_NULL:\n opts.fill = \"none\";\n break;\n default:\n Helper.log(\"[gdi] unsupported brush style: \" + brush.style);\n opts.fill = \"none\";\n break;\n }\n }\n if (useFont) {\n const font = this.state.selected.font;\n opts[\"font-family\"] = font.facename;\n opts[\"font-size\"] = Math.abs(font.height);\n opts.fill = \"#\" + this.state.textcolor.toHex();\n }\n return opts;\n }\n}\n","/*\n\nThe MIT License (MIT)\n\nCopyright (c) 2016 Tom Zoehner\nCopyright (c) 2018 Thomas Bluemel\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n*/\n\nimport { SVG } from \"../util\";\nimport { Blob } from \"./Blob\";\nimport { EMFRecords } from \"./EMFRecords\";\nimport { GDIContext } from \"./GDIContext\";\nimport { EMFJSError, Helper } from \"./Helper\";\n\nexport interface IRendererSettings {\n width: string;\n height: string;\n wExt: number;\n hExt: number;\n xExt: number;\n yExt: number;\n mapMode: number;\n}\n\nexport class Renderer {\n private _img: EMF;\n\n constructor(blob: ArrayBuffer) {\n this.parse(blob);\n Helper.log(\"EMFJS.Renderer instantiated\");\n }\n\n public render(info: IRendererSettings): SVGElement {\n const svgElement = document.createElementNS(\"http://www.w3.org/2000/svg\", \"svg\");\n\n this._render(\n new SVG(svgElement),\n info.mapMode,\n info.wExt,\n info.hExt,\n info.xExt,\n info.yExt);\n svgElement.setAttribute(\"viewBox\", [0, 0, info.xExt, info.yExt].join(\" \"));\n svgElement.setAttribute(\"preserveAspectRatio\", \"none\"); // TODO: MM_ISOTROPIC vs MM_ANISOTROPIC\n svgElement.setAttribute(\"width\", info.width);\n svgElement.setAttribute(\"height\", info.height);\n return svgElement;\n }\n\n private parse(blob: ArrayBuffer) {\n this._img = null;\n\n const reader = new Blob(blob);\n\n const type = reader.readUint32();\n if (type !== 0x00000001) {\n throw new EMFJSError(\"Not an EMF file\");\n }\n const size = reader.readUint32();\n if (size % 4 !== 0) {\n throw new EMFJSError(\"Not an EMF file\");\n }\n\n this._img = new EMF(reader, size);\n\n if (this._img == null) {\n throw new EMFJSError(\"Format not recognized\");\n }\n }\n\n private _render(svg: SVG, mapMode: number, w: number, h: number, xExt: number, yExt: number) {\n const gdi = new GDIContext(svg);\n gdi.setWindowExtEx(w, h);\n gdi.setViewportExtEx(xExt, yExt);\n gdi.setMapMode(mapMode);\n Helper.log(\"[EMF] BEGIN RENDERING --->\");\n this._img.render(gdi);\n Helper.log(\"[EMF] <--- DONE RENDERING\");\n }\n}\n\nclass EMF {\n private _hdrsize: number;\n private _records: EMFRecords;\n\n constructor(reader: Blob, hdrsize: number) {\n this._hdrsize = hdrsize;\n this._records = new EMFRecords(reader, this._hdrsize);\n }\n\n public render(gdi: GDIContext): void {\n this._records.play(gdi);\n }\n}\n"],"names":["root","factory","exports","module","define","amd","this","__webpack_require__","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","flood","filter","resultId","color","opacity","_settings","floodElement","document","createElementNS","setAttribute","toString","appendChild","composite","in1","in2","k1","k2","k3","k4","compositeElement","_path","move","x","y","path","substr","line","pts","forEach","point","curveC","x1","y1","x2","y2","close","svg","filters","SVGFilters","_defs","undefined","_svg","parent","width","height","settings","svgElement","_appendSettings","image","url","imageElement","setAttributeNS","rect","rx","ry","rectElement","Number","lineElement","polygon","points","polygonElement","map","join","polyline","polylineElement","ellipse","cx","cy","ellipseElement","builder","pathElement","text","textElement","textNode","createTextNode","id","filterElement","pattern","patternElement","defs","defsElement","clipPath","units","clipElement","createPath","SVGPathBuilder","element","keys","message","setPrototypeOf","Error","isLoggingEnabled","loggingEnabled","enabled","log","console","_makeUniqueId","prefix","_uniqueId","_writeUint32Val","uint8arr","pos","val","_blobToBinary","blob","ret","len","length","i","String","fromCharCode","GDI","FormatSignature","ENHMETA_SIGNATURE","EPS_SIGNATURE","BITMAPINFOHEADER_SIZE","BITMAPCOREHEADER_SIZE","RecordType","EMR_POLYBEZIER","EMR_POLYGON","EMR_POLYLINE","EMR_POLYBEZIERTO","EMR_POLYLINETO","EMR_POLYPOLYLINE","EMR_POLYPOLYGON","EMR_SETWINDOWEXTEX","EMR_SETWINDOWORGEX","EMR_SETVIEWPORTEXTEX","EMR_SETVIEWPORTORGEX","EMR_SETBRUSHORGEX","EMR_EOF","EMR_SETPIXELV","EMR_SETMAPPERFLAGS","EMR_SETMAPMODE","EMR_SETBKMODE","EMR_SETPOLYFILLMODE","EMR_SETROP2","EMR_SETSTRETCHBLTMODE","EMR_SETTEXTALIGN","EMR_SETCOLORADJUSTMENT","EMR_SETTEXTCOLOR","EMR_SETBKCOLOR","EMR_OFFSETCLIPRGN","EMR_MOVETOEX","EMR_SETMETARGN","EMR_EXCLUDECLIPRECT","EMR_INTERSECTCLIPRECT","EMR_SCALEVIEWPORTEXTEX","EMR_SCALEWINDOWEXTEX","EMR_SAVEDC","EMR_RESTOREDC","EMR_SETWORLDTRANSFORM","EMR_MODIFYWORLDTRANSFORM","EMR_SELECTOBJECT","EMR_CREATEPEN","EMR_CREATEBRUSHINDIRECT","EMR_DELETEOBJECT","EMR_ANGLEARC","EMR_ELLIPSE","EMR_RECTANGLE","EMR_ROUNDRECT","EMR_ARC","EMR_CHORD","EMR_PIE","EMR_SELECTPALETTE","EMR_CREATEPALETTE","EMR_SETPALETTEENTRIES","EMR_RESIZEPALETTE","EMR_REALIZEPALETTE","EMR_EXTFLOODFILL","EMR_LINETO","EMR_ARCTO","EMR_POLYDRAW","EMR_SETARCDIRECTION","EMR_SETMITERLIMIT","EMR_BEGINPATH","EMR_ENDPATH","EMR_CLOSEFIGURE","EMR_FILLPATH","EMR_STROKEANDFILLPATH","EMR_STROKEPATH","EMR_FLATTENPATH","EMR_WIDENPATH","EMR_SELECTCLIPPATH","EMR_ABORTPATH","EMR_COMMENT","EMR_FILLRGN","EMR_FRAMERGN","EMR_INVERTRGN","EMR_PAINTRGN","EMR_EXTSELECTCLIPRGN","EMR_BITBLT","EMR_STRETCHBLT","EMR_MASKBLT","EMR_PLGBLT","EMR_SETDIBITSTODEVICE","EMR_STRETCHDIBITS","EMR_EXTCREATEFONTINDIRECTW","EMR_EXTTEXTOUTA","EMR_EXTTEXTOUTW","EMR_POLYBEZIER16","EMR_POLYGON16","EMR_POLYLINE16","EMR_POLYBEZIERTO16","EMR_POLYLINETO16","EMR_POLYPOLYLINE16","EMR_POLYPOLYGON16","EMR_POLYDRAW16","EMR_CREATEMONOBRUSH","EMR_CREATEDIBPATTERNBRUSHPT","EMR_EXTCREATEPEN","EMR_POLYTEXTOUTA","EMR_POLYTEXTOUTW","EMR_SETICMMODE","EMR_CREATECOLORSPACE","EMR_SETCOLORSPACE","EMR_DELETECOLORSPACE","EMR_GLSRECORD","EMR_GLSBOUNDEDRECORD","EMR_PIXELFORMAT","EMR_DRAWESCAPE","EMR_EXTESCAPE","EMR_SMALLTEXTOUT","EMR_FORCEUFIMAPPING","EMR_NAMEDESCAPE","EMR_COLORCORRECTPALETTE","EMR_SETICMPROFILEA","EMR_SETICMPROFILEW","EMR_ALPHABLEND","EMR_SETLAYOUT","EMR_TRANSPARENTBLT","EMR_GRADIENTFILL","EMR_SETLINKEDUFIS","EMR_SETTEXTJUSTIFICATION","EMR_COLORMATCHTOTARGETW","EMR_CREATECOLORSPACEW","MetafileEscapes","NEWFRAME","ABORTDOC","NEXTBAND","SETCOLORTABLE","GETCOLORTABLE","FLUSHOUT","DRAFTMODE","QUERYESCSUPPORT","SETABORTPROC","STARTDOC","ENDDOC","GETPHYSPAGESIZE","GETPRINTINGOFFSET","GETSCALINGFACTOR","META_ESCAPE_ENHANCED_METAFILE","SETPENWIDTH","SETCOPYCOUNT","SETPAPERSOURCE","PASSTHROUGH","GETTECHNOLOGY","SETLINECAP","SETLINEJOIN","SETMITERLIMIT","BANDINFO","DRAWPATTERNRECT","GETVECTORPENSIZE","GETVECTORBRUSHSIZE","ENABLEDUPLEX","GETSETPAPERBINS","GETSETPRINTORIENT","ENUMPAPERBINS","SETDIBSCALING","EPSPRINTING","ENUMPAPERMETRICS","GETSETPAPERMETRICS","POSTSCRIPT_DATA","POSTSCRIPT_IGNORE","GETDEVICEUNITS","GETEXTENDEDTEXTMETRICS","GETPAIRKERNTABLE","EXTTEXTOUT","GETFACENAME","DOWNLOADFACE","METAFILE_DRIVER","QUERYDIBSUPPORT","BEGIN_PATH","CLIP_TO_PATH","END_PATH","OPEN_CHANNEL","DOWNLOADHEADER","CLOSE_CHANNEL","POSTSCRIPT_PASSTHROUGH","ENCAPSULATED_POSTSCRIPT","POSTSCRIPT_IDENTIFY","POSTSCRIPT_INJECTION","CHECKJPEGFORMAT","CHECKPNGFORMAT","GET_PS_FEATURESETTING","MXDC_ESCAPE","SPCLPASSTHROUGH2","MapMode","MM_TEXT","MM_LOMETRIC","MM_HIMETRIC","MM_LOENGLISH","MM_HIENGLISH","MM_TWIPS","MM_ISOTROPIC","MM_ANISOTROPIC","StretchMode","BLACKONWHITE","WHITEONBLACK","COLORONCOLOR","HALFTONE","MixMode","TRANSPARENT","OPAQUE","BrushStyle","BS_SOLID","BS_NULL","BS_HATCHED","BS_PATTERN","BS_INDEXED","BS_DIBPATTERN","BS_DIBPATTERNPT","BS_PATTERN8X8","BS_DIBPATTERN8X8","BS_MONOPATTERN","PenStyle","PS_COSMETIC","PS_ENDCAP_ROUND","PS_JOIN_ROUND","PS_SOLID","PS_DASH","PS_DOT","PS_DASHDOT","PS_DASHDOTDOT","PS_NULL","PS_INSIDEFRAME","PS_USERSTYLE","PS_ALTERNATE","PS_ENDCAP_SQUARE","PS_ENDCAP_FLAT","PS_JOIN_BEVEL","PS_JOIN_MITER","PS_GEOMETRIC","PolygonFillMode","ALTERNATE","WINDING","BitmapCompression","BI_RGB","BI_RLE8","BI_RLE4","BI_BITFIELDS","BI_JPEG","BI_PNG","RegionMode","RGN_AND","RGN_OR","RGN_XOR","RGN_DIFF","RGN_COPY","StockObject","WHITE_BRUSH","LTGRAY_BRUSH","GRAY_BRUSH","DKGRAY_BRUSH","BLACK_BRUSH","NULL_BRUSH","WHITE_PEN","BLACK_PEN","NULL_PEN","OEM_FIXED_FONT","ANSI_FIXED_FONT","ANSI_VAR_FONT","SYSTEM_FONT","DEVICE_DEFAULT_FONT","DEFAULT_PALETTE","SYSTEM_FIXED_FONT","DEFAULT_GUI_FONT","DC_BRUSH","DC_PEN","offset","Blob","data","Uint8Array","eof","seek","newpos","EMFJSError","skip","cnt","newPos","readBinary","readInt8","readUint8","readInt32","readUint32","readUint16","readInt16","readString","readNullTermString","maxSize","byte","readFixedSizeUnicodeString","fixedSizeChars","charCode","reader","clone","PointS","PointL","left","top","right","bottom","RectL","empty","intersect","rectL","Math","max","min","SizeL","type","copy","rectCnt","bounds","scans","scanLine","r","Scan","push","append","_updateComplexity","complexity","Region","scan","scanlines","scanline","subtract","Helper","si","cloned","splice","first","last","slen","offX","offY","Obj","skipsize","planes","bitcount","colors","compression","sizeimage","xpelspermeter","ypelspermeter","clrused","clrimportant","usergb","_usergb","hdrsize","_infosize","_header","BitmapCoreHeader","BitmapInfoHeader","masks","getWidth","getHeight","abs","infosize","header","bitmapInfo","_reader","_offset","_location","_info","BitmapInfo","totalSize","size","makeBitmapFileHeader","buf","ArrayBuffer","view","base64ref","prevpos","mime","ref","btoa","g","b","ColorRef","toHex","slice","escapement","orientation","weight","italic","underline","strikeout","charset","outprecision","clipprecision","quality","pitchAndFamily","pitch","family","dataLength","start","facename","Font","JSON","stringify","style","DIBitmap","dibpatternpt","hatchstyle","Brush","brush","Pen","headerSize","recordStart","frame","descriptionLen","descriptionOff","nPalEntries","refDevCx","refDevCy","refDevCxMm","refDevCyMm","hdrSize","prevPos","description","pixelFormatSize","pixelFormatOff","displayDevCxUm","displayDevCyUm","_records","EmfHeader","all","curpos","gdi","setMapMode","setWindowOrgEx","setWindowExtEx","setViewportOrgEx","setViewportExtEx","saveDC","restoreDC","setBkMode","setBkColor","createBrush","createPen","offBmi","cbBmi","offBits","cbBits","off","selectObject","deleteObject","rectangle","lineTo","moveToEx","isSmall","polyCnt","polygonsPtCnts","ptCnt","p","ip","polyPolygon","setPolyFillMode","polybezier","setTextAlign","setStretchBltMode","setBrushOrgEx","beginPath","endPath","abortPath","closeFigure","fillPath","strokePath","selectClipPath","selectClipRgn","offsetClipRgn","setMiterLimit","recordName","main_loop","play","svgPath","Path","_StockObjects","createSolidBrush","createSolidPen","stockObjs","objs","t","createStockObjects","defObjects","_svggroup","_svgclipChanged","_svgtextbkfilter","mapmode","stretchmode","textalign","bkmode","textcolor","bkcolor","polyfillmode","miterlimit","wx","wy","ww","wh","vx","vy","vw","vh","nextbrx","nextbry","brx","bry","clip","ownclip","selected","defObj","_svgdefs","_svgPatterns","_svgClipPaths","_svgPath","pen","font","palette","region","state","GDIContextState","statestack","objects","mode","origin","prevstate","saved","pop","stretchMode","rw","rh","_todevY","_todevX","_todevH","_pushGroup","opts","_applyOpts","toX","toY","fromX","fromY","polygons","isLineTo","firstPts","firstPt","unshift","lastPt","isPolyBezierTo","cp1","cp2","ep","rgnMode","_getClipRgn","textAlignmentMode","miterLimit","bkMode","bkColor","polyFillMode","index","idx","_storeObject","createPenEx","objIdx","checkType","_getObject","_selectObject","selPath","fill","_deleteObject","viewBox","preserveAspectRatio","_getSvgClipPathForRegion","_getStockObject","_getSvgDef","existingId","sclip","_todevW","j","_getSvgPatternForBrush","img","spat","patternUnits","rgn","floor","_tologicalX","_tologicalY","_tologicalW","_tologicalH","usePen","useBrush","useFont","stroke","dotWidth","dashWidth","dotSpacing","parse","render","info","_render","SVG","mapMode","wExt","hExt","xExt","yExt","_img","EMF","w","h","GDIContext","_hdrsize","EMFRecords"],"sourceRoot":""} |