Example #1
0
  /**
   * Output a frame.
   *
   * @exception IllegalActionException If thrown while writing to the port.
   */
  public void fire() throws IllegalActionException {
    int size1 = ((IntToken) (size1Param.getToken())).intValue();
    int size2 = ((IntToken) (size2Param.getToken())).intValue();

    if (input.hasToken(0)) {
      ObjectToken inputToken = (ObjectToken) input.get(0);
      Object inputObject = inputToken.getValue();
      if (!(inputObject instanceof IplImage)) {
        throw new IllegalActionException(
            this, "Input is required to be an instance of IplImage. Got " + inputObject.getClass());
      }
      _frame = (IplImage) inputObject;
      cvSmooth(_frame, _frame, CV_GAUSSIAN, size1, size2, 0, 0);
      output.send(0, new ObjectToken(_frame));
    }
  }
  public void fire() throws IllegalActionException {
    ObjectToken obj = (ObjectToken) lsp_old.get(0);
    Short[] arg1 = (Short[]) obj.getValue();

    obj = (ObjectToken) lsp_mid.get(0);
    Short[] arg2 = (Short[]) obj.getValue();

    obj = (ObjectToken) lsp_new.get(0);
    Short[] arg3 = (Short[]) obj.getValue();

    Short[] arg4 = new Short[Cnst.MP1 * 4];

    _int_lpc2(arg1, arg2, arg3, arg4);

    obj = new ObjectToken(arg4);
    A.broadcast(obj);
  }
  public void fire() throws IllegalActionException {

    ObjectToken ot = (ObjectToken) input.get(0);
    MuxDataFrame mf = (MuxDataFrame) ot.getValue();
    int b;

    if (_frameCounter == 0) {
      b = _processFast(mf.getFastByte());
      mf.setFastByte(b);

      if (!_LS0Map) {
        for (int i = 0; i < _LS0Bytes; i++) {
          b = _processFast(mf.getLS0Byte(i));
          mf.setLS0Byte(b, i);
        }
      }

      if (mf.hasLEX()) {
        b = _processFast(mf.getLEXByte());
        mf.setLEXByte(b);
      }
    } else {
      b = _processInter(mf.getFastByte());
      mf.setFastByte(b);

      if (_LS0Map) {
        for (int i = 0; i < _LS0Bytes; i++) {
          b = _processInter(mf.getLS0Byte(i));
          mf.setLS0Byte(b, i);
        }
      }

      if (mf.hasLEX()) {
        b = _processInter(mf.getLEXByte());
        mf.setLEXByte(b);
      }
    }
    _frameCounter++;
    if (_frameCounter == 1 + _S) _frameCounter = 0;

    ot = new ObjectToken(mf);
    output.broadcast(ot);
  }