patchanim-commit Mailing List for patchanim (Page 7)
Brought to you by:
dbrosius
You can subscribe to this list here.
2008 |
Jan
(80) |
Feb
(158) |
Mar
|
Apr
|
May
(3) |
Jun
(7) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(26) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2009 |
Jan
(6) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(9) |
Aug
(1) |
Sep
(2) |
Oct
|
Nov
(2) |
Dec
(3) |
2010 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
(4) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2012 |
Jan
(2) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <dbr...@us...> - 2008-02-10 23:21:50
|
Revision: 155 http://patchanim.svn.sourceforge.net/patchanim/?rev=155&view=rev Author: dbrosius Date: 2008-02-10 15:21:55 -0800 (Sun, 10 Feb 2008) Log Message: ----------- get ready for 0.6.0 release Modified Paths: -------------- trunk/patchanim/build.xml trunk/patchanim/htdocs/jnlp/patchanim.jnlp Modified: trunk/patchanim/build.xml =================================================================== --- trunk/patchanim/build.xml 2008-02-10 19:00:45 UTC (rev 154) +++ trunk/patchanim/build.xml 2008-02-10 23:21:55 UTC (rev 155) @@ -34,7 +34,7 @@ <property name="javac.deprecation" value="on"/> <property name="javac.debug" value="on"/> - <property name="patchanim.version" value="0.5.0"/> + <property name="patchanim.version" value="0.6.0"/> <target name="clean" description="removes all generated collateral"> <delete dir="${classes.dir}"/> Modified: trunk/patchanim/htdocs/jnlp/patchanim.jnlp =================================================================== --- trunk/patchanim/htdocs/jnlp/patchanim.jnlp 2008-02-10 19:00:45 UTC (rev 154) +++ trunk/patchanim/htdocs/jnlp/patchanim.jnlp 2008-02-10 23:21:55 UTC (rev 155) @@ -16,7 +16,7 @@ </security> <resources> <j2se version="1.5+" initial-heap-size="300m" max-heap-size="800m"/> - <jar href="patchanim-0.5.0.jar"/> + <jar href="patchanim-0.6.0.jar"/> <jar href="xml-apis.jar"/> <jar href="xalan.jar"/> <jar href="xercesImpl.jar"/> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-02-10 19:00:39
|
Revision: 154 http://patchanim.svn.sourceforge.net/patchanim/?rev=154&view=rev Author: dbrosius Date: 2008-02-10 11:00:45 -0800 (Sun, 10 Feb 2008) Log Message: ----------- add tween meta keyword Modified Paths: -------------- trunk/patchanim/htdocs/index.html Modified: trunk/patchanim/htdocs/index.html =================================================================== --- trunk/patchanim/htdocs/index.html 2008-02-10 18:59:21 UTC (rev 153) +++ trunk/patchanim/htdocs/index.html 2008-02-10 19:00:45 UTC (rev 154) @@ -1,7 +1,7 @@ <html> <head> <title>PatchAnim - A Bezier Surface based blend animation tool</title> - <meta name="Keywords" content="animated blends gradients gif png mng jpeg bezier curve patch java webstart"> + <meta name="Keywords" content="animated blends gradients gif png mng jpeg bezier curve patch tween java webstart"> </head> <body background> <div style="position:absolute;top:0;left:0;width:256;height:65535;z-index:1;background-image:url(blend.jpg);"> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-02-10 18:59:16
|
Revision: 153 http://patchanim.svn.sourceforge.net/patchanim/?rev=153&view=rev Author: dbrosius Date: 2008-02-10 10:59:21 -0800 (Sun, 10 Feb 2008) Log Message: ----------- add meta Keywords Modified Paths: -------------- trunk/patchanim/htdocs/index.html Modified: trunk/patchanim/htdocs/index.html =================================================================== --- trunk/patchanim/htdocs/index.html 2008-02-10 18:51:53 UTC (rev 152) +++ trunk/patchanim/htdocs/index.html 2008-02-10 18:59:21 UTC (rev 153) @@ -1,6 +1,7 @@ <html> <head> <title>PatchAnim - A Bezier Surface based blend animation tool</title> + <meta name="Keywords" content="animated blends gradients gif png mng jpeg bezier curve patch java webstart"> </head> <body background> <div style="position:absolute;top:0;left:0;width:256;height:65535;z-index:1;background-image:url(blend.jpg);"> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-02-10 18:51:48
|
Revision: 152 http://patchanim.svn.sourceforge.net/patchanim/?rev=152&view=rev Author: dbrosius Date: 2008-02-10 10:51:53 -0800 (Sun, 10 Feb 2008) Log Message: ----------- add looping Modified Paths: -------------- trunk/patchanim/src/com/mebigfatguy/encoders/MngEncoder.java Modified: trunk/patchanim/src/com/mebigfatguy/encoders/MngEncoder.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/encoders/MngEncoder.java 2008-02-10 18:25:31 UTC (rev 151) +++ trunk/patchanim/src/com/mebigfatguy/encoders/MngEncoder.java 2008-02-10 18:51:53 UTC (rev 152) @@ -44,7 +44,9 @@ private static final int SAVE = 0x53415645; private static final int TERM = 0x5445524D; private static final int SEEK = 0x5345454B; + private static final int LOOP = 0x4E4F4F50; private static final int SHOW = 0x53484F59; + private static final int ENDL = 0x454E444E; private static final int MEND = 0x4D454E44; private DataOutputStream out = null; @@ -114,10 +116,26 @@ seekChunk.calcCRC(); seekChunk.write(out); + if (repeatInfinite) { + Chunk loopChunk = new Chunk(6, LOOP); + loopChunk.injectByte(0, 0); + loopChunk.injectInt(1, 0x7FFFFFFF); + loopChunk.injectByte(5, 6); + loopChunk.calcCRC(); + loopChunk.write(out); + } + Chunk showChunk = new Chunk(0, SHOW); showChunk.calcCRC(); showChunk.write(out); + if (repeatInfinite) { + Chunk endlChunk = new Chunk(1, ENDL); + endlChunk.injectByte(0, 0); + endlChunk.calcCRC(); + endlChunk.write(out); + } + Chunk iendChunk = new Chunk(0, MEND); iendChunk.calcCRC(); iendChunk.write(out); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-02-10 18:25:26
|
Revision: 151 http://patchanim.svn.sourceforge.net/patchanim/?rev=151&view=rev Author: dbrosius Date: 2008-02-10 10:25:31 -0800 (Sun, 10 Feb 2008) Log Message: ----------- remove unused Modified Paths: -------------- trunk/patchanim/src/com/mebigfatguy/encoders/MngEncoder.java Modified: trunk/patchanim/src/com/mebigfatguy/encoders/MngEncoder.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/encoders/MngEncoder.java 2008-02-10 18:15:14 UTC (rev 150) +++ trunk/patchanim/src/com/mebigfatguy/encoders/MngEncoder.java 2008-02-10 18:25:31 UTC (rev 151) @@ -137,7 +137,6 @@ return false; try { PngStream pStrm; - boolean sawIDAT = false; { ByteArrayOutputStream baos = new ByteArrayOutputStream(im.getHeight() * im.getWidth()); //a conservative estimate ImageIO.write(im, ExportType.Pngs.getExtension(), baos); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-02-10 18:15:08
|
Revision: 150 http://patchanim.svn.sourceforge.net/patchanim/?rev=150&view=rev Author: dbrosius Date: 2008-02-10 10:15:14 -0800 (Sun, 10 Feb 2008) Log Message: ----------- flush out MNG exporting Modified Paths: -------------- trunk/patchanim/src/com/mebigfatguy/encoders/Chunk.java trunk/patchanim/src/com/mebigfatguy/encoders/MngEncoder.java trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchAnimFrame.java trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchExporter.java Modified: trunk/patchanim/src/com/mebigfatguy/encoders/Chunk.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/encoders/Chunk.java 2008-02-10 17:34:27 UTC (rev 149) +++ trunk/patchanim/src/com/mebigfatguy/encoders/Chunk.java 2008-02-10 18:15:14 UTC (rev 150) @@ -55,6 +55,10 @@ data[offset] = (byte)(value & 0x00FF); } + public void injectByte(int offset, int value) { + data[offset] = (byte)(value & 0x00FF); + } + public void calcCRC() { CRC32 crc32 = new CRC32(); byte[] typeBytes = new byte[4]; Modified: trunk/patchanim/src/com/mebigfatguy/encoders/MngEncoder.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/encoders/MngEncoder.java 2008-02-10 17:34:27 UTC (rev 149) +++ trunk/patchanim/src/com/mebigfatguy/encoders/MngEncoder.java 2008-02-10 18:15:14 UTC (rev 150) @@ -39,8 +39,13 @@ private static final int IHDR = 0x49484452; private static final int IDAT = 0x49444154; private static final int IEND = 0x49454E44; - private static final int MHDR = 0; - private static final int MEND = 0; + private static final int MHDR = 0x4D484452; + private static final int DEFI = 0x44454649; + private static final int SAVE = 0x53415645; + private static final int TERM = 0x5445524D; + private static final int SEEK = 0x5345454B; + private static final int SHOW = 0x53484F59; + private static final int MEND = 0x4D454E44; private DataOutputStream out = null; private boolean started = false; @@ -50,7 +55,6 @@ private int delay = 100; private int frameCount = 1; private int seqNum = 0; - private boolean processedFirstFrame = false; public void setDelay(int ms) { delay = ms; @@ -94,6 +98,26 @@ if (!started) return false; try { + Chunk saveChunk = new Chunk(0, SAVE); + saveChunk.calcCRC(); + saveChunk.write(out); + + Chunk termChunk = new Chunk(10, TERM); + termChunk.injectShort(0, 0); + termChunk.injectInt(2, 0); + termChunk.injectInt(6, repeatInfinite ? 0x7FFFFFFF : 0); + + termChunk.calcCRC(); + termChunk.write(out); + + Chunk seekChunk = new Chunk(0, SEEK); + seekChunk.calcCRC(); + seekChunk.write(out); + + Chunk showChunk = new Chunk(0, SHOW); + showChunk.calcCRC(); + showChunk.write(out); + Chunk iendChunk = new Chunk(0, MEND); iendChunk.calcCRC(); iendChunk.write(out); @@ -126,18 +150,34 @@ case IHDR: if (!headerWritten) { Chunk mhdrChunk = new Chunk(28, MHDR); + mhdrChunk.injectInt(0, im.getWidth()); + mhdrChunk.injectInt(4, im.getHeight()); + mhdrChunk.injectInt(8, delay); + mhdrChunk.injectInt(12, 0); + mhdrChunk.injectInt(16, frameCount); + mhdrChunk.injectInt(20, frameCount); + mhdrChunk.injectInt(24, 583); mhdrChunk.calcCRC(); mhdrChunk.write(out); + headerWritten = true; } + Chunk defiChunk = new Chunk(4, DEFI); + defiChunk.injectInt(0, (seqNum++) << 16); + defiChunk.calcCRC(); + defiChunk.write(out); + chunk.write(out); break; case IDAT: + chunk.write(out); break; + + case IEND: + chunk.write(out); + break; } chunk = pStrm.readNextChunk(); } - processedFirstFrame = true; - return true; } catch (IOException ioe) { return false; Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchAnimFrame.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchAnimFrame.java 2008-02-10 17:34:27 UTC (rev 149) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchAnimFrame.java 2008-02-10 18:15:14 UTC (rev 150) @@ -110,7 +110,6 @@ exportAnimatedGifItem = new JMenuItem(rb.getString(PatchAnimBundle.ANIMATEDGIF)); exportAnimatedPngItem = new JMenuItem(rb.getString(PatchAnimBundle.ANIMATEDPNG)); exportAnimatedMngItem = new JMenuItem(rb.getString(PatchAnimBundle.ANIMATEDMNG)); - exportAnimatedMngItem.setEnabled(false); exportMenu.add(exportJpgsItem); exportMenu.add(exportPngsItem); exportMenu.add(exportGifsItem); Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchExporter.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchExporter.java 2008-02-10 17:34:27 UTC (rev 149) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchExporter.java 2008-02-10 18:15:14 UTC (rev 150) @@ -100,6 +100,7 @@ } else if (type == ExportType.AnimatedMng) { mngEncoder.setRepeat(atype != AnimationType.None); mngEncoder.setNumFrames(totalImages); + mngEncoder.setDelay(100); } if (lastPatch == 0) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-02-10 17:34:21
|
Revision: 149 http://patchanim.svn.sourceforge.net/patchanim/?rev=149&view=rev Author: dbrosius Date: 2008-02-10 09:34:27 -0800 (Sun, 10 Feb 2008) Log Message: ----------- break out Chunk and PrmStream to separate class, remove references to MPeg, and stub in Mng support Modified Paths: -------------- trunk/patchanim/src/com/mebigfatguy/encoders/APngEncoder.java trunk/patchanim/src/com/mebigfatguy/patchanim/ExportType.java trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchAnimFrame.java trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchExporter.java trunk/patchanim/src/com/mebigfatguy/patchanim/main/PatchAnimBundle.java trunk/patchanim/src/com/mebigfatguy/patchanim/resources.properties Added Paths: ----------- trunk/patchanim/src/com/mebigfatguy/encoders/Chunk.java trunk/patchanim/src/com/mebigfatguy/encoders/MngEncoder.java trunk/patchanim/src/com/mebigfatguy/encoders/PngStream.java Modified: trunk/patchanim/src/com/mebigfatguy/encoders/APngEncoder.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/encoders/APngEncoder.java 2008-02-10 17:26:23 UTC (rev 148) +++ trunk/patchanim/src/com/mebigfatguy/encoders/APngEncoder.java 2008-02-10 17:34:27 UTC (rev 149) @@ -16,7 +16,7 @@ * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -package com.mebigfatguy.apng; +package com.mebigfatguy.encoders; import java.awt.image.BufferedImage; import java.io.BufferedOutputStream; @@ -25,7 +25,6 @@ import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStream; -import java.util.zip.CRC32; import javax.imageio.ImageIO; @@ -122,7 +121,7 @@ pStrm = new PngStream(baos.toByteArray()); baos.reset(); } - Chunk chunk = pStrm.readNextChunk(pStrm); + Chunk chunk = pStrm.readNextChunk(); while (chunk != null) { switch (chunk.type) { case IHDR: @@ -164,7 +163,7 @@ } break; } - chunk = pStrm.readNextChunk(pStrm); + chunk = pStrm.readNextChunk(); } processedFirstFrame = true; @@ -175,81 +174,4 @@ } } - - static class PngStream { - public PngStream(byte[] pngData) { - pos = HEADER.length; - data = pngData; - } - - public Chunk readNextChunk(PngStream pStrm) { - if (pos >= data.length) - return null; - - Chunk c = new Chunk(readNextInt(), readNextInt()); - - System.arraycopy(data, pos, c.data, 0, c.length); - pos += c.length; - c.crc = readNextInt(); - return c; - } - - private int readNextInt() { - int val = 0; - for (int i = 0; i < 4; i++) { - val <<= 8; - val |= (0x00FF & data[pos++]); - } - return val; - } - - public int pos; - public byte[] data; - } - - static class Chunk { - - public int length; - public int type; - public byte[] data; - public int crc; - - public Chunk(int len, int chunkType) { - length = len; - type = chunkType; - data = new byte[length]; - crc = 0; - } - - public void write(DataOutputStream out) throws IOException { - out.writeInt(length); - out.writeInt(type); - out.write(data); - out.writeInt(crc); - } - - public void injectInt(int offset, int value) { - data[offset++] = (byte)(value >> 24 & 0x00FF); - data[offset++] = (byte)(value >> 16 & 0x00FF); - data[offset++] = (byte)(value >> 8 & 0x00FF); - data[offset] = (byte)(value & 0x00FF); - } - - public void injectShort(int offset, int value) { - data[offset++] = (byte)(value >> 8 & 0x00FF); - data[offset] = (byte)(value & 0x00FF); - } - - public void calcCRC() { - CRC32 crc32 = new CRC32(); - byte[] typeBytes = new byte[4]; - typeBytes[0] = (byte)(type >> 24 & 0x00FF); - typeBytes[1] = (byte)(type >> 16 & 0x00FF); - typeBytes[2] = (byte)(type >> 8 & 0x00FF); - typeBytes[3] = (byte)(type & 0x00FF); - crc32.update(typeBytes); - crc32.update(data); - crc = (int)crc32.getValue(); - } - } } Added: trunk/patchanim/src/com/mebigfatguy/encoders/Chunk.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/encoders/Chunk.java (rev 0) +++ trunk/patchanim/src/com/mebigfatguy/encoders/Chunk.java 2008-02-10 17:34:27 UTC (rev 149) @@ -0,0 +1,69 @@ +/* + * patchanim - A bezier surface patch color blend gif builder + * Copyright (C) 2008 Dave Brosius + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +package com.mebigfatguy.encoders; + +import java.io.DataOutputStream; +import java.io.IOException; +import java.util.zip.CRC32; + +public class Chunk { + + public int length; + public int type; + public byte[] data; + public int crc; + + public Chunk(int len, int chunkType) { + length = len; + type = chunkType; + data = new byte[length]; + crc = 0; + } + + public void write(DataOutputStream out) throws IOException { + out.writeInt(length); + out.writeInt(type); + out.write(data); + out.writeInt(crc); + } + + public void injectInt(int offset, int value) { + data[offset++] = (byte)(value >> 24 & 0x00FF); + data[offset++] = (byte)(value >> 16 & 0x00FF); + data[offset++] = (byte)(value >> 8 & 0x00FF); + data[offset] = (byte)(value & 0x00FF); + } + + public void injectShort(int offset, int value) { + data[offset++] = (byte)(value >> 8 & 0x00FF); + data[offset] = (byte)(value & 0x00FF); + } + + public void calcCRC() { + CRC32 crc32 = new CRC32(); + byte[] typeBytes = new byte[4]; + typeBytes[0] = (byte)(type >> 24 & 0x00FF); + typeBytes[1] = (byte)(type >> 16 & 0x00FF); + typeBytes[2] = (byte)(type >> 8 & 0x00FF); + typeBytes[3] = (byte)(type & 0x00FF); + crc32.update(typeBytes); + crc32.update(data); + crc = (int)crc32.getValue(); + } +} \ No newline at end of file Property changes on: trunk/patchanim/src/com/mebigfatguy/encoders/Chunk.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + native Added: trunk/patchanim/src/com/mebigfatguy/encoders/MngEncoder.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/encoders/MngEncoder.java (rev 0) +++ trunk/patchanim/src/com/mebigfatguy/encoders/MngEncoder.java 2008-02-10 17:34:27 UTC (rev 149) @@ -0,0 +1,148 @@ +/* + * patchanim - A bezier surface patch color blend gif builder + * Copyright (C) 2008 Dave Brosius + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +package com.mebigfatguy.encoders; + +import java.awt.image.BufferedImage; +import java.io.BufferedOutputStream; +import java.io.ByteArrayOutputStream; +import java.io.DataOutputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.OutputStream; + +import javax.imageio.ImageIO; + +import com.mebigfatguy.patchanim.ExportType; + +/** + * generates mng files by simply relying on the built in png encoder of ImageIO + * and sewing together multiple chunks from the underlying pngs. + */ +public class MngEncoder { + private static final byte[] HEADER = new byte[] { -118, 77, 78, 71, 13, 10, 26, 10 }; + private static final int IHDR = 0x49484452; + private static final int IDAT = 0x49444154; + private static final int IEND = 0x49454E44; + private static final int MHDR = 0; + private static final int MEND = 0; + + private DataOutputStream out = null; + private boolean started = false; + private boolean closeStream = false; + private boolean headerWritten = false; + private boolean repeatInfinite = false; + private int delay = 100; + private int frameCount = 1; + private int seqNum = 0; + private boolean processedFirstFrame = false; + + public void setDelay(int ms) { + delay = ms; + } + + public void setRepeat(boolean infinite) { + repeatInfinite = infinite; + } + + public void setNumFrames(int frames) { + frameCount = frames; + } + + public boolean start(OutputStream os) { + if (os == null) + return false; + boolean ok = true; + closeStream = false; + out = new DataOutputStream(os); + try { + out.write(HEADER); + } catch (IOException e) { + ok = false; + } + return started = ok; + } + + public boolean start(String file) { + boolean ok = true; + try { + out = new DataOutputStream(new BufferedOutputStream(new FileOutputStream(file))); + ok = start(out); + closeStream = true; + } catch (IOException e) { + ok = false; + } + return started = ok; + } + + public boolean finish() { + if (!started) + return false; + try { + Chunk iendChunk = new Chunk(0, MEND); + iendChunk.calcCRC(); + iendChunk.write(out); + if (closeStream) + out.close(); + } catch (IOException ioe) { + } finally { + out = null; + started = false; + } + + return true; + } + + public boolean addFrame(BufferedImage im) { + if ((im == null) || !started) + return false; + try { + PngStream pStrm; + boolean sawIDAT = false; + { + ByteArrayOutputStream baos = new ByteArrayOutputStream(im.getHeight() * im.getWidth()); //a conservative estimate + ImageIO.write(im, ExportType.Pngs.getExtension(), baos); + pStrm = new PngStream(baos.toByteArray()); + baos.reset(); + } + Chunk chunk = pStrm.readNextChunk(); + while (chunk != null) { + switch (chunk.type) { + case IHDR: + if (!headerWritten) { + Chunk mhdrChunk = new Chunk(28, MHDR); + mhdrChunk.calcCRC(); + mhdrChunk.write(out); + } + break; + + case IDAT: + break; + } + chunk = pStrm.readNextChunk(); + } + processedFirstFrame = true; + + return true; + } catch (IOException ioe) { + return false; + } finally { + + } + } +} Property changes on: trunk/patchanim/src/com/mebigfatguy/encoders/MngEncoder.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + native Added: trunk/patchanim/src/com/mebigfatguy/encoders/PngStream.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/encoders/PngStream.java (rev 0) +++ trunk/patchanim/src/com/mebigfatguy/encoders/PngStream.java 2008-02-10 17:34:27 UTC (rev 149) @@ -0,0 +1,52 @@ +/* + * patchanim - A bezier surface patch color blend gif builder + * Copyright (C) 2008 Dave Brosius + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +package com.mebigfatguy.encoders; + +public class PngStream { + private static final int HEADERLENGTH = 8; + public int pos; + public byte[] data; + + public PngStream(byte[] pngData) { + pos = HEADERLENGTH; + data = pngData; + } + + public Chunk readNextChunk() { + if (pos >= data.length) + return null; + + Chunk c = new Chunk(readNextInt(), readNextInt()); + + System.arraycopy(data, pos, c.data, 0, c.length); + pos += c.length; + c.crc = readNextInt(); + return c; + } + + private int readNextInt() { + int val = 0; + for (int i = 0; i < 4; i++) { + val <<= 8; + val |= (0x00FF & data[pos++]); + } + return val; + } + +} Property changes on: trunk/patchanim/src/com/mebigfatguy/encoders/PngStream.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + native Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/ExportType.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/ExportType.java 2008-02-10 17:26:23 UTC (rev 148) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/ExportType.java 2008-02-10 17:34:27 UTC (rev 149) @@ -10,7 +10,7 @@ * <li><b>Gifs</b> a series of Gif files in a directory</li> * <li><b>AnimatedGif</b> an animated gif file</li> * <li><b>AnimatedPng</b> an animated png file</li> - * <li><b>Mpeg</b> an animated mpeg file</li> + * <li><b>AnimatedMng</b> an animated mng file</li> * </ul> */ public enum ExportType { @@ -19,7 +19,7 @@ Gifs("gif", true, PatchAnimBundle.GIFSERIESFILTER), AnimatedGif("gif", false, PatchAnimBundle.ANIMATEDGIFFILTER), AnimatedPng("png", false, PatchAnimBundle.ANIMATEDPNGFILTER), - MPeg("mpeg", false, PatchAnimBundle.MPEGFILTER); + AnimatedMng("mng", false, PatchAnimBundle.ANIMATEDMNGFILTER); private String ext; private boolean multi; Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchAnimFrame.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchAnimFrame.java 2008-02-10 17:26:23 UTC (rev 148) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchAnimFrame.java 2008-02-10 17:34:27 UTC (rev 149) @@ -61,6 +61,7 @@ private JMenuItem exportGifsItem; private JMenuItem exportAnimatedGifItem; private JMenuItem exportAnimatedPngItem; + private JMenuItem exportAnimatedMngItem; private JMenuItem quitItem; private PatchAnimDocument document; private File documentLocation; @@ -108,12 +109,15 @@ exportGifsItem = new JMenuItem(rb.getString(PatchAnimBundle.GIFSERIES)); exportAnimatedGifItem = new JMenuItem(rb.getString(PatchAnimBundle.ANIMATEDGIF)); exportAnimatedPngItem = new JMenuItem(rb.getString(PatchAnimBundle.ANIMATEDPNG)); + exportAnimatedMngItem = new JMenuItem(rb.getString(PatchAnimBundle.ANIMATEDMNG)); + exportAnimatedMngItem.setEnabled(false); exportMenu.add(exportJpgsItem); exportMenu.add(exportPngsItem); exportMenu.add(exportGifsItem); exportMenu.addSeparator(); exportMenu.add(exportAnimatedGifItem); exportMenu.add(exportAnimatedPngItem); + exportMenu.add(exportAnimatedMngItem); fileMenu.add(exportMenu); fileMenu.addSeparator(); quitItem = new JMenuItem(rb.getString(PatchAnimBundle.QUIT)); @@ -245,6 +249,12 @@ } }); + exportAnimatedMngItem.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent ae) { + export(ExportType.AnimatedMng); + } + }); + quitItem.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) { try { Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchExporter.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchExporter.java 2008-02-10 17:26:23 UTC (rev 148) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchExporter.java 2008-02-10 17:34:27 UTC (rev 149) @@ -29,7 +29,8 @@ import javax.imageio.ImageIO; import com.fmsware.gif.AnimatedGifEncoder; -import com.mebigfatguy.apng.APngEncoder; +import com.mebigfatguy.encoders.APngEncoder; +import com.mebigfatguy.encoders.MngEncoder; import com.mebigfatguy.patchanim.AnimationType; import com.mebigfatguy.patchanim.ExportType; import com.mebigfatguy.patchanim.OutOfBoundsColor; @@ -44,6 +45,7 @@ private File loc; private AnimatedGifEncoder agEncoder; private APngEncoder apngEncoder; + private MngEncoder mngEncoder; private int totalImages; private Set<ExportListener> elisteners = new HashSet<ExportListener>(); @@ -54,8 +56,8 @@ agEncoder = new AnimatedGifEncoder(); else if (type == ExportType.AnimatedPng) apngEncoder = new APngEncoder(); - else - agEncoder = null; + else if (type == ExportType.AnimatedMng) + mngEncoder = new MngEncoder(); } public void addExportListener(ExportListener el) { @@ -76,6 +78,8 @@ agEncoder.start(new File(loc, baseName).getPath()); else if (type == ExportType.AnimatedPng) apngEncoder.start(new File(loc, baseName).getPath()); + else if (type == ExportType.AnimatedMng) + mngEncoder.start(new File(loc, baseName).getPath()); } totalImages = calcImageCount(document); @@ -93,6 +97,9 @@ } else if (type == ExportType.AnimatedPng) { apngEncoder.setRepeat(atype != AnimationType.None); apngEncoder.setNumFrames(totalImages); + } else if (type == ExportType.AnimatedMng) { + mngEncoder.setRepeat(atype != AnimationType.None); + mngEncoder.setNumFrames(totalImages); } if (lastPatch == 0) { @@ -134,6 +141,8 @@ agEncoder.finish(); } else if (type == ExportType.AnimatedPng) { apngEncoder.finish(); + } else if (type == ExportType.AnimatedMng) { + mngEncoder.finish(); } } } @@ -157,6 +166,9 @@ } else if (type == ExportType.AnimatedPng) { apngEncoder.setDelay(100); apngEncoder.addFrame(image); + } else if (type == ExportType.AnimatedMng) { + mngEncoder.setDelay(100); + mngEncoder.addFrame(image); } else ImageIO.write(image, type.getExtension(), imageFile); Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/main/PatchAnimBundle.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/main/PatchAnimBundle.java 2008-02-10 17:26:23 UTC (rev 148) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/main/PatchAnimBundle.java 2008-02-10 17:34:27 UTC (rev 149) @@ -40,8 +40,8 @@ public static final String ANIMATEDGIFFILTER = "patchanim.filter.animatedgif"; public static final String ANIMATEDPNG = "patchanim.apng"; public static final String ANIMATEDPNGFILTER = "patchanim.filter.apng"; - public static final String MPEG = "patchanim.mpeg"; - public static final String MPEGFILTER = "patchanim.filter.mpeg"; + public static final String ANIMATEDMNG = "patchanim.mng"; + public static final String ANIMATEDMNGFILTER = "patchanim.filter.mng"; public static final String EXPORTINGFILE = "patchanim.exportfile"; public static final String QUIT = "patchanim.quit"; public static final String CONTROLS = "patchanim.control"; Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/resources.properties =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/resources.properties 2008-02-10 17:26:23 UTC (rev 148) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/resources.properties 2008-02-10 17:34:27 UTC (rev 149) @@ -33,8 +33,8 @@ patchanim.filter.animatedgif = GIF Files (*.gif) patchanim.apng = an Animated PNG patchanim.filter.apng = (PNG Files (*.png) -patchanim.mpeg = an MPEG -patchanim.filter.mpeg = MPEG Files (*.mpg) +patchanim.mng = an Animated MNG +patchanim.filter.mng = (MNG Files (*.mng) patchanim.exportfile = Exporting Animation patchanim.quit = Quit patchanim.control = Controls This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-02-10 17:26:18
|
Revision: 148 http://patchanim.svn.sourceforge.net/patchanim/?rev=148&view=rev Author: dbrosius Date: 2008-02-10 09:26:23 -0800 (Sun, 10 Feb 2008) Log Message: ----------- Renamed apng to encoders Added Paths: ----------- trunk/patchanim/src/com/mebigfatguy/encoders/ Removed Paths: ------------- trunk/patchanim/src/com/mebigfatguy/apng/ Copied: trunk/patchanim/src/com/mebigfatguy/encoders (from rev 147, trunk/patchanim/src/com/mebigfatguy/apng) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-02-10 17:08:30
|
Revision: 147 http://patchanim.svn.sourceforge.net/patchanim/?rev=147&view=rev Author: dbrosius Date: 2008-02-10 09:08:35 -0800 (Sun, 10 Feb 2008) Log Message: ----------- capitalize graphic format names Modified Paths: -------------- trunk/patchanim/src/com/mebigfatguy/patchanim/resources.properties Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/resources.properties =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/resources.properties 2008-02-10 07:32:58 UTC (rev 146) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/resources.properties 2008-02-10 17:08:35 UTC (rev 147) @@ -26,13 +26,13 @@ patchanim.jpgs = a series of JPGs patchanim.filter.jpgs = Files (*.jpg) patchanim.pngs = a series of PNGs -patchanim.filter.pngs = Png Files (*.png) +patchanim.filter.pngs = PNG Files (*.png) patchanim.gifs = a series of GIFs -patchanim.filter.gifs = Gif Files (*.gif) -patchanim.animatedgif = an Animated Gif -patchanim.filter.animatedgif = Gif Files (*.gif) -patchanim.apng = an Animated Png -patchanim.filter.apng = (Png Files (*.png) +patchanim.filter.gifs = GIF Files (*.gif) +patchanim.animatedgif = an Animated GIF +patchanim.filter.animatedgif = GIF Files (*.gif) +patchanim.apng = an Animated PNG +patchanim.filter.apng = (PNG Files (*.png) patchanim.mpeg = an MPEG patchanim.filter.mpeg = MPEG Files (*.mpg) patchanim.exportfile = Exporting Animation This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-02-10 07:32:54
|
Revision: 146 http://patchanim.svn.sourceforge.net/patchanim/?rev=146&view=rev Author: dbrosius Date: 2008-02-09 23:32:58 -0800 (Sat, 09 Feb 2008) Log Message: ----------- update the date Modified Paths: -------------- trunk/patchanim/htdocs/index.html Modified: trunk/patchanim/htdocs/index.html =================================================================== --- trunk/patchanim/htdocs/index.html 2008-02-10 07:27:59 UTC (rev 145) +++ trunk/patchanim/htdocs/index.html 2008-02-10 07:32:58 UTC (rev 146) @@ -50,7 +50,7 @@ very easy to generate in-between images from two separate blend descriptions.</p> - <p><b>Feb 2, 2008 - This tool is not finished at this time, although the patch animations work</b><br/> + <p><b>Feb 10, 2008 - This tool is not finished at this time, although the patch animations work</b><br/> Still to be done: <ul> <li>export to mpeg?</li> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-02-10 07:27:54
|
Revision: 145 http://patchanim.svn.sourceforge.net/patchanim/?rev=145&view=rev Author: dbrosius Date: 2008-02-09 23:27:59 -0800 (Sat, 09 Feb 2008) Log Message: ----------- better docs Modified Paths: -------------- trunk/patchanim/htdocs/index.html Modified: trunk/patchanim/htdocs/index.html =================================================================== --- trunk/patchanim/htdocs/index.html 2008-02-10 07:21:20 UTC (rev 144) +++ trunk/patchanim/htdocs/index.html 2008-02-10 07:27:59 UTC (rev 145) @@ -19,8 +19,8 @@ <p>This tool creates a sequence of color blends using <a href="http://en.wikipedia.org/wiki/B%C3%A9zier_surface">Bezier Patches</a>. This sequence of blends is tweened and - animated giving smooth transitions from one blend to another. Blend animations can be outputted to animated gifs, mpegs - or a series of bitmaps.</p> + animated giving smooth transitions from one blend to another. Blend animations can be outputted to animated gifs, animated pngs + or a series of gifs, pngs or jpegs.</p> <div style="position:relative;left:100;"><img src="animation.gif"/></div> <p>Unfortunately gif files are 256 color images, and so you get some grainyness. If you have <a href="http://developer.mozilla.org/en/docs/Main_Page">FireFox 3.0</a> with the This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-02-10 07:21:16
|
Revision: 144 http://patchanim.svn.sourceforge.net/patchanim/?rev=144&view=rev Author: dbrosius Date: 2008-02-09 23:21:20 -0800 (Sat, 09 Feb 2008) Log Message: ----------- spell APNG edit correctly Modified Paths: -------------- trunk/patchanim/htdocs/index.html Modified: trunk/patchanim/htdocs/index.html =================================================================== --- trunk/patchanim/htdocs/index.html 2008-02-10 07:18:13 UTC (rev 143) +++ trunk/patchanim/htdocs/index.html 2008-02-10 07:21:20 UTC (rev 144) @@ -24,7 +24,7 @@ <div style="position:relative;left:100;"><img src="animation.gif"/></div> <p>Unfortunately gif files are 256 color images, and so you get some grainyness. If you have <a href="http://developer.mozilla.org/en/docs/Main_Page">FireFox 3.0</a> with the - <a href="https://addons.mozilla.org/en-US/firefox/addon/5519">APng Editor</a> plugin, you can see the following + <a href="https://addons.mozilla.org/en-US/firefox/addon/5519">APNG Edit</a> plugin, you can see the following Animated Png, which is shown in 24 bit color. If you do not, you will just see a still image.</p> <div style="position:relative;left:100;"><img src="animation.png"/></div> <p>A Cubic Bezier <b>curve</b> is a curve defined by 4 control points. The curve goes thru both end points, and This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-02-10 07:18:08
|
Revision: 143 http://patchanim.svn.sourceforge.net/patchanim/?rev=143&view=rev Author: dbrosius Date: 2008-02-09 23:18:13 -0800 (Sat, 09 Feb 2008) Log Message: ----------- better doc Modified Paths: -------------- trunk/patchanim/htdocs/index.html Modified: trunk/patchanim/htdocs/index.html =================================================================== --- trunk/patchanim/htdocs/index.html 2008-02-10 07:16:48 UTC (rev 142) +++ trunk/patchanim/htdocs/index.html 2008-02-10 07:18:13 UTC (rev 143) @@ -22,10 +22,10 @@ animated giving smooth transitions from one blend to another. Blend animations can be outputted to animated gifs, mpegs or a series of bitmaps.</p> <div style="position:relative;left:100;"><img src="animation.gif"/></div> - <p>Unfortunately gif files are 256 images, and so you get some grainyness. If you have + <p>Unfortunately gif files are 256 color images, and so you get some grainyness. If you have <a href="http://developer.mozilla.org/en/docs/Main_Page">FireFox 3.0</a> with the <a href="https://addons.mozilla.org/en-US/firefox/addon/5519">APng Editor</a> plugin, you can see the following - Animated Png, which is shown in 24 bits. If you do not, you will just see a still image.</p> + Animated Png, which is shown in 24 bit color. If you do not, you will just see a still image.</p> <div style="position:relative;left:100;"><img src="animation.png"/></div> <p>A Cubic Bezier <b>curve</b> is a curve defined by 4 control points. The curve goes thru both end points, and the curve is influenced by the two middle points. In fact the slope of the curve at the first point is equal to This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-02-10 07:16:43
|
Revision: 142 http://patchanim.svn.sourceforge.net/patchanim/?rev=142&view=rev Author: dbrosius Date: 2008-02-09 23:16:48 -0800 (Sat, 09 Feb 2008) Log Message: ----------- fix html Modified Paths: -------------- trunk/patchanim/htdocs/index.html Modified: trunk/patchanim/htdocs/index.html =================================================================== --- trunk/patchanim/htdocs/index.html 2008-02-10 07:15:46 UTC (rev 141) +++ trunk/patchanim/htdocs/index.html 2008-02-10 07:16:48 UTC (rev 142) @@ -23,7 +23,7 @@ or a series of bitmaps.</p> <div style="position:relative;left:100;"><img src="animation.gif"/></div> <p>Unfortunately gif files are 256 images, and so you get some grainyness. If you have - <a href="http://developer.mozilla.org/en/docs/Main_Page">FireFox 3.0</b> with the + <a href="http://developer.mozilla.org/en/docs/Main_Page">FireFox 3.0</a> with the <a href="https://addons.mozilla.org/en-US/firefox/addon/5519">APng Editor</a> plugin, you can see the following Animated Png, which is shown in 24 bits. If you do not, you will just see a still image.</p> <div style="position:relative;left:100;"><img src="animation.png"/></div> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-02-10 07:15:42
|
Revision: 141 http://patchanim.svn.sourceforge.net/patchanim/?rev=141&view=rev Author: dbrosius Date: 2008-02-09 23:15:46 -0800 (Sat, 09 Feb 2008) Log Message: ----------- add links for firefox 3.0 and apng editor Modified Paths: -------------- trunk/patchanim/htdocs/index.html Modified: trunk/patchanim/htdocs/index.html =================================================================== --- trunk/patchanim/htdocs/index.html 2008-02-10 07:11:33 UTC (rev 140) +++ trunk/patchanim/htdocs/index.html 2008-02-10 07:15:46 UTC (rev 141) @@ -22,8 +22,10 @@ animated giving smooth transitions from one blend to another. Blend animations can be outputted to animated gifs, mpegs or a series of bitmaps.</p> <div style="position:relative;left:100;"><img src="animation.gif"/></div> - <p>Unfortunately gif files are 256 images, and so you get some grainyness. If you have FireFox 3.0 with the APng Editor - plugin, you can see the following Animated Png, which is shown in 24 bits. If you do not, you will just see a still image.</p> + <p>Unfortunately gif files are 256 images, and so you get some grainyness. If you have + <a href="http://developer.mozilla.org/en/docs/Main_Page">FireFox 3.0</b> with the + <a href="https://addons.mozilla.org/en-US/firefox/addon/5519">APng Editor</a> plugin, you can see the following + Animated Png, which is shown in 24 bits. If you do not, you will just see a still image.</p> <div style="position:relative;left:100;"><img src="animation.png"/></div> <p>A Cubic Bezier <b>curve</b> is a curve defined by 4 control points. The curve goes thru both end points, and the curve is influenced by the two middle points. In fact the slope of the curve at the first point is equal to This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-02-10 07:11:28
|
Revision: 140 http://patchanim.svn.sourceforge.net/patchanim/?rev=140&view=rev Author: dbrosius Date: 2008-02-09 23:11:33 -0800 (Sat, 09 Feb 2008) Log Message: ----------- update web page to show animated png Modified Paths: -------------- trunk/patchanim/htdocs/index.html Added Paths: ----------- trunk/patchanim/htdocs/animation.png Added: trunk/patchanim/htdocs/animation.png =================================================================== (Binary files differ) Property changes on: trunk/patchanim/htdocs/animation.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Modified: trunk/patchanim/htdocs/index.html =================================================================== --- trunk/patchanim/htdocs/index.html 2008-02-10 07:02:15 UTC (rev 139) +++ trunk/patchanim/htdocs/index.html 2008-02-10 07:11:33 UTC (rev 140) @@ -22,9 +22,9 @@ animated giving smooth transitions from one blend to another. Blend animations can be outputted to animated gifs, mpegs or a series of bitmaps.</p> <div style="position:relative;left:100;"><img src="animation.gif"/></div> - <p>Unfortunately gif files are 256 images, and so you get some grainyness. Eventually MPeg and APng will be supported to - get around this shortcoming</p> - + <p>Unfortunately gif files are 256 images, and so you get some grainyness. If you have FireFox 3.0 with the APng Editor + plugin, you can see the following Animated Png, which is shown in 24 bits. If you do not, you will just see a still image.</p> + <div style="position:relative;left:100;"><img src="animation.png"/></div> <p>A Cubic Bezier <b>curve</b> is a curve defined by 4 control points. The curve goes thru both end points, and the curve is influenced by the two middle points. In fact the slope of the curve at the first point is equal to the slope of the line from the first to the second point. Similarly the slope of the curve at the end point is This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-02-10 07:02:09
|
Revision: 139 http://patchanim.svn.sourceforge.net/patchanim/?rev=139&view=rev Author: dbrosius Date: 2008-02-09 23:02:15 -0800 (Sat, 09 Feb 2008) Log Message: ----------- update for apng working Modified Paths: -------------- trunk/patchanim/htdocs/index.html Modified: trunk/patchanim/htdocs/index.html =================================================================== --- trunk/patchanim/htdocs/index.html 2008-02-10 06:59:23 UTC (rev 138) +++ trunk/patchanim/htdocs/index.html 2008-02-10 07:02:15 UTC (rev 139) @@ -51,7 +51,7 @@ <p><b>Feb 2, 2008 - This tool is not finished at this time, although the patch animations work</b><br/> Still to be done: <ul> - <li>export to mpeg, apng?</li> + <li>export to mpeg?</li> <li>Patch Library</li> <li>Color Swatch for editing values</li> <li>....and much more</li> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-02-10 06:59:18
|
Revision: 138 http://patchanim.svn.sourceforge.net/patchanim/?rev=138&view=rev Author: dbrosius Date: 2008-02-09 22:59:23 -0800 (Sat, 09 Feb 2008) Log Message: ----------- YEAH! Crc32 to the rescue, APngs work! Modified Paths: -------------- trunk/patchanim/src/com/mebigfatguy/apng/APngEncoder.java Modified: trunk/patchanim/src/com/mebigfatguy/apng/APngEncoder.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/apng/APngEncoder.java 2008-02-10 06:00:52 UTC (rev 137) +++ trunk/patchanim/src/com/mebigfatguy/apng/APngEncoder.java 2008-02-10 06:59:23 UTC (rev 138) @@ -25,6 +25,7 @@ import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStream; +import java.util.zip.CRC32; import javax.imageio.ImageIO; @@ -207,23 +208,7 @@ } static class Chunk { - private static long crcTable[] = new long[256]; - static { - long c; - int n, k; - - for (n = 0; n < 256; n++) { - c = (long) n; - for (k = 0; k < 8; k++) { - if ((c & 1) != 0) - c = 0xedb88320L ^ (c >> 1); - else - c = c >> 1; - } - crcTable[n] = c; - } - } - + public int length; public int type; public byte[] data; @@ -256,13 +241,15 @@ } public void calcCRC() { - long c = -1; - for (int n = 0; n < length; n++) { - c = crcTable[(int)((c ^ data[n]) & 0x00FF)] ^ (c >> 8); - } - - c ^= -1; - crc = (int)c; + CRC32 crc32 = new CRC32(); + byte[] typeBytes = new byte[4]; + typeBytes[0] = (byte)(type >> 24 & 0x00FF); + typeBytes[1] = (byte)(type >> 16 & 0x00FF); + typeBytes[2] = (byte)(type >> 8 & 0x00FF); + typeBytes[3] = (byte)(type & 0x00FF); + crc32.update(typeBytes); + crc32.update(data); + crc = (int)crc32.getValue(); } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-02-10 06:00:47
|
Revision: 137 http://patchanim.svn.sourceforge.net/patchanim/?rev=137&view=rev Author: dbrosius Date: 2008-02-09 22:00:52 -0800 (Sat, 09 Feb 2008) Log Message: ----------- fix crc Modified Paths: -------------- trunk/patchanim/src/com/mebigfatguy/apng/APngEncoder.java Modified: trunk/patchanim/src/com/mebigfatguy/apng/APngEncoder.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/apng/APngEncoder.java 2008-02-10 05:56:06 UTC (rev 136) +++ trunk/patchanim/src/com/mebigfatguy/apng/APngEncoder.java 2008-02-10 06:00:52 UTC (rev 137) @@ -261,7 +261,7 @@ c = crcTable[(int)((c ^ data[n]) & 0x00FF)] ^ (c >> 8); } - c &= -1; + c ^= -1; crc = (int)c; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-02-10 05:56:01
|
Revision: 136 http://patchanim.svn.sourceforge.net/patchanim/?rev=136&view=rev Author: dbrosius Date: 2008-02-09 21:56:06 -0800 (Sat, 09 Feb 2008) Log Message: ----------- get sequence number right should incr on every fcTL and fdAT Modified Paths: -------------- trunk/patchanim/src/com/mebigfatguy/apng/APngEncoder.java Modified: trunk/patchanim/src/com/mebigfatguy/apng/APngEncoder.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/apng/APngEncoder.java 2008-02-10 05:46:03 UTC (rev 135) +++ trunk/patchanim/src/com/mebigfatguy/apng/APngEncoder.java 2008-02-10 05:56:06 UTC (rev 136) @@ -95,6 +95,9 @@ if (!started) return false; try { + Chunk iendChunk = new Chunk(0, IEND); + iendChunk.calcCRC(); + iendChunk.write(out); if (closeStream) out.close(); } catch (IOException ioe) { @@ -137,7 +140,7 @@ case IDAT: if (!sawIDAT) { Chunk fcTLChunk = new Chunk(26, fcTL); - fcTLChunk.injectInt(0, seqNum); + fcTLChunk.injectInt(0, seqNum++); fcTLChunk.injectInt(4, im.getWidth()); fcTLChunk.injectInt(8, im.getHeight()); fcTLChunk.injectInt(12, 0); @@ -153,22 +156,16 @@ chunk.write(out); } else { Chunk fdATChunk = new Chunk(chunk.length + 4, fdAT); - fdATChunk.injectInt(0, seqNum); + fdATChunk.injectInt(0, seqNum++); System.arraycopy(chunk.data, 0, fdATChunk.data, 4, chunk.length); fdATChunk.calcCRC(); fdATChunk.write(out); } break; - - case IEND: - if (seqNum >= (frameCount - 1)) - chunk.write(out); - break; } chunk = pStrm.readNextChunk(pStrm); } processedFirstFrame = true; - seqNum++; return true; } catch (IOException ioe) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-02-10 05:46:00
|
Revision: 135 http://patchanim.svn.sourceforge.net/patchanim/?rev=135&view=rev Author: dbrosius Date: 2008-02-09 21:46:03 -0800 (Sat, 09 Feb 2008) Log Message: ----------- move to 0.5.0 Modified Paths: -------------- trunk/patchanim/build.xml trunk/patchanim/htdocs/jnlp/patchanim.jnlp Modified: trunk/patchanim/build.xml =================================================================== --- trunk/patchanim/build.xml 2008-02-10 05:37:00 UTC (rev 134) +++ trunk/patchanim/build.xml 2008-02-10 05:46:03 UTC (rev 135) @@ -34,7 +34,7 @@ <property name="javac.deprecation" value="on"/> <property name="javac.debug" value="on"/> - <property name="patchanim.version" value="0.4.0"/> + <property name="patchanim.version" value="0.5.0"/> <target name="clean" description="removes all generated collateral"> <delete dir="${classes.dir}"/> Modified: trunk/patchanim/htdocs/jnlp/patchanim.jnlp =================================================================== --- trunk/patchanim/htdocs/jnlp/patchanim.jnlp 2008-02-10 05:37:00 UTC (rev 134) +++ trunk/patchanim/htdocs/jnlp/patchanim.jnlp 2008-02-10 05:46:03 UTC (rev 135) @@ -16,7 +16,7 @@ </security> <resources> <j2se version="1.5+" initial-heap-size="300m" max-heap-size="800m"/> - <jar href="patchanim-0.4.0.jar"/> + <jar href="patchanim-0.5.0.jar"/> <jar href="xml-apis.jar"/> <jar href="xalan.jar"/> <jar href="xercesImpl.jar"/> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-02-10 05:36:55
|
Revision: 134 http://patchanim.svn.sourceforge.net/patchanim/?rev=134&view=rev Author: dbrosius Date: 2008-02-09 21:37:00 -0800 (Sat, 09 Feb 2008) Log Message: ----------- make sure finish cleans up Modified Paths: -------------- trunk/patchanim/src/com/mebigfatguy/apng/APngEncoder.java Modified: trunk/patchanim/src/com/mebigfatguy/apng/APngEncoder.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/apng/APngEncoder.java 2008-02-10 05:34:06 UTC (rev 133) +++ trunk/patchanim/src/com/mebigfatguy/apng/APngEncoder.java 2008-02-10 05:37:00 UTC (rev 134) @@ -98,6 +98,9 @@ if (closeStream) out.close(); } catch (IOException ioe) { + } finally { + out = null; + started = false; } return true; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-02-10 05:34:03
|
Revision: 133 http://patchanim.svn.sourceforge.net/patchanim/?rev=133&view=rev Author: dbrosius Date: 2008-02-09 21:34:06 -0800 (Sat, 09 Feb 2008) Log Message: ----------- enable the remove button when clone occurs Modified Paths: -------------- trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchListPanel.java Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchListPanel.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchListPanel.java 2008-02-10 05:32:10 UTC (rev 132) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchListPanel.java 2008-02-10 05:34:06 UTC (rev 133) @@ -245,6 +245,7 @@ CombinedPatch newPatch = (CombinedPatch)patch.clone(); patchListModel.add(selIndex + 1, newPatch); patchList.setSelectedIndex(selIndex + 1); + removeButton.setEnabled(true); } }); patchMenu.add(cloneItem); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-02-10 05:32:05
|
Revision: 132 http://patchanim.svn.sourceforge.net/patchanim/?rev=132&view=rev Author: dbrosius Date: 2008-02-09 21:32:10 -0800 (Sat, 09 Feb 2008) Log Message: ----------- fix multi file names Modified Paths: -------------- trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchExporter.java Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchExporter.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchExporter.java 2008-02-10 05:29:53 UTC (rev 131) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchExporter.java 2008-02-10 05:32:10 UTC (rev 132) @@ -140,7 +140,8 @@ private void writeSingleFile(BufferedImage image, int index, File dir, String baseName, ExportType type) throws IOException { NumberFormat nf = NumberFormat.getIntegerInstance(); - nf.setMinimumIntegerDigits(6); + nf.setMinimumIntegerDigits(5); + nf.setGroupingUsed(false); String name = baseName + "_" + nf.format(index) + "." + type.getExtension(); File imageFile = new File(dir, name); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-02-10 05:29:47
|
Revision: 131 http://patchanim.svn.sourceforge.net/patchanim/?rev=131&view=rev Author: dbrosius Date: 2008-02-09 21:29:53 -0800 (Sat, 09 Feb 2008) Log Message: ----------- fix image counts, and make sure IEND gets written for APNGS Modified Paths: -------------- trunk/patchanim/src/com/mebigfatguy/apng/APngEncoder.java trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchExporter.java Modified: trunk/patchanim/src/com/mebigfatguy/apng/APngEncoder.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/apng/APngEncoder.java 2008-02-10 04:33:41 UTC (rev 130) +++ trunk/patchanim/src/com/mebigfatguy/apng/APngEncoder.java 2008-02-10 05:29:53 UTC (rev 131) @@ -158,7 +158,7 @@ break; case IEND: - if (seqNum >= frameCount) + if (seqNum >= (frameCount - 1)) chunk.write(out); break; } Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchExporter.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchExporter.java 2008-02-10 04:33:41 UTC (rev 130) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchExporter.java 2008-02-10 05:29:53 UTC (rev 131) @@ -102,22 +102,27 @@ for(int p = 0; p < lastPatch; p++) { CombinedPatch startPatch = patches.get(p); CombinedPatch endPatch = patches.get(p+1); - for (int t = 0; t < tweenCount; t++) { - CombinedPatch tweenPatch = CombinedPatch.tween(startPatch, endPatch, (double)t / (double)tweenCount); + for (int t = 0; t < tweenCount + 1; t++) { + CombinedPatch tweenPatch = CombinedPatch.tween(startPatch, endPatch, (double)t / (double)(tweenCount + 1)); PatchGenerator.recalcCombinedImage(tweenPatch, image, oob); writeSingleFile(image, imageIndex++, loc, baseName, type); } } - if (atype == AnimationType.None) - return; + if ((atype == AnimationType.None) || (atype == AnimationType.Cycle)) { + CombinedPatch patch = patches.get(lastPatch); + PatchGenerator.recalcCombinedImage(patch, image, oob); + writeSingleFile(image, imageIndex++, loc, baseName, type); + if (atype == AnimationType.None) + return; + } if (atype == AnimationType.Wave) { for (int p = lastPatch; p > 0; p--) { CombinedPatch startPatch = patches.get(p-1); CombinedPatch endPatch = patches.get(p); - for (int t = tweenCount - 1; t >= 0; t--) { - CombinedPatch tweenPatch = CombinedPatch.tween(startPatch, endPatch, (double)t / (double)tweenCount); + for (int t = tweenCount + 1; t > 0; t--) { + CombinedPatch tweenPatch = CombinedPatch.tween(startPatch, endPatch, (double)t / (double)(tweenCount + 1)); PatchGenerator.recalcCombinedImage(tweenPatch, image, oob); writeSingleFile(image, imageIndex++, loc, baseName, type); } @@ -166,10 +171,13 @@ } private int calcImageCount(PatchAnimDocument document) { - int total = (document.getPatches().size() - 1) * document.getTweenCount() + 1; + int numPatches = document.getPatches().size(); + int total = (numPatches - 1) * document.getTweenCount() + (numPatches - 1); if (document.getAnimationType() == AnimationType.Wave) - total *= 2; + total = total * 2; + else + total++; return total; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |