Examples of RGBFormat


Examples of javax.media.format.RGBFormat

    if (input == null)
      return supportedOutputFormats;
   
    final VideoFormat inputCast = (VideoFormat) input;
    final Format[] result = new Format[] {
        new RGBFormat(inputCast.getSize(), -1, Format.byteArray, inputCast.getFrameRate(), -1, -1, -1, -1)};
    // TODO: we don't know the details of the output format (pixel masks, etc) until we actually parse one!
   
    return result;
  }
View Full Code Here

Examples of javax.media.format.RGBFormat

  {
    if (input == null)
      return supportedOutputFormats;
    VideoFormat inputCast = (VideoFormat) input;
    final Format[] result = new Format[] {
        new RGBFormat(DIMENSION, -1, Format.intArray, -1.0f, -1, -1, -1, -1)};
    // TODO: we have to specify the RGB, etc. in the output format.
    return result;
  }
View Full Code Here

Examples of javax.media.format.RGBFormat

    h = format.getSize().height;
    dataType = format.getDataType();
   
    if (format instanceof RGBFormat)
    {
      final RGBFormat rgbFormat = (RGBFormat) format;
      final int bitsPerPixel = rgbFormat.getBitsPerPixel();
      final int redMask = rgbFormat.getRedMask();
      final int greenMask = rgbFormat.getGreenMask();
      final int blueMask = rgbFormat.getBlueMask();
      final int lineStride = rgbFormat.getLineStride();
      final int pixelStride = rgbFormat.getPixelStride();
      final boolean flipped = rgbFormat.getFlipped() == 1;
     
      // TODO: check for -1s
     
      if (dataType == Format.byteArray)
      {
View Full Code Here

Examples of javax.media.format.RGBFormat

    assertFalse(new CaptureDeviceInfo().equals(new CaptureDeviceInfo()));
    assertFalse(new CaptureDeviceInfo("xyz", null, null).equals(
          new CaptureDeviceInfo("xyz", null, null)));
    assertFalse(new CaptureDeviceInfo("xyz", new MediaLocator("abc"), null).equals(
          new CaptureDeviceInfo("xyz", new MediaLocator("abc"), null)));
    assertFalse(new CaptureDeviceInfo("xyz", new MediaLocator("abc"), new Format[] {new RGBFormat()}).equals(
        new CaptureDeviceInfo("xyz", new MediaLocator("abc"), new Format[] {new RGBFormat()})));
   
    {
      MediaLocator m = new MediaLocator("abc");
      Format[] f = new Format[] {new RGBFormat()};
      assertTrue(new CaptureDeviceInfo("xyz", m, f).equals(
          new CaptureDeviceInfo("xyz", m, f)));
    }
   
    {
      MediaLocator m = new MediaLocator("abc");
      Format[] f1 = new Format[] {new RGBFormat()};
      Format[] f2 = new Format[] {new RGBFormat()};
      assertFalse(new CaptureDeviceInfo("xyz", m, f1).equals(
          new CaptureDeviceInfo("xyz", m, f2)));
    }
   
    {
      MediaLocator m = new MediaLocator("abc");
      RGBFormat r = new RGBFormat();
      Format[] f1 = new Format[] {r};
      Format[] f2 = new Format[] {r};
      assertFalse(new CaptureDeviceInfo("xyz", m, f1).equals(
          new CaptureDeviceInfo("xyz", m, f2)));
    }
    {
      MediaLocator m1 = new MediaLocator("abc");
      MediaLocator m2 = new MediaLocator("abc");
      Format[] f = new Format[] {new RGBFormat()};
      assertFalse(new CaptureDeviceInfo("xyz", m1, f).equals(
          new CaptureDeviceInfo("xyz", m2, f)));
    }
   
    {
      MediaLocator m = null;
      Format[] f = new Format[] {new RGBFormat()};
      assertFalse(new CaptureDeviceInfo("xyz", m, f).equals(
          new CaptureDeviceInfo("xyz", m, f)));
    }
   
    {
      MediaLocator m = new MediaLocator("abc");
      Format[] f = new Format[] {};
      assertTrue(new CaptureDeviceInfo("xyz", m, f).equals(
          new CaptureDeviceInfo("xyz", m, f)));
    }
    {
      MediaLocator m = new MediaLocator("abc");
      Format[] f = null;
      assertFalse(new CaptureDeviceInfo("xyz", m, f).equals(
          new CaptureDeviceInfo("xyz", m, f)));
    }
   
    {
      MediaLocator m = new MediaLocator("abc");
      Format[] f = new Format[] {new RGBFormat()};
      assertFalse(new CaptureDeviceInfo(null, m, f).equals(
          new CaptureDeviceInfo(null, m, f)));
    }
   
    {
      MediaLocator m = new MediaLocator("abc");
      Format[] f = new Format[] {new RGBFormat()};
      assertTrue(new CaptureDeviceInfo("", m, f).equals(
          new CaptureDeviceInfo("", m, f)));
    }
   
    {
      MediaLocator m = new MediaLocator("abc");
      Format[] f = new Format[] {new RGBFormat()};
      assertFalse(new CaptureDeviceInfo("", m, f).equals(
          "test"));
    }
   
    assertTrue(new CaptureDeviceInfo().getFormats() == null);
    assertEquals(new CaptureDeviceInfo().toString(), "null : null\n");
    if (false)
    {
      System.out.println(new CaptureDeviceInfo().toString())// null : null
      System.out.println(new CaptureDeviceInfo("xyz", null, null).toString())// xyz : null
      System.out.println(new CaptureDeviceInfo("xyz", new MediaLocator("abc"), null).toString())// xyz : abc
      System.out.println(new CaptureDeviceInfo("xyz", new MediaLocator("abc"), new Format[] {}).toString())// xyz : abc
      System.out.println(new CaptureDeviceInfo("xyz", new MediaLocator("abc"), new Format[] {new RGBFormat()}).toString())
      // xyz : abc
      //RGB, -1-bit, Masks=-1:-1:-1, PixelStride=-1, LineStride=-1
    }
   
  }
View Full Code Here

Examples of javax.media.format.RGBFormat

    final MyBasicPlugIn p = new MyBasicPlugIn();
    {
      final Format in = new VideoFormat(null, null, -1, null, -1.0f);
      final Format[] outs = new Format[]{
          new AudioFormat("ULAW", 8000.0, 8, 1, -1, -1, -1, -1.0, Format.byteArray),
          new RGBFormat(null, -1, Format.intArray, -1.0f, 32, 0xff0000, 0xff00, 0xff, 1, -1, 0, -1)
         
      };
      assertTrue(BasicPlugIn.matches(in, outs) == outs[1]);
     
      // Sun's BasicPlugIn throws an NPE in this situation.  So for now, so will FMJ's.
View Full Code Here

Examples of javax.media.format.RGBFormat

          throw new IllegalArgumentException("Unsupported buffered image type: " + bufferedImageType);
      }
      else
        throw new IllegalArgumentException("Unsupported buffered image type: " + bufferedImageType);
   
    result.setFormat(new RGBFormat(size, maxDataLength, dataType, frameRate, bitsPerPixel, red, green, blue));
    result.setData(pixels);
    result.setLength(pixelsLength);
    result.setOffset(0);
   
    return result;
View Full Code Here

Examples of javax.media.format.RGBFormat

    Class[] classes = new Class[] {byte[].class, short[].class, int[].class};
    float[] frameRates = new float[] {-2.f, -1.f, 0.f};
    for (int i = 0; i < classes.length; ++i)
    for (int j = 0; j < frameRates.length; ++j)
    {
      final RGBFormat f;
      if (j == 0)
        f = (RGBFormat) b.createVideoFormat(classes[i]);
      else
        f = (RGBFormat) b.createVideoFormat(classes[i], frameRates[j]);
      assertEquals(f.getEncoding(), b.fourcc.toLowerCase());
      assertEquals(f.getBitsPerPixel(), b.biBitCount);
        assertEquals(f.getDataType(), classes[i]);
      assertEquals(f.getFrameRate(), j == 0 ? -1.f : frameRates[j]);
      //assertEquals(f.getMaxDataLength(), -2);  // TODO: sometimes -1, sometimes -2
      assertEquals(f.getSize(), new Dimension(b.biWidth, b.biHeight));
    }
   

  }
