Examples of Color4f


Examples of javax.vecmath.Color4f

      public void draw(View view, Graphics renderer) {
        long elapsedTime = System.nanoTime() - currTime;
        currTime += elapsedTime;

        renderer.clearTransformation();
        renderer.setClearColor(new Color4f(0,1,0,1));
        renderer.clear();
       
        // Draw darkness
       
        renderer.fillTriangle(0, 0, 100, 0, 50, 100);
        renderer.copyToImage(dark);
       
        renderer.setColor(new Color4f(1,0,0,1));
//        renderer.drawLine(201, 100, 201, 200);
        renderer.fillTriangle(101, 0, 501, 0, 101, 400);
        renderer.setColor(new Color4f(1,1,1,1));

        renderer.translate(-102, 0);
        renderer.drawImage(dark, 512, 512);

        // draw frames per second
View Full Code Here

Examples of javax.vecmath.Color4f

  public void drawImageColored() throws IOException {
    final ch.blackspirit.graphics.Image image = imageFactory.createImage(this.getClass().getResource("/player1.png"), true);
    context.setGraphicsListener(new GraphicsListener() {
      public void draw(View view, Graphics graphics) {
        graphics.clear();
        graphics.setColor(new Color4f(1, 0, 0, 1));
        graphics.drawImage(image, image.getWidth(), image.getHeight());
      }
      public void init(View view, Graphics renderer) {}
      public void sizeChanged(GraphicsContext graphicsContext, View view) {}
    });
View Full Code Here

Examples of javax.vecmath.Color4f

  public void drawSubImageColored() throws IOException {
    final ch.blackspirit.graphics.Image image = imageFactory.createImage(this.getClass().getResource("/player1.png"), true);
    context.setGraphicsListener(new GraphicsListener() {
      public void draw(View view, Graphics graphics) {
        graphics.clear();
        graphics.setColor(new Color4f(1, 0, 0, 1));
        graphics.drawImage(image, image.getWidth(), image.getHeight(),
            image.getWidth() / 4, image.getHeight() / 4, image.getWidth() / 2, image.getHeight() / 2);
      }
      public void init(View view, Graphics renderer) {}
      public void sizeChanged(GraphicsContext graphicsContext, View view) {}
View Full Code Here

Examples of javax.vecmath.Color4f

//      return bi;
//    } else {
      BufferType type = image.getBufferType();

      BufferedImage bi = new BufferedImage(image.getWidth(), image.getHeight(), BufferedImage.TYPE_4BYTE_ABGR);
      Color4f color = new Color4f();
      for(int y = 0; y < image.getHeight(); y++) {
        for(int x = 0; x < image.getWidth(); x++) {
          type.getColor(image, x, y, color);
          int r = (int)(color.x * 255);
          int g = (int)(color.y * 255);
 
View Full Code Here

Examples of javax.vecmath.Color4f

      }
      public void sizeChanged(GraphicsContext graphicsContext, View view) {}
    });
   
    ColorGradientFactory gradient = new ColorGradientFactory();
    gradient.setBaseColor(new Color4f(1,0,0,1));
    gradient.addSourcePoint(256, 256, 256, new Color4f(0,0,1,1));
   
    gradient.drawGradient(image);
   
    BufferedImage bimage = null;
//    long time = System.nanoTime();
View Full Code Here

Examples of javax.vecmath.Color4f

    public Listener(ch.blackspirit.graphics.Image image) {
      this.image = image;
    }
   
    public void draw(View view, Graphics graphics) {
      graphics.setClearColor(new Color4f(0, 1, 0, 0));
      graphics.clear();
      graphics.translate(-400, -300);
      graphics.drawImage(image, image.getWidth() * 8, image.getHeight() * 8);
    }
 
View Full Code Here

Examples of javax.vecmath.Color4f

   */
  public void drawGradient(Image image) {
    if(image.isBuffered() == false) throw new IllegalArgumentException("Only buffered images can be processed!");
    if(pointSources.size() == 0 && lineSources.size() == 0) return;
    BufferType bufferType = image.getBufferType();
    Color4f color = new Color4f();
    for(int x = 0; x < image.getWidth(); x++) {
      for(int y = 0; y < image.getHeight(); y++) {
        getColor(x, y, color);
        bufferType.setColor(image, x, y, color);
      }
View Full Code Here

Examples of javax.vecmath.Color4f

      }
      public void sizeChanged(GraphicsContext graphicsContext, View view) {}
    });
   
    ColorGradientFactory gradient = new ColorGradientFactory();
    gradient.setBaseColor(new Color4f(0,0,0,0));
    gradient.addSourcePoint(256, 256, 256, new Color4f(0,0,1,1));
   
    gradient.drawGradient(image);
   
    BufferedImage bimage = null;
//    long time = System.nanoTime();
View Full Code Here

Examples of railo.runtime.img.vecmath.Color4f

    float width45 = Math.abs(6.0f * bumpHeight);
    boolean invertBumps = bumpHeight < 0;
    Vector3f position = new Vector3f(0.0f, 0.0f, 0.0f);
    Vector3f viewpoint = new Vector3f(width / 2.0f, height / 2.0f, viewDistance);
    Vector3f normal = new Vector3f();
    Color4f c = new Color4f();
    Function2D bump = bumpFunction;

    if (bumpSource == BUMPS_FROM_IMAGE || bumpSource == BUMPS_FROM_IMAGE_ALPHA || bumpSource == BUMPS_FROM_MAP || bump == null) {
      if ( bumpSoftness != 0 ) {
        int bumpWidth = width;
View Full Code Here

Examples of railo.runtime.img.vecmath.Color4f

    bumpShape = 0;
    material = new Material();
    l = new Vector3f();
    v = new Vector3f();
    n = new Vector3f();
    shadedColor = new Color4f();
    diffuse_color = new Color4f();
    specular_color = new Color4f();
    tmpv = new Vector3f();
    tmpv2 = new Vector3f();
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.