-
Notifications
You must be signed in to change notification settings - Fork 26
JPEGEncoder
Nick Ryzhy edited this page Apr 3, 2016
·
9 revisions
Encodes image data using JPEG compression algorithm.
Name | Value |
---|---|
Package | by.blooddy.crypto.image |
Name | final class JPEGEncoder |
Inheritance |
JPEGEncoder → Process → EventDispatcher → Object
|
import by.blooddy.crypto.Base64;
var result:ByteArray = Base64.decode( 'ZWFzdXJlLg==' );
import by.blooddy.crypto.JPEGEncoder;
import by.blooddy.crypto.events.ProcessEvent;
var jpeg:JPEGEncoder= new JPEGEncoder();
jpeg.decode( bytes );
jpeg.addEventListener( ProcessEvent.COMPLETE, function(event:ProcessEvent):void {
var result:ByteArray = event.data;
trace( result ); // async result
} );
jpeg.addEventListener( ProcessEvent.ERROR, function(event:ProcessEvent):void {
var error:Error = event.data;
trace( error ); // async error
} );
Name | Description |
---|---|
encode(image:BitmapData, quality:uint=60):ByteArray |
Creates a JPEG image from the specified BitmapData . Used BitmapData.encode() , if posible. |
encodeBytes(bytes:ByteArray, width:uint, height:uint, quality:uint=60):ByteArray |
Creates a JPEG image from the specified ByteArray . |
Name | Description |
---|---|
function JPEGEncoder() |
Creates a JPEGEncoder object. |
Name | Description |
---|---|
encode(image:BitmapData, quality:uint=60):ByteArray |
Asynchronously creates a JPEG image from the specified BitmapData . Dispatched sequence of bytes in ProcessEvent . |
encodeBytes(bytes:ByteArray, width:uint, height:uint, quality:uint=60):ByteArray |
Asynchronously creates a JPEG image from the specified ByteArray . Dispatched sequence of bytes in ProcessEvent . |
Name | Type | Description |
---|---|---|
complete |
ProcessEvent | Dispatched when success. |
error |
ProcessEven | Dispatched when fault. |