Skip to content

Commit

Permalink
* Added transformations support (rotate() and skew())
Browse files Browse the repository at this point in the history
* Faster (4x) JPEG Encoding
  • Loading branch information
thibaultimbert committed Jun 11, 2009
1 parent 8206374 commit 090047c
Show file tree
Hide file tree
Showing 10 changed files with 830 additions and 393 deletions.
99 changes: 51 additions & 48 deletions AlivePDF/.flexLibProperties
Original file line number Diff line number Diff line change
@@ -1,67 +1,70 @@
<?xml version="1.0" encoding="UTF-8"?>
<flexLibProperties version="1">
<includeClasses>
<classEntry path="org.alivepdf.metrics.FontMetrics"/>
<classEntry path="org.alivepdf.viewing.Direction"/>
<classEntry path="org.alivepdf.drawing.DashedLine"/>
<classEntry path="org.alivepdf.encoding.PNGEncoder"/>
<classEntry path="org.alivepdf.pages.Page"/>
<classEntry path="org.alivepdf.viewing.CenterWindow"/>
<classEntry path="org.alivepdf.data.Grid"/>
<classEntry path="org.alivepdf.fonts.FontType"/>
<classEntry path="org.alivepdf.events.ProcessingEvent"/>
<classEntry path="org.alivepdf.saving.Download"/>
<classEntry path="org.alivepdf.encoding.JPEGEncoder"/>
<classEntry path="org.alivepdf.saving.Method"/>
<classEntry path="org.alivepdf.annotations.AnnotationHighlight"/>
<classEntry path="org.alivepdf.encoding.IntList"/>
<classEntry path="org.alivepdf.drawing.Caps"/>
<classEntry path="org.alivepdf.viewing.Title"/>
<classEntry path="org.alivepdf.images.ImageHeader"/>
<classEntry path="org.alivepdf.encoding.Base64"/>
<classEntry path="org.alivepdf.drawing.Joint"/>
<classEntry path="org.alivepdf.viewing.ToolBar"/>
<classEntry path="org.alivepdf.images.PDFImage"/>
<classEntry path="org.alivepdf.fonts.CoreFonts"/>
<classEntry path="org.alivepdf.images.JPEGImage"/>
<classEntry path="org.alivepdf.display.PageMode"/>
<classEntry path="org.alivepdf.cells.CellVO"/>
<classEntry path="org.alivepdf.fonts.FontFamily"/>
<classEntry path="org.alivepdf.transitions.Dimension"/>
<classEntry path="org.alivepdf.layout.Size"/>
<classEntry path="org.alivepdf.pdf.PDF"/>
<classEntry path="org.alivepdf.layout.Align"/>
<classEntry path="org.alivepdf.viewing.MenuBar"/>
<classEntry path="org.alivepdf.layout.Unit"/>
<classEntry path="org.alivepdf.encoding.IntBlock"/>
<classEntry path="org.alivepdf.annotations.AttachFileStyle"/>
<classEntry path="org.alivepdf.annotations.StampStyle"/>
<classEntry path="org.alivepdf.cells.CellVO"/>
<classEntry path="org.alivepdf.colors.CMYKColor"/>
<classEntry path="org.alivepdf.colors.Color"/>
<classEntry path="org.alivepdf.images.GIFImage"/>
<classEntry path="org.alivepdf.colors.GrayColor"/>
<classEntry path="org.alivepdf.colors.IColor"/>
<classEntry path="org.alivepdf.colors.RGBColor"/>
<classEntry path="org.alivepdf.data.Grid"/>
<classEntry path="org.alivepdf.data.GridColumn"/>
<classEntry path="org.alivepdf.viewing.WindowUI"/>
<classEntry path="org.alivepdf.layout.Format"/>
<classEntry path="org.alivepdf.tools.sprintf"/>
<classEntry path="org.alivepdf.transitions.MotionDirection"/>
<classEntry path="org.alivepdf.drawing.WindingRule"/>
<classEntry path="org.alivepdf.transitions.TransitionDirection"/>
<classEntry path="org.alivepdf.images.ImageFormat"/>
<classEntry path="org.alivepdf.display.Display"/>
<classEntry path="org.alivepdf.display.PageMode"/>
<classEntry path="org.alivepdf.colors.IColor"/>
<classEntry path="org.alivepdf.drawing.Blend"/>
<classEntry path="org.alivepdf.drawing.Caps"/>
<classEntry path="org.alivepdf.drawing.DashedLine"/>
<classEntry path="org.alivepdf.drawing.Joint"/>
<classEntry path="org.alivepdf.drawing.WindingRule"/>
<classEntry path="org.alivepdf.encoding.Base64"/>
<classEntry path="org.alivepdf.encoding.JPEGEncoder"/>
<classEntry path="org.alivepdf.encoding.PNGEncoder"/>
<classEntry path="org.alivepdf.events.PageEvent"/>
<classEntry path="org.alivepdf.transitions.Transition"/>
<classEntry path="org.alivepdf.encoding.BitString"/>
<classEntry path="org.alivepdf.colors.CMYKColor"/>
<classEntry path="org.alivepdf.events.PagingEvent"/>
<classEntry path="org.alivepdf.events.ProcessingEvent"/>
<classEntry path="org.alivepdf.fonts.CoreFonts"/>
<classEntry path="org.alivepdf.fonts.FontFamily"/>
<classEntry path="org.alivepdf.fonts.FontType"/>
<classEntry path="org.alivepdf.fonts.Style"/>
<classEntry path="org.alivepdf.html.HTMLTag"/>
<classEntry path="org.alivepdf.images.GIFImage"/>
<classEntry path="org.alivepdf.layout.Orientation"/>
<classEntry path="org.alivepdf.events.PageEvent"/>
<classEntry path="org.alivepdf.images.IImage"/>
<classEntry path="org.alivepdf.images.ImageFormat"/>
<classEntry path="org.alivepdf.images.ImageHeader"/>
<classEntry path="org.alivepdf.images.JPEGImage"/>
<classEntry path="org.alivepdf.images.PDFImage"/>
<classEntry path="org.alivepdf.viewing.FitWindow"/>
<classEntry path="org.alivepdf.layout.Layout"/>
<classEntry path="org.alivepdf.images.PNGImage"/>
<classEntry path="org.alivepdf.images.ResizeMode"/>
<classEntry path="org.alivepdf.layout.Align"/>
<classEntry path="org.alivepdf.layout.Format"/>
<classEntry path="org.alivepdf.layout.Layout"/>
<classEntry path="org.alivepdf.layout.Orientation"/>
<classEntry path="org.alivepdf.layout.Size"/>
<classEntry path="org.alivepdf.layout.Unit"/>
<classEntry path="org.alivepdf.metrics.FontMetrics"/>
<classEntry path="org.alivepdf.pages.Page"/>
<classEntry path="org.alivepdf.pdf.PDF"/>
<classEntry path="org.alivepdf.saving.Download"/>
<classEntry path="org.alivepdf.saving.Method"/>
<classEntry path="org.alivepdf.tools.sprintf"/>
<classEntry path="org.alivepdf.transitions.Dimension"/>
<classEntry path="org.alivepdf.transitions.MotionDirection"/>
<classEntry path="org.alivepdf.transitions.Transition"/>
<classEntry path="org.alivepdf.transitions.TransitionDirection"/>
<classEntry path="org.alivepdf.viewing.CenterWindow"/>
<classEntry path="org.alivepdf.viewing.Direction"/>
<classEntry path="org.alivepdf.viewing.FitWindow"/>
<classEntry path="org.alivepdf.viewing.MenuBar"/>
<classEntry path="org.alivepdf.viewing.Title"/>
<classEntry path="org.alivepdf.viewing.ToolBar"/>
<classEntry path="org.alivepdf.viewing.WindowUI"/>
<classEntry path="org.alivepdf.colors.RGBColor"/>
<classEntry path="org.alivepdf.TestHtml"/>
<classEntry path="org.alivepdf.fonts.Style"/>
<classEntry path="org.alivepdf.data.GridColumn"/>
</includeClasses>
<includeResources/>
<namespaceManifests/>
Expand Down
14 changes: 14 additions & 0 deletions AlivePDF/src/main/flex/org/alivepdf/encoding/BitString.as
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package org.alivepdf.encoding
{
public class BitString
{
public var len:int = 0;
public var val:int = 0;

public function BitString(vl:int, ln:int)
{
val = vl;
len = ln;
}
}
}
43 changes: 43 additions & 0 deletions AlivePDF/src/main/flex/org/alivepdf/encoding/IntBlock.as
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
package org.alivepdf.encoding
{
public class IntBlock
{
public var data:int;
public var next:IntBlock;
public var down:IntBlock;

public function IntBlock(dt:int, nx:IntBlock, dn:IntBlock)
{
data = dt;
next = nx;
down = dn;
}

public static function create8_8(arr:Array):IntBlock
{
if(arr.length != 64) throw new Error("Need an 8*8 array!");

var i:int = arr.length;
var item:IntBlock = null;
var c7:IntBlock = item = new IntBlock(arr[--i], item, null);
var c6:IntBlock = item = new IntBlock(arr[--i], item, null);
var c5:IntBlock = item = new IntBlock(arr[--i], item, null);
var c4:IntBlock = item = new IntBlock(arr[--i], item, null);
var c3:IntBlock = item = new IntBlock(arr[--i], item, null);
var c2:IntBlock = item = new IntBlock(arr[--i], item, null);
var c1:IntBlock = item = new IntBlock(arr[--i], item, null);
var c0:IntBlock = item = new IntBlock(arr[--i], item, null);
while(i != 0) {
c7 = item = new IntBlock(arr[--i], item, c7);
c6 = item = new IntBlock(arr[--i], item, c6);
c5 = item = new IntBlock(arr[--i], item, c5);
c4 = item = new IntBlock(arr[--i], item, c4);
c3 = item = new IntBlock(arr[--i], item, c3);
c2 = item = new IntBlock(arr[--i], item, c2);
c1 = item = new IntBlock(arr[--i], item, c1);
c0 = item = new IntBlock(arr[--i], item, c0);
}
return item;
}
}
}
24 changes: 24 additions & 0 deletions AlivePDF/src/main/flex/org/alivepdf/encoding/IntList.as
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package org.alivepdf.encoding
{
public final class IntList
{
public var data:int;
public var next:IntList;

public function IntList(dt:int, nx:IntList)
{
data = dt;
next = nx;
}

public static function create(arr:Array):IntList
{
var i:int = arr.length;
var itm:IntList = new IntList(arr[--i], null);
while (--i > -1) {
itm = new IntList(arr[i], itm);
}
return itm;
}
}
}
Loading

0 comments on commit 090047c

Please sign in to comment.