Beispiel #1
0
int main(int argc, char *argv[])
{
	int mFd = open("/dev/fb0", O_RDWR);
	if (!strcmp(argv[1], "contrast")) {
		setContrast(mFd, atoi(argv[2]));
		printf("please enter a number (0 ~ 100)\n");
	}

	if (!strcmp(argv[1], "brightness")) {
		setBrightness(mFd, atoi(argv[2]));
		printf("please enter a number (0 ~ 100)\n");
	}

	if (!strcmp(argv[1], "hue")) {
		setHue(mFd, atoi(argv[2]));
		printf("please enter a number (0 ~ 100)\n");
	}

	if (!strcmp(argv[1], "saturation")) {
		setSaturation(mFd, atoi(argv[2]));
		printf("please enter a number (0 ~ 100)\n");
	}

	if (!strcmp(argv[1], "gamma")) {
		setGamma(mFd, atoi(argv[2]));
		printf("please enter a number (0 ~ 100)\n");
	}

	if (!strcmp(argv[1], "vee")) {
		setVee(mFd, atoi(argv[2]));
		printf("please enter a number (0 ~ 100)\n");
	}

	return 0;
}
Beispiel #2
0
void HueLight::updateStates(const QVariantMap &statesMap)
{
    // color mode
    if (statesMap.value("colormode").toString() == "hs") {
        setColorMode(ColorModeHS);
    } else if (statesMap.value("colormode").toString() == "ct") {
        setColorMode(ColorModeCT);
    } else if (statesMap.value("colormode").toString() == "xy") {
        setColorMode(ColorModeXY);
    }

    // effect (none, colorloop)
    if (statesMap.value("effect").toString() == "none") {
        setEffect("none");
    } else if (statesMap.value("effect").toString() == "colorloop") {
        setEffect("color loop");
    }

    setReachable(statesMap.value("reachable").toBool());

    // alert (none, select, lselect)
    setAlert(statesMap.value("alert").toString());
    setBrigtness(statesMap.value("bri").toInt());
    setCt(statesMap.value("ct").toInt());
    setPower(statesMap.value("on").toBool());
    setSat(statesMap.value("sat").toInt());
    setHue(statesMap.value("hue").toInt());
    if (!statesMap.value("xy").toList().isEmpty())
        setXy(QPointF(statesMap.value("xy").toList().first().toFloat(), statesMap.value("xy").toList().last().toFloat()));

    emit stateChanged();
}
Beispiel #3
0
FUNCTION int Q43R(obj user, int newType)
{
  int Q5NC = 0x00;
  if(Q50G(user))
  {
    if(newType >= 0x00)
    {
      if(isRiding(user))
      {
        int Q52Q = unRide(user);
      }
      if(!(hasObjVar(Q62D, "oldBodyType")))
      {
        setObjVar(Q62D, "oldBodyType", getObjType(Q62D));
      }
      if(!(hasObjVar(Q62D, "oldHue")))
      {
        setObjVar(Q62D, "oldHue", getHue(Q62D));
      }
      setType(user, newType);
      setHue(user, 0x00);
      int Q4NC = (getSkillLevel(user, 0x19) / 0x05) * 0x05;
      if(isScroll())
      {
        Q4NC = 0x3C;
      }
      Q4MU(user, Q4NC);
      Q5NC = 0x01;
    }
  }
  Q5UQ(this);
  return(Q5NC);
}
Beispiel #4
0
void main(void) {
    TRISB0 = 0; //blue
    TRISB1 = 0; //green
    TRISB2 = 0; //red

    //set up timer
    T0IF = 0;
    TMR0 = PW_period;
    T0CS = 0;
    PSA = 1;
    GIE = 1; //global interrupt flag
    T0IE = 1;

    TRISB3 = 1; //button

    short i = EEPROM_READ(0x0A);
    while (1) {
        if (i >= 360/60) i=0;

        EEPROM_WRITE(0x0A, i);

        setHue(60*i);

        //delay(1000);
        while(RB3 == 1); //debounce
        while(RB3 == 0);
        setColor(100,100,100);
        delay(1000);
        i++;
    }
}
Beispiel #5
0
    SaturationColorMap( int formatType )
    {
        setFormat( ( QwtColorMap::Format ) formatType );

        setHue( 220 );
        setSaturationInterval( 0, 255 );
        setValueInterval( 255, 255 );
    }
