InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
IImageStreamManager Class Referenceabstract

#include <IImageStreamManager.h>

Inheritance diagram for IImageStreamManager:
IPMUnknown

Public Types

enum  { kDefaultIID = IID_IIMAGESTREAMMANAGER }
 
enum  ResamplingType { kSubsample, kDownsample, kBicubicDownsample, kSubAverage }
 

Public Member Functions

virtual void SetSourceAttributes (IImageAttributes *srcImageAttributes)=0
 
virtual void SetDestinationAttributes (IImageAttributes *dstImageAttributes)=0
 
virtual void SetFirstImageStreamSegment (IImageStream *firstImageStreamSegment)=0
 
virtual void SetResamplingType (ResamplingType resample)=0
 
virtual void SetCache (uint8 *cacheptr)=0
 
virtual void SetDoDiffusion (bool16 yesno)=0
 
virtual void SetGrayThreshold (uint8 threshold)=0
 
virtual void SetReadAlphaChannelOnly (uint16 channelIndex)=0
 
virtual void SetWhiteIsZeroForPlanarChannels (bool16 yesno)=0
 
virtual void SetSourceProfile (IPMUnknown *ownerItem)=0
 
virtual void SetSourceProfile (ICMSProfile *srcProfile)=0
 
virtual void SetSourceAGMColorSpace (AGMColorSpace *srcAGMColorSpace)=0
 
virtual void SetDestinationProfile (IPMUnknown *ownerItem)=0
 
virtual void SetDestinationProfile (ICMSProfile *dstProfile)=0
 
virtual void SetDestinationAGMColorSpace (AGMColorSpace *dstAGMColorSpace)=0
 
virtual uint32 GetNumberOfTasks ()=0
 
virtual IImageStreamQueryImageStream ()=0
 
virtual void SetReadSingleChannelOnly (uint16 channelIndex)=0
 
virtual void SetColorConvertOptions (AGMColorProfile *defRGBProfile, AGMColorProfile *defCMYKProfile, bool32 idealizedBlack, bool32 oppBlending, bool32 fastXforms, IGraphicsPort::RenderingIntent defaultRI)=0
 
virtual void SetColorConvertOptions (void *opts, IGraphicsPort::RenderingIntent defaultRI)=0
 
- Public Member Functions inherited from IPMUnknown
virtual IPMUnknownQueryInterface (PMIID interfaceID) const =0
 
virtual void AddRef () const =0
 
virtual void Release () const =0
 

Detailed Description

An interface to create an image manipulation pipeline. The manager is given attributes describing the source and destination images (colorspaces, bit depths, planar/chunky layout, dimensions, etc), and creates a chain of image streams. The image stream chain is an exemplar of the pipe and filter pattern. As an image data consumer reads from the tail of the chain, preceding segments of the pipeline perform transformations required to massage the source data into the required output format.

Basic operation is: create an instance of the stream manager; set attributes describing the source and destinations formats, and set any desired options, profile information, etc.; then query for an image stream that will return image data in the requested destination format.

Most of the methods exposed by the interface set options and should be called before calling QueryImageStream to create the image stream. For instance, if the user specifies kTrue for anti-aliasing, then the ImageStream manager will choose the anti-aliasing segment instead of the downsample segment when the output image dimensions are smaller than the input dimensions.

See Also
IImageStream, IImageAttributes, ICMSProfile

Member Enumeration Documentation

Resampling type.

Note: these all downsample; we don't support upsampling

Member Function Documentation

virtual uint32 IImageStreamManager::GetNumberOfTasks ()
pure virtual

Returns number of tasks that will take place during the creation of the image stream. This should be called after attributes and other stream creation options have been set and before calling QueryImageStream.

Intended to be used in initializing a progress bar

Returns
number of tasks to be performed during creation of image stream
virtual IImageStream* IImageStreamManager::QueryImageStream ()
pure virtual

Creates an IImageStream based on specified attributes and options

The image stream is cached, so that subsequent calls without additional changes to the attributes and/or options will return the cached stream.

Note: The colormap in the destination image attributes may be modified during the creation of the image stream. As a result, you should access the colormap after you have queried for the image stream

Returns
AddRef'd IImageStream
virtual void IImageStreamManager::SetCache (uint8 * cacheptr)
pure virtual

Sets the cache buffer (default is no cache)

Cache must be large enough to hold the output image data

The image stream manager does not take possession of the cache buffer. It is the responsibility of the caller to delete the buffer

Parameters
cacheptrThe cache buffer
virtual void IImageStreamManager::SetColorConvertOptions (AGMColorProfile * defRGBProfile,
AGMColorProfile * defCMYKProfile,
bool32 idealizedBlack,
bool32 oppBlending,
bool32 fastXforms,
IGraphicsPort::RenderingIntent defaultRI 
)
pure virtual

Provides color conversion options for cases where color conversions are requested.

Parameters
defRGBProfileThe default rgb profile to use for uncalibrated rgb.
defCMYKProfileThe default cmyk profile to use for uncalibrated rgb.
idealizedBlackIf true, uses idealized black conversions from CMYK to RGB/Gray. If false, uses accurate black conversions.
oppBlendingIf true, uses XYZ-based blending for NChannel->process conversion. If false, blends in destination space.
fastXformsIf true, uses faster but less accurate xforms. If false, uses slower but more accurate xforms.
virtual void IImageStreamManager::SetColorConvertOptions (void * opts,
IGraphicsPort::RenderingIntent defaultRI 
)
pure virtual

Internal-only direct setting of all color convert options.

Parameters
optsA pointer to the options dictionary container.
virtual void IImageStreamManager::SetDestinationAGMColorSpace (AGMColorSpace * dstAGMColorSpace)
pure virtual

Sets destination color profile

Parameters
dstAGMColorSpaceColorspace, assumed to be profile based
virtual void IImageStreamManager::SetDestinationAttributes (IImageAttributesdstImageAttributes)
pure virtual

Set attributes for destination image. Tells manager how to construct the image stream

Parameters
dstImageAttributesThe attributes describing the source image
virtual void IImageStreamManager::SetDestinationProfile (IPMUnknownownerItem)
pure virtual

Sets destination color profile.

It is assumed that either the item contains a profile (i.e. an image with an embedded profile) or if not then its owning document should be used as the container of the profile

If profile information is not provided, then color conversion will be uncalibrated.

Parameters
ownerItemProfile owner
virtual void IImageStreamManager::SetDestinationProfile (ICMSProfiledstProfile)
pure virtual

Sets destination color profile

Parameters
dstProfileThe profile, specified as an ICMSProfile
virtual void IImageStreamManager::SetDoDiffusion (bool16 yesno)
pure virtual

Sets whether or not to do diffusion during chunky to indexed conversion. Default is kFalse (no)

Parameters
yesnoBoolean: kTrue = do diffusion, kFalse, no diffusion
virtual void IImageStreamManager::SetFirstImageStreamSegment (IImageStreamfirstImageStreamSegment)
pure virtual

Sets the first image stream segment. This segment is closest to the source data and serves as the glue tying the source image data to the rest of the image manager pipeline.

Parameters
firstImageStreamSegmentThe head of the image stream
virtual void IImageStreamManager::SetGrayThreshold (uint8 threshold)
pure virtual

If converting to 1-bit, use this value to determine if a pixel should be black or white. Default is 128.

Parameters
thresholdThreshold for gray
virtual void IImageStreamManager::SetReadAlphaChannelOnly (uint16 channelIndex)
pure virtual

Read a specific alpha channel and strip away all other channels including the color channels.

Parameters
channelIndexZero based index, where zero refers to the first extra channel after the color channels
virtual void IImageStreamManager::SetReadSingleChannelOnly (uint16 channelIndex)
pure virtual

Instructs image stream manager to create a stream that reads only a single specific channel and to strip away data for all other channels. Similar to SetReadAlphaChannelOnly, but is not limited to alpha channels. Also, index is absolute and is not relative to color channels.

Parameters
channelIndexZero based index of channel to read
virtual void IImageStreamManager::SetResamplingType (ResamplingType resample)
pure virtual

If downsampling is required, then this determines whether we subsample, downsample (anti-alias), or downsample using a weighted average.

Default is subsampling.

Parameters
resampleResampling type
See Also
IImageStreamManager::ResamplingType
virtual void IImageStreamManager::SetSourceAGMColorSpace (AGMColorSpace * srcAGMColorSpace)
pure virtual

Sets source color profile

Parameters
srcAGMColorSpaceColorspace, assumed to be profile based
virtual void IImageStreamManager::SetSourceAttributes (IImageAttributessrcImageAttributes)
pure virtual

Set attributes for source image. Tells manager how to construct the image stream

Parameters
srcImageAttributesThe attributes describing the source image
virtual void IImageStreamManager::SetSourceProfile (IPMUnknownownerItem)
pure virtual

Sets source color profile

It is assumed that either the item contains a profile (i.e. an image with an embedded profile) or if not then its owning document should be used as the container of the profile

If profile information is not provided, then color conversion will be uncalibrated.

Parameters
ownerItemProfile owner
virtual void IImageStreamManager::SetSourceProfile (ICMSProfilesrcProfile)
pure virtual

Sets source color profile

Parameters
srcProfileThe profile, specified as an ICMSProfile
virtual void IImageStreamManager::SetWhiteIsZeroForPlanarChannels (bool16 yesno)
pure virtual

When printing separations, the client may be requesting individual planes of data which are represented in gray space. The client can request that the data is presented such that white is zero which may have the effect of inverting the color channel.

If this method is NOT called, then the ImageStreamManager will not touch the planar data.

If this method IS called and the kPMTagPlanarConfig is kPMPlanar, then the ImageStreamManager will look at the destination color space to determine whether or not each channel of data needs to be inverted.

Calling this method does not change the destination IImageAttributes as it is intended to only be used when printing separations.

Parameters
yesnoBoolean: kTrue = set white is zero. Default = kFalse