FileDocCategorySizeDatePackage
Short4.javaAPI DocAndroid 5.1 API10417Thu Mar 12 22:22:42 GMT 2015android.renderscript

Short4

public class Short4 extends Object
Vector version of the basic short type. Provides four short fields packed.

Fields Summary
public short
x
public short
y
public short
z
public short
w
Constructors Summary
public Short4()

    
public Short4(short i)

hide

        this.x = this.y = this.z = this.w = i;
    
public Short4(short x, short y, short z, short w)

        this.x = x;
        this.y = y;
        this.z = z;
        this.w = w;
    
public Short4(Short4 source)

hide

        this.x = source.x;
        this.y = source.y;
        this.z = source.z;
        this.w = source.w;
    
Methods Summary
public voidadd(android.renderscript.Short4 a)

hide
Vector add
param
a

        this.x += a.x;
        this.y += a.y;
        this.z += a.z;
        this.w += a.w;
    
public static android.renderscript.Short4add(android.renderscript.Short4 a, android.renderscript.Short4 b)

hide
Vector add
param
a
param
b
return

        Short4 result = new Short4();
        result.x = (short)(a.x + b.x);
        result.y = (short)(a.y + b.y);
        result.z = (short)(a.z + b.z);
        result.w = (short)(a.w + b.w);

        return result;
    
public voidadd(short value)

hide
Vector add
param
value

        x += value;
        y += value;
        z += value;
        w += value;
    
public static android.renderscript.Short4add(android.renderscript.Short4 a, short b)

hide
Vector add
param
a
param
b
return

        Short4 result = new Short4();
        result.x = (short)(a.x + b);
        result.y = (short)(a.y + b);
        result.z = (short)(a.z + b);
        result.w = (short)(a.w + b);

        return result;
    
public voidaddAt(int i, short value)

hide
add the vector field value by index
param
i
param
value

        switch (i) {
        case 0:
            x += value;
            return;
        case 1:
            y += value;
            return;
        case 2:
            z += value;
            return;
        case 3:
            w += value;
            return;
        default:
            throw new IndexOutOfBoundsException("Index: i");
        }
    
public voidaddMultiple(android.renderscript.Short4 a, short factor)

hide
Vector add Multiple
param
a
param
factor

        x += a.x * factor;
        y += a.y * factor;
        z += a.z * factor;
        w += a.w * factor;
    
public voidcopyTo(short[] data, int offset)

hide
copy the vector to short array
param
data
param
offset

        data[offset] = (short)(x);
        data[offset + 1] = (short)(y);
        data[offset + 2] = (short)(z);
        data[offset + 3] = (short)(w);
    
public voiddiv(android.renderscript.Short4 a)

hide
Vector division
param
a

        this.x /= a.x;
        this.y /= a.y;
        this.z /= a.z;
        this.w /= a.w;
    
public static android.renderscript.Short4div(android.renderscript.Short4 a, android.renderscript.Short4 b)

hide
Vector division
param
a
param
b
return

        Short4 result = new Short4();
        result.x = (short)(a.x / b.x);
        result.y = (short)(a.y / b.y);
        result.z = (short)(a.z / b.z);
        result.w = (short)(a.w / b.w);

        return result;
    
public voiddiv(short value)

hide
Vector division
param
value

        x /= value;
        y /= value;
        z /= value;
        w /= value;
    
public static android.renderscript.Short4div(android.renderscript.Short4 a, short b)

hide
Vector division
param
a
param
b
return

        Short4 result = new Short4();
        result.x = (short)(a.x / b);
        result.y = (short)(a.y / b);
        result.z = (short)(a.z / b);
        result.w = (short)(a.w / b);

        return result;
    
public shortdotProduct(android.renderscript.Short4 a)

hide
Vector dot Product
param
a
return

        return (short)((x * a.x) + (y * a.y) + (z * a.z) + (w * a.w));
    
public static shortdotProduct(android.renderscript.Short4 a, android.renderscript.Short4 b)

hide
Vector dot Product
param
a
param
b
return

        return (short)((b.x * a.x) + (b.y * a.y) + (b.z * a.z) + (b.w * a.w));
    
public shortelementSum()

hide
return the element sum of vector
return

        return (short)(x + y + z + w);
    
public shortget(int i)

