Package javax.media.format

Examples of javax.media.format.IndexedColorFormat


    {
      final byte[] arr1 = new byte[] {0, 0};
      final byte[] arr2 = new byte[] {0, 0};
      final byte[] arr3 = new byte[] {0, 0};
     
      final IndexedColorFormat f1 = new IndexedColorFormat(new Dimension(1, 1), 2000, Format.byteArray, 3.f, 1, 2, arr1, arr2, arr3);
      assertEquals(f1.getBlueValues(), arr3);
      assertEquals(f1.getDataType(), byte[].class);
      assertEquals(f1.getFrameRate(), 3.f);
      assertEquals(f1.getGreenValues(), arr2);
      assertEquals(f1.getLineStride(), 1);
      assertEquals(f1.getMapSize(), 2);
      assertEquals(f1.getMaxDataLength(), 2000);
      assertEquals(f1.getRedValues(), arr1);
      assertEquals(f1.getSize(), new Dimension(1, 1));
    }
  }
View Full Code Here


  {
    final byte[] arr1 = new byte[] {0, 0};
    final byte[] arr2 = new byte[] {0, 0};
    final byte[] arr3 = new byte[] {0, 0};
   
    final IndexedColorFormat f1 = new IndexedColorFormat(new Dimension(1, 1), 2000, Format.byteArray, 3.f, 1, 2, arr1, arr2, arr3);
    final IndexedColorFormat f2 = (IndexedColorFormat) f1.clone();
   
    assertTrue(f2.getRedValues() == f1.getRedValues());
    assertTrue(f2.getGreenValues() == f1.getGreenValues());
    assertTrue(f2.getBlueValues() == f1.getBlueValues());
    assertTrue(f2.getSize() != f1.getSize());

    assertEquals(f1.getSize(), f2.getSize());
   
  }