View Full Code Here

Examples of javax.media.format.RGBFormat

   
  }
 
  public void testClone()
  {
    assertEquals(new RGBFormat(null, -1, Format.intArray, -1.0f, 32, 0xff, 0xff00, 0xff0000, 1, -1, 0, -1).clone(),
         new RGBFormat(null, -1, Format.intArray, -1.0f, 32, 0xff, 0xff00, 0xff0000, 1, -1, 0, -1));

       
  }
View Full Code Here

Examples of javax.media.format.RGBFormat

       
  }
 
  public void testMatches()
  {
    assertFalse(new RGBFormat(new java.awt.Dimension(320, 200), 64000, Format.intArray, 1.3414634f, 32, 0xff, 0xff00, 0xff0000, -1, -1, -1, -1).matches(
        new RGBFormat(null, -1, Format.intArray, -1.0f, 32, 0xff0000, 0xff00, 0xff, 1, -1, 0, -1)));
    assertTrue(new RGBFormat(new java.awt.Dimension(320, 200), 64000, Format.intArray, 1.3414634f, 32, 0xff, 0xff00, 0xff0000, -1, -1, -1, -1)
        .matches( new RGBFormat(null, -1, Format.intArray, -1.0f, 32, 0xff, 0xff00, 0xff0000, 1, -1, 0, -1)
            ));
    assertFalse(new RGBFormat(new java.awt.Dimension(320, 200), 64000, Format.intArray, 1.3414634f, 32, 0xff, 0xff00, 0xff0000, -1, -1, -1, -1).matches(
         new RGBFormat(null, -1, Format.intArray, -1.0f, 32, 0xff0000, 0xff00, 0xff, 1, -1, 0, -1)));
    assertTrue(new RGBFormat(new java.awt.Dimension(320, 200), 64000, Format.intArray, 1.3414634f, 32, 0xff, 0xff00, 0xff0000, -1, -1, -1, -1).matches(
        new RGBFormat(null, -1, Format.intArray, -1.0f, 32, 0xff, 0xff00, 0xff0000, 1, -1, 0, -1)));
    assertFalse(new RGBFormat(new java.awt.Dimension(320, 200), 64000, Format.intArray, 1.3414634f, 32, 0xff, 0xff00, 0xff0000, 1, -1, 0, -1).matches(
        new RGBFormat(null, -1, Format.intArray, -1.0f, 32, 0xff0000, 0xff00, 0xff, 1, -1, 0, -1)));
    assertTrue(new RGBFormat(new java.awt.Dimension(320, 200), 64000, Format.intArray, 1.3414634f, 32, 0xff, 0xff00, 0xff0000, 1, -1, 0, -1).matches(
        new RGBFormat(null, -1, Format.intArray, -1.0f, 32, 0xff, 0xff00, 0xff0000, 1, -1, 0, -1)));
    assertTrue( new RGBFormat(new java.awt.Dimension(320, 200), 64000, Format.intArray, 1.3414634f, 32, 0xff, 0xff00, 0xff0000, 1, -1, 0, -1).matches(
        new RGBFormat(new java.awt.Dimension(320, 200), 64000, Format.intArray, 1.3414634f, 32, 0xff, 0xff00, 0xff0000, -1, -1, -1, -1)));
    assertFalse(new RGBFormat(new java.awt.Dimension(320, 200), 64000, Format.intArray, 1.3414634f, 32, 0xff, 0xff00, 0xff0000, 1, -1, 0, -1).matches(
        new RGBFormat(null, -1, Format.intArray, -1.0f, 32, 0xff0000, 0xff00, 0xff, 1, -1, 0, -1)));
    assertTrue(new RGBFormat(new java.awt.Dimension(320, 200), 64000, Format.intArray, 1.3414634f, 32, 0xff, 0xff00, 0xff0000, 1, -1, 0, -1).matches(
        new RGBFormat(null, -1, Format.intArray, -1.0f, 32, 0xff, 0xff00, 0xff0000, 1, -1, 0, -1)));
    assertTrue(new RGBFormat(new java.awt.Dimension(320, 200), 64000, Format.intArray, 1.3414634f, 32, 0xff, 0xff00, 0xff0000, 1, -1, 0, -1).matches(
        new RGBFormat(new java.awt.Dimension(320, 200), 64000, Format.intArray, 1.3414634f, 32, 0xff, 0xff00, 0xff0000, -1, -1, -1, -1)));
       
       
  }
