Groups > Application developers > Photoshop SDK > Re: How to get layer size in filter?




How to get layer size in filter?

How to get layer size in filter?
Tue, 18 Mar 2008 03:32:11 -070
I want get layer size and position in filter.
top, bottom, left, and right.
on automation, I can get those informations by sPSActionControl suite, but I can
not access this suite in filter.
Post Reply
Re: How to get layer size in filter?
Tue, 18 Mar 2008 19:39:06 -070
In PS,it's easy to get the size of a document through
FilterRecord->documentInfo,but always we want to get the size&position of
the layer(or maybe a layerset) in a document in order to do something with the
layer(such as get RGB channel data and Transparency channel data).So just as
what liuhui asked,we haven't found the method in filter,will somebody know and
pls show your precious opinion?
Post Reply
Re: How to get layer size in filter?
Mon, 29 Sep 2008 20:37:38 -070
Is it now possible to have filters as part of the filter record. It appears from
this code that you can now do it out side of channeldata and could add dummy
layers for use later.

This really does not match the documentation but I can find any example that
really uses the following data:

int16		inLayerPlanes;		 /**< The number of target layer planes for the input
data. 	 If all the input plane values are zero, 	 then the plug-in should assume
the host has not set them. 	

	 @note When processing layer data, Photoshop structures
	 its input and output data for plug-ins as follows:
	 - target layer channels
	 - transparency mask for target layer
	 - layer mask channels for target layer
	 - inverted layer mask channels for target layer
	 - non-layer channels	

	 The output planes are a prefix of the input planes.
	 For example, in the protected transparency case, the input
	 can contain a transparency mask and a layer mask while the
	 output can contain just the layerPlanes. 										

										 When processing non-layer data (including running a filter
										 on the layer mask alone), Photoshop structures the data
										 as consisting only of non-layer channels. It indicates
										 this structure through a series of short counts. The
										 transparency count must be either 0 or 1.
										 */
	int16		inTransparencyMask;	 /**< The number of transparency masks for the
input target 	 layer data. 	 See @ref inLayerPlanes for additional information.
*/ 	int16		inLayerMasks;		 /**< The number of layer mask channels for the
input 	 target layer. 	 See @ref inLayerPlanes for additional information.*/
	int16		inInvertedLayerMasks; /**< The number of inverted layer mask channels
for the 	 input target layer.
	 With the inverted layer masks, 0 = fully visible
	 and 255 = completely hidden. See @ref inLayerPlanes for
	 additional information.*/
	int16		inNonLayerPlanes;	 /**< The number of non-layer channels for the
input data. 	 See @ref inLayerPlanes for additional information. */

	int16		outLayerPlanes;		 /**< The number of target layer planes for the
output data. 										 See @ref inLayerPlanes for additional information about
										 the structure of the output data. */ 	int16		outTransparencyMask;
/**< The number of transparency masks for the output data. 										 See
@ref inLayerPlanes for additional information about 										 the structure of
the output data. */ 	int16		outLayerMasks;		 /**< The number of layer mask
channels for the output data. 										 See @ref inLayerPlanes for additional
information about 										 the structure of the output data. */
	int16		outInvertedLayerMasks; /**< The number of inverted layer mask
channels for the output data. 										 See @ref inLayerPlanes for additional
information about 										 the structure of the output data. */
	int16		outNonLayerPlanes;	 /**< The number of non-layer channels for the
output data. 										 See @ref inLayerPlanes for additional information about
										 the structure of the output data. */

	int16		absLayerPlanes;		 /**< The number of target layer planes for the
input data, 										 used for the structure of the input data when 										
\c wantsAbsolute is TRUE. 										 See @ref inLayerPlanes for additional
information about 										 the structure of the input data. */
	int16		absTransparencyMask; /**< The number of transparency masks for the
input data, 										 used for the structure of the input data when 										
\c wantsAbsolute is TRUE. 										 See @ref inLayerPlanes for additional
information about 										 the structure of the input data. */
	int16		absLayerMasks;		 /**< The number of layer mask channels for the input
data, 										 used for the structure of the input data when 										 \c
wantsAbsolute is TRUE. 										 See @ref inLayerPlanes for additional
information about 										 the structure of the input data. */
	int16		absInvertedLayerMasks; /**< The number of inverted layer mask
channels for the input 										 data, used for the structure of the input data
when 										 \c wantsAbsolute is TRUE. 										 See @ref inLayerPlanes for
additional information about 										 the structure of the input data. */
	int16		absNonLayerPlanes;	 /**< The number of target layer planes for the
input data, 										 used for the structure of the input data when 										
\c wantsAbsolute is TRUE. 										 See @ref inLayerPlanes for additional
information about 										 the structure of the input data. */

	/* We allow for extra planes in the input and the output. These planes
	 will be filled with dummyPlaneValue at those times when we build the
	 buffers. These features will only be available if supportsDummyPlanes
	 is TRUE. */

	int16		inPreDummyPlanes;	/**< The number of extra planes before 									
the input data. Only available if 									 \c supportsDummyChannels=TRUE. Used
for 									 things like forcing RGB data to appear as RGBA. */
	int16		inPostDummyPlanes;	/**< The number of extra planes after 									
the input data. Only available if 									 \c supportsDummyChannels=TRUE. Used
for 									 things like forcing RGB data to appear as RGBA. */

Post Reply
about | contact