Package | com.threerings.display |
Class | public class JPGEncoder |
Property | Defined by | ||
---|---|---|---|
_bytenew : int = 0 | JPGEncoder | ||
_byteout : ByteArray Byte array to contain the jpg while encoding is in progress.
| JPGEncoder | ||
_bytepos : int = 7 | JPGEncoder | ||
_DCU : Number = 0 | JPGEncoder | ||
_DCV : Number = 0 | JPGEncoder | ||
_DCY : Number = 0 | JPGEncoder | ||
_encodedJpeg : ByteArray Byte array to contain the resuling jpg
| JPGEncoder | ||
_image : BitmapData The image to encode
| JPGEncoder | ||
_pixelGranularity : int The minumum number of pixels that will be processed at a time.
| JPGEncoder | ||
pixelsDone : Boolean = false | JPGEncoder | ||
_xpos : int = 0 | JPGEncoder | ||
_ypos : int = 0 | JPGEncoder |
Method | Defined by | ||
---|---|---|---|
JPGEncoder(image:BitmapData, quality:Number = 50, pixelGranularity:int = 100)
Construct a new JPGEncoder object.
| JPGEncoder | ||
getJpeg():ByteArray
Return a byte array containing the encoded jpeg.
| JPGEncoder | ||
isComplete():Boolean
Return true if the encoding is complete.
| JPGEncoder | ||
process(timeSlice:int):Boolean
Work on encoding the image for a specified number of milliseconds.
| JPGEncoder |
Method | Defined by | ||
---|---|---|---|
completeEncoding():void
Add the EOI marker to the end of the buffer, and make the result available to the consumer
of this class.
| JPGEncoder | ||
encodePixels(unitSize:int):void
Encode a specified number of pixels.
| JPGEncoder | ||
initializeEncoding():void
| JPGEncoder | ||
writeHeader():void
Write the jpeg header into the byte array for output.
| JPGEncoder |
_bytenew | property |
protected var _bytenew:int = 0
_byteout | property |
protected var _byteout:ByteArray
Byte array to contain the jpg while encoding is in progress.
_bytepos | property |
protected var _bytepos:int = 7
_DCU | property |
protected var _DCU:Number = 0
_DCV | property |
protected var _DCV:Number = 0
_DCY | property |
protected var _DCY:Number = 0
_encodedJpeg | property |
protected var _encodedJpeg:ByteArray
Byte array to contain the resuling jpg
_image | property |
protected var _image:BitmapData
The image to encode
_pixelGranularity | property |
protected var _pixelGranularity:int
The minumum number of pixels that will be processed at a time.
pixelsDone | property |
protected var pixelsDone:Boolean = false
_xpos | property |
protected var _xpos:int = 0
_ypos | property |
protected var _ypos:int = 0
JPGEncoder | () | constructor |
public function JPGEncoder(image:BitmapData, quality:Number = 50, pixelGranularity:int = 100)
Construct a new JPGEncoder object.
Parametersimage:BitmapData — The image to encode
|
|
quality:Number (default = 50 ) — Quality level between 1 and 100 determining the level of compression.s
|
|
pixelGranularity:int (default = 100 ) — The minumum number of pixels to process at a time.
|
completeEncoding | () | method |
protected function completeEncoding():void
Add the EOI marker to the end of the buffer, and make the result available to the consumer of this class.
encodePixels | () | method |
protected function encodePixels(unitSize:int):void
Encode a specified number of pixels. Fewer pixels will be encoded if the end of the image is reached first.
ParametersunitSize:int |
getJpeg | () | method |
public function getJpeg():ByteArray
Return a byte array containing the encoded jpeg.
ReturnsByteArray |
initializeEncoding | () | method |
protected function initializeEncoding():void
isComplete | () | method |
public function isComplete():Boolean
Return true if the encoding is complete.
ReturnsBoolean |
process | () | method |
public function process(timeSlice:int):Boolean
Work on encoding the image for a specified number of milliseconds. Return true if there is no more processing to do.
ParameterstimeSlice:int |
Boolean |
writeHeader | () | method |
protected function writeHeader():void
Write the jpeg header into the byte array for output.