Packagemx.graphics.codec
Classpublic class JPEGEncoder
InheritanceJPEGEncoder Inheritance Object
Implements IImageEncoder

An implementation of IImageEncoder that converts raw bitmaps into encoded images using Joint Photographic Experts Group (JPEG) compression.



Public Properties
 PropertyDefined By
 Inheritedconstructor : Object
A reference to the class object or constructor function for a given object instance.
Object
  contentType : String
[read-only] The MIME type for the JPEG encoded image.
JPEGEncoder
 Inheritedprototype : Object
[static] A reference to the prototype object of a class or function object.
Object
Public Methods
 MethodDefined By
  
JPEGEncoder(quality:Number = 50)
Constructor.
JPEGEncoder
  
Converts the pixels of raw BitmapData to a JPG encoded ByteArray.
JPEGEncoder
  
encodeByteArray(raw:ByteArray, width:int, height:int, transparent:Boolean = true):ByteArray
Converts the ByteArray of pixels from a raw bitmap to a JPG encoded ByteArray.
JPEGEncoder
 Inherited
Indicates whether an object has a specified property defined.
Object
 Inherited
Indicates whether an instance of the Object class is in the prototype chain of the object specified as the parameter.
Object
 Inherited
Indicates whether the specified property exists and is enumerable.
Object
 Inherited
Sets the availability of a dynamic property for loop operations.
Object
 Inherited
Returns the string representation of the specified object.
Object
 Inherited
Returns the primitive value of the specified object.
Object
Public Constants
 ConstantDefined By
  CONTENT_TYPE : String = "image/jpeg"
[static]
JPEGEncoder
Property Detail
contentTypeproperty
contentType:String  [read-only]

The MIME type for the JPEG encoded image.


Implementation
    public function get contentType():String
Constructor Detail
JPEGEncoder()Constructor
public function JPEGEncoder(quality:Number = 50)

Constructor.

Parameters
quality:Number (default = 50) — A value between 1 and 100. The default is 50.
Method Detail
encode()method
public function encode(image:BitmapData):ByteArray

Converts the pixels of raw BitmapData to a JPG encoded ByteArray.

Parameters

image:BitmapData

Returns
ByteArray
encodeByteArray()method 
public function encodeByteArray(raw:ByteArray, width:int, height:int, transparent:Boolean = true):ByteArray

Converts the ByteArray of pixels from a raw bitmap to a JPG encoded ByteArray. Transparency is not supported however 4 bytes must still be sent per pixel in ARGB format.

Parameters

raw:ByteArray
 
width:int
 
height:int
 
transparent:Boolean (default = true)

Returns
ByteArray
Constant Detail
CONTENT_TYPEConstant
public static const CONTENT_TYPE:String = "image/jpeg"




 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/livecycle/es/sdkHelp/common/langref/mx/graphics/codec/JPEGEncoder.html