<?xml version='1.0' encoding='UTF-8' standalone='no'?>
<doxygen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="compound.xsd" version="1.8.8">
  <compounddef id="ImagickEscposImage_8php" kind="file">
    <compoundname>ImagickEscposImage.php</compoundname>
    <innerclass refid="classMike42_1_1Escpos_1_1ImagickEscposImage" prot="public">Mike42::Escpos::ImagickEscposImage</innerclass>
    <innernamespace refid="namespaceMike42_1_1Escpos">Mike42::Escpos</innernamespace>
    <innernamespace refid="namespaceImagick">Imagick</innernamespace>
    <briefdescription>
    </briefdescription>
    <detaileddescription>
    </detaileddescription>
    <programlisting>
<codeline lineno="1"><highlight class="normal">&lt;?php</highlight></codeline>
<codeline lineno="13"><highlight class="keyword">namespace<sp/></highlight><highlight class="normal"><ref refid="namespaceMike42_1_1Escpos" kindref="compound">Mike42\Escpos</ref>;</highlight></codeline>
<codeline lineno="14"><highlight class="normal"></highlight></codeline>
<codeline lineno="15"><highlight class="normal">use<sp/><ref refid="namespaceException" kindref="compound">Exception</ref>;</highlight></codeline>
<codeline lineno="16"><highlight class="normal">use<sp/><ref refid="namespaceImagick" kindref="compound">Imagick</ref>;</highlight></codeline>
<codeline lineno="17"><highlight class="normal">use<sp/><ref refid="namespaceMike42_1_1Escpos_1_1EscposImage" kindref="compound">Mike42\Escpos\EscposImage</ref>;</highlight></codeline>
<codeline lineno="18"><highlight class="normal"></highlight></codeline>
<codeline lineno="22" refid="classMike42_1_1Escpos_1_1ImagickEscposImage" refkind="compound"><highlight class="keyword">class<sp/></highlight><highlight class="normal"><ref refid="classMike42_1_1Escpos_1_1ImagickEscposImage" kindref="compound">ImagickEscposImage</ref><sp/></highlight><highlight class="keyword">extends</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1EscposImage" kindref="compound">EscposImage</ref></highlight></codeline>
<codeline lineno="23"><highlight class="normal">{</highlight></codeline>
<codeline lineno="29"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">public</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">function</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1ImagickEscposImage_1a2d02c732d54547687d1c02707d017daa" kindref="member">readImageFromImagick</ref>(\<ref refid="namespaceImagick" kindref="compound">Imagick</ref><sp/>$im)</highlight></codeline>
<codeline lineno="30"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="31"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*<sp/>Strip<sp/>transparency<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="32"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$im<sp/>=<sp/>self::alphaRemove($im);</highlight></codeline>
<codeline lineno="33"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*<sp/>Threshold<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="34"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$im<sp/>-&gt;<sp/>setImageType(\Imagick::IMGTYPE_TRUECOLOR);<sp/></highlight><highlight class="comment">//<sp/>Remove<sp/>transparency<sp/>(good<sp/>for<sp/>PDF&apos;s)</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="35"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$max<sp/>=<sp/>$im-&gt;getQuantumRange();</highlight></codeline>
<codeline lineno="36"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$max<sp/>=<sp/>$max[</highlight><highlight class="stringliteral">&quot;quantumRangeLong&quot;</highlight><highlight class="normal">];</highlight></codeline>
<codeline lineno="37"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$im<sp/>-&gt;<sp/>thresholdImage(0.5<sp/>*<sp/>$max);</highlight></codeline>
<codeline lineno="38"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*<sp/>Make<sp/>a<sp/>string<sp/>of<sp/>1&apos;s<sp/>and<sp/>0&apos;s<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="39"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classMike42_1_1Escpos_1_1EscposImage_1abbd7d7d81db631a2a555be2906856489" kindref="member">$imgHeight</ref><sp/>=<sp/>$im<sp/>-&gt;<sp/>getimageheight();</highlight></codeline>
<codeline lineno="40"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classMike42_1_1Escpos_1_1EscposImage_1a16c9f28626c3fe81aec151042a9e5e58" kindref="member">$imgWidth</ref><sp/>=<sp/>$im<sp/>-&gt;<sp/>getimagewidth();</highlight></codeline>
<codeline lineno="41"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$imgData<sp/>=<sp/>str_repeat(</highlight><highlight class="stringliteral">&quot;\0&quot;</highlight><highlight class="normal">,<sp/><ref refid="classMike42_1_1Escpos_1_1EscposImage_1abbd7d7d81db631a2a555be2906856489" kindref="member">$imgHeight</ref><sp/>*<sp/><ref refid="classMike42_1_1Escpos_1_1EscposImage_1a16c9f28626c3fe81aec151042a9e5e58" kindref="member">$imgWidth</ref>);</highlight></codeline>
<codeline lineno="42"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>($y<sp/>=<sp/>0;<sp/>$y<sp/>&lt;<sp/><ref refid="classMike42_1_1Escpos_1_1EscposImage_1abbd7d7d81db631a2a555be2906856489" kindref="member">$imgHeight</ref>;<sp/>$y++)<sp/>{</highlight></codeline>
<codeline lineno="43"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>($x<sp/>=<sp/>0;<sp/>$x<sp/>&lt;<sp/><ref refid="classMike42_1_1Escpos_1_1EscposImage_1a16c9f28626c3fe81aec151042a9e5e58" kindref="member">$imgWidth</ref>;<sp/>$x++)<sp/>{</highlight></codeline>
<codeline lineno="44"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*<sp/>Faster<sp/>to<sp/>average<sp/>channels,<sp/>blend<sp/>alpha<sp/>and<sp/>negate<sp/>the<sp/>image<sp/>here<sp/>than<sp/>via<sp/>filters<sp/>(tested!)<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="45"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$cols<sp/>=<sp/>$im<sp/>-&gt;<sp/>getImagePixelColor($x,<sp/>$y);</highlight></codeline>
<codeline lineno="46"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$cols<sp/>=<sp/>$cols<sp/>-&gt;<sp/>getcolor();</highlight></codeline>
<codeline lineno="47"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$greyness<sp/>=<sp/>(int)(($cols[</highlight><highlight class="charliteral">&apos;r&apos;</highlight><highlight class="normal">]<sp/>+<sp/>$cols[</highlight><highlight class="charliteral">&apos;g&apos;</highlight><highlight class="normal">]<sp/>+<sp/>$cols[</highlight><highlight class="charliteral">&apos;b&apos;</highlight><highlight class="normal">])<sp/>/<sp/>3)<sp/>&gt;&gt;<sp/>7;<sp/><sp/></highlight><highlight class="comment">//<sp/>1<sp/>for<sp/>white,<sp/>0<sp/>for<sp/>black</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="48"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$imgData[$y<sp/>*<sp/>$imgWidth<sp/>+<sp/>$x]<sp/>=<sp/>(1<sp/>-<sp/>$greyness);<sp/></highlight><highlight class="comment">//<sp/>1<sp/>for<sp/>black,<sp/>0<sp/>for<sp/>white</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="49"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="50"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="51"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$this<sp/>-&gt;<sp/><ref refid="classMike42_1_1Escpos_1_1EscposImage_1a27ea4fc9d668db992c8222400f566307" kindref="member">setImgWidth</ref>($imgWidth);</highlight></codeline>
<codeline lineno="52"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$this<sp/>-&gt;<sp/><ref refid="classMike42_1_1Escpos_1_1EscposImage_1a3ff7e9483ccc19429dfbd214cdde520b" kindref="member">setImgHeight</ref>($imgHeight);</highlight></codeline>
<codeline lineno="53"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$this<sp/>-&gt;<sp/><ref refid="classMike42_1_1Escpos_1_1EscposImage_1a085b7aab6c7269700d80c8e163aaf365" kindref="member">setImgData</ref>($imgData);</highlight></codeline>
<codeline lineno="54"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="55"><highlight class="normal"></highlight></codeline>
<codeline lineno="65"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">protected</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">function</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1ImagickEscposImage_1a64620c2719eecb99034ab5fd9d92b509" kindref="member">getColumnFormatFromFile</ref>($filename<sp/>=<sp/>null,<sp/>$highDensityVertical<sp/>=<sp/></highlight><highlight class="keyword">true</highlight><highlight class="normal">)</highlight></codeline>
<codeline lineno="66"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="67"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>($filename<sp/>===<sp/>null)<sp/>{</highlight></codeline>
<codeline lineno="68"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>null;</highlight></codeline>
<codeline lineno="69"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="70"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$im<sp/>=<sp/>$this<sp/>-&gt;<sp/>getImageFromFile($filename);</highlight></codeline>
<codeline lineno="71"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$this<sp/>-&gt;<sp/><ref refid="classMike42_1_1Escpos_1_1EscposImage_1a27ea4fc9d668db992c8222400f566307" kindref="member">setImgWidth</ref>($im<sp/>-&gt;<sp/>getimagewidth());</highlight></codeline>
<codeline lineno="72"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$this<sp/>-&gt;<sp/><ref refid="classMike42_1_1Escpos_1_1EscposImage_1a3ff7e9483ccc19429dfbd214cdde520b" kindref="member">setImgHeight</ref>($im<sp/>-&gt;<sp/>getimageheight());</highlight></codeline>
<codeline lineno="73"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="74"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*<sp/>Strip<sp/>transparency<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="75"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$im<sp/>=<sp/>self::alphaRemove($im);</highlight></codeline>
<codeline lineno="76"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$im<sp/>-&gt;<sp/>setformat(</highlight><highlight class="stringliteral">&apos;pbm&apos;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="77"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$im<sp/>-&gt;<sp/>getimageblob();<sp/></highlight><highlight class="comment">//<sp/>Forces<sp/>1-bit<sp/>rendering<sp/>now,<sp/>so<sp/>that<sp/>subsequent<sp/>operations<sp/>are<sp/>faster</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="78"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$im<sp/>-&gt;<sp/>rotateImage(</highlight><highlight class="stringliteral">&apos;#fff&apos;</highlight><highlight class="normal">,<sp/>90.0);</highlight></codeline>
<codeline lineno="79"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$im<sp/>-&gt;<sp/>flopImage();</highlight></codeline>
<codeline lineno="80"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$lineHeight<sp/>=<sp/>$highDensityVertical<sp/>?<sp/>3<sp/>:<sp/>1;</highlight></codeline>
<codeline lineno="81"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$blobs<sp/>=<sp/>$this<sp/>-&gt;<sp/>getColumnFormatFromImage($im,<sp/>$lineHeight<sp/>*<sp/>8);</highlight></codeline>
<codeline lineno="82"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>$blobs;</highlight></codeline>
<codeline lineno="83"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="84"><highlight class="normal"></highlight></codeline>
<codeline lineno="92"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">protected</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">function</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1ImagickEscposImage_1a0acfb9a43c697638c8c7e59e62fa12db" kindref="member">loadImageData</ref>($filename<sp/>=<sp/>null)</highlight></codeline>
<codeline lineno="93"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="94"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>($filename<sp/>===<sp/>null)<sp/>{</highlight></codeline>
<codeline lineno="95"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*<sp/>Set<sp/>to<sp/>blank<sp/>image<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="96"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>parent::loadImageData($filename);</highlight></codeline>
<codeline lineno="97"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="98"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="99"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$im<sp/>=<sp/>$this<sp/>-&gt;<sp/>getImageFromFile($filename);</highlight></codeline>
<codeline lineno="100"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$this<sp/>-&gt;<sp/><ref refid="classMike42_1_1Escpos_1_1ImagickEscposImage_1a2d02c732d54547687d1c02707d017daa" kindref="member">readImageFromImagick</ref>($im);</highlight></codeline>
<codeline lineno="101"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="102"><highlight class="normal"></highlight></codeline>
<codeline lineno="112"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">private</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">function</highlight><highlight class="normal"><sp/>getColumnFormatFromImage(<ref refid="namespaceImagick" kindref="compound">Imagick</ref><sp/>$im,<sp/>$lineHeight)</highlight></codeline>
<codeline lineno="113"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="114"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classMike42_1_1Escpos_1_1EscposImage_1a16c9f28626c3fe81aec151042a9e5e58" kindref="member">$imgWidth</ref><sp/>=<sp/>$im-&gt;getimagewidth();</highlight></codeline>
<codeline lineno="115"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(<ref refid="classMike42_1_1Escpos_1_1EscposImage_1a16c9f28626c3fe81aec151042a9e5e58" kindref="member">$imgWidth</ref><sp/>==<sp/>$lineHeight)<sp/>{</highlight></codeline>
<codeline lineno="116"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Return<sp/>glob<sp/>of<sp/>this<sp/>panel</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="117"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>[$this<sp/>-&gt;<sp/>getRasterBlobFromImage($im)];</highlight></codeline>
<codeline lineno="118"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}<sp/>elseif<sp/>(<ref refid="classMike42_1_1Escpos_1_1EscposImage_1a16c9f28626c3fe81aec151042a9e5e58" kindref="member">$imgWidth</ref><sp/>&gt;<sp/>$lineHeight)<sp/>{</highlight></codeline>
<codeline lineno="119"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Calculations</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="120"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$slicesLeft<sp/>=<sp/>ceil(<ref refid="classMike42_1_1Escpos_1_1EscposImage_1a16c9f28626c3fe81aec151042a9e5e58" kindref="member">$imgWidth</ref><sp/>/<sp/>$lineHeight<sp/>/<sp/>2);</highlight></codeline>
<codeline lineno="121"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$widthLeft<sp/>=<sp/>$slicesLeft<sp/>*<sp/>$lineHeight;</highlight></codeline>
<codeline lineno="122"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$widthRight<sp/>=<sp/><ref refid="classMike42_1_1Escpos_1_1EscposImage_1a16c9f28626c3fe81aec151042a9e5e58" kindref="member">$imgWidth</ref><sp/>-<sp/>$widthLeft;</highlight></codeline>
<codeline lineno="123"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Slice<sp/>up<sp/>(left)</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="124"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$left<sp/>=<sp/>clone<sp/>$im;</highlight></codeline>
<codeline lineno="125"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$left<sp/>-&gt;<sp/>extentimage($widthLeft,<sp/>$left<sp/>-&gt;<sp/>getimageheight(),<sp/>0,<sp/>0);</highlight></codeline>
<codeline lineno="126"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Slice<sp/>up<sp/>(right<sp/>-<sp/>ensure<sp/>width<sp/>is<sp/>divisible<sp/>by<sp/>lineHeight<sp/>also)</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="127"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$right<sp/>=<sp/>clone<sp/>$im;</highlight></codeline>
<codeline lineno="128"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$widthRightRounded<sp/>=<sp/>$widthRight<sp/>&lt;<sp/>$lineHeight<sp/>?<sp/>$lineHeight<sp/>:<sp/>$widthRight;</highlight></codeline>
<codeline lineno="129"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$right<sp/>-&gt;<sp/>extentimage($widthRightRounded,<sp/>$right<sp/>-&gt;<sp/>getimageheight(),<sp/>$widthLeft,<sp/>0);</highlight></codeline>
<codeline lineno="130"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Recurse</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="131"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$leftBlobs<sp/>=<sp/>$this<sp/>-&gt;<sp/>getColumnFormatFromImage($left,<sp/>$lineHeight);</highlight></codeline>
<codeline lineno="132"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$rightBlobs<sp/>=<sp/>$this<sp/>-&gt;<sp/>getColumnFormatFromImage($right,<sp/>$lineHeight);</highlight></codeline>
<codeline lineno="133"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>array_merge($leftBlobs,<sp/>$rightBlobs);</highlight></codeline>
<codeline lineno="134"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}<sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/>{</highlight></codeline>
<codeline lineno="135"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*<sp/>Image<sp/>is<sp/>smaller<sp/>than<sp/>full<sp/>width<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="136"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$im<sp/>-&gt;<sp/>extentimage($lineHeight,<sp/>$im<sp/>-&gt;<sp/>getimageheight(),<sp/>0,<sp/>0);</highlight></codeline>
<codeline lineno="137"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>[$this<sp/>-&gt;<sp/>getRasterBlobFromImage($im)];</highlight></codeline>
<codeline lineno="138"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="139"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="140"><highlight class="normal"></highlight></codeline>
<codeline lineno="148"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">private</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">function</highlight><highlight class="normal"><sp/>getImageFromFile($filename)</highlight></codeline>
<codeline lineno="149"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="150"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$im<sp/>=<sp/></highlight><highlight class="keyword">new</highlight><highlight class="normal"><sp/><ref refid="namespaceImagick" kindref="compound">Imagick</ref>();</highlight></codeline>
<codeline lineno="151"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">try</highlight><highlight class="normal"><sp/>{</highlight></codeline>
<codeline lineno="152"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$im-&gt;setResourceLimit(6,<sp/>1);<sp/></highlight><highlight class="comment">//<sp/>Prevent<sp/>libgomp1<sp/>segfaults,<sp/>grumble<sp/>grumble.</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="153"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$im<sp/>-&gt;<sp/>readimage($filename);</highlight></codeline>
<codeline lineno="154"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}<sp/></highlight><highlight class="keywordflow">catch</highlight><highlight class="normal"><sp/>(\ImagickException<sp/>$e)<sp/>{</highlight></codeline>
<codeline lineno="155"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*<sp/>Re-throw<sp/>as<sp/>normal<sp/>exception<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="156"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">throw</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">new</highlight><highlight class="normal"><sp/><ref refid="namespaceException" kindref="compound">Exception</ref>($e);</highlight></codeline>
<codeline lineno="157"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="158"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>$im;</highlight></codeline>
<codeline lineno="159"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="160"><highlight class="normal"></highlight></codeline>
<codeline lineno="168"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">private</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">function</highlight><highlight class="normal"><sp/>getRasterBlobFromImage(<ref refid="namespaceImagick" kindref="compound">Imagick</ref><sp/>$im)</highlight></codeline>
<codeline lineno="169"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="170"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$blob<sp/>=<sp/>$im<sp/>-&gt;<sp/>getimageblob();</highlight></codeline>
<codeline lineno="171"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*<sp/>Find<sp/>where<sp/>header<sp/>ends<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="172"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$i<sp/>=<sp/>strpos($blob,<sp/></highlight><highlight class="stringliteral">&quot;P4\n&quot;</highlight><highlight class="normal">)<sp/>+<sp/>2;</highlight></codeline>
<codeline lineno="173"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">while</highlight><highlight class="normal"><sp/>($blob[$i<sp/>+<sp/>1]<sp/>==<sp/></highlight><highlight class="charliteral">&apos;#&apos;</highlight><highlight class="normal">)<sp/>{</highlight></codeline>
<codeline lineno="174"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$i<sp/>=<sp/>strpos($blob,<sp/></highlight><highlight class="stringliteral">&quot;\n&quot;</highlight><highlight class="normal">,<sp/>$i<sp/>+<sp/>1);</highlight></codeline>
<codeline lineno="175"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="176"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$i<sp/>=<sp/>strpos($blob,<sp/></highlight><highlight class="stringliteral">&quot;\n&quot;</highlight><highlight class="normal">,<sp/>$i<sp/>+<sp/>1);</highlight></codeline>
<codeline lineno="177"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*<sp/>Return<sp/>raster<sp/>data<sp/>only<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="178"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$subBlob<sp/>=<sp/>substr($blob,<sp/>$i<sp/>+<sp/>1);</highlight></codeline>
<codeline lineno="179"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>$subBlob;</highlight></codeline>
<codeline lineno="180"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="181"><highlight class="normal"></highlight></codeline>
<codeline lineno="189"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">protected</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">function</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1ImagickEscposImage_1a4ed34b8472da1d612460c8006cca69fc" kindref="member">getRasterFormatFromFile</ref>($filename<sp/>=<sp/>null)</highlight></codeline>
<codeline lineno="190"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="191"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>($filename<sp/>===<sp/>null)<sp/>{</highlight></codeline>
<codeline lineno="192"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>null;</highlight></codeline>
<codeline lineno="193"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="194"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$im<sp/>=<sp/>$this<sp/>-&gt;<sp/>getImageFromFile($filename);</highlight></codeline>
<codeline lineno="195"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$this<sp/>-&gt;<sp/><ref refid="classMike42_1_1Escpos_1_1EscposImage_1a27ea4fc9d668db992c8222400f566307" kindref="member">setImgWidth</ref>($im<sp/>-&gt;<sp/>getimagewidth());</highlight></codeline>
<codeline lineno="196"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$this<sp/>-&gt;<sp/><ref refid="classMike42_1_1Escpos_1_1EscposImage_1a3ff7e9483ccc19429dfbd214cdde520b" kindref="member">setImgHeight</ref>($im<sp/>-&gt;<sp/>getimageheight());</highlight></codeline>
<codeline lineno="197"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*<sp/>Convert<sp/>to<sp/>PBM<sp/>and<sp/>extract<sp/>raster<sp/>portion<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="198"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$im<sp/>=<sp/>self::alphaRemove($im);</highlight></codeline>
<codeline lineno="199"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$im<sp/>-&gt;<sp/>setFormat(</highlight><highlight class="stringliteral">&apos;pbm&apos;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="200"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>$this<sp/>-&gt;<sp/>getRasterBlobFromImage($im);</highlight></codeline>
<codeline lineno="201"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="202"><highlight class="normal"></highlight></codeline>
<codeline lineno="215"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">public</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">function</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1ImagickEscposImage_1a7449e38530371defc837ccd13b7900da" kindref="member">loadPdf</ref>($pdfFile,<sp/>$pageWidth<sp/>=<sp/>550)</highlight></codeline>
<codeline lineno="216"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="217"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(!<ref refid="classMike42_1_1Escpos_1_1EscposImage_1a57ec8e7158c5c5fb2930c1f185a4b2d7" kindref="member">EscposImage::isImagickLoaded</ref>())<sp/>{</highlight></codeline>
<codeline lineno="218"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">throw</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">new</highlight><highlight class="normal"><sp/><ref refid="namespaceException" kindref="compound">Exception</ref>(__FUNCTION__<sp/>.<sp/></highlight><highlight class="stringliteral">&quot;<sp/>requires<sp/>imagick<sp/>extension.&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="219"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="220"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*</highlight></codeline>
<codeline lineno="221"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*<sp/>Load<sp/>first<sp/>page<sp/>at<sp/>very<sp/>low<sp/>density<sp/>(resolution),<sp/>to<sp/>figure<sp/>out<sp/>what</highlight></codeline>
<codeline lineno="222"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*<sp/>density<sp/>to<sp/>use<sp/>to<sp/>achieve<sp/>$pageWidth</highlight></codeline>
<codeline lineno="223"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="224"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">try</highlight><highlight class="normal"><sp/>{</highlight></codeline>
<codeline lineno="225"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$image<sp/>=<sp/>new<sp/>\Imagick();</highlight></codeline>
<codeline lineno="226"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$testRes<sp/>=<sp/>2;<sp/></highlight><highlight class="comment">//<sp/>Test<sp/>resolution</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="227"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$image<sp/>-&gt;<sp/>setresolution($testRes,<sp/>$testRes);</highlight></codeline>
<codeline lineno="228"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*<sp/>Load<sp/>document<sp/>just<sp/>to<sp/>measure<sp/>geometry<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="229"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$image<sp/>-&gt;<sp/>readimage($pdfFile);</highlight></codeline>
<codeline lineno="230"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$geo<sp/>=<sp/>$image<sp/>-&gt;<sp/>getimagegeometry();</highlight></codeline>
<codeline lineno="231"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$image<sp/>-&gt;<sp/>destroy();</highlight></codeline>
<codeline lineno="232"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$width<sp/>=<sp/>$geo[</highlight><highlight class="stringliteral">&apos;width&apos;</highlight><highlight class="normal">];</highlight></codeline>
<codeline lineno="233"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$newRes<sp/>=<sp/>$pageWidth<sp/>/<sp/>$width<sp/>*<sp/>$testRes;</highlight></codeline>
<codeline lineno="234"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*<sp/>Load<sp/>entire<sp/>document<sp/>in<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="235"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$image<sp/>-&gt;<sp/>setresolution($newRes,<sp/>$newRes);</highlight></codeline>
<codeline lineno="236"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$image<sp/>-&gt;<sp/>readImage($pdfFile);</highlight></codeline>
<codeline lineno="237"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$pages<sp/>=<sp/>$image<sp/>-&gt;<sp/>getNumberImages();</highlight></codeline>
<codeline lineno="238"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*<sp/>Convert<sp/>images<sp/>to<sp/>Escpos<sp/>objects<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="239"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$ret<sp/>=<sp/>[];</highlight></codeline>
<codeline lineno="240"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>($i<sp/>=<sp/>0;<sp/>$i<sp/>&lt;<sp/>$pages;<sp/>$i++)<sp/>{</highlight></codeline>
<codeline lineno="241"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$image<sp/>-&gt;<sp/>setIteratorIndex($i);</highlight></codeline>
<codeline lineno="242"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$ep<sp/>=<sp/></highlight><highlight class="keyword">new</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1ImagickEscposImage" kindref="compound">ImagickEscposImage</ref>();</highlight></codeline>
<codeline lineno="243"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$ep<sp/>-&gt;<sp/><ref refid="classMike42_1_1Escpos_1_1ImagickEscposImage_1a2d02c732d54547687d1c02707d017daa" kindref="member">readImageFromImagick</ref>($image);</highlight></codeline>
<codeline lineno="244"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$ret[]<sp/>=<sp/>$ep;</highlight></codeline>
<codeline lineno="245"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="246"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>$ret;</highlight></codeline>
<codeline lineno="247"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}<sp/></highlight><highlight class="keywordflow">catch</highlight><highlight class="normal"><sp/>(\ImagickException<sp/>$e)<sp/>{</highlight></codeline>
<codeline lineno="248"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*<sp/>Wrap<sp/>in<sp/>normal<sp/>exception,<sp/>so<sp/>that<sp/>classes<sp/>which<sp/>call<sp/>this<sp/>do<sp/>not</highlight></codeline>
<codeline lineno="249"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*<sp/>themselves<sp/>require<sp/>imagick<sp/>as<sp/>a<sp/>dependency.<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="250"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">throw</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">new</highlight><highlight class="normal"><sp/><ref refid="namespaceException" kindref="compound">Exception</ref>($e);</highlight></codeline>
<codeline lineno="251"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="252"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="253"><highlight class="normal"></highlight></codeline>
<codeline lineno="266"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">private</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">function</highlight><highlight class="normal"><sp/>alphaRemove(<ref refid="namespaceImagick" kindref="compound">Imagick</ref><sp/>$im)</highlight></codeline>
<codeline lineno="267"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="268"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$flat<sp/>=<sp/>new<sp/>\Imagick();</highlight></codeline>
<codeline lineno="269"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$flat<sp/>-&gt;<sp/>newImage($im<sp/>-&gt;<sp/>getimagewidth(),<sp/>$im<sp/>-&gt;<sp/>getimageheight(),<sp/></highlight><highlight class="stringliteral">&quot;white&quot;</highlight><highlight class="normal">,<sp/>$im<sp/>-&gt;<sp/>getimageformat());</highlight></codeline>
<codeline lineno="270"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$flat<sp/>-&gt;<sp/>compositeimage($im,<sp/>\Imagick::COMPOSITE_OVER,<sp/>0,<sp/>0);</highlight></codeline>
<codeline lineno="271"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>$flat;</highlight></codeline>
<codeline lineno="272"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="273"><highlight class="normal">}</highlight></codeline>
    </programlisting>
    <location file="C:/www/aplusnet/incahellas.com/public_html/lib/escpos-php-development/src/Mike42/Escpos/ImagickEscposImage.php"/>
  </compounddef>
</doxygen>
