Package javax.media

Examples of javax.media.Format.relax()


  public int process(Buffer input, Buffer output) {
    Format inputFormat = input.getFormat();
    Format outputFormat = output.getFormat();
   
    if(inputFormat.relax().matches(rgbFormat) && outputFormat.relax().matches(jpegFormat)) {
      return processRGBtoJPEG(input,output);
    }
    return PlugIn.BUFFER_PROCESSED_FAILED;
  }
  static Hashtable imageTable = new Hashtable();
View Full Code Here


  public int process(Buffer input, Buffer output) {
    Format inputFormat = input.getFormat();
    Format outputFormat = output.getFormat();
   
    if(inputFormat.relax().matches(jpegFormat) &&
        (outputFormat==null || outputFormat.relax().matches(rgbFormat))) {
      return processJPEGtoRGB(input,output);
    }
    return PlugIn.BUFFER_PROCESSED_FAILED;
  }
View Full Code Here

  {
   
    // relax:
    {
      final Format f1 = new Format("abc", Format.byteArray);
      assertTrue(f1.relax().equals(f1));
    }
   
    {
      final Format f1 = new Format(null, Format.byteArray);
      assertTrue(f1.relax().equals(f1));
View Full Code Here

      assertTrue(f1.relax().equals(f1));
    }
   
    {
      final Format f1 = new Format(null, Format.byteArray);
      assertTrue(f1.relax().equals(f1));
    }
   
    {
      final Format f1 = new Format("abc");
      assertTrue(f1.relax().equals(f1));
View Full Code Here

      assertTrue(f1.relax().equals(f1));
    }
   
    {
      final Format f1 = new Format("abc");
      assertTrue(f1.relax().equals(f1));
    }
   
    {
      final Format f1 = new Format(null);
      assertTrue(f1.relax().equals(f1));
View Full Code Here

      assertTrue(f1.relax().equals(f1));
    }
   
    {
      final Format f1 = new Format(null);
      assertTrue(f1.relax().equals(f1));
    }

    {
      final IndexedColorFormat f1 = new IndexedColorFormat(new Dimension(1, 1), 2000, Format.byteArray, 3.f, 1, 2, new byte[] {0, 0}, new byte[] {0, 0}, new byte[] {0, 0});
      final IndexedColorFormat f2 = (IndexedColorFormat) f1.relax();
View Full Code Here

      assertTrue(f1.relax().equals(f1));
    }

    {
      final IndexedColorFormat f1 = new IndexedColorFormat(new Dimension(1, 1), 2000, Format.byteArray, 3.f, 1, 2, new byte[] {0, 0}, new byte[] {0, 0}, new byte[] {0, 0});
      final IndexedColorFormat f2 = (IndexedColorFormat) f1.relax();
      assertFalse(f1.equals(f2));
      assertEquals(f2.getRedValues(), f1.getRedValues());
      assertEquals(f2.getGreenValues(), f1.getGreenValues());
      assertEquals(f2.getBlueValues(), f1.getBlueValues());
      assertEquals(f2.getEncoding(), f1.getEncoding());
View Full Code Here

     
    }

    {
      final AudioFormat f1 = new AudioFormat(AudioFormat.DOLBYAC3, 2.0, 1, 2, 3, 4, 5, 6.0, Format.byteArray);
      final AudioFormat f2 = (AudioFormat) f1.relax();
      assertTrue(f1.equals(f2));
      assertEquals(f2.getSampleRate(), f1.getSampleRate());
      assertEquals(f2.getChannels(), f1.getChannels());
      assertEquals(f2.getEndian(), f1.getEndian());
      assertEquals(f2.getEncoding(), f1.getEncoding());
View Full Code Here

     
    }

    {
      final RGBFormat f1 = new RGBFormat(new Dimension(1, 1), 2000, Format.byteArray, 2.f, 1, 2, 3, 4, 5, 6, 7, 8);
      final RGBFormat f2 = (RGBFormat) f1.relax();
      assertFalse(f1.equals(f2));
      assertEquals(f2.getRedMask(), f1.getRedMask());
      assertEquals(f2.getGreenMask(), f1.getGreenMask());
      assertEquals(f2.getBlueMask(), f1.getBlueMask());
      assertEquals(f2.getEncoding(), f1.getEncoding());
View Full Code Here

     
    }

    {
      final YUVFormat f1 = new YUVFormat(new Dimension(1, 1), 2000, Format.byteArray, 2.f, 1, 2, 3, 4, 5, 6);
      final YUVFormat f2 = (YUVFormat) f1.relax();
      assertFalse(f1.equals(f2));
      assertEquals(f2.getEncoding(), f1.getEncoding());
      assertEquals(f2.getDataType(), f1.getDataType());
      assertEquals(f2.getFrameRate(), -1.f);
      assertEquals(f2.getMaxDataLength(), -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.