Beispiel #6
0
void HSLFilter::filterImage()
{
    setHue(d->settings.hue);
    setSaturation(d->settings.saturation);
    setLightness(d->settings.lightness);
    applyHSL(m_orgImage);
    m_destImage = m_orgImage;
}
void UpgradeState::updateShip() {
	if (sh < 1) {
		sh = 1;
	}
	if (sh > 3) {
		sh = 3;
	}
	if (sh == 1) {
		Ship.setColor(sf::Color::White);
		getContext().player->setShip(sh);
	}
	if (sh == 2) {
		Ship.setColor(setHue(0, 0, 255));
		getContext().player->setShip(sh);
	}
	if (sh == 3) {
		Ship.setColor(setHue(0, 255, 0));
		getContext().player->setShip(sh);
	}
}
Beispiel #8
0
void HeaterMOO::fillImage ( double** img ) {
  uint32_t h = getH ();
  uint32_t w = getW ();
  Calibreurs calibreur ( 0, 1, 0.7, 0 );
#pragma omp parallel for if ( _omp )
  for ( size_t i = 1; i <= w; i++ ) {
    for ( size_t j = 1; j <= h; j++ ) {
      double temperature = img[i - 1][j - 1];
      float hue = calibreur.calibrate ( temperature );
      setHue ( i, j, hue );
    }
  }
}
Beispiel #9
0
FUNCTION void Q5VC(obj attacker)
{
  obj n = createGlobalNPCAtSpecificLoc(0x0232, getLocation(this));
  setHue(n, getHue(this));
  int Q4XB = getCurHP(this);
  Q4XB = Q4XB / 0x02;
  setCurHP(n, Q4XB);
  setCurHP(this, Q4XB);
  attack(n, attacker);
  sfx(getLocation(this), random(0x01C8, 0x01CC), 0x00);
  bark(n, "*The slime splits when struck!*");
  return;
}
void cGumpImage::processDefinitionAttribute(QString name, QString value) {
	if (name == "gump") {
		setId(Utilities::stringToUInt(value));
	} else if (name == "hue") {
		setHue(Utilities::stringToUInt(value));
	} else if (name == "partialhue") {
		setPartialHue(Utilities::stringToBool(value));
	} else if (name == "autosize") {
		setAutoSize(Utilities::stringToBool(value));
	} else {
		cControl::processDefinitionAttribute(name, value);
	}
}
Beispiel #11
0
TRIGGER( use )(obj user)
{
  int x = getHue(this);
  if(x < 0x0960)
  {
    x = 0x0960;
  }
  x = x + 0x01;
  if(x > 0x097D)
  {
    x = 0x0961;
  }
  setHue(this, x);
  string Q4XU = x;
  bark(this, Q4XU);
  return(0x01);
}
void ControlHuePicker::updateSliderPosition(Vector2 location)
{

    // Clamp the position of the icon within the circle
    Rect backgroundBox=_background->getBoundingBox();
    
    // Get the center point of the background image
    float centerX           = _startPos.x + backgroundBox.size.width * 0.5f;
    float centerY           = _startPos.y + backgroundBox.size.height * 0.5f;

    // Work out the distance difference between the location and center
    float dx                = location.x - centerX;
    float dy                = location.y - centerY;
    
    // Update angle by using the direction of the location
    float angle             = atan2f(dy, dx);
    float angleDeg          = CC_RADIANS_TO_DEGREES(angle) + 180.0f;
    
    // use the position / slider width to determin the percentage the dragger is at
    setHue(angleDeg);
    
    // send Control callback
    sendActionsForControlEvents(Control::EventType::VALUE_CHANGED);
}
Beispiel #13
0
void BallConfigItem::addParameter(std::string name, double value)
{
    if (name == "xCoordinate") {
        setXCoordinate(value);
    } else if (name == "yCoordinate") {
        setYCoordinate(value);
    } else if (name == "radius") {
        setRadius(value);
    } else if (name == "xVelocity") {
        setXVelocity(value);
    } else if (name == "yVelocity") {
        setYVelocity(value);
    } else if (name == "colorHue") {
        if (value < 0 || value > 1) {
            std::cout << "Hue value out of bounds [0,1] when creating a ball." << std::endl;
            exit(0);
        }
        setHue(value);
    } else {
        // Unrecognised parameter.
        std::cout << "Unrecognised parameter when creating a ball: " + name << std::endl;
        exit(0);
    }
}
Beispiel #14
0
void HSIColor::setHSI(float hue, float saturation, float intensity) {
  setHue(hue);
  setSaturation(saturation);
  setIntensity(intensity);
}
Beispiel #15
0
TRIGGER( targetobj )(obj user, obj usedon)
{
  if(usedon == NULL())
  {
    return(0x00);
  }
  if(isEquipped(usedon))
  {
    systemMessage(user, "Can't Dye clothing that is being worn.");
    return(0x00);
  }
  int Q66P = getObjType(usedon);
  int Q61R = getHue(this);
  loc Q66R = loc( getLocation(usedon) );
  switch(Q66P)
  {
  case 0x0DEF:
  case 0x0DF8:
  case 0x0DF9:
  case 0x0E1D:
  case 0x0E1E:
  case 0x0E1F:
  case 0x0E75:
  case 0x0E76:
  case 0x0F95:
  case 0x0F96:
  case 0x0F97:
  case 0x0F98:
  case 0x0F99:
  case 0x0F9A:
  case 0x0F9B:
  case 0x0F9C:
  case 0x0F9C:
  case 0x0FA0:
  case 0x0FA1:
  case 0x101F:
  case 0x13A4:
  case 0x0BD5:
  case 0x0BD6:
  case 0x0BD7:
  case 0x0BD8:
  case 0x0BD9:
  case 0x0BDA:
  case 0x0BDB:
  case 0x0BDC:
  case 0x0BDD:
  case 0x0BDE:
  case 0x1515:
  case 0x1516:
  case 0x1517:
  case 0x1518:
  case 0x152E:
  case 0x152F:
  case 0x1530:
  case 0x1531:
  case 0x1537:
  case 0x1538:
  case 0x1539:
  case 0x153A:
  case 0x153B:
  case 0x153C:
  case 0x153D:
  case 0x153E:
  case 0x153F:
  case 0x1540:
  case 0x1541:
  case 0x1542:
  case 0x1543:
  case 0x1544:
  case 0x170B:
  case 0x170C:
  case 0x170F:
  case 0x1710:
  case 0x1711:
  case 0x1712:
  case 0x1713:
  case 0x1714:
  case 0x1715:
  case 0x1716:
  case 0x1717:
  case 0x1718:
  case 0x1719:
  case 0x171A:
  case 0x171B:
  case 0x171C:
  case 0x175D:
  case 0x175E:
  case 0x175F:
  case 0x1760:
  case 0x1761:
  case 0x1762:
  case 0x1763:
  case 0x1764:
  case 0x1765:
  case 0x1766:
  case 0x1767:
  case 0x1768:
  case 0x1914:
  case 0x1915:
  case 0x1B74:
  case 0x1B75:
  case 0x1EFD:
  case 0x1EFE:
  case 0x1EFF:
  case 0x1F00:
  case 0x1F01:
  case 0x1F02:
  case 0x1F03:
  case 0x1F04:
  case 0x1F7B:
  case 0x1F7C:
  case 0x1F9F:
  case 0x1FA0:
  case 0x1FA1:
  case 0x1FA2:
  case 0x1F7B:
  case 0x1F7C:
  case 0x1FA1:
  case 0x1FA1:
  case 0x1FFD:
  case 0x1FFE:
    sfx(Q66R, 0x023E, 0x00);
    setHue(usedon, Q61R);
    break;
  }
  return(0x00);
}
Beispiel #16
0
// Default constructor.
HSIColor::HSIColor(void) {
  setHue(0);
  setSaturation(0);
  setIntensity(0);
}
int GStreamerPlayer::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QObject::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        if (_id < 13)
            qt_static_metacall(this, _c, _id, _a);
        _id -= 13;
    } else if (_c == QMetaObject::RegisterMethodArgumentMetaType) {
        if (_id < 13)
            *reinterpret_cast<int*>(_a[0]) = -1;
        _id -= 13;
    }
