<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>toxicsoftware.com &#187; gus mueller has a posse</title>
	<atom:link href="http://toxicsoftware.com/tag/gus-mueller-has-a-posse/feed/" rel="self" type="application/rss+xml" />
	<link>http://toxicsoftware.com</link>
	<description>RANDOMIZE USR 0</description>
	<lastBuildDate>Sun, 01 Aug 2010 17:49:39 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>AcornImage</title>
		<link>http://toxicsoftware.com/acornimage/</link>
		<comments>http://toxicsoftware.com/acornimage/#comments</comments>
		<pubDate>Tue, 19 Feb 2008 15:05:58 +0000</pubDate>
		<dc:creator>schwa</dc:creator>
				<category><![CDATA[Default]]></category>
		<category><![CDATA[Acorn]]></category>
		<category><![CDATA[Cocoa]]></category>
		<category><![CDATA[Flying Meat]]></category>
		<category><![CDATA[gus mueller has a posse]]></category>
		<category><![CDATA[Source Code]]></category>

		<guid isPermaLink="false">http://toxicsoftware.com/acornimage/</guid>
		<description><![CDATA[It was just your typical InterfaceBuilder 3 window&#8230; with your vanilla NSImageView&#8230; referring to an image file within an Xcode project&#8230; Holy Cow! An Acorn file? Does that mean I can use Acorn files directly in Interface Builder 3? Does &#8230; <a href="http://toxicsoftware.com/acornimage/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>It was just your typical InterfaceBuilder 3 window&#8230;</p>

<p><a href="/uploads/acornimageib3.png&quot;"><img src="/uploads/acornimageib3.thumbnail.png" alt="AcornImageIB3.png" /></a></p>

<p>with your vanilla NSImageView&#8230;</p>

<p><a href="/uploads/acornimageview.png"><img src="/uploads/acornimageview.thumbnail.png" alt="AcornImageView.png" /></a></p>

<p>referring to an image file within an Xcode project&#8230;</p>

<p><a href="/uploads/acorninxcode.png"><img src="/uploads/acorninxcode.thumbnail.png" alt="AcornInXcode.png" /></a></p>

<p><a href="http://www.hospitalgowns.com/Buy_Bouffant_Pages/A0822b.htm">Holy Cow!</a> An <a href="http://www.flyingmeat.com/acorn/">Acorn</a> file? Does that mean I can use Acorn files directly in Interface Builder 3? Does that mean you&#8217;ve written an NSCustomImageRep that understands the Acorn file format? Does that mean I can use Acorn files directly in my Cocoa projects? And that means I no longer have to keep exporting these bloody files as pngs so I can use them in Cocoa, right? Will this give rixstep some ammunition to go apeshit insane about?</p>

<p>Yes! Yes!! Yes!!! Yes!!!! Yes!!!!! Almost certainly.</p>

<p>Not only does Gus Mueller generously provide details about the <a href="http://flyingmeat.com/wikka/AcornFileFormat">Acorn file format</a>, he has even released the source code to his Acorn Quicklook plugin. This gives me everything I need to convince NSImage to load Acorn files.</p>

<p>You might well be asking yourself why. I was getting annoyed with having to constantly keep exporting original Acorn images as pngs or TIFFs so I could use them in Xcode. I&#8217;m prototyping a new application that uses a lot of custom UI elements. These elements are made up of one or more pngs, some of which needed a lot of tweaking and attention to detail to get right. Acorn is perfect for UI work (although it needs more than 2000% zoom! <em>cough</em>) but having to export as png (or another format that Cocoa understands natively) and manage two sets of images (original Acorn, exported png) was turning into a pain.</p>

<p>I&#8217;ve taken Gus&#8217; QuickLook code and wrapped a small <a href="http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/Classes/NSCustomImageRep_Class/Reference/Reference.html">NSCustomImageRep</a> around it. Very small. I&#8217;ve repackaged it up as a Framework so you can refer to it from an Interface Builder 3 plugin. This gives you the ability to do this:</p>

<pre><code>[NSImage imageNamed:@"IAmAnAcornFile"];
</code></pre>

<p>You should be able to use Acorn files anywhere an NSImage is used. Just embed your Acorn files in your XCode project resources and refer to them by name in your NIBs or in code.</p>

<p>I&#8217;ve put the code on my public googlecode.com subversion <a href="http://toxic-public.googlecode.com/svn/tags/BlogTag_20080219_785/Projects/Acorn/AcornImageFramework">repository</a>.</p>

<p>I&#8217;m currently on the fence about whether it is a good idea or not to ship your application with Acorn images. It certainly makes sense to me to use them during the interface design stage of application development. Once the user interface churn settles down I should be able to finalize the images and convert them to pngs or whatever (keeping the originals of course).</p>

<p>A best of both worlds solution might be to make a little command line tool that can convert Acorn files:</p>

<pre><code>#!/usr/bin/python
from AcornImage import *
# Everything else is an exercise for the reader.
</code></pre>

<p>And then automatically convert from Acorn to whatever during the Xcode build process. I might investigate this technique at a later date. But for now &#8211; have at it.</p>
]]></content:encoded>
			<wfw:commentRss>http://toxicsoftware.com/acornimage/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
	</channel>
</rss>
