//----------------------------------------------------------------------------------------------- // Engines JavaScript 1+ // JScript 1+ // Environments NN2+ IE3+ WSH1+ MOZILLA1+ SAFARI1+ //----------------------------------------------------------------------------------------------- function makeWORD (l, h) { return l & 0xFF | (h & 0xFF) << 8; } // 0-255 * 2 function loBYTE (n) { return n & 0xFF; } function hiBYTE (n) { return (n >> 8) & 0xFF; } //----------------------------------------------------------------------------------------------- function make3BYTE (a, b, c) { return makeWORD(a, b) | (c & 0xFF) << 16; } // 0-255 * 3 function RGB (r, g, b) { return make3BYTE(r, g, b); } function makeQBYTE (a, b, c, d) { return make3BYTE(a, b, c) | (d & 0xFF) << 24; } // 0-255 * 4 function RGBA (r, g, b, a) { return makeQBYTE(r, g, b, a); } function h3BYTE (n) { return (n >> 16) & 0xFF; } function h4BYTE (n) { return (n >> 24) & 0xFF; } function getRValue (n) { return loBYTE(n); } function getGValue (n) { return hiBYTE(n); } function getBValue (n) { return h3BYTE(n); } function getAValue (n) { return h4BYTE(n); } //----------------------------------------------------------------------------------------------- function makeLONG (l, h) { return l & 0xFFFF | (h & 0xFFFF) << 16; } // 0-65535 * 2 function loWORD (n) { return n & 0xFFFF; } function hiWORD (n) { return (n >> 16) & 0xFFFF; }
viernes, 28 de junio de 2013
Macros de C en JavaScript
Suscribirse a:
Enviar comentarios (Atom)
No hay comentarios:
Publicar un comentario