/* * Copyright (C) 2011-2013 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * This file is auto-generated. DO NOT MODIFY! * The source Renderscript file: C:\\Users\\Kasutaja\\workspace\\Gallery\\src\\com\\android\\gallery3d\\filtershow\\filters\\grey.rs */ package com.android.gallery3d.filtershow.filters; import android.renderscript.*; import android.annotation.SuppressLint; import android.content.res.Resources; /** * @hide */ public class ScriptC_grey extends ScriptC { private static final String __rs_resource_name = "grey"; // Constructor public ScriptC_grey(RenderScript rs) { this(rs, rs.getApplicationContext().getResources(), rs.getApplicationContext().getResources().getIdentifier( __rs_resource_name, "raw", rs.getApplicationContext().getPackageName())); } public ScriptC_grey(RenderScript rs, Resources resources, int id) { super(rs, resources, id); __U8_4 = Element.U8_4(rs); __U8 = Element.U8(rs); } private Element __U8; private Element __U8_4; //private final static int mExportForEachIdx_root = 0; private final static int mExportForEachIdx_RGBAtoA = 1; @SuppressLint("NewApi") public Script.KernelID getKernelID_RGBAtoA() { return createKernelID(mExportForEachIdx_RGBAtoA, 3, null, null); } public void forEach_RGBAtoA(Allocation ain, Allocation aout) { forEach_RGBAtoA(ain, aout, null); } public void forEach_RGBAtoA(Allocation ain, Allocation aout, Script.LaunchOptions sc) { // check ain if (!ain.getType().getElement().isCompatible(__U8_4)) { throw new RSRuntimeException("Type mismatch with U8_4!"); } // check aout if (!aout.getType().getElement().isCompatible(__U8)) { throw new RSRuntimeException("Type mismatch with U8!"); } // Verify dimensions Type tIn = ain.getType(); Type tOut = aout.getType(); if ((tIn.getCount() != tOut.getCount()) || (tIn.getX() != tOut.getX()) || (tIn.getY() != tOut.getY()) || (tIn.getZ() != tOut.getZ()) || (tIn.hasFaces() != tOut.hasFaces()) || (tIn.hasMipmaps() != tOut.hasMipmaps())) { throw new RSRuntimeException("Dimension mismatch between input and output parameters!"); } forEach(mExportForEachIdx_RGBAtoA, ain, aout, null, sc); } }