If the Android hardware buffer has one of the formats listed in the Format Equivalence table, then format must have the equivalent Vulkan format listed in the table. Otherwise, format may be FORMAT_UNDEFINED, indicating the Android hardware buffer can only be used with an external format.
The formatFeatures member must include FORMAT_FEATURE_SAMPLED_IMAGE_BIT and at least one of FORMAT_FEATURE_MIDPOINT_CHROMA_SAMPLES_BIT or FORMAT_FEATURE_COSITED_CHROMA_SAMPLES_BIT, and should include FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT and FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_LINEAR_FILTER_BIT.
The formatFeatures member only indicates the features available when using an external-format image created from the Android hardware buffer. Images from Android hardware buffers with a format other than FORMAT_UNDEFINED are subject to the format capabilities obtained from GetPhysicalDeviceFormatProperties2, and GetPhysicalDeviceImageFormatProperties2 with appropriate parameters. These sets of features are independent of each other, e.g. the external format will support sampler Y′CBCR conversion even if the non-external format does not, and writing to non-external format images is possible but writing to external format images is not.
Android hardware buffers with the same external format must have the same support for FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT, FORMAT_FEATURE_MIDPOINT_CHROMA_SAMPLES_BIT, FORMAT_FEATURE_COSITED_CHROMA_SAMPLES_BIT, FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_LINEAR_FILTER_BIT, FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_SEPARATE_RECONSTRUCTION_FILTER_BIT, and FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_FORCEABLE_BIT. in formatFeatures. Other format features may differ between Android hardware buffers that have the same external format. This allows applications to use the same VkSamplerYcbcrConversion object (and samplers and pipelines created from them) for any Android hardware buffers that have the same external format.
If format is not FORMAT_UNDEFINED, then the value of samplerYcbcrConversionComponents must be valid when used as the components member of VkSamplerYcbcrConversionCreateInfo with that format. If format is FORMAT_UNDEFINED, all members of samplerYcbcrConversionComponents must be the identity swizzle.
Implementations may not always be able to determine the color model, numerical range, or chroma offsets of the image contents, so the values in VkAndroidHardwareBufferFormatPropertiesANDROID are only suggestions. Applications should treat these values as sensible defaults to use in the absence of more reliable information obtained through some other means. If the underlying physical device is also usable via OpenGL ES with the GL_OES_EGL_image_external extension, the implementation should suggest values that will produce similar sampled values as would be obtained by sampling the same external image via samplerExternalOES in OpenGL ES using equivalent sampler parameters.
Since GL_OES_EGL_image_external does not require the same sampling and conversion calculations as Vulkan does, achieving identical results between APIs may not be possible on some implementations.
struct VkAndroidHardwareBufferFormatPropertiesANDROID {
VkStructureType sType;
void * pNext;
VkFormat format;
uint64_t externalFormat;
VkFormatFeatureFlags formatFeatures;
VkComponentMapping samplerYcbcrConversionComponents;
VkSamplerYcbcrModelConversion suggestedYcbcrModel;
VkSamplerYcbcrRange suggestedYcbcrRange;
VkChromaLocation suggestedXChromaOffset;
VkChromaLocation suggestedYChromaOffset;
}
| Modifier and Type | Class and Description |
|---|---|
| public static class |
| Modifier and Type | Field and Description |
|---|---|
| public static final int | ALIGNOF
The struct alignment in bytes. |
| public static final int | EXTERNALFORMAT
The struct member offsets. |
| public static final int | FORMAT
The struct member offsets. |
| public static final int | FORMATFEATURES
The struct member offsets. |
| public static final int | PNEXT
The struct member offsets. |
| public static final int | SAMPLERYCBCRCONVERSIONCOMPONENTS
The struct member offsets. |
| public static final int | SIZEOF
The struct size in bytes. |
| public static final int | STYPE
The struct member offsets. |
| public static final int | SUGGESTEDXCHROMAOFFSET
The struct member offsets. |
| public static final int | SUGGESTEDYCBCRMODEL
The struct member offsets. |
| public static final int | SUGGESTEDYCBCRRANGE
The struct member offsets. |
| public static final int | SUGGESTEDYCHROMAOFFSET
The struct member offsets. |
| Access | Constructor and Description |
|---|---|
| protected | |
| public | VkAndroidHardwareBufferFormatPropertiesANDROID(ByteBuffer container)
Creates a |
| Modifier and Type | Method and Description |
|---|---|
| public static VkAndroidHardwareBufferFormatPropertiesANDROID | |
| public static VkAndroidHardwareBufferFormatPropertiesANDROID. | calloc(int
the buffer capacity capacity)Returns a new |
| public static VkAndroidHardwareBufferFormatPropertiesANDROID | calloc(MemoryStack
the stack from which to allocate stack)Returns a new |
| public static VkAndroidHardwareBufferFormatPropertiesANDROID. | calloc(int
the buffer capacity capacity, MemoryStack the stack from which to allocate stack)Returns a new |
| protected VkAndroidHardwareBufferFormatPropertiesANDROID | create(long
the struct memory address address, ByteBuffer an optional container buffer, to be referenced strongly by the struct instance. container)Implements abstract org. the constructor, but returns the exact type of the Struct subclass.
|
| public static VkAndroidHardwareBufferFormatPropertiesANDROID | create()
Returns a new |
| public static VkAndroidHardwareBufferFormatPropertiesANDROID | create(long address)
Returns a new |
| public static VkAndroidHardwareBufferFormatPropertiesANDROID. | create(int
the buffer capacity capacity)Returns a new |
| public static VkAndroidHardwareBufferFormatPropertiesANDROID. | create(long
the memory address address, int the buffer capacity capacity)Create a |
| public static VkAndroidHardwareBufferFormatPropertiesANDROID | |
| public static VkAndroidHardwareBufferFormatPropertiesANDROID. | |
| public long | externalFormat()
an implementation-defined external format identifier for use with |
| public int | format()
the Vulkan format corresponding to the Android hardware buffer’s format, or |
| public int | formatFeatures()
describes the capabilities of this external format when used with an image bound to memory imported from |
| public static VkAndroidHardwareBufferFormatPropertiesANDROID | |
| public static VkAndroidHardwareBufferFormatPropertiesANDROID. | malloc(int
the buffer capacity capacity)Returns a new |
| public static VkAndroidHardwareBufferFormatPropertiesANDROID | malloc(MemoryStack
the stack from which to allocate stack)Returns a new |
| public static VkAndroidHardwareBufferFormatPropertiesANDROID. | malloc(int
the buffer capacity capacity, MemoryStack the stack from which to allocate stack)Returns a new |
| public static long | |
| public static int | |
| public static int | |
| public static long | |
| public static void | |
| public static VkComponentMapping | |
| public static int | |
| public static void | |
| public static int | |
| public static int | |
| public static int | |
| public static int | |
| public long | |
| public VkAndroidHardwareBufferFormatPropertiesANDROID | |
| public VkComponentMapping | samplerYcbcrConversionComponents()
the component swizzle that should be used in |
| public VkAndroidHardwareBufferFormatPropertiesANDROID | |
| public VkAndroidHardwareBufferFormatPropertiesANDROID | Returns: this structthe source struct src)Copies the specified struct data to this struct. |
| public int | |
| public int | |
| public VkAndroidHardwareBufferFormatPropertiesANDROID | |
| public VkAndroidHardwareBufferFormatPropertiesANDROID | sType$Default()
Sets the |
| public int | |
| public int | |
| public int | suggestedYcbcrRange()
a suggested numerical value range to use in |
| public int |
| ALIGNOF | back to summary |
|---|---|
| public static final int ALIGNOF The struct alignment in bytes. | |
| EXTERNALFORMAT | back to summary |
|---|---|
| public static final int EXTERNALFORMAT The struct member offsets. | |
| FORMAT | back to summary |
|---|---|
| public static final int FORMAT The struct member offsets. | |
| FORMATFEATURES | back to summary |
|---|---|
| public static final int FORMATFEATURES The struct member offsets. | |
| PNEXT | back to summary |
|---|---|
| public static final int PNEXT The struct member offsets. | |
| SAMPLERYCBCRCONVERSIONCOMPONENTS | back to summary |
|---|---|
| public static final int SAMPLERYCBCRCONVERSIONCOMPONENTS The struct member offsets. | |
| SIZEOF | back to summary |
|---|---|
| public static final int SIZEOF The struct size in bytes. | |
| STYPE | back to summary |
|---|---|
| public static final int STYPE The struct member offsets. | |
| SUGGESTEDXCHROMAOFFSET | back to summary |
|---|---|
| public static final int SUGGESTEDXCHROMAOFFSET The struct member offsets. | |
| SUGGESTEDYCBCRMODEL | back to summary |
|---|---|
| public static final int SUGGESTEDYCBCRMODEL The struct member offsets. | |
| SUGGESTEDYCBCRRANGE | back to summary |
|---|---|
| public static final int SUGGESTEDYCBCRRANGE The struct member offsets. | |
| SUGGESTEDYCHROMAOFFSET | back to summary |
|---|---|
| public static final int SUGGESTEDYCHROMAOFFSET The struct member offsets. | |
| VkAndroidHardwareBufferFormatPropertiesANDROID | back to summary |
|---|---|
| protected VkAndroidHardwareBufferFormatPropertiesANDROID(long address, ByteBuffer container) | |
| VkAndroidHardwareBufferFormatPropertiesANDROID | back to summary |
|---|---|
| public VkAndroidHardwareBufferFormatPropertiesANDROID(ByteBuffer container) Creates a The created instance holds a strong reference to the container object. | |
| calloc | back to summary |
|---|---|
| public static VkAndroidHardwareBufferFormatPropertiesANDROID calloc() Returns a new | |
| calloc | back to summary |
|---|---|
| public static VkAndroidHardwareBufferFormatPropertiesANDROID. Returns a new
| |
| calloc | back to summary |
|---|---|
| public static VkAndroidHardwareBufferFormatPropertiesANDROID calloc(MemoryStack stack) Returns a new
| |
| calloc | back to summary |
|---|---|
| public static VkAndroidHardwareBufferFormatPropertiesANDROID. Returns a new
| |
| create | back to summary |
|---|---|
| protected VkAndroidHardwareBufferFormatPropertiesANDROID create(long address, ByteBuffer container) Implements abstract org. Doc from org. Similar to Effectively, every
| |
| create | back to summary |
|---|---|
| public static VkAndroidHardwareBufferFormatPropertiesANDROID create() Returns a new | |
| create | back to summary |
|---|---|
| public static VkAndroidHardwareBufferFormatPropertiesANDROID create(long address) Returns a new | |
| create | back to summary |
|---|---|
| public static VkAndroidHardwareBufferFormatPropertiesANDROID. Returns a new
| |
| create | back to summary |
|---|---|
| public static VkAndroidHardwareBufferFormatPropertiesANDROID. Create a
| |
| createSafe | back to summary |
|---|---|
| public static VkAndroidHardwareBufferFormatPropertiesANDROID createSafe(long address) Like
| |
| createSafe | back to summary |
|---|---|
| public static VkAndroidHardwareBufferFormatPropertiesANDROID. Like
| |
| externalFormat | back to summary |
|---|---|
| public long externalFormat() an implementation-defined external format identifier for use with
| |
| format | back to summary |
|---|---|
| public int format() the Vulkan format corresponding to the Android hardware buffer’s format, or
| |
| formatFeatures | back to summary |
|---|---|
| public int formatFeatures() describes the capabilities of this external format when used with an image bound to memory imported from
| |
| malloc | back to summary |
|---|---|
| public static VkAndroidHardwareBufferFormatPropertiesANDROID malloc() Returns a new | |
| malloc | back to summary |
|---|---|
| public static VkAndroidHardwareBufferFormatPropertiesANDROID. Returns a new
| |
| malloc | back to summary |
|---|---|
| public static VkAndroidHardwareBufferFormatPropertiesANDROID malloc(MemoryStack stack) Returns a new
| |
| malloc | back to summary |
|---|---|
| public static VkAndroidHardwareBufferFormatPropertiesANDROID. Returns a new
| |
| nexternalFormat | back to summary |
|---|---|
| public static long nexternalFormat(long struct) Unsafe version of | |
| nformat | back to summary |
|---|---|
| public static int nformat(long struct) Unsafe version of | |
| nformatFeatures | back to summary |
|---|---|
| public static int nformatFeatures(long struct) Unsafe version of | |
| npNext | back to summary |
|---|---|
| public static long npNext(long struct) Unsafe version of | |
| npNext | back to summary |
|---|---|
| public static void npNext(long struct, long value) Unsafe version of | |
| nsamplerYcbcrConversionComponents | back to summary |
|---|---|
| public static VkComponentMapping nsamplerYcbcrConversionComponents(long struct) Unsafe version of | |
| nsType | back to summary |
|---|---|
| public static int nsType(long struct) Unsafe version of | |
| nsType | back to summary |
|---|---|
| public static void nsType(long struct, int value) Unsafe version of | |
| nsuggestedXChromaOffset | back to summary |
|---|---|
| public static int nsuggestedXChromaOffset(long struct) Unsafe version of | |
| nsuggestedYcbcrModel | back to summary |
|---|---|
| public static int nsuggestedYcbcrModel(long struct) Unsafe version of | |
| nsuggestedYcbcrRange | back to summary |
|---|---|
| public static int nsuggestedYcbcrRange(long struct) Unsafe version of | |
| nsuggestedYChromaOffset | back to summary |
|---|---|
| public static int nsuggestedYChromaOffset(long struct) Unsafe version of | |
| pNext | back to summary |
|---|---|
| public long pNext()
| |
| pNext | back to summary |
|---|---|
| public VkAndroidHardwareBufferFormatPropertiesANDROID pNext(long value) Sets the specified value to the | |
| samplerYcbcrConversionComponents | back to summary |
|---|---|
| public VkComponentMapping samplerYcbcrConversionComponents() the component swizzle that should be used in | |
| set | back to summary |
|---|---|
| public VkAndroidHardwareBufferFormatPropertiesANDROID set(int sType, long pNext) Initializes this struct with the specified values. | |
| set | back to summary |
|---|---|
| public VkAndroidHardwareBufferFormatPropertiesANDROID set(VkAndroidHardwareBufferFormatPropertiesANDROID src) Copies the specified struct data to this struct.
| |
| sizeof | back to summary |
|---|---|
| public int sizeof() Implements abstract org. Doc from org. Returns
| |
| sType | back to summary |
|---|---|
| public int sType() a
| |
| sType | back to summary |
|---|---|
| public VkAndroidHardwareBufferFormatPropertiesANDROID sType(int value) Sets the specified value to the | |
| sType$Default | back to summary |
|---|---|
| public VkAndroidHardwareBufferFormatPropertiesANDROID sType$Default() Sets the | |
| suggestedXChromaOffset | back to summary |
|---|---|
| public int suggestedXChromaOffset() a suggested X chroma offset to use in
| |
| suggestedYcbcrModel | back to summary |
|---|---|
| public int suggestedYcbcrModel() a suggested color model to use in the
| |
| suggestedYcbcrRange | back to summary |
|---|---|
| public int suggestedYcbcrRange() a suggested numerical value range to use in
| |
| suggestedYChromaOffset | back to summary |
|---|---|
| public int suggestedYChromaOffset() a suggested Y chroma offset to use in
| |
VkAndroidHardwareBufferFormatPropertiesANDROID structs.
| Modifier and Type | Field and Description |
|---|---|
| private static final VkAndroidHardwareBufferFormatPropertiesANDROID |
| Access | Constructor and Description |
|---|---|
| public | Buffer(ByteBuffer container)
Creates a new |
| public | |
| pack-priv |
| ELEMENT_FACTORY | back to summary |
|---|---|
| private static final VkAndroidHardwareBufferFormatPropertiesANDROID ELEMENT_FACTORY | |
| Buffer | back to summary |
|---|---|
| public Buffer(ByteBuffer container) Creates a new Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values
will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided
by The created buffer instance holds a strong reference to the container object. | |
| Buffer | back to summary |
|---|---|
| public Buffer(long address, int cap) | |
| Buffer | back to summary |
|---|---|
| pack-priv Buffer(long address, ByteBuffer container, int mark, int pos, int lim, int cap) | |
| externalFormat | back to summary |
|---|---|
public long externalFormat()
| |
| format | back to summary |
|---|---|
public int format()
| |
| formatFeatures | back to summary |
|---|---|
public int formatFeatures()
| |
| getElementFactory | back to summary |
|---|---|
| protected VkAndroidHardwareBufferFormatPropertiesANDROID getElementFactory() Implements abstract org.
| |
| pNext | back to summary |
|---|---|
public long pNext()
| |
| pNext | back to summary |
|---|---|
| public VkAndroidHardwareBufferFormatPropertiesANDROID. Sets the specified value to the | |
| samplerYcbcrConversionComponents | back to summary |
|---|---|
public VkComponentMapping samplerYcbcrConversionComponents()
| |
| self | back to summary |
|---|---|
| protected VkAndroidHardwareBufferFormatPropertiesANDROID. Implements abstract org.
| |
| sType | back to summary |
|---|---|
public int sType()
| |
| sType | back to summary |
|---|---|
| public VkAndroidHardwareBufferFormatPropertiesANDROID. Sets the specified value to the | |
| sType$Default | back to summary |
|---|---|
| public VkAndroidHardwareBufferFormatPropertiesANDROID. Sets the | |
| suggestedXChromaOffset | back to summary |
|---|---|
public int suggestedXChromaOffset()
| |
| suggestedYcbcrModel | back to summary |
|---|---|
public int suggestedYcbcrModel()
| |
| suggestedYcbcrRange | back to summary |
|---|---|
public int suggestedYcbcrRange()
| |
| suggestedYChromaOffset | back to summary |
|---|---|
public int suggestedYChromaOffset()
| |