Class Index | File Index

Classes


Namespace jamLayers


Version 4.5.

Defined in: jamLayers.jsxinc.

Namespace Summary
Constructor Attributes Constructor Name and Description
 
Global object (used to simulate a namespace in JavaScript) containing a set of layer-related functions for scripts written with the JSON Action Manager engine.
Method Summary
Method Attributes Method Name and Description
<static>  
jamLayers.fromLayerObject(layerObject)
Get a simplified layer JSON object from a layer object in JSON AM Data Format.
<static>  
jamLayers.groupLayer()
Group the current layer (create clipping mask).
<static>  
jamLayers.makeLayer(layer, below)
Create a new layer.
<static>  
jamLayers.setLayerProperties(layerProperties)
Set properties of the current layer.
<static>  
jamLayers.setLayerType(layerType)
Set current layer type.
<static>  
jamLayers.toLayerClassReference(layer)
Get a layer class reference in JSON AM format from a simplified layer JSON object.
<static>  
jamLayers.toLayerObject(layer)
Get a layer object in JSON AM Data Format from a simplified layer JSON object.
<static>  
jamLayers.toLayerReference(layer)
Get the current layer reference in JSON AM format from a simplified layer JSON object.
<static>  
jamLayers.toLayerTypeObject(layerType)
Get the current layer type object in JSON AM format from a simplified layer type JSON object.
<static>  
jamLayers.toLayerTypeReference(layerType)
Get the current layer type reference in JSON AM format from a simplified layer type JSON object.
<static>  
jamLayers.ungroupLayer()
Ungroup the current layer (release clipping mask).
Namespace Detail
jamLayers
Global object (used to simulate a namespace in JavaScript) containing a set of layer-related functions for scripts written with the JSON Action Manager engine.
Author: Michel MARIANI.
Method Detail
<static> {Object} jamLayers.fromLayerObject(layerObject)
Get a simplified layer JSON object from a layer object in JSON AM Data Format.
var layerObject =
{
    "<object>":
    {
        "adjustmentLayer":
        {
            "name":
            {
                "<string>": "Contrast"
            },
            "type":
            {
                "<object>":
                {
                    "brightnessContrast":
                    {
                        "brightness":
                        {
                            "<integer>": 0
                        },
                        "contrast":
                        {
                            "<integer>": 20
                        }
                    }
                }
            }
        }
    }
};
var layerObj = jamLayers.fromLayerObject (layerObject);
alert (jamJSON.stringify (layerObj, '\t'));
Parameters:
{Object|Array} layerObject
Layer object in JSON AM Data Format
Returns:
{Object} Simplified layer JSON object (cf. Layer Object Simplified Format)
See:
jamLayers.toLayerObject

<static> jamLayers.groupLayer()
Group the current layer (create clipping mask).
jamLayers.groupLayer ();
See:
jamLayers.ungroupLayer

<static> jamLayers.makeLayer(layer, below)
Create a new layer.
var blueOverlay =
{
    "contentLayer":
    {
        "name": "Blue Color | Overlay 50%",
        "mode": "overlay",
        "opacity": 50,
        "type":
        {
            "solidColorLayer":
            {
                "color": { "red": 0, "green": 0, "blue": 255 }
            }
        }
    }
};
jamLayers.makeLayer (blueOverlay);
Parameters:
{Object} layer
Simplified layer JSON object
(cf. Layer Object Simplified Format)
{Boolean} below Optional
Create a new layer below the current one (false by default; ignored for adjustment and fill layers)

<static> jamLayers.setLayerProperties(layerProperties)
Set properties of the current layer.
var layerProperties =
{
    "opacity": 80,
    "blendRange":
    [
        {
            "channel": "gray",
            "srcBlackMin": 10,
            "srcBlackMax": 20,
            "srcWhiteMin": 255,
            "srcWhiteMax": 255,
            "destBlackMin": 0,
            "destBlackMax": 0,
            "destWhiteMin": 235,
            "destWhiteMax": 245
        }
    ]
};
jamLayers.setLayerProperties (layerProperties);
Parameters:
{Object} layerProperties
Simplified layer properties JSON object
(cf. Layer Object Simplified Format)