#ifndef QT_NO_PROPERTIES
      else if (_c == QMetaObject::ReadProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: *reinterpret_cast< int*>(_v) = getBrightness(); break;
        case 1: *reinterpret_cast< int*>(_v) = getContrast(); break;
        case 2: *reinterpret_cast< int*>(_v) = getHue(); break;
        case 3: *reinterpret_cast< int*>(_v) = getSaturation(); break;
        case 4: *reinterpret_cast< bool*>(_v) = getPlaying(); break;
        case 5: *reinterpret_cast< bool*>(_v) = getPaused(); break;
        case 6: *reinterpret_cast< bool*>(_v) = getStopped(); break;
        default: break;
        }
        _id -= 7;
    } else if (_c == QMetaObject::WriteProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: setBrightness(*reinterpret_cast< int*>(_v)); break;
        case 1: setContrast(*reinterpret_cast< int*>(_v)); break;
        case 2: setHue(*reinterpret_cast< int*>(_v)); break;
        case 3: setSaturation(*reinterpret_cast< int*>(_v)); break;
        case 4: setPlaying(*reinterpret_cast< bool*>(_v)); break;
        case 5: setPaused(*reinterpret_cast< bool*>(_v)); break;
        case 6: setStopped(*reinterpret_cast< bool*>(_v)); break;
        default: break;
        }
        _id -= 7;
    } else if (_c == QMetaObject::ResetProperty) {
        _id -= 7;
    } else if (_c == QMetaObject::QueryPropertyDesignable) {
        _id -= 7;
    } else if (_c == QMetaObject::QueryPropertyScriptable) {
        _id -= 7;
    } else if (_c == QMetaObject::QueryPropertyStored) {
        _id -= 7;
    } else if (_c == QMetaObject::QueryPropertyEditable) {
        _id -= 7;
    } else if (_c == QMetaObject::QueryPropertyUser) {
        _id -= 7;
    } else if (_c == QMetaObject::RegisterPropertyMetaType) {
        if (_id < 7)
            *reinterpret_cast<int*>(_a[0]) = -1;
        _id -= 7;
    }
#endif // QT_NO_PROPERTIES
    return _id;
}
Beispiel #18
0
void ColorPicker::mousePressEvent(QMouseEvent *m)
{
  if      (m_mode==Hue)        setHue(y2hue(m->y())); 
  else if (m_mode==Saturation) setSat(y2sat(m->y()));
  else                         setGam(y2gam(m->y()));
}