View Full Code Here

    }
    else if (c == IndexedColorFormat.class)
    {
 

      final IndexedColorFormat o = (IndexedColorFormat) f;
      return "new IndexedColorFormat(" +
      toLiteral(o.getSize()) +
      ", " + o.getMaxDataLength() +
      ", " + dataTypeToStr(o.getDataType()) +
      ", " + CGUtils.toLiteral(o.getFrameRate()) +
      ", " + o.getLineStride() // TODO: use constants
      ", " + o.getMapSize() +
      ", " + CGUtils.toLiteral(o.getRedValues()) +
      ", " + CGUtils.toLiteral(o.getGreenValues()) +
      ", " + CGUtils.toLiteral(o.getBlueValues())
      + ")";

     
    }
    else if (c == H263Format.class)
    {

      final H263Format o = (H263Format) f;
      return "new H263Format(" +
      toLiteral(o.getSize()) +
      ", " + o.getMaxDataLength() +
      ", " + dataTypeToStr(o.getDataType()) +
      ", " + CGUtils.toLiteral(o.getFrameRate()) +
      ", " + o.getAdvancedPrediction()
      ", " + o.getArithmeticCoding() +
      ", " + o.getErrorCompensation() +
      ", " + o.getHrDB() +
      ", " + o.getPBFrames() +
      ", " + o.getUnrestrictedVector()
      + ")";

     
    }
    else if (c == H261Format.class)
    {
 
      final H261Format o = (H261Format) f;
      return "new H261Format(" +
      toLiteral(o.getSize()) +
      ", " + o.getMaxDataLength() +
      ", " + dataTypeToStr(o.getDataType()) +
      ", " + CGUtils.toLiteral(o.getFrameRate()) +
      ", " + o.getStillImageTransmission()
      + ")";

     
    }
    else if (c == AudioFormat.class)
    {
      final AudioFormat o = (AudioFormat) f;
      return "new AudioFormat(" +
      CGUtils.toLiteral(o.getEncoding()) +
      ", " + CGUtils.toLiteral(o.getSampleRate()) +
      ", " + CGUtils.toLiteral(o.getSampleSizeInBits()) +
      ", " + CGUtils.toLiteral(o.getChannels()) +
      ", " + CGUtils.toLiteral(o.getEndian()) +
      ", " + CGUtils.toLiteral(o.getSigned()) +
      ", " + CGUtils.toLiteral(o.getFrameSizeInBits()) +
      ", " + CGUtils.toLiteral(o.getFrameRate()) +
      ", " + dataTypeToStr(o.getDataType())
      + ")";

     
    }
    else if (c == VideoFormat.class)
    {
     
      final VideoFormat o = (VideoFormat) f;
      return "new VideoFormat(" +
      CGUtils.toLiteral(o.getEncoding()) +
      ", " + toLiteral(o.getSize()) +
      ", " + o.getMaxDataLength() +
      ", " + dataTypeToStr(o.getDataType()) +
      ", " + CGUtils.toLiteral(o.getFrameRate())
      + ")";

     
    }
    else if (c == Format.class)
    {
 
      final Format o = (Format) f;
      return "new Format(" +
      CGUtils.toLiteral(o.getEncoding()) +
      ", " + dataTypeToStr(o.getDataType())
      + ")";

     
    }
    else if (c == FileTypeDescriptor.class)
    {
      final FileTypeDescriptor o = (FileTypeDescriptor) f;
      return "new FileTypeDescriptor(" +
      CGUtils.toLiteral(o.getEncoding())
      + ")";
    }
    else if (c == ContentDescriptor.class)
    {
      final ContentDescriptor o = (ContentDescriptor) f;
      return "new ContentDescriptor(" +
      CGUtils.toLiteral(o.getEncoding())
      + ")";
    }
    else if (c == com.sun.media.format.WavAudioFormat.class)
    {
      // TODO: are the parameters correct?
      final com.sun.media.format.WavAudioFormat o = (com.sun.media.format.WavAudioFormat) f;
      return "new com.sun.media.format.WavAudioFormat(" +
      CGUtils.toLiteral(o.getEncoding()) +
      ", " + CGUtils.toLiteral(o.getSampleRate()) +
      //", -1" + // int arg TODO - what is this?
      ", " + CGUtils.toLiteral(o.getSampleSizeInBits()) +
      ", " + CGUtils.toLiteral(o.getChannels()) +
      ", " + CGUtils.toLiteral(o.getFrameSizeInBits()) +
      ", " + CGUtils.toLiteral(o.getAverageBytesPerSecond()) +
      ", " + CGUtils.toLiteral(o.getEndian()) +
      ", " + CGUtils.toLiteral(o.getSigned()) +
      ", " + CGUtils.toLiteral((float) o.getFrameRate()) +
      ", " + dataTypeToStr(o.getDataType()) +
      ", " + CGUtils.toLiteral(o.getCodecSpecificHeader())
      + ")";
    }
    else
    throw new IllegalArgumentException("" + f.getClass());
      //System.err.println(f.getClass());
View Full Code Here

    assertEquals(new H263Format().toString(), "H.263 video format");
   
    assertEquals(new H263Format(new Dimension(1, 1), 2000, Format.shortArray, 2.f, 1, 2, 3, 4, 5, 6).toString(), "H.263 video format");
 
 
    assertEquals(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}).toString(), "IRGB, 1x1, FrameRate=3.0, Length=2000");
    assertEquals(new IndexedColorFormat(new Dimension(1, 1), 2000, Format.byteArray, -1.f, 1, 2, new byte[] {0, 0}, new byte[] {0, 0}, new byte[] {0, 0}).toString(), "IRGB, 1x1, Length=2000");
    assertEquals(new IndexedColorFormat(new Dimension(1, 1), -1, Format.byteArray, -1.f, 1, 2, new byte[] {0, 0}, new byte[] {0, 0}, new byte[] {0, 0}).toString(), "IRGB, 1x1");
    assertEquals(new IndexedColorFormat(null, -1, Format.byteArray, -1.f, 1, 2, new byte[] {0, 0}, new byte[] {0, 0}, new byte[] {0, 0}).toString(), "IRGB");
 
 
    assertEquals(new AudioFormat(AudioFormat.DOLBYAC3).toString(), "dolbyac3, Unknown Sample Rate");
    assertEquals(new AudioFormat(AudioFormat.DOLBYAC3, 2.0, 1, 2, 3, 4, 5, 6.0, Format.byteArray).toString(), "dolbyac3, 2.0 Hz, 1-bit, Stereo, Unsigned, 6.0 frame rate, FrameSize=5 bits");
    assertEquals(new AudioFormat(AudioFormat.DOLBYAC3, 2.0, 1, 1, 3, 4, 5, 6.0, Format.byteArray).toString(), "dolbyac3, 2.0 Hz, 1-bit, Mono, Unsigned, 6.0 frame rate, FrameSize=5 bits");