<static> jamLayers.setLayerType(layerType)
Set current layer type.
var layerType =
{
    "photoFilter":
    {
        "density": 50
    }
};
jamLayers.setLayerType (layerType);
Parameters:
{Object} layerType
Simplified layer type JSON object
(cf. Layer Object Simplified Format)

<static> {Object|Array} jamLayers.toLayerClassReference(layer)
Get a layer class reference in JSON AM format from a simplified layer JSON object.
var invertColor =
{
    "adjustmentLayer":
    {
        "mode": "color",
        "type":
        {
            "invert": null
        }
    }
};
jamEngine.jsonPlay
(
    "make",
    {
        "target": jamLayers.toLayerClassReference (invertColor),
        "using": jamLayers.toLayerObject (invertColor)
    }
);
Parameters:
{Object} layer
Simplified layer JSON object (cf. Layer Object Simplified Format)
Returns:
{Object|Array} Layer class reference in JSON AM Data Format

<static> {Object|Array} jamLayers.toLayerObject(layer)
Get a layer object in JSON AM Data Format from a simplified layer JSON object.
var redFilter =
{
    "adjustmentLayer":
    {
        "name": "Red Filter",
        "opacity": 75,
        "type":
        {
            "photoFilter":
            {
                "color": { "red": 255, "green": 0, "blue": 0 },
                "density": 50,
                "preserveLuminosity": true
            }
        }
    }
};
jamEngine.jsonPlay
(
    "make",
    {
        "target": jamLayers.toLayerClassReference (redFilter),
        "using": jamLayers.toLayerObject (redFilter)
    }
);
Parameters:
{Object} layer
Simplified layer JSON object (cf. Layer Object Simplified Format)
Returns:
{Object|Array} Layer object in JSON AM Data Format
See:
jamLayers.fromLayerObject

<static> {Object|Array} jamLayers.toLayerReference(layer)
Get the current layer reference in JSON AM format from a simplified layer JSON object.
var overlay50 =
{
    "layer":
    {
        "mode": "overlay",
        "opacity": 50
    }
};
jamEngine.jsonPlay
(
    "set",
    {
        "target": jamLayers.toLayerReference (overlay50),
        "to": jamLayers.toLayerObject (overlay50)
    }
);
Parameters:
{Object} layer
Simplified layer JSON object (cf. Layer Object Simplified Format)
Returns:
{Object|Array} Current layer reference in JSON AM Data Format

<static> {Object|Array} jamLayers.toLayerTypeObject(layerType)
Get the current layer type object in JSON AM format from a simplified layer type JSON object.
var brightness10 =
{
    "brightnessContrast":
    {
        "brightness": 10
    }
};
jamEngine.jsonPlay
(
    "set",
    {
        "target": jamLayers.toLayerTypeReference (brightness10),
        "to": jamLayers.toLayerTypeObject (brightness10)
    }
);
Parameters:
{Object} layerType
Simplified layer type JSON object (cf. Layer Object Simplified Format)
Returns:
{Object|Array} Current layer type object in JSON AM Data Format

<static> {Object|Array} jamLayers.toLayerTypeReference(layerType)
Get the current layer type reference in JSON AM format from a simplified layer type JSON object.
var contrast50 =
{
    "brightnessContrast":
    {
        "contrast": 50
    }
};
jamEngine.jsonPlay
(
    "set",
    {
        "target": jamLayers.toLayerTypeReference (contrast50),
        "to": jamLayers.toLayerTypeObject (contrast50)
    }
);
Parameters:
{Object} layerType
Simplified layer type JSON object (cf. Layer Object Simplified Format)
Returns:
{Object|Array} Current layer type reference in JSON AM Data Format

<static> jamLayers.ungroupLayer()
Ungroup the current layer (release clipping mask).
jamLayers.ungroupLayer ();
See:
jamLayers.groupLayer

Documentation generated by JsDoc Toolkit 2.4.0 on Wed Oct 12 2016 23:32:44 GMT+0200 (CEST)