UNPKG

processing-js

Version:

For the project website, visit http://processingjs.org

304 lines (257 loc) • 6.32 kB
/** * Processing.js environment constants */ module.exports = { X: 0, Y: 1, Z: 2, R: 3, G: 4, B: 5, A: 6, U: 7, V: 8, NX: 9, NY: 10, NZ: 11, EDGE: 12, // Stroke SR: 13, SG: 14, SB: 15, SA: 16, SW: 17, // Transformations (2D and 3D) TX: 18, TY: 19, TZ: 20, VX: 21, VY: 22, VZ: 23, VW: 24, // Material properties AR: 25, AG: 26, AB: 27, DR: 3, DG: 4, DB: 5, DA: 6, SPR: 28, SPG: 29, SPB: 30, SHINE: 31, ER: 32, EG: 33, EB: 34, BEEN_LIT: 35, VERTEX_FIELD_COUNT: 36, // Renderers P2D: 1, JAVA2D: 1, WEBGL: 2, P3D: 2, OPENGL: 2, PDF: 0, DXF: 0, // Platform IDs OTHER: 0, WINDOWS: 1, MAXOSX: 2, LINUX: 3, EPSILON: 0.0001, MAX_FLOAT: 3.4028235e+38, MIN_FLOAT: -3.4028235e+38, MAX_INT: 2147483647, MIN_INT: -2147483648, PI: Math.PI, TWO_PI: 2 * Math.PI, TAU: 2 * Math.PI, HALF_PI: Math.PI / 2, THIRD_PI: Math.PI / 3, QUARTER_PI: Math.PI / 4, DEG_TO_RAD: Math.PI / 180, RAD_TO_DEG: 180 / Math.PI, WHITESPACE: " \t\n\r\f\u00A0", // Color modes RGB: 1, ARGB: 2, HSB: 3, ALPHA: 4, CMYK: 5, // Image file types TIFF: 0, TARGA: 1, JPEG: 2, GIF: 3, // Filter/convert types BLUR: 11, GRAY: 12, INVERT: 13, OPAQUE: 14, POSTERIZE: 15, THRESHOLD: 16, ERODE: 17, DILATE: 18, // Blend modes REPLACE: 0, BLEND: 1 << 0, ADD: 1 << 1, SUBTRACT: 1 << 2, LIGHTEST: 1 << 3, DARKEST: 1 << 4, DIFFERENCE: 1 << 5, EXCLUSION: 1 << 6, MULTIPLY: 1 << 7, SCREEN: 1 << 8, OVERLAY: 1 << 9, HARD_LIGHT: 1 << 10, SOFT_LIGHT: 1 << 11, DODGE: 1 << 12, BURN: 1 << 13, // Color component bit masks ALPHA_MASK: 0xff000000, RED_MASK: 0x00ff0000, GREEN_MASK: 0x0000ff00, BLUE_MASK: 0x000000ff, // Projection matrices CUSTOM: 0, ORTHOGRAPHIC: 2, PERSPECTIVE: 3, // Shapes POINT: 2, POINTS: 2, LINE: 4, LINES: 4, TRIANGLE: 8, TRIANGLES: 9, TRIANGLE_STRIP: 10, TRIANGLE_FAN: 11, QUAD: 16, QUADS: 16, QUAD_STRIP: 17, POLYGON: 20, PATH: 21, RECT: 30, ELLIPSE: 31, ARC: 32, SPHERE: 40, BOX: 41, // Arc drawing modes //OPEN: 1, // shared with Shape closing modes CHORD: 2, PIE: 3, GROUP: 0, PRIMITIVE: 1, //PATH: 21, // shared with Shape PATH GEOMETRY: 3, // Shape Vertex VERTEX: 0, BEZIER_VERTEX: 1, CURVE_VERTEX: 2, BREAK: 3, CLOSESHAPE: 4, // Shape closing modes OPEN: 1, CLOSE: 2, // Shape drawing modes CORNER: 0, // Draw mode convention to use (x, y) to (width, height) CORNERS: 1, // Draw mode convention to use (x1, y1) to (x2, y2) coordinates RADIUS: 2, // Draw mode from the center, and using the radius CENTER_RADIUS: 2, // Deprecated! Use RADIUS instead CENTER: 3, // Draw from the center, using second pair of values as the diameter DIAMETER: 3, // Synonym for the CENTER constant. Draw from the center CENTER_DIAMETER: 3, // Deprecated! Use DIAMETER instead // Text vertical alignment modes BASELINE: 0, // Default vertical alignment for text placement TOP: 101, // Align text to the top BOTTOM: 102, // Align text from the bottom, using the baseline // UV Texture coordinate modes NORMAL: 1, NORMALIZED: 1, IMAGE: 2, // Text placement modes MODEL: 4, SHAPE: 5, // Stroke modes SQUARE: 'butt', ROUND: 'round', PROJECT: 'square', MITER: 'miter', BEVEL: 'bevel', // Lighting modes AMBIENT: 0, DIRECTIONAL: 1, //POINT: 2, Shared with Shape constant SPOT: 3, // Key constants // Both key and keyCode will be equal to these values BACKSPACE: 8, TAB: 9, ENTER: 10, RETURN: 13, ESC: 27, DELETE: 127, CODED: 0xffff, // p.key will be CODED and p.keyCode will be this value SHIFT: 16, CONTROL: 17, ALT: 18, CAPSLK: 20, PGUP: 33, PGDN: 34, END: 35, HOME: 36, LEFT: 37, UP: 38, RIGHT: 39, DOWN: 40, F1: 112, F2: 113, F3: 114, F4: 115, F5: 116, F6: 117, F7: 118, F8: 119, F9: 120, F10: 121, F11: 122, F12: 123, NUMLK: 144, META: 157, INSERT: 155, // Cursor types ARROW: 'default', CROSS: 'crosshair', HAND: 'pointer', MOVE: 'move', TEXT: 'text', WAIT: 'wait', NOCURSOR: "url('data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw=='), auto", // Hints DISABLE_OPENGL_2X_SMOOTH: 1, ENABLE_OPENGL_2X_SMOOTH: -1, ENABLE_OPENGL_4X_SMOOTH: 2, ENABLE_NATIVE_FONTS: 3, DISABLE_DEPTH_TEST: 4, ENABLE_DEPTH_TEST: -4, ENABLE_DEPTH_SORT: 5, DISABLE_DEPTH_SORT: -5, DISABLE_OPENGL_ERROR_REPORT: 6, ENABLE_OPENGL_ERROR_REPORT: -6, ENABLE_ACCURATE_TEXTURES: 7, DISABLE_ACCURATE_TEXTURES: -7, HINT_COUNT: 10, // PJS defined constants SINCOS_LENGTH: 720, // every half degree PRECISIONB: 15, // fixed point precision is limited to 15 bits!! PRECISIONF: 1 << 15, PREC_MAXVAL: (1 << 15) - 1, PREC_ALPHA_SHIFT: 24 - 15, PREC_RED_SHIFT: 16 - 15, NORMAL_MODE_AUTO: 0, NORMAL_MODE_SHAPE: 1, NORMAL_MODE_VERTEX: 2, MAX_LIGHTS: 8 };