View Full Code Here

Examples of javax.media.format.RGBFormat

       
  }
  public void testIntersects()
  {
    assertEquals(
         new RGBFormat(new java.awt.Dimension(320, 200), 64000, Format.intArray, 1.3414634f, 32, 0xff, 0xff00, 0xff0000, -1, -1, -1, -1)
         .intersects(
         new RGBFormat(null, -1, Format.intArray, -1.0f, 32, 0xff, 0xff00, 0xff0000, 1, -1, 0, -1) ),
         new RGBFormat(new java.awt.Dimension(320, 200), 64000, Format.intArray, 1.3414634f, 32, 0xff, 0xff00, 0xff0000, 1, -1, 0, -1));
   
    assertEquals(
        new RGBFormat(new java.awt.Dimension(320, 200), 64000, Format.intArray, 1.3414634f, 32, 0xff, 0xff00, 0xff0000, -1, -1, -1, -1).intersects(
        new RGBFormat(null, -1, Format.intArray, -1.0f, 32, 0xff, 0xff00, 0xff0000, 1, -1, 0, -1)),
        new RGBFormat(new java.awt.Dimension(320, 200), 64000, Format.intArray, 1.3414634f, 32, 0xff, 0xff00, 0xff0000, 1, -1, 0, -1));
    assertEquals(
        new RGBFormat(new java.awt.Dimension(320, 200), 64000, Format.intArray, 1.3414634f, 32, 0xff, 0xff00, 0xff0000, 1, -1, 0, -1),
        new RGBFormat(new java.awt.Dimension(320, 200), 64000, Format.intArray, 1.3414634f, 32, 0xff, 0xff00, 0xff0000, 1, -1, 0, -1));
  }
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.