View Full Code Here

      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();
      assertFalse(f1.equals(f2));
      assertEquals(f2.getRedValues(), f1.getRedValues());
      assertEquals(f2.getGreenValues(), f1.getGreenValues());
      assertEquals(f2.getBlueValues(), f1.getBlueValues());
      assertEquals(f2.getEncoding(), f1.getEncoding());
      assertEquals(f2.getDataType(), f1.getDataType());
      assertEquals(f2.getFrameRate(), -1.f);
      assertEquals(f2.getLineStride(), -1);
      assertEquals(f2.getMapSize(), f1.getMapSize());
      assertEquals(f2.getMaxDataLength(), -1);
      assertEquals(f2.getSize(), null);
     
    }

    {
      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());
      assertEquals(f2.getDataType(), f1.getDataType());
      assertEquals(f2.getFrameRate(), f1.getFrameRate());
      assertEquals(f2.getFrameSizeInBits(), f1.getFrameSizeInBits());
      assertEquals(f2.getSampleSizeInBits(), f1.getSampleSizeInBits());
      assertEquals(f2.getSigned(), f1.getSigned());
     
    }

    {
      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());
      assertEquals(f2.getDataType(), f1.getDataType());
      assertEquals(f2.getFrameRate(), -1.f);
      assertEquals(f2.getLineStride(), -1);
      assertEquals(f2.getEndian(), f1.getEndian());
      assertEquals(f2.getBitsPerPixel(), f1.getBitsPerPixel());
      assertEquals(f2.getFlipped(), f1.getFlipped());
      assertEquals(f2.getMaxDataLength(), -1);
      assertEquals(f2.getSize(), null);
     
    }

    {
      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);
      assertEquals(f2.getSize(), null);
      assertEquals(f2.getOffsetU(), -1);
      assertEquals(f2.getOffsetV(), -1);
      assertEquals(f2.getOffsetY(), -1);
      assertEquals(f2.getStrideUV(), -1);
      assertEquals(f2.getStrideY(), -1);
      assertEquals(f2.getYuvType(), f1.getYuvType());
     
    }
   
    {
      final JPEGFormat f1 = new JPEGFormat(new Dimension(1, 1), 2000, Format.byteArray, 2.f, 1, 2);
      final JPEGFormat f2 = (JPEGFormat) 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);
      assertEquals(f2.getSize(), null);
      assertEquals(f2.getQFactor(), f1.getQFactor());
      assertEquals(f2.getDecimation(), f1.getDecimation());
     
    }
   
    {
      final H261Format f1 = new H261Format(new Dimension(1, 1), 2000, Format.byteArray, 2.f, 1);
      final H261Format f2 = (H261Format) 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);
      assertEquals(f2.getSize(), null);
      assertEquals(f2.getStillImageTransmission(), f1.getStillImageTransmission());
     
    }

    {
      final H263Format f1 = new H263Format(new Dimension(1, 1), 2000, Format.byteArray, 2.f, 1, 2, 3, 4, 5, 6);
      final H263Format f2 = (H263Format) 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);
      assertEquals(f2.getSize(), null);
      assertEquals(f2.getAdvancedPrediction(), f1.getAdvancedPrediction());
      assertEquals(f2.getArithmeticCoding(), f1.getArithmeticCoding());
      assertEquals(f2.getErrorCompensation(), f1.getErrorCompensation());
      assertEquals(f2.getHrDB(), f1.getHrDB());
      assertEquals(f2.getPBFrames(), f1.getPBFrames());
      assertEquals(f2.getUnrestrictedVector(), f1.getUnrestrictedVector());
     
    }

  }
