Mako 7.3.0 API
IDOMJPEGImage Class Reference

Interface to a class representing a JPEG (.jpg or .jpeg) image. More...

#include <idomimageresource.h>

Inheritance diagram for IDOMJPEGImage:

Static Public Member Functions

static EDL_API IDOMJPEGImagePtr create (IEDLClassFactory *pFactory, const IInputStreamPtr &stream)
 Create a JPEG Image resource with the given JPEG stream. More...
 
static EDL_API IDOMImagePtr createWriterAndImage (const ISessionPtr &session, IImageFrameWriterPtr &frame, const IDOMColorSpacePtr &colorSpace, uint32 width, uint32 height, uint8 bitsPerComponent=8, double xResolution=96.0, double yResolution=96.0, uint8 quality=3, const IInputStreamPtr &inStream=IInputStreamPtr(), const IOutputStreamPtr &outStream=IOutputStreamPtr())
 Create an IDOMJPEGImage and frame that can be used to populate same. More...
 
static EDL_API void encode (const ISessionPtr &pSession, const IDOMImagePtr &image, const IOutputStreamPtr &stream, uint8 quality=3, bool allowCmyk=false, bool invertCmyk=true)
 Encode an image as a JPEG stream. This routine may convert the source image into a form that may be encoded as JPEG, such as by stripping alpha channels or converting to a supported colour space. More...
 
static EDL_API void encode (const ISessionPtr &pSession, const IImageFramePtr &frame, const IOutputStreamPtr &stream, uint8 quality=3, bool allowCmyk=false, bool invertCmyk=true)
 Encode the contents of an IImageFrame as a JPEG stream, returning the stream. This routine may convert the source image into a form that may be encoded as JPEG, such as by stripping alpha channels or converting to a supported colour space. More...
 
static const CClassIDclassID ()
 Retrieves class id of IDOMJPEGImage. More...
 

Additional Inherited Members

- Public Member Functions inherited from IDOMImage
virtual IImageDecoderPtr createImageDecoder (IEDLClassFactory *factory, const IDOMImagePropertiesPtr &imageProperties)=0
 Creates a properly initialized image decoder object that reads from an inputstream that is specific to that image format. More...
 
virtual IImageFramePtr getImageFrame (IEDLClassFactory *factory)
 Fetch the image frame; convenience. More...
 
virtual IImageEncoderPtr createImageEncoder (const ISessionPtr &session, const IOutputStreamPtr &imageDest, const IDOMImagePropertiesPtr &imageProperties)=0
 Creates a properly initialized image encoder object that writes to an outputstream that is specific to that image format. More...
 
virtual IDOMImagePropertiesPtr getImageProperties ()=0
 Returns an object that stores the properties for this image object. The properties can then be inspected (or more added) by clients that need to manipulate the image resource. More...
 
virtual eDOMImageType getImageType ()=0
 Retrieves the image type. More...
 
virtual bool getIsRendered ()=0
 Determine if the image is as a result of rendering. This is indicated if the image type is eDITRendered or if the image explicitly notes this is the case (such as for IDOMPDFImage). More...
 
virtual IDOMImagePtr getImageWithSubstitutedColorSpace (IEDLClassFactory *factory, const IDOMColorSpacePtr &colorSpace)
 Obtain an image that is the same as this image, but with the colorspace substituted for another. More...
 
- Public Member Functions inherited from IDOMResource
virtual IInputStreamPtr getStream () const =0
 Retrieves the resource stream. More...
 
virtual void setStream (const IInputStreamPtr &stream)=0
 Sets the resource stream for the node. More...
 
virtual uint64 getStreamLength () const =0
 Retrieves the stream length, if it is available. More...
 
virtual const EDLSysString & getUri () const =0
 Retrieves the resource URI. More...
 
virtual void setUri (const EDLSysString &uri)=0
 Sets the resource URI. More...
 
- Public Member Functions inherited from IEDLObject
virtual const CClassIDgetClassID () const =0
 Returns class ID of IEDLObject. More...
 
virtual bool init (CClassParams *pData)
 The init() method is called to perform any post-construction initialization of an IEDLObject that has been created by the EDL class factory, before it is actually returned by the factory. More...
 
virtual bool clone (IEDLObjectPtr &ptrObject, IEDLClassFactory *pFactory)
 Create a copy of EDLObject. More...
 
- Public Member Functions inherited from IRCObject
virtual void addRef () const =0
 Increases the reference count of the actual object pointed to. This would take place during an assignment or copying.
 
virtual bool decRef () const =0
 Decreases the reference count of the actual object pointed to. When the reference count falls to Zero, it deletes the actual object pointed to. More...
 
virtual int32 getRefCount () const =0
 Retrieve the current reference count of the actual object pointed to. More...
 
- Public Member Functions inherited from IDOMHashable
virtual ~IDOMHashable ()
 Virtual destructor.
 
