Lines Matching refs:FrameType
19 * A FrameType instance specifies the data format of a Frame.
22 * When filters are connected, their FrameType information is analyzed and checked for
26 * A FrameType generally consists of an element type and number of dimensions. The currently
37 * If the object element type is used, class information may be appended to the FrameType to
38 * indicate what class of objects are expected. When constructing an object based FrameType, you
83 public final class FrameType {
112 private static SimpleCache<String, FrameType> mTypeCache =
113 new SimpleCache<String, FrameType>(64);
116 * Constructs a wild-card FrameType that matches any other FrameType.
117 * @return The wild-card FrameType instance.
119 public static FrameType any() {
120 return FrameType.fetchType(ELEMENT_DONTCARE, -1, ACCESS_UNKNOWN);
124 * Constructs an object-based single FrameType that matches object-based FrameTypes of any
126 * @return A single object-based FrameType instance.
128 public static FrameType single() {
129 return FrameType.fetchType(null, 0);
133 * Constructs an object-based single FrameType of the specified class.
134 * @param clazz The class of the FrameType.
135 * @return A single object-base FrameType instance of the specified class.
137 public static FrameType single(Class<?> clazz) {
138 return FrameType.fetchType(clazz, 0);
142 * Constructs an object-based array FrameType that matches object-based FrameTypes of any class.
143 * @return An array object-based FrameType instance.
145 public static FrameType array() {
146 return FrameType.fetchType(null, 1);
150 * Constructs an object-based array FrameType with elements of the specified class.
152 * @return An array object-based FrameType instance of the specified class.
154 public static FrameType array(Class<?> clazz) {
155 return FrameType.fetchType(clazz, 1);
161 * @return A 1D buffer FrameType instance.
163 public static FrameType buffer1D(int elementType) {
164 return FrameType.fetchType(elementType, 1, ACCESS_UNKNOWN);
170 * @return A 2D buffer FrameType instance.
172 public static FrameType buffer2D(int elementType) {
173 return FrameType.fetchType(elementType, 2, ACCESS_UNKNOWN);
180 * @return A 2D image FrameType instance.
182 public static FrameType image2D(int elementType, int accessHint) {
183 return FrameType.fetchType(elementType, 2, accessHint);
192 public FrameType asSingle() {
196 return FrameType.fetchType(mClass, 0);
205 public FrameType asArray() {
209 return FrameType.fetchType(mClass, 1);
213 * Returns the FrameType's class specifier, or null if no class was set or the receiver is not
215 * @return The FrameType's class specifier or null.
222 * Returns the FrameType's element id.
230 * Returns the number of bytes of the FrameType's element, or 0 if no such size can be
232 * @return The number of bytes of the FrameType's element.
253 * Returns the access hints bit-mask of the FrameType.
254 * @return The access hints bit-mask of the FrameType.
261 * Returns the number of dimensions of the FrameType or -1 if no dimensions were set.
262 * @return The number of dimensions of the FrameType.
269 * Returns true, if the FrameType is fully specified.
271 * A FrameType is fully specified if its element and dimensions are specified.
273 * @return true, if the FrameType is fully specified.
281 if (object instanceof FrameType) {
282 FrameType type = (FrameType) object;
322 static FrameType tryMerge(FrameType writer, FrameType reader) {
336 static FrameType tryMergeObjectTypes(FrameType writer, FrameType reader) {
340 return success ? FrameType.fetchType(mergedClass, dimensions) : null;
343 static FrameType tryMergeBuffers(FrameType writer, FrameType reader) {
346 return FrameType.fetchType(writer.mElementId, writer.mDimensions, accessHints);
351 static FrameType merge(FrameType writer, FrameType reader) {
352 FrameType result = tryMerge(writer, reader);
404 private static FrameType fetchType(int elementId, int dimensions, int accessHints) {
408 private static FrameType fetchType(Class<?> clazz, int dimensions) {
412 private static FrameType fetchType(
414 String typeKey = FrameType.keyValueForType(elementId, dimensions, accessHints, clazz);
415 FrameType type = mTypeCache.get(typeKey);
417 type = new FrameType(elementId, dimensions, accessHints, clazz);
423 private FrameType(int elementId, int dimensions, int accessHints, Class<?> clazz) {