View Full Code Here

    {
      final byte[] arr1 = new byte[] {0, 0};
      final byte[] arr2 = new byte[] {0, 0};
      final byte[] arr3 = new byte[] {0, 0};
     
      final IndexedColorFormat f1 = new IndexedColorFormat(new Dimension(1, 1), 2000, Format.byteArray, 3.f, 1, 2, arr1, arr2, arr3);
      final IndexedColorFormat f2 = new IndexedColorFormat(new Dimension(1, 1), 2000, Format.byteArray, 3.f, 1, 2, arr1, arr2, arr3);
      assertTrue(f1.equals(f2));
      assertTrue(f1.matches(f2));
      assertTrue(f2.equals(f1));
      assertTrue(f2.matches(f1));

    }
   
    // dimension
    {
      final byte[] arr1 = new byte[] {0, 0};
      final byte[] arr2 = new byte[] {0, 0};
      final byte[] arr3 = new byte[] {0, 0};
     
      final IndexedColorFormat f1 = new IndexedColorFormat(new Dimension(1, 1), 2000, Format.byteArray, 3.f, 1, 2, arr1, arr2, arr3);
      final IndexedColorFormat f2 = new IndexedColorFormat(new Dimension(0, 1), 2000, Format.byteArray, 3.f, 1, 2, arr1, arr2, arr3);
      assertFalse(f1.equals(f2));
      assertFalse(f1.matches(f2));
      assertFalse(f2.equals(f1));
      assertFalse(f2.matches(f1));

    }
   
    // dataType
    {
      final byte[] arr1 = new byte[] {0, 0};
      final byte[] arr2 = new byte[] {0, 0};
      final byte[] arr3 = new byte[] {0, 0};
     
      final IndexedColorFormat f1 = new IndexedColorFormat(new Dimension(1, 1), 2000, Format.byteArray, 3.f, 1, 2, arr1, arr2, arr3);
      final IndexedColorFormat f2 = new IndexedColorFormat(new Dimension(1, 1), 2000, Format.shortArray, 3.f, 1, 2, arr1, arr2, arr3);
      assertFalse(f1.equals(f2));
      assertFalse(f1.matches(f2));
      assertFalse(f2.equals(f1));
      assertFalse(f2.matches(f1));

    }
   
    // max
    {
      final byte[] arr1 = new byte[] {0, 0};
      final byte[] arr2 = new byte[] {0, 0};
      final byte[] arr3 = new byte[] {0, 0};
     
      final IndexedColorFormat f1 = new IndexedColorFormat(new Dimension(1, 1), 2000, Format.byteArray, 3.f, 1, 2, arr1, arr2, arr3);
      final IndexedColorFormat f2 = new IndexedColorFormat(new Dimension(1, 1), 2001, Format.byteArray, 3.f, 1, 2, arr1, arr2, arr3);
      assertFalse(f1.equals(f2));
      assertTrue(f1.matches(f2));
      assertFalse(f2.equals(f1));
      assertTrue(f2.matches(f1));

    }
   
   
    {
      final byte[] arr1 = new byte[] {0, 0};
      final byte[] arr2 = new byte[] {0, 0};
      final byte[] arr3 = new byte[] {0, 0};
     
      final IndexedColorFormat f1 = new IndexedColorFormat(new Dimension(1, 1), 2000, Format.byteArray, 3.f, 1, 2, arr1, arr2, arr3);
      final IndexedColorFormat f2 = new IndexedColorFormat(new Dimension(1, 1), 2000, Format.byteArray, 4.f, 1, 2, arr1, arr2, arr3);
      assertFalse(f1.equals(f2));
      assertFalse(f1.matches(f2));
      assertFalse(f2.equals(f1));
      assertFalse(f2.matches(f1));

    }
   
    {
      final byte[] arr1 = new byte[] {0, 0};
      final byte[] arr2 = new byte[] {0, 0};
      final byte[] arr3 = new byte[] {0, 0};
     
      final IndexedColorFormat f1 = new IndexedColorFormat(new Dimension(1, 1), 2000, Format.byteArray, 3.f, 1, 2, arr1, arr2, arr3);
      final IndexedColorFormat f2 = new IndexedColorFormat(new Dimension(1, 1), 2000, Format.byteArray, 3.f, 2, 2, arr1, arr2, arr3);
      assertFalse(f1.equals(f2));
      assertFalse(f1.matches(f2));
      assertFalse(f2.equals(f1));
      assertFalse(f2.matches(f1));

    }
   
    {
      final byte[] arr1 = new byte[] {0, 0};
      final byte[] arr2 = new byte[] {0, 0};
      final byte[] arr3 = new byte[] {0, 0};
     
      final IndexedColorFormat f1 = new IndexedColorFormat(new Dimension(1, 1), 2000, Format.byteArray, 3.f, 1, 2, arr1, arr2, arr3);
      final IndexedColorFormat f2 = new IndexedColorFormat(new Dimension(1, 1), 2000, Format.byteArray, 3.f, 1, 3, arr1, arr2, arr3);
      assertFalse(f1.equals(f2));
      assertFalse(f1.matches(f2));
      assertFalse(f2.equals(f1));
      assertFalse(f2.matches(f1));

    }
   
    {
      final byte[] arr1 = new byte[] {0, 0};
      final byte[] arr2 = new byte[] {0, 0};
      final byte[] arr3 = new byte[] {0, 0};
     
      final IndexedColorFormat f1 = new IndexedColorFormat(new Dimension(1, 1), 2000, Format.byteArray, 3.f, 1, 2, arr1, arr2, arr3);
      final IndexedColorFormat f2 = new IndexedColorFormat(new Dimension(1, 1), 2000, Format.byteArray, 3.f, 1, 3, new byte[] {0, 0}, arr2, arr3);
      assertFalse(f1.equals(f2));
      assertFalse(f1.matches(f2));
      assertFalse(f2.equals(f1));
      assertFalse(f2.matches(f1));

    }
   
  }
