<spanclass="nv">Image = </span><spanclass="nx">require</span><spanclass="s">'./psd/image.coffee'</span></pre></div></td></tr><trid="section-2"><tdclass="docs"><divclass="pilwrap"><ahref="#section-2"class="pilcrow">¶</a></div><p>A general purpose parser for Photoshop files. PSDs are broken up in to 4 logical sections:
the header, resources, the layer mask (including layers), and the preview image. We parse
the header, resources, the layer mask (including layers), and the preview image. We parse
<spanclass="nx">@</span><spanclass="k">extends</span><spanclass="nx">require</span><spanclass="p">(</span><spanclass="s">'./psd/init.coffee'</span><spanclass="p">)</span></pre></div></td></tr><trid="section-3"><tdclass="docs"><divclass="pilwrap"><ahref="#section-3"class="pilcrow">¶</a></div><p>Creates a new PSD object. Typically you will use a helper method to instantiate
<spanclass="nx">@</span><spanclass="k">extends</span><spanclass="nx">require</span><spanclass="p">(</span><spanclass="s">'./psd/init.coffee'</span><spanclass="p">)</span></pre></div></td></tr><trid="section-2"><tdclass="docs"><divclass="pilwrap"><ahref="#section-2"class="pilcrow">¶</a></div><p>Creates a new PSD object. Typically you will use a helper method to instantiate
the PSD object. However, if you already have the PSD data stored as a Uint8Array,
the PSD object. However, if you already have the PSD data stored as a Uint8Array,
you can instantiate the PSD object directly.</p>
you can instantiate the PSD object directly.</p>
...
@@ -38,7 +39,7 @@ you can instantiate the PSD object directly.</p>
...
@@ -38,7 +39,7 @@ you can instantiate the PSD object directly.</p>
<spanclass="nx">RSVP</span><spanclass="p">.</span><spanclass="nx">on</span><spanclass="s">'error'</span><spanclass="p">,</span><spanclass="nf">(reason) -></span><spanclass="nx">console</span><spanclass="p">.</span><spanclass="nx">error</span><spanclass="p">(</span><spanclass="nx">reason</span><spanclass="p">)</span></pre></div></td></tr><trid="section-4"><tdclass="docs"><divclass="pilwrap"><ahref="#section-4"class="pilcrow">¶</a></div><p>Parses the PSD. You must call this method before attempting to
<spanclass="nx">RSVP</span><spanclass="p">.</span><spanclass="nx">on</span><spanclass="s">'error'</span><spanclass="p">,</span><spanclass="nf">(reason) -></span><spanclass="nx">console</span><spanclass="p">.</span><spanclass="nx">error</span><spanclass="p">(</span><spanclass="nx">reason</span><spanclass="p">)</span></pre></div></td></tr><trid="section-3"><tdclass="docs"><divclass="pilwrap"><ahref="#section-3"class="pilcrow">¶</a></div><p>Parses the PSD. You must call this method before attempting to
access PSD data. It will not re-parse the PSD if it has already
access PSD data. It will not re-parse the PSD if it has already
<spanclass="vi">@parsed = </span><spanclass="kc">true</span></pre></div></td></tr><trid="section-5"><tdclass="docs"><divclass="pilwrap"><ahref="#section-5"class="pilcrow">¶</a></div><p>The next 4 methods are responsible for parsing the 4 main sections of the PSD.
<spanclass="vi">@parsed = </span><spanclass="kc">true</span></pre></div></td></tr><trid="section-4"><tdclass="docs"><divclass="pilwrap"><ahref="#section-4"class="pilcrow">¶</a></div><p>The next 4 methods are responsible for parsing the 4 main sections of the PSD.
These are private, and you should never call them from your own code.</p>
These are private, and you should never call them from your own code.</p>
<spanclass="p">.</span><spanclass="nx">get</span><spanclass="p">()</span></pre></div></td></tr><trid="section-6"><tdclass="docs"><divclass="pilwrap"><ahref="#section-6"class="pilcrow">¶</a></div><p>Returns a tree representation of the PSD document, which is the
<spanclass="p">.</span><spanclass="nx">get</span><spanclass="p">()</span></pre></div></td></tr><trid="section-5"><tdclass="docs"><divclass="pilwrap"><ahref="#section-5"class="pilcrow">¶</a></div><p>Returns a tree representation of the PSD document, which is the
preferred way of accessing most of the PSD's data.</p>
preferred way of accessing most of the PSD's data.</p>
</td><tdclass="code"><divclass="highlight"><pre></pre></div></td></tr><trid="section-2"><tdclass="docs"><divclass="pilwrap"><ahref="#section-2"class="pilcrow">¶</a></div><p>The blend mode describes important data regarding a layer, such as
</td><tdclass="code"><divclass="highlight"><pre><spanclass="p">{</span><spanclass="nx">Module</span><spanclass="p">}</span><spanclass="o">=</span><spanclass="nx">require</span><spanclass="s">'coffeescript-module'</span></pre></div></td></tr><trid="section-2"><tdclass="docs"><divclass="pilwrap"><ahref="#section-2"class="pilcrow">¶</a></div><p>The blend mode describes important data regarding a layer, such as
the blending mode, the opacity, and whether it's a part of a clipping mask.</p>
the blending mode, the opacity, and whether it's a part of a clipping mask.</p>
</td><tdclass="code"><divclass="highlight"><pre>undefined</pre></div></td></tr><trid="section-3"><tdclass="docs"><divclass="pilwrap"><ahref="#section-3"class="pilcrow">¶</a></div><p>All of the blend modes are stored in the PSD file with a specific key.
<spanclass="nx">@aliasProperty</span><spanclass="s">'blendingMode'</span><spanclass="p">,</span><spanclass="s">'mode'</span></pre></div></td></tr><trid="section-3"><tdclass="docs"><divclass="pilwrap"><ahref="#section-3"class="pilcrow">¶</a></div><p>All of the blend modes are stored in the PSD file with a specific key.
This is the mapping of that key to its readable name.</p>
This is the mapping of that key to its readable name.</p>
</td><tdclass="code"><divclass="highlight"><pre>undefined</pre></div></td></tr><trid="section-4"><tdclass="docs"><divclass="pilwrap"><ahref="#section-4"class="pilcrow">¶</a></div><p>The 4 character key for the blending mode.</p>
</td><tdclass="code"><divclass="highlight"><pre>undefined</pre></div></td></tr><trid="section-5"><tdclass="docs"><divclass="pilwrap"><ahref="#section-5"class="pilcrow">¶</a></div><p>The opacity of the layer, from [0, 255].</p>
<spanclass="nv">constructor: </span><spanclass="nf">(@file) -></span></pre></div></td></tr><trid="section-4"><tdclass="docs"><divclass="pilwrap"><ahref="#section-4"class="pilcrow">¶</a></div><p>The 4 character key for the blending mode.</p>
</td><tdclass="code"><divclass="highlight"><pre>undefined</pre></div></td></tr><trid="section-6"><tdclass="docs"><divclass="pilwrap"><ahref="#section-6"class="pilcrow">¶</a></div><p>Raw value for the clipping state of this layer.</p>
</td><tdclass="code"><divclass="highlight"><pre><spanclass="vi">@blendKey = </span><spanclass="kc">null</span></pre></div></td></tr><trid="section-5"><tdclass="docs"><divclass="pilwrap"><ahref="#section-5"class="pilcrow">¶</a></div><p>The opacity of the layer, from [0, 255].</p>
</td><tdclass="code"><divclass="highlight"><pre>undefined</pre></div></td></tr><trid="section-7"><tdclass="docs"><divclass="pilwrap"><ahref="#section-7"class="pilcrow">¶</a></div><p>Is this layer a clipping mask?</p>
</td><tdclass="code"><divclass="highlight"><pre><spanclass="vi">@opacity = </span><spanclass="kc">null</span></pre></div></td></tr><trid="section-6"><tdclass="docs"><divclass="pilwrap"><ahref="#section-6"class="pilcrow">¶</a></div><p>Raw value for the clipping state of this layer.</p>
</td><tdclass="code"><divclass="highlight"><pre>undefined</pre></div></td></tr><trid="section-8"><tdclass="docs"><divclass="pilwrap"><ahref="#section-8"class="pilcrow">¶</a></div><p>The readable representation of the blend mode.</p>
</td><tdclass="code"><divclass="highlight"><pre><spanclass="vi">@clipping = </span><spanclass="kc">null</span></pre></div></td></tr><trid="section-7"><tdclass="docs"><divclass="pilwrap"><ahref="#section-7"class="pilcrow">¶</a></div><p>Is this layer a clipping mask?</p>
</td><tdclass="code"><divclass="highlight"><pre>undefined</pre></div></td></tr><trid="section-9"><tdclass="docs"><divclass="pilwrap"><ahref="#section-9"class="pilcrow">¶</a></div><p>Is this layer visible?</p>
<spanclass="vi">@flags = </span><spanclass="kc">null</span></pre></div></td></tr><trid="section-8"><tdclass="docs"><divclass="pilwrap"><ahref="#section-8"class="pilcrow">¶</a></div><p>The readable representation of the blend mode.</p>
</td><tdclass="code"><divclass="highlight"><pre>undefined</pre></div></td></tr><trid="section-10"><tdclass="docs"><divclass="pilwrap"><ahref="#section-10"class="pilcrow">¶</a></div><p>Parses the blend mode data.</p>
</td><tdclass="code"><divclass="highlight"><pre><spanclass="vi">@mode = </span><spanclass="kc">null</span></pre></div></td></tr><trid="section-9"><tdclass="docs"><divclass="pilwrap"><ahref="#section-9"class="pilcrow">¶</a></div><p>Is this layer visible?</p>
</td><tdclass="code"><divclass="highlight"><pre>undefined</pre></div></td></tr><trid="section-11"><tdclass="docs"><divclass="pilwrap"><ahref="#section-11"class="pilcrow">¶</a></div><p>Returns the layer opacity as a percentage.</p>
</td><tdclass="code"><divclass="highlight"><pre><spanclass="vi">@visible = </span><spanclass="kc">null</span></pre></div></td></tr><trid="section-10"><tdclass="docs"><divclass="pilwrap"><ahref="#section-10"class="pilcrow">¶</a></div><p>Parses the blend mode data.</p>
</td><tdclass="code"><divclass="highlight"><pre>undefined</pre></div></td></tr></tbody></table><divid="generated">generated Tue May 12 2015 11:04:03 GMT-0400 (EDT) </div></div></body></html>
<spanclass="nx">@file</span><spanclass="p">.</span><spanclass="nx">seek</span><spanclass="mi">1</span><spanclass="p">,</span><spanclass="kc">true</span></pre></div></td></tr><trid="section-11"><tdclass="docs"><divclass="pilwrap"><ahref="#section-11"class="pilcrow">¶</a></div><p>Returns the layer opacity as a percentage.</p>