Adobe 65014912 Scripting Guide - Page 67

Defining the area of a selection object

Page 67 highlights

CHAPTER 3: Scripting Photoshop Advanced Scripting 67 ➤ Apply a wave filter to the selection. NOTE: The wave is a truncated sine curve. Defining the area of a selection object To define the area of a selection object, we create an array of coordinates, or points specified in pixels within the document. The array indicates the coordinates that define the outside corners of a rectangular area that begins at the top left corner of the document and extends half way across the document. NOTE: You can define any number of points for a selected area. The number of coordinates determines the shape of the selection. The last coordinate defined must be the same as the first so that the area is a closed selection path. NOTE: See "Photoshop Object Model" on page 11 for information on selection objects and other Photoshop objects. The array values in order are: ➤ Upper left corner of the selection: 0,0 ➣ 0 indicates the left-most column in the document. ➣ 0 indicates the top row in the document. ➤ Upper right corner of the selection: theDocWidthInPixels / 2, 0 ➣ theDocWidthInPixels / 2 indicates the column in the middle of the document; that is, the column whose coordinate is the total number of columns in the document divided by 2. NOTE: The value of theDocWidthInPixels is the total number of pixels that defines the document's horizontal dimension. Columns are arranged horizontally. ➣ 0 indicates the top row in the document. ➤ Lower right corner: theDocWidthInPixels / 2, theDocHeightInPixels ➣ theDocWidthInPixels / 2 indicates the middle of the document. ➣ theDocHeightInPixels indicates the bottom row in the document; that is row whose coordinate is the total number of rows in the document. NOTE: The value of theDocHeightInPixels is the total number of pixels that determine the vertical dimension of the document. Rows are stacked vertically. ➤ Lower left corner: 0, theDocHeightInPixels ➣ 0 indicates the left-most column in the document. ➣ theDocHeightInPixels indicates the bottom row in the document ➤ Upper left corner of the selection: 0,0 ➣ This closes the selection path back at the initial point.

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87

C
HAPTER
3: Scripting Photoshop
Advanced Scripting
67
Apply a wave filter to the selection.
N
OTE
:
The wave is a truncated sine curve.
Defining the area of a selection object
To define the area of a selection object, we create an array of coordinates, or points specified in pixels
within the document. The array indicates the coordinates that define the outside corners of a rectangular
area that begins at the top left corner of the document and extends half way across the document.
N
OTE
:
You can define any number of points for a selected area. The number of coordinates determines the
shape of the selection. The last coordinate defined must be the same as the first so that the area is a closed
selection path.
N
OTE
:
See
“Photoshop Object Model” on page 11
for information on selection objects and other
Photoshop objects.
The array values in order are:
Upper left corner of the selection:
0,0
0
indicates the left-most column in the document.
0
indicates the top row in the document.
Upper right corner of the selection:
theDocWidthInPixels
/
2,
0
theDocWidthInPixels
/
2
indicates the column in the middle of the document; that is, the
column whose coordinate is the total number of columns in the document divided by 2.
N
OTE
:
The value of
theDocWidthInPixels
is the total number of pixels that defines the document’s
horizontal dimension. Columns are arranged horizontally.
0
indicates the top row in the document.
Lower right corner:
theDocWidthInPixels
/
2,
theDocHeightInPixels
theDocWidthInPixels
/
2
indicates the middle of the document.
theDocHeightInPixels
indicates the bottom row in the document; that is row whose coordinate
is the total number of rows in the document.
N
OTE
:
The value of
theDocHeightInPixels
is the total number of pixels that determine the vertical
dimension of the document. Rows are stacked vertically.
Lower left corner:
0,
theDocHeightInPixels
0
indicates the left-most column in the document.
theDocHeightInPixels
indicates the bottom row in the document
Upper left corner of the selection:
0,0
This closes the selection path back at the initial point.