View Full Code Here

    final byte[] arr1 = new byte[] {0, 0};
    final byte[] arr2 = new byte[] {0, 0};
    final byte[] arr3 = new byte[] {0, 0};
   
    final IndexedColorFormat f1 = new IndexedColorFormat(new Dimension(1, 1), 2000, Format.byteArray, 3.f, 1, 2, arr1, arr2, arr3);

    // IndexedColorFormat - equal and match:
    {
      final IndexedColorFormat[] f2s = new IndexedColorFormat[]{
          new IndexedColorFormat(new Dimension(1, 1), 2000, Format.byteArray, 3.f, 1, 2, arr1, arr2, arr3),
            (IndexedColorFormat) f1.clone(),
            (IndexedColorFormat) f1.intersects(f1)
      };
      for (int i = 0; i < f2s.length; ++i)
      {
        IndexedColorFormat f2 = f2s[i];
        assertTrue(f1.equals(f2));
        assertTrue(f1.matches(f2));
        assertTrue(f2.equals(f1));
        assertTrue(f2.matches(f1));
      }
    }
   
    // IndexedColorFormat - not equal and not match:
    {
     
      final IndexedColorFormat[] f2s = new IndexedColorFormat[]{
          new IndexedColorFormat(new Dimension(1, 2), 2000, Format.byteArray, 3.f, 1, 2, arr1, arr2, arr3),
          new IndexedColorFormat(new Dimension(1, 1), 2000, Format.shortArray, 3.f, 1, 2, arr1, arr2, arr3),
          new IndexedColorFormat(new Dimension(1, 1), 2000, Format.byteArray, 4.f, 1, 2, arr1, arr2, arr3),
          new IndexedColorFormat(new Dimension(1, 1), 2000, Format.byteArray, 3.f, 11, 2, arr1, arr2, arr3),
          new IndexedColorFormat(new Dimension(1, 1), 2000, Format.byteArray, 3.f, 1, 12, arr1, arr2, arr3),
          new IndexedColorFormat(new Dimension(1, 1), 2000, Format.byteArray, 3.f, 1, 2, arr2, arr2, arr3),
          new IndexedColorFormat(new Dimension(1, 1), 2000, Format.byteArray, 3.f, 1, 2, arr1, arr3, arr3),
          new IndexedColorFormat(new Dimension(1, 1), 2000, Format.byteArray, 3.f, 1, 2, arr1, arr2, arr1),
                           
         
                 
                 
      };
      for (int i = 0; i < f2s.length; ++i)
      {
        IndexedColorFormat f2 = f2s[i];
        //System.out.println(f2);
        assertFalse(f1.equals(f2));
        assertFalse(f1.matches(f2));
        assertFalse(f2.equals(f1));
        assertFalse(f2.matches(f1));
      }
    }

    // IndexedColorFormat - not equal but match:
    {
     
      final IndexedColorFormat[] f2s = new IndexedColorFormat[]{
          new IndexedColorFormat(new Dimension(1, 1), 2001, Format.byteArray, 3.f, 1, 2, arr1, arr2, arr3),
          new IndexedColorFormat(null, 2000, Format.byteArray, 3.f, 1, 2, arr1, arr2, arr3),
          new IndexedColorFormat(new Dimension(1, 1), Format.NOT_SPECIFIED, Format.byteArray, 3.f, 1, 2, arr1, arr2, arr3),
          new IndexedColorFormat(new Dimension(1, 1), 2000, null, 3.f, 1, 2, arr1, arr2, arr3),
          new IndexedColorFormat(new Dimension(1, 1), 2000, Format.byteArray, Format.NOT_SPECIFIED, 1, 2, arr1, arr2, arr3),
          new IndexedColorFormat(new Dimension(1, 1), 2000, Format.byteArray, 3.f, Format.NOT_SPECIFIED, 2, arr1, arr2, arr3),
          new IndexedColorFormat(new Dimension(1, 1), 2000, Format.byteArray, 3.f, 1, Format.NOT_SPECIFIED, arr1, arr2, arr3),
          new IndexedColorFormat(new Dimension(1, 1), 2000, Format.byteArray, 3.f, 1, 2, null, arr2, arr3),
          new IndexedColorFormat(new Dimension(1, 1), 2000, Format.byteArray, 3.f, 1, 2, arr1, null, arr3),
          new IndexedColorFormat(new Dimension(1, 1), 2000, Format.byteArray, 3.f, 1, 2, arr1, arr2, null),
                 
         
         
                 
                   
      };
      for (int i = 0; i < f2s.length; ++i)
      {
        IndexedColorFormat f2 = f2s[i];
        //System.out.println(f2);
        assertFalse(f1.equals(f2));
        assertTrue(f1.matches(f2));
        assertFalse(f2.equals(f1));
        assertTrue(f2.matches(f1));
      }
    }
  }
View Full Code Here

    assertEquals(new H261Format().getDataType(), Format.byteArray);
   
    assertEquals(new H263Format().getEncoding(), "h263");
    assertEquals(new H263Format().getDataType(), Format.byteArray);
   
    final IndexedColorFormat indexedColorFormat = new IndexedColorFormat(new java.awt.Dimension(0, 0), 0, null, 0.f, 0, 0, null, null, null);
    assertEquals(indexedColorFormat.getEncoding(), "irgb")
    assertEquals(indexedColorFormat.getDataType(), null);
   
    assertEquals(new JPEGFormat().getEncoding(), "jpeg")
    assertEquals(new JPEGFormat().getDecimation(), Format.NOT_SPECIFIED)
    assertEquals(new JPEGFormat().getQFactor(), Format.NOT_SPECIFIED)
    assertEquals(new JPEGFormat().getDataType(), Format.byteArray);
View Full Code Here

TOP

Related Classes of javax.media.format.IndexedColorFormat

Copyright © 2018 www.massapicom. 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.