hide
get the vector field value by index
param
i
return

        switch (i) {
        case 0:
            return (short)(x);
        case 1:
            return (short)(y);
        case 2:
            return (short)(z);
        case 3:
            return (short)(w);
        default:
            throw new IndexOutOfBoundsException("Index: i");
        }
    
public shortlength()

hide
get vector length
return

        return 4;
    
public voidmod(android.renderscript.Short4 a)

hide
Vector Modulo
param
a

        this.x %= a.x;
        this.y %= a.y;
        this.z %= a.z;
        this.w %= a.w;
    
public static android.renderscript.Short4mod(android.renderscript.Short4 a, android.renderscript.Short4 b)

hide
Vector Modulo
param
a
param
b
return

        Short4 result = new Short4();
        result.x = (short)(a.x % b.x);
        result.y = (short)(a.y % b.y);
        result.z = (short)(a.z % b.z);
        result.w = (short)(a.w % b.w);

        return result;
    
public voidmod(short value)

hide
Vector Modulo
param
value

        x %= value;
        y %= value;
        z %= value;
        w %= value;
    
public static android.renderscript.Short4mod(android.renderscript.Short4 a, short b)

hide
Vector Modulo
param
a
param
b
return

        Short4 result = new Short4();
        result.x = (short)(a.x % b);
        result.y = (short)(a.y % b);
        result.z = (short)(a.z % b);
        result.w = (short)(a.w % b);

        return result;
    
public voidmul(android.renderscript.Short4 a)

hide
Vector multiplication
param
a

        this.x *= a.x;
        this.y *= a.y;
        this.z *= a.z;
        this.w *= a.w;
    
public static android.renderscript.Short4mul(android.renderscript.Short4 a, android.renderscript.Short4 b)

hide
Vector multiplication
param
a
param
b
return

        Short4 result = new Short4();
        result.x = (short)(a.x * b.x);
        result.y = (short)(a.y * b.y);
        result.z = (short)(a.z * b.z);
        result.w = (short)(a.w * b.w);

        return result;
    
public voidmul(short value)

hide
Vector multiplication
param
value

        x *= value;
        y *= value;
        z *= value;
        w *= value;
    
public static android.renderscript.Short4mul(android.renderscript.Short4 a, short b)

hide
Vector multiplication
param
a
param
b
return

        Short4 result = new Short4();
        result.x = (short)(a.x * b);
        result.y = (short)(a.y * b);
        result.z = (short)(a.z * b);
        result.w = (short)(a.w * b);

        return result;
    
public voidnegate()

hide
set vector negate

        this.x = (short)(-x);
        this.y = (short)(-y);
        this.z = (short)(-z);
        this.w = (short)(-w);
    
public voidset(android.renderscript.Short4 a)

hide
set vector value by Short4
param
a

        this.x = a.x;
        this.y = a.y;
        this.z = a.z;
        this.w = a.w;
    
public voidsetAt(int i, short value)

hide
set the vector field value by index
param
i
param
value

        switch (i) {
        case 0:
            x = value;
            return;
        case 1:
            y = value;
            return;
        case 2:
            z = value;
            return;
        case 3:
            w = value;
            return;
        default:
            throw new IndexOutOfBoundsException("Index: i");
        }
    
public voidsetValues(short a, short b, short c, short d)

hide
set the vector field value by Short
param
a
param
b
param
c
param
d

        this.x = a;
        this.y = b;
        this.z = c;
        this.w = d;
    
public static android.renderscript.Short4sub(android.renderscript.Short4 a, android.renderscript.Short4 b)

hide
Vector subtraction
param
a
param
b
return

        Short4 result = new Short4();
        result.x = (short)(a.x - b.x);
        result.y = (short)(a.y - b.y);
        result.z = (short)(a.z - b.z);
        result.w = (short)(a.w - b.w);

        return result;
    
public voidsub(short value)

hide
Vector subtraction
param
value

        x -= value;
        y -= value;
        z -= value;
        w -= value;
    
public static android.renderscript.Short4sub(android.renderscript.Short4 a, short b)

hide
Vector subtraction
param
a
param
b
return

        Short4 result = new Short4();
        result.x = (short)(a.x - b);
        result.y = (short)(a.y - b);
        result.z = (short)(a.z - b);
        result.w = (short)(a.w - b);

        return result;
    
public voidsub(android.renderscript.Short4 a)

hide
Vector subtraction
param
a

        this.x -= a.x;
        this.y -= a.y;
        this.z -= a.z;
        this.w -= a.w;