virtual bool hash (uint64 &hash)=0
 Retrieve a hash for this object. More...
 
virtual uint64 hashE ()
 As hash(), but throws an exception if the operation fails. More...
 
- Protected Member Functions inherited from IRCObject
virtual ~IRCObject ()
 Virtual destructor.
 

Detailed Description

Interface to a class representing a JPEG (.jpg or .jpeg) image.

Member Function Documentation

◆ classID()

static const CClassID& IDOMJPEGImage::classID ( )
inlinestatic

Retrieves class id of IDOMJPEGImage.

Returns
CClassID Class id of the element

◆ create()

static EDL_API IDOMJPEGImagePtr IDOMJPEGImage::create ( IEDLClassFactory pFactory,
const IInputStreamPtr &  stream 
)
static

Create a JPEG Image resource with the given JPEG stream.

Parameters
pFactoryThe EDL Class factory to use.
streamThe stream containing the JPEG image.
Returns
IDOMImagePtr The new image.

◆ createWriterAndImage()

static EDL_API IDOMImagePtr IDOMJPEGImage::createWriterAndImage ( const ISessionPtr &  session,
IImageFrameWriterPtr &  frame,
const IDOMColorSpacePtr &  colorSpace,
uint32  width,
uint32  height,
uint8  bitsPerComponent = 8,
double  xResolution = 96.0,
double  yResolution = 96.0,
uint8  quality = 3,
const IInputStreamPtr &  inStream = IInputStreamPtr(),
const IOutputStreamPtr &  outStream = IOutputStreamPtr() 
)
static

Create an IDOMJPEGImage and frame that can be used to populate same.

Parameters
sessionThe session to use
frameOn exit, this is populated with a frame ready to receive image data via frame->writeScanLine(). Use frame->flushData() to complete the encoding process.
colorSpaceThe color space to use. Must be compatible with the JPEG format.
widthThe width of the image, in pixels.
heightThe height of the image, in pixels.
bitsPerComponentThe number of bits per color component, either 8 or 16. Default is 8.
xResolutionThe x resolution, in pixels-per-inch.
yResolutionThe y resolution, in pixels-per-inch.
qualityThe desired quality in the range 1 through 5, with 1 being lowest and 5 being highest. Default is 3.
inStreamOptional. The first in a pair of streams used to read and write the raw image data if an external stream is desired. If NULL, a temporary store stream will be created. If non NULL, outStream must also be provided.
outStreamOptional. The second in a pair of streams used to read and write the raw image data if an external stream is desired. If NULL, a temporary store stream will be created. If non NULL, inStream must also be provided.
Returns
IDOMImagePtr The resulting image. Not valid until the frame is flushed.

◆ encode() [1/2]

static EDL_API void IDOMJPEGImage::encode ( const ISessionPtr &  pSession,
const IDOMImagePtr &  image,
const IOutputStreamPtr &  stream,
uint8  quality = 3,
bool  allowCmyk = false,
bool  invertCmyk = true 
)
static

Encode an image as a JPEG stream. This routine may convert the source image into a form that may be encoded as JPEG, such as by stripping alpha channels or converting to a supported colour space.

Parameters
pSessionThe relevant EDL session
imageThe image to be encoded
streamThe stream to use to store the image data.
qualityThe desired quality in the range 1 through 5, with 1 being lowest and 5 being highest. Default is 3.
allowCmykWhether or not CMYK encoding should be allowed. CMYK JPEGs are not universally supported, and so are not generated by default.
invertCmykIf CMYK data is encoded, this controls whether or not the image data is inverted. If inverted, it is likely that the CMYK image will view correctly in more viewers. However, doing this will result in inverted results when the image is used with Mako.

◆ encode() [2/2]

static EDL_API void IDOMJPEGImage::encode ( const ISessionPtr &  pSession,
const IImageFramePtr &  frame,
const IOutputStreamPtr &  stream,
uint8  quality = 3,
bool  allowCmyk = false,
bool  invertCmyk = true 
)
static

Encode the contents of an IImageFrame as a JPEG stream, returning the stream. This routine may convert the source image into a form that may be encoded as JPEG, such as by stripping alpha channels or converting to a supported colour space.

Parameters
pSessionThe relevant EDL session
frameThe frame providing the source image data
streamThe stream to use to store the image data.
qualityThe desired quality in the range 1 through 5, with 1 being lowest and 5 being highest. Default is 3.
allowCmykWhether or not CMYK encoding should be allowed. CMYK JPEGs are not universally supported, and so are not generated by default.
invertCmykIf CMYK data is encoded, this controls whether or not the image data is inverted. If inverted, it is likely that the CMYK image will view correctly in more viewers. However, doing this will result in inverted results when the image is used with Mako.

The documentation for this class was generated from the following file: