PSChannelPortsSuite1 Struct Reference

The set of routines available in the Channel Ports Suite. More...

#include <PIChannelPortsSuite.h>

Data Fields

SPAPI SPErr(* CountLevels )(PIChannelPort port, int32 *count)
 Determines the number levels the port has.
SPAPI SPErr(* GetDepth )(PIChannelPort port, int32 level, int32 *depth)
 Gets the pixel depth at a given level.
SPAPI SPErr(* GetDataBounds )(PIChannelPort port, int32 level, VRect *bounds)
 Gets the bounds for the pixel data at a given level.
SPAPI SPErr(* GetWriteLimit )(PIChannelPort port, int32 level, VRect *writeBounds)
 Gets the bounds to which we can write at a given level.
SPAPI SPErr(* GetTilingGrid )(PIChannelPort port, int32 level, VPoint *tileOrigin, VPoint *tileSize)
 Gets the tiling information at a given level.
SPAPI SPErr(* GetSupportRect )(PIChannelPort port, int32 level, const VRect *bounds, int32 *supportLevel, VRect *supportBounds)
 Finds the rectangle used as the downsample source for a particular level in the pyramid.
SPAPI SPErr(* GetDependentRect )(PIChannelPort port, int32 sourceLevel, const VRect *sourceBounds, int32 dependentLevel, VRect *dependentBounds)
 Gets the dependent rectangle at a particular level.
SPAPI SPErr(* CanRead )(PIChannelPort port, Boolean *canRead)
 Determines if the plug-in can read from the port.
SPAPI SPErr(* CanWrite )(PIChannelPort port, Boolean *canWrite)
 Determines if the plug-in can write to the port.
SPAPI SPErr(* ReadPixelsFromLevel )(PIChannelPort port, int32 level, VRect *bounds, const PixelMemoryDesc *destination)
 Reads a given rectangle (tile) of pixels from a given level of the port.
SPAPI SPErr(* WritePixelsToBaseLevel )(PIChannelPort port, VRect *bounds, const PixelMemoryDesc *source)
 Writes a rectangle (tile) of pixels to a level in the pyramid.
SPAPI SPErr(* ReadScaledPixels )(PIChannelPort port, VRect *readRect, const PSScaling *scaling, const PixelMemoryDesc *destination)
 Reads a given rectangle (tile) of scaled data from the pyramid provided in the port.
SPAPI SPErr(* FindSourceForScaledRead )(PIChannelPort port, const VRect *readRect, const PSScaling *scaling, int32 dstDepth, int32 *sourceLevel, VRect *sourceRect, VRect *sourceScalingBounds)
 Determines what level would be used for a given scaling.
SPAPI SPErr(* New )(PIChannelPort *port, const VRect *rect, int32 depth, Boolean globalScope)
 Creates a pixel array and the port to go with it.
SPAPI SPErr(* Dispose )(PIChannelPort *port)
 Disposes of a port and sets the port to NULL.
SPAPI SPErr(* SupportsOperation )(const char *operation, Boolean *supported)
 Checks to see whether the host supports an operation.
SPAPI SPErr(* ApplyOperation )(const char *operation, PIChannelPort sourcePort, PIChannelPort destinationPort, PIChannelPort maskPort, void *parameters, VRect *rect)
 Applies an operation from a source port to a destination port.
SPAPI SPErr(* AddOperation )(const char *operation, SPErr(*proc)(PIChannelPort, PIChannelPort, PIChannelPort, void *, VRect *, void *refCon), void *refCon)
 Adds a channel port operation.
SPAPI SPErr(* RemoveOperation )(const char *operation, void **refCon)
 Removes a channel port operation.
SPAPI SPErr(* NewCopyOnWrite )(PIChannelPort *result, PIChannelPort basePort, VRect *writeLimit, Boolean globalScope)
 Supports using the copy-on-write mechanism.
SPAPI SPErr(* Freeze )(PIChannelPort port)
 Freezes the data associated with a channel port.
SPAPI SPErr(* Restore )(PIChannelPort port, VRect *area)
 Restores an area within a copy-on-write port to its initial state.

Detailed Description

The set of routines available in the Channel Ports Suite.


Field Documentation

SPAPI SPErr(* PSChannelPortsSuite1::CountLevels)(PIChannelPort port, int32 *count)

Determines the number levels the port has.

This is the number of levels in the pyramid of an image.

Parameters:
portPort to check.
count[OUT] The number of levels the port has. Zero if port is invalid.
Returns:
Non-zero error if failure.
SPAPI SPErr(* PSChannelPortsSuite1::GetDepth)(PIChannelPort port, int32 level, int32 *depth)

Gets the pixel depth at a given level.

Parameters:
portPort to check.
levelLevel of the port to check.
depth[OUT] Pixel depth, returned. Zero if the port or level is invalid.
Returns:
Non-zero error if failure.
SPAPI SPErr(* PSChannelPortsSuite1::GetDataBounds)(PIChannelPort port, int32 level, VRect *bounds)

Gets the bounds for the pixel data at a given level.

Parameters:
portPort to check.
levelLevel of the port to check.
bounds[OUT] Rectangle that provides the bounds for the pixel data. An empty rectangle if the parameters are invalid.
Returns:
Non-zero error if failure.
SPAPI SPErr(* PSChannelPortsSuite1::GetWriteLimit)(PIChannelPort port, int32 level, VRect *writeBounds)

Gets the bounds to which we can write at a given level.

Parameters:
portPort to check.
levelLevel of the port to check.
writeBounds[OUT] Rectangle that provides the write bounds for the pixel data.
Returns:
Non-zero error if failure.
SPAPI SPErr(* PSChannelPortsSuite1::GetTilingGrid)(PIChannelPort port, int32 level, VPoint *tileOrigin, VPoint *tileSize)

Gets the tiling information at a given level.

Parameters:
portPort to check.
levelLevel of the port to check.
tileOrigin[OUT] Origin point for the tiling system.
tileSize[OUT] Size of the tiles. This is the best size to work with, if possible.
Returns:
Non-zero error if failure.
SPAPI SPErr(* PSChannelPortsSuite1::GetSupportRect)(PIChannelPort port, int32 level, const VRect *bounds, int32 *supportLevel, VRect *supportBounds)

Finds the rectangle used as the downsample source for a particular level in the pyramid.

Parameters:
portPort to check.
levelLevel of the port to check.
bounds[OUT]
supportLevel[OUT] Set to -1 if no support rectangle exists.
supportBounds[OUT] Support rectangle, returned.
Returns:
Non-zero error if failure.
SPAPI SPErr(* PSChannelPortsSuite1::GetDependentRect)(PIChannelPort port, int32 sourceLevel, const VRect *sourceBounds, int32 dependentLevel, VRect *dependentBounds)

Gets the dependent rectangle at a particular level.

Parameters:
portPort to check.
sourceLevelLevel of the port to check.
sourceBounds[OUT]
dependentLevel
dependentBounds[OUT] Dependent rectangle, returned.
Returns:
Non-zero error if failure.
SPAPI SPErr(* PSChannelPortsSuite1::CanRead)(PIChannelPort port, Boolean *canRead)

Determines if the plug-in can read from the port.

Parameters:
portPort to check.
canRead[OUT] Indicates if the plug-in can read from the port; TRUE if so.
Returns:
Non-zero error if failure.
SPAPI SPErr(* PSChannelPortsSuite1::CanWrite)(PIChannelPort port, Boolean *canWrite)

Determines if the plug-in can write to the port.

Parameters:
portPort to check.
canRead[OUT] Indicates if the plug-in can write to the port; TRUE if so.
Returns:
Non-zero error if failure.
SPAPI SPErr(* PSChannelPortsSuite1::ReadPixelsFromLevel)(PIChannelPort port, int32 level, VRect *bounds,const PixelMemoryDesc *destination)

Reads a given rectangle (tile) of pixels from a given level of the port.

Parameters:
portPort to read from.
levelLevel of the port.
bounds[IN/OUT] Provides the rectangular area (tile) of the port to read as an input parameter. Provides the rectangular area (tile) of data actually read into destination.data as an output parameter, if result is noErr. If result is non-zero, the value is undefined.
destination[IN/OUT] A description of the memory to read, provided as input. The data read from the port is written into the buffer provided in destination.data.
Returns:
Non-zero error if failure.

Writes a rectangle (tile) of pixels to a level in the pyramid.

Parameters:
portPort to write to.
bounds[IN/OUT] As input, provides the rectangular area (tile) of source.data the pixels are written from. As output, reflects the area of the port actually written to. If the input rectangle maps to pixels beyond the bounds of the port, the output rectangle reflects the area actually written.
sourceA description of the memory to write. The actual pixels that are written to the port are provided in source.data. [??? no existing doc. verify. This appears to be an input only parameter for this function, verify.]
Returns:
Non-zero error if failure.
SPAPI SPErr(* PSChannelPortsSuite1::ReadScaledPixels)(PIChannelPort port, VRect *readRect,const PSScaling *scaling, const PixelMemoryDesc *destination)

Reads a given rectangle (tile) of scaled data from the pyramid provided in the port.

To determine what level is used for a given scaling, use FindSourceForScaledRead.

Parameters:
portPort to read from.
readRect[IN/OUT] Provides the rectangular area (tile) of the port to read as an input parameter. Provides the rectangular area (tile) of data actually read as an output parameter. The output rectangle is scaled based on the information provided in scaling.
scalingA scaling between source and destination rectangles.
destination[IN/OUT] A description of the memory to read, provided as input. The data read from the port is written into destination.data.
Returns:
Non-zero error if failure.
SPAPI SPErr(* PSChannelPortsSuite1::FindSourceForScaledRead)(PIChannelPort port, const VRect *readRect, const PSScaling *scaling, int32 dstDepth, int32 *sourceLevel, VRect *sourceRect, VRect *sourceScalingBounds)

Determines what level would be used for a given scaling.

Parameters:
portPort to read from.
readRect[IN/OUT] Provides the rectangular area of the port to read as an input parameter. Provides the rectangular area of data actually read as an output parameter. The output rectangle is scaled based on the information provided in scaling.
scalingA scaling between source and destination rectangles for which to find the pyramid level.
dstDepth
sourceLevel[OUT] The level that would be read from for this scaling.
sourceRect[OUT] The rectangle that would be read from for this scaling.
sourceScalingBounds[OUT] The bounds used for scaling from this level to the final result.
Returns:
Non-zero error if failure.
SPAPI SPErr(* PSChannelPortsSuite1::New)(PIChannelPort *port, const VRect *rect, int32 depth, Boolean globalScope)

Creates a pixel array and the port to go with it.

Parameters:
portReturned port.
rectThe rectangle used to create a pixel array.
depthThe pixel depth for the pixel array.
globalScope
Returns:
Non-zero error if failure.

Disposes of a port and sets the port to NULL.

Parameters:
portThe port to dispose of.
Returns:
Non-zero error if failure.
SPAPI SPErr(* PSChannelPortsSuite1::SupportsOperation)(const char *operation, Boolean *supported)

Checks to see whether the host supports an operation.

Parameters:
operationThe operation to check. See Channel Port Operations.
supported[OUT] Indicates whether the operation is supported; TRUE if so.
Returns:
Non-zero error if failure.
SPAPI SPErr(* PSChannelPortsSuite1::ApplyOperation)(const char *operation, PIChannelPort sourcePort, PIChannelPort destinationPort, PIChannelPort maskPort, void *parameters,VRect *rect)

Applies an operation from a source port to a destination port.

Parameters:
operationThe operation to apply. See Channel Port Operations.
sourcePortThe source port to apply an operation from.
destinationPortThe destination port to write the results of the operation.
maskPort
parametersA structure that provides the parameters for the operation. The structure depends on the operation. See Channel Port Operations.
rect[IN/OUT] A bounding rectangle; may also be an output parameter, depending on the operation.
Returns:
Non-zero error if failure.
SPAPI SPErr(* PSChannelPortsSuite1::AddOperation)(const char *operation, SPErr(*proc)(PIChannelPort, PIChannelPort, PIChannelPort,void *, VRect *, void *refCon), void *refCon)

Adds a channel port operation.

Parameters:
operationThe name of the operation.
procThe routine to execute when this operation is invoked. The first three parameters indicate source, destination and mask ports, respectively. The fifth parameter is a bounding rectangle, and the sixth is a structure used to pass parameters to the operation.
refCon
Returns:
Non-zero error if failure.
SPAPI SPErr(* PSChannelPortsSuite1::RemoveOperation)(const char *operation, void **refCon)

Removes a channel port operation.

Parameters:
operationThe name of the operation.
refCon
Returns:
Non-zero error if failure.
SPAPI SPErr(* PSChannelPortsSuite1::NewCopyOnWrite)(PIChannelPort *result, PIChannelPort basePort, VRect *writeLimit, Boolean globalScope)

Supports using the copy-on-write mechanism.

Parameters:
result[OUT] The destination port, returned.
basePortThe base port; must be frozen. See Freeze.
writeLimit[OUT] Defines a rectangle that limits the scope of the write. Can be NULL in which case writing is allowed everywhere.
globalScope
Returns:
Non-zero error if failure.

Freezes the data associated with a channel port.

This should generally only be used in conjunction with ports allocated through NewCopyOnWrite.

Parameters:
portThe port to freeze.
Returns:
Non-zero error if failure.
SPAPI SPErr(* PSChannelPortsSuite1::Restore)(PIChannelPort port, VRect *area)

Restores an area within a copy-on-write port to its initial state.

Parameters:
portThe port to restore.
area.The area to restore. If NULL, the entire port is restored.
Returns:
Non-zero error if failure.

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