⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 formattest.java

📁 FMJ(freedom media for java)是java视频开发的新选择
💻 JAVA
📖 第 1 页 / 共 5 页
字号:
						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));		}			}	public void testEqualsMatches_RGBFormat()	{		final RGBFormat f1 =  new RGBFormat(new Dimension(1, 1), 2000, Format.byteArray, 2.f, 1, 2, 3, 4, 5, 6, 7, 8);				// RGBFormat - equal and match:		{			final RGBFormat[] f2s = new RGBFormat[]{						new RGBFormat(new Dimension(1, 1), 2000, Format.byteArray, 2.f, 1, 2, 3, 4, 5, 6, 7, 8),						(RGBFormat) f1.clone(),						(RGBFormat) f1.intersects(f1)			};			for (int i = 0; i < f2s.length; ++i)			{				RGBFormat f2 = f2s[i];				assertTrue(f1.equals(f2));				assertTrue(f1.matches(f2));				assertTrue(f2.equals(f1));				assertTrue(f2.matches(f1));			}		}				// RGBFormat - not equal and not match:		{						final RGBFormat[] f2s = new RGBFormat[]{					new RGBFormat(new Dimension(1, 2), 2000, Format.byteArray, 2.f, 1, 2, 3, 4, 5, 6, 7, 8),					new RGBFormat(new Dimension(1, 1), 2000, Format.intArray, 2.f, 1, 2, 3, 4, 5, 6, 7, 8),					new RGBFormat(new Dimension(1, 1), 2000, Format.byteArray, 1.f, 1, 2, 3, 4, 5, 6, 7, 8),					new RGBFormat(new Dimension(1, 1), 2000, Format.byteArray, 2.f, 11, 2, 3, 4, 5, 6, 7, 8),					new RGBFormat(new Dimension(1, 1), 2000, Format.byteArray, 2.f, 1, 12, 3, 4, 5, 6, 7, 8),					new RGBFormat(new Dimension(1, 1), 2000, Format.byteArray, 2.f, 1, 2, 13, 4, 5, 6, 7, 8),					new RGBFormat(new Dimension(1, 1), 2000, Format.byteArray, 2.f, 1, 2, 3, 14, 5, 6, 7, 8),					new RGBFormat(new Dimension(1, 1), 2000, Format.byteArray, 2.f, 1, 2, 3, 4, 15, 6, 7, 8),					new RGBFormat(new Dimension(1, 1), 2000, Format.byteArray, 2.f, 1, 2, 3, 4, 5, 6, 17, 8),					new RGBFormat(new Dimension(1, 1), 2000, Format.byteArray, 2.f, 1, 2, 3, 4, 5, 6, 7, 18),			};			for (int i = 0; i < f2s.length; ++i)			{				RGBFormat f2 = f2s[i];				//System.out.println(f2);				assertFalse(f1.equals(f2));				assertFalse(f1.matches(f2));				assertFalse(f2.equals(f1));				assertFalse(f2.matches(f1));			}		}		// RGBFormat - not equal but match:		{						final RGBFormat[] f2s = new RGBFormat[]{					new RGBFormat(new Dimension(1, 1), 2000, Format.byteArray, 2.f, 1, 2, 3, 4, 5, 16, 7, 8),					new RGBFormat(null, 2000, Format.byteArray, 2.f, 1, 2, 3, 4, 5, 6, 7, 8),					new RGBFormat(new Dimension(1, 1), Format.NOT_SPECIFIED, Format.byteArray, 2.f, 1, 2, 3, 4, 5, 6, 7, 8),					new RGBFormat(new Dimension(1, 1), 2000, null, 2.f, 1, 2, 3, 4, 5, 6, 7, 8),					new RGBFormat(new Dimension(1, 1), 2000, Format.byteArray, Format.NOT_SPECIFIED, 1, 2, 3, 4, 5, 6, 7, 8),					new RGBFormat(new Dimension(1, 1), 2000, Format.byteArray, 2.f, Format.NOT_SPECIFIED, 2, 3, 4, 5, 6, 7, 8),					new RGBFormat(new Dimension(1, 1), 2000, Format.byteArray, 2.f, 1, Format.NOT_SPECIFIED, 3, 4, 5, 6, 7, 8),					new RGBFormat(new Dimension(1, 1), 2000, Format.byteArray, 2.f, 1, 2, Format.NOT_SPECIFIED, 4, 5, 6, 7, 8),					new RGBFormat(new Dimension(1, 1), 2000, Format.byteArray, 2.f, 1, 2, 3, Format.NOT_SPECIFIED, 5, 6, 7, 8),					new RGBFormat(new Dimension(1, 1), 2000, Format.byteArray, 2.f, 1, 2, 3, 4, Format.NOT_SPECIFIED, 6, 7, 8),					new RGBFormat(new Dimension(1, 1), 2000, Format.byteArray, 2.f, 1, 2, 3, 4, 5, Format.NOT_SPECIFIED, 7, 8),					new RGBFormat(new Dimension(1, 1), 2000, Format.byteArray, 2.f, 1, 2, 3, 4, 5, 6, Format.NOT_SPECIFIED, 8),					new RGBFormat(new Dimension(1, 1), 2000, Format.byteArray, 2.f, 1, 2, 3, 4, 5, 6, 7, Format.NOT_SPECIFIED),								};			for (int i = 0; i < f2s.length; ++i)			{				RGBFormat f2 = f2s[i];				//System.out.println(f2);				assertFalse(f1.equals(f2));				assertTrue(f1.matches(f2));				assertFalse(f2.equals(f1));				assertTrue(f2.matches(f1));			}		}					}	public void testEqualsMatches_YUVFormat()	{		final YUVFormat f1 =  new YUVFormat(new java.awt.Dimension(120, 200), 1000, YUVFormat.byteArray, 1.f, YUVFormat.YUV_111, 2, 3, 4, 5, 6);				// YUVFormat - equal and match:		{			final YUVFormat[] f2s = new YUVFormat[]{						new YUVFormat(new java.awt.Dimension(120, 200), 1000, YUVFormat.byteArray, 1.f, YUVFormat.YUV_111, 2, 3, 4, 5, 6),						(YUVFormat) f1.clone(),						(YUVFormat) f1.intersects(f1)			};			for (int i = 0; i < f2s.length; ++i)			{				YUVFormat f2 = f2s[i];								assertTrue(f1.equals(f2));				assertTrue(f1.matches(f2));				assertTrue(f2.equals(f1));				assertTrue(f2.matches(f1));			}		}				// YUVFormat - not equal and not match:		{						final YUVFormat[] f2s = new YUVFormat[]{					new YUVFormat(new java.awt.Dimension(120, 200), 1000, YUVFormat.byteArray, 1.f, YUVFormat.YUV_411, 2, 3, 4, 5, 6),					new YUVFormat(new java.awt.Dimension(120, 200), 1000, YUVFormat.byteArray, 1.f, YUVFormat.YUV_111, 12, 3, 4, 5, 6),					new YUVFormat(new java.awt.Dimension(120, 200), 1000, YUVFormat.byteArray, 1.f, YUVFormat.YUV_111, 2, 13, 4, 5, 6),					new YUVFormat(new java.awt.Dimension(120, 200), 1000, YUVFormat.byteArray, 1.f, YUVFormat.YUV_111, 2, 3, 14, 5, 6),					new YUVFormat(new java.awt.Dimension(120, 200), 1000, YUVFormat.byteArray, 1.f, YUVFormat.YUV_111, 2, 3, 4, 15, 6),					new YUVFormat(new java.awt.Dimension(120, 200), 1000, YUVFormat.byteArray, 1.f, YUVFormat.YUV_111, 2, 3, 4, 5, 16),			};			for (int i = 0; i < f2s.length; ++i)			{				YUVFormat f2 = f2s[i];				//System.out.println(f2);				assertFalse(f1.equals(f2));				assertFalse(f1.matches(f2));				assertFalse(f2.equals(f1));				assertFalse(f2.matches(f1));			}		}		// YUVFormat - not equal but match:		{						final YUVFormat[] f2s = new YUVFormat[]{					new YUVFormat(null, 1000, YUVFormat.byteArray, 1.f, YUVFormat.YUV_111, 2, 3, 4, 5, 6),					new YUVFormat(new java.awt.Dimension(120, 200), Format.NOT_SPECIFIED, YUVFormat.byteArray, 1.f, YUVFormat.YUV_111, 2, 3, 4, 5, 6),					new YUVFormat(new java.awt.Dimension(120, 200), 1000, null, 1.f, YUVFormat.YUV_111, 2, 3, 4, 5, 6),					new YUVFormat(new java.awt.Dimension(120, 200), 1000, YUVFormat.byteArray, Format.NOT_SPECIFIED, YUVFormat.YUV_111, 2, 3, 4, 5, 6),					new YUVFormat(new java.awt.Dimension(120, 200), 1000, YUVFormat.byteArray, 1.f, Format.NOT_SPECIFIED, 2, 3, 4, 5, 6),					new YUVFormat(new java.awt.Dimension(120, 200), 1000, YUVFormat.byteArray, 1.f, YUVFormat.YUV_111, Format.NOT_SPECIFIED, 3, 4, 5, 6),					new YUVFormat(new java.awt.Dimension(120, 200), 1000, YUVFormat.byteArray, 1.f, YUVFormat.YUV_111, 2, Format.NOT_SPECIFIED, 4, 5, 6),					new YUVFormat(new java.awt.Dimension(120, 200), 1000, YUVFormat.byteArray, 1.f, YUVFormat.YUV_111, 2, 3, Format.NOT_SPECIFIED, 5, 6),					new YUVFormat(new java.awt.Dimension(120, 200), 1000, YUVFormat.byteArray, 1.f, YUVFormat.YUV_111, 2, 3, 4, Format.NOT_SPECIFIED, 6),					new YUVFormat(new java.awt.Dimension(120, 200), 1000, YUVFormat.byteArray, 1.f, YUVFormat.YUV_111, 2, 3, 4, 5, Format.NOT_SPECIFIED),												};			for (int i = 0; i < f2s.length; ++i)			{				YUVFormat f2 = f2s[i];				//System.out.println(f2);				assertFalse(f1.equals(f2));				assertTrue(f1.matches(f2));				assertFalse(f2.equals(f1));				assertTrue(f2.matches(f1));			}		}	}	public void testEqualsMatches_AudioFormat()	{		final AudioFormat f1 =  new AudioFormat(AudioFormat.DOLBYAC3, 2.0, 1, 2, 3, 4, 5, 6.0, Format.byteArray);		// AudioFormat - equal and match:		{			final AudioFormat[] f2s = new AudioFormat[]{					new AudioFormat(AudioFormat.DOLBYAC3, 2.0, 1, 2, 3, 4, 5, 6.0, Format.byteArray),						(AudioFormat) f1.clone(),						(AudioFormat) f1.intersects(f1)			};			for (int i = 0; i < f2s.length; ++i)			{				AudioFormat f2 = f2s[i];				assertTrue(f1.equals(f2));				assertTrue(f1.matches(f2));				assertTrue(f2.equals(f1));				assertTrue(f2.matches(f1));			}		}				// AudioFormat - not equal and not match:		{						final AudioFormat[] f2s = new AudioFormat[]{					new AudioFormat(AudioFormat.ALAW, 2.0, 1, 2, 3, 4, 5, 6.0, Format.byteArray),					new AudioFormat(AudioFormat.DOLBYAC3, 3.0, 1, 2, 3, 4, 5, 6.0, Format.byteArray),					new AudioFormat(AudioFormat.DOLBYAC3, 2.0, 11, 2, 3, 4, 5, 6.0, Format.byteArray),					new AudioFormat(AudioFormat.DOLBYAC3, 2.0, 1, 12, 3, 4, 5, 6.0, Format.byteArray),					new AudioFormat(AudioFormat.DOLBYAC3, 2.0, 1, 2, 13, 4, 5, 6.0, Format.byteArray),					new AudioFormat(AudioFormat.DOLBYAC3, 2.0, 1, 2, 3, 14, 5, 6.0, Format.byteArray),					new AudioFormat(AudioFormat.DOLBYAC3, 2.0, 1, 2, 3, 4, 15, 6.0, Format.byteArray),					new AudioFormat(AudioFormat.DOLBYAC3, 2.0, 1, 2, 3, 4, 5, 16.0, Format.byteArray),					new AudioFormat(AudioFormat.DOLBYAC3, 2.0, 1, 2, 3, 4, 5, 6.0, Format.intArray),												};			for (int i = 0; i < f2s.length; ++i)			{				AudioFormat f2 = f2s[i];				//System.out.println(f2);				assertFalse(f1.equals(f2));				assertFalse(f1.matches(f2));				assertFalse(f2.equals(f1));				assertFalse(f2.matches(f1));			}		}		// AudioFormat - not equal but match:		{						final AudioFormat[] f2s = new AudioFormat[]{					new AudioFormat(null, 2.0, 1, 2, 3, 4, 5, 6.0, Format.byteArray),					new AudioFormat(AudioFormat.DOLBYAC3, Format.NOT_SPECIFIED, 1, 2, 3, 4, 5, 6.0, Format.byteArray),					new AudioFormat(AudioFormat.DOLBYAC3, 2.0, Format.NOT_SPECIFIED, 2, 3, 4, 5, 6.0, Format.byteArray),					new AudioFormat(AudioFormat.DOLBYAC3, 2.0, 1, Format.NOT_SPECIFIED, 3, 4, 5, 6.0, Format.byteArray),					new AudioFormat(AudioFormat.DOLBYAC3, 2.0, 1, 2, Format.NOT_SPECIFIED, 4, 5, 6.0, Format.byteArray),					new AudioFormat(AudioFormat.DOLBYAC3, 2.0, 1, 2, 3, Format.NOT_SPECIFIED, 5, 6.0, Format.byteArray),					new AudioFormat(AudioFormat.DOLBYAC3, 2.0, 1, 2, 3, 4, Format.NOT_SPECIFIED, 6.0, Format.byteArray),					new AudioFormat(AudioFormat.DOLBYAC3, 2.0, 1, 2, 3, 4, 5, Format.NOT_SPECIFIED, Format.byteArray),					new AudioFormat(AudioFormat.DOLBYAC3, 2.0, 1, 2, 3, 4, 5, 6.0, null),													};			for (int i = 0; i < f2s.length; ++i)			{				AudioFormat f2 = f2s[i];				//System.out.println(f2);				assertFalse(f1.equals(f2));				assertTrue(f1.matches(f2));				assertFalse(f2.equals(f1));				assertTrue(f2.matches(f1));			}		}	}		public void testEqualsMatches_H261Format()	{		final H261Format f1 = new H261Format(new Dimension(1, 1), 2000, Format.byteArray, 3.f, 1);		// H261Format - equal and match:		{			final H261Format[] f2s = new H261Format[]{					new H261Format(new Dimension(1, 1), 2000, Format.byteArray, 3.f, 1),						(H261Format) f1.clone(),						(H261Format) f1.intersects(f1)			};			for (int i = 0; i < f2s.length; ++i)			{				H261Format f2 = f2s[i];				assertTrue(f1.equals(f2));				assertTrue(f1.matches(f2));				assertTrue(f2.equals(f1));				assertTrue(f2.matches(f1));			}		}				// H261Format - not equal and not match:		{			final H261Format[] f2s = new H261Format[]{					new H261Format(new Dimension(1, 2), 2000, Format.byteArray, 3.f, 1),					new H261Format(new Dimension(1, 1), 2000, Format.intArray, 3.f, 1),					new H261Format(new Dimension(1, 1), 2000, Format.byteArray, 4.f, 1),					new H261Format(new Dimension(1, 1), 2000, Format.byteArray, 3.f, 11),																										};			for (int i = 0; i < f2s.length; ++i)			{				H261Format f2 = f2s[i];								//System.out.println(f2);				assertFalse(f1.equals(f2));				assertFalse(f1.matches(f2));				assertFalse(f2.equals(f1));				assertFalse(f2.matches(f1));			}		}		// H261Format - not equal but match:		{			final H261Format[] f2s = new H261Format[]{					new H261Format(new Dimension(1, 1), 3000, Format.byteArray, 3.f, 1),					new H261Format(null, 2000, Format.byteArray, 3.f, 1),					new H261Format(new Dimension(1, 1), Format.NOT_SPECIFIED, Format.byteArray, 3.f, 1),					new H261Format(new Dimension(1, 1), 2000, null, 3.f, 1),					new H261Format(new Dimension(1, 1), 2000, Format.byteArray, Format.NOT_SPECIFIED, 1),					new H261Format(new Dimension(1, 1), 2000, Format.byteArray, 3.f, Format.NOT_SPECIFIED),					

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -