Package org.lwjgl.vulkan
Class VkSamplerYcbcrConversionCreateInfo
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.vulkan.VkSamplerYcbcrConversionCreateInfo
-
- All Implemented Interfaces:
java.lang.AutoCloseable
,org.lwjgl.system.NativeResource
,org.lwjgl.system.Pointer
- Direct Known Subclasses:
VkSamplerYcbcrConversionCreateInfoKHR
public class VkSamplerYcbcrConversionCreateInfo extends org.lwjgl.system.Struct implements org.lwjgl.system.NativeResource
Structure specifying the parameters of the newly created conversion.Description
Note
Setting
forceExplicitReconstruction
toTRUE
may have a performance penalty on implementations where explicit reconstruction is not the default mode of operation.Sampler Y'CBCR conversion objects do not support external format conversion without additional extensions defining external formats.
Valid Usage
format
must not beFORMAT_UNDEFINED
format
must supportFORMAT_FEATURE_MIDPOINT_CHROMA_SAMPLES_BIT
orFORMAT_FEATURE_COSITED_CHROMA_SAMPLES_BIT
- If the format does not support
FORMAT_FEATURE_COSITED_CHROMA_SAMPLES_BIT
,xChromaOffset
andyChromaOffset
must not beCHROMA_LOCATION_COSITED_EVEN
- If the format does not support
FORMAT_FEATURE_MIDPOINT_CHROMA_SAMPLES_BIT
,xChromaOffset
andyChromaOffset
must not beCHROMA_LOCATION_MIDPOINT
format
must represent unsigned normalized values (i.e. the format must be aUNORM
format)- If the format has a
_422
or_420
suffix, thencomponents.g
must beCOMPONENT_SWIZZLE_IDENTITY
- If the format has a
_422
or_420
suffix, thencomponents.a
must beCOMPONENT_SWIZZLE_IDENTITY
,COMPONENT_SWIZZLE_ONE
, orCOMPONENT_SWIZZLE_ZERO
- If the format has a
_422
or_420
suffix, thencomponents.r
must beCOMPONENT_SWIZZLE_IDENTITY
orCOMPONENT_SWIZZLE_B
- If the format has a
_422
or_420
suffix, thencomponents.b
must beCOMPONENT_SWIZZLE_IDENTITY
orCOMPONENT_SWIZZLE_R
- If the format has a
_422
or_420
suffix, and if eithercomponents.r
orcomponents.b
isCOMPONENT_SWIZZLE_IDENTITY
, both values must beCOMPONENT_SWIZZLE_IDENTITY
- If
ycbcrModel
is notSAMPLER_YCBCR_MODEL_CONVERSION_RGB_IDENTITY
, thencomponents.r
,components.g
, andcomponents.b
must correspond to channels of theformat
; that is,components.r
,components.g
, andcomponents.b
must not beCOMPONENT_SWIZZLE_ZERO
orCOMPONENT_SWIZZLE_ONE
, and must not correspond to a channel which contains zero or one as a consequence of conversion to RGBA - If
ycbcrRange
isSAMPLER_YCBCR_RANGE_ITU_NARROW
then the R, G and B channels obtained by applying thecomponent
swizzle toformat
must each have a bit-depth greater than or equal to 8. - If the format does not support
FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_FORCEABLE_BIT
,forceExplicitReconstruction
must be FALSE - If the format does not support
FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_LINEAR_FILTER_BIT
,chromaFilter
must beFILTER_NEAREST
Valid Usage (Implicit)
sType
must beSTRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_CREATE_INFO
pNext
must beNULL
format
must be a validVkFormat
valueycbcrModel
must be a validVkSamplerYcbcrModelConversion
valueycbcrRange
must be a validVkSamplerYcbcrRange
valuecomponents
must be a validVkComponentMapping
structurexChromaOffset
must be a validVkChromaLocation
valueyChromaOffset
must be a validVkChromaLocation
valuechromaFilter
must be a validVkFilter
value
If
chromaFilter
isFILTER_NEAREST
, chroma samples are reconstructed to luma channel resolution using nearest-neighbour sampling. Otherwise, chroma samples are reconstructed using interpolation. More details can be found in the description of sampler Y'CBCR conversion in the Image Operations chapter.See Also
VkComponentMapping
,CreateSamplerYcbcrConversion
,CreateSamplerYcbcrConversionKHR
Member documentation
sType
– the type of this structure.pNext
–NULL
or a pointer to an extension-specific structure.format
– the format of the image from which color information will be retrieved.ycbcrModel
– describes the color matrix for conversion between color models.ycbcrRange
– describes whether the encoded values have headroom and foot room, or whether the encoding uses the full numerical range.components
– applies a swizzle based onVkComponentSwizzle
enums prior to range expansion and color model conversion.xChromaOffset
– describes the sample location associated with downsampled chroma channels in the x dimension.xChromaOffset
has no effect for formats in which chroma channels are the same resolution as the luma channel.yChromaOffset
– describes the sample location associated with downsampled chroma channels in the y dimension.yChromaOffset
has no effect for formats in which the chroma channels are not downsampled vertically.chromaFilter
– the filter for chroma reconstruction.forceExplicitReconstruction
– can be used to ensure that reconstruction is done explicitly, if supported.
Layout
struct VkSamplerYcbcrConversionCreateInfo { VkStructureType sType; void const * pNext; VkFormat format; VkSamplerYcbcrModelConversion ycbcrModel; VkSamplerYcbcrRange ycbcrRange;
VkComponentMapping
components; VkChromaLocation xChromaOffset; VkChromaLocation yChromaOffset; VkFilter chromaFilter; VkBool32 forceExplicitReconstruction; }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
VkSamplerYcbcrConversionCreateInfo.Buffer
An array ofVkSamplerYcbcrConversionCreateInfo
structs.
-
Field Summary
Fields Modifier and Type Field Description static int
ALIGNOF
The struct alignment in bytes.static int
CHROMAFILTER
COMPONENTS
FORCEEXPLICITRECONSTRUCTION
FORMAT
PNEXTThe struct member offsets.static int
SIZEOF
The struct size in bytes.static int
STYPE
XCHROMAOFFSET
YCBCRMODEL
YCBCRRANGE
YCHROMAOFFSETThe struct member offsets.
-
Constructor Summary
Constructors Constructor Description VkSamplerYcbcrConversionCreateInfo(java.nio.ByteBuffer container)
Creates aVkSamplerYcbcrConversionCreateInfo
instance at the current position of the specifiedByteBuffer
container.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static VkSamplerYcbcrConversionCreateInfo
calloc()
Returns a newVkSamplerYcbcrConversionCreateInfo
instance allocated withmemCalloc
.static VkSamplerYcbcrConversionCreateInfo.Buffer
calloc(int capacity)
Returns a newVkSamplerYcbcrConversionCreateInfo.Buffer
instance allocated withmemCalloc
.static VkSamplerYcbcrConversionCreateInfo
callocStack()
Returns a newVkSamplerYcbcrConversionCreateInfo
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static VkSamplerYcbcrConversionCreateInfo.Buffer
callocStack(int capacity)
Returns a newVkSamplerYcbcrConversionCreateInfo.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static VkSamplerYcbcrConversionCreateInfo.Buffer
callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newVkSamplerYcbcrConversionCreateInfo.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static VkSamplerYcbcrConversionCreateInfo
callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVkSamplerYcbcrConversionCreateInfo
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.int
chromaFilter()
Returns the value of thechromaFilter
field.VkSamplerYcbcrConversionCreateInfo
chromaFilter(int value)
Sets the specified value to thechromaFilter
field.VkComponentMapping
components()
Returns aVkComponentMapping
view of thecomponents
field.VkSamplerYcbcrConversionCreateInfo
components(java.util.function.Consumer<VkComponentMapping> consumer)
Passes thecomponents
field to the specifiedConsumer
.VkSamplerYcbcrConversionCreateInfo
components(VkComponentMapping value)
Copies the specifiedVkComponentMapping
to thecomponents
field.static VkSamplerYcbcrConversionCreateInfo
create()
Returns a newVkSamplerYcbcrConversionCreateInfo
instance allocated withBufferUtils
.static VkSamplerYcbcrConversionCreateInfo.Buffer
create(int capacity)
Returns a newVkSamplerYcbcrConversionCreateInfo.Buffer
instance allocated withBufferUtils
.static VkSamplerYcbcrConversionCreateInfo
create(long address)
Returns a newVkSamplerYcbcrConversionCreateInfo
instance for the specified memory address.static VkSamplerYcbcrConversionCreateInfo.Buffer
create(long address, int capacity)
Create aVkSamplerYcbcrConversionCreateInfo.Buffer
instance at the specified memory.static VkSamplerYcbcrConversionCreateInfo
createSafe(long address)
static VkSamplerYcbcrConversionCreateInfo.Buffer
createSafe(long address, int capacity)
boolean
forceExplicitReconstruction()
Returns the value of theforceExplicitReconstruction
field.VkSamplerYcbcrConversionCreateInfo
forceExplicitReconstruction(boolean value)
Sets the specified value to theforceExplicitReconstruction
field.int
format()
Returns the value of theformat
field.VkSamplerYcbcrConversionCreateInfo
format(int value)
Sets the specified value to theformat
field.static VkSamplerYcbcrConversionCreateInfo
malloc()
Returns a newVkSamplerYcbcrConversionCreateInfo
instance allocated withmemAlloc
.static VkSamplerYcbcrConversionCreateInfo.Buffer
malloc(int capacity)
Returns a newVkSamplerYcbcrConversionCreateInfo.Buffer
instance allocated withmemAlloc
.static VkSamplerYcbcrConversionCreateInfo
mallocStack()
Returns a newVkSamplerYcbcrConversionCreateInfo
instance allocated on the thread-localMemoryStack
.static VkSamplerYcbcrConversionCreateInfo.Buffer
mallocStack(int capacity)
Returns a newVkSamplerYcbcrConversionCreateInfo.Buffer
instance allocated on the thread-localMemoryStack
.static VkSamplerYcbcrConversionCreateInfo.Buffer
mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newVkSamplerYcbcrConversionCreateInfo.Buffer
instance allocated on the specifiedMemoryStack
.static VkSamplerYcbcrConversionCreateInfo
mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVkSamplerYcbcrConversionCreateInfo
instance allocated on the specifiedMemoryStack
.static int
nchromaFilter(long struct)
Unsafe version ofchromaFilter()
.static void
nchromaFilter(long struct, int value)
Unsafe version ofchromaFilter
.static VkComponentMapping
ncomponents(long struct)
Unsafe version ofcomponents()
.static void
ncomponents(long struct, VkComponentMapping value)
Unsafe version ofcomponents
.static int
nforceExplicitReconstruction(long struct)
Unsafe version offorceExplicitReconstruction()
.static void
nforceExplicitReconstruction(long struct, int value)
Unsafe version offorceExplicitReconstruction
.static int
nformat(long struct)
Unsafe version offormat()
.static void
nformat(long struct, int value)
Unsafe version offormat
.static long
npNext(long struct)
Unsafe version ofpNext()
.static void
npNext(long struct, long value)
Unsafe version ofpNext
.static int
nsType(long struct)
Unsafe version ofsType()
.static void
nsType(long struct, int value)
Unsafe version ofsType
.static int
nxChromaOffset(long struct)
Unsafe version ofxChromaOffset()
.static void
nxChromaOffset(long struct, int value)
Unsafe version ofxChromaOffset
.static int
nycbcrModel(long struct)
Unsafe version ofycbcrModel()
.static void
nycbcrModel(long struct, int value)
Unsafe version ofycbcrModel
.static int
nycbcrRange(long struct)
Unsafe version ofycbcrRange()
.static void
nycbcrRange(long struct, int value)
Unsafe version ofycbcrRange
.static int
nyChromaOffset(long struct)
Unsafe version ofyChromaOffset()
.static void
nyChromaOffset(long struct, int value)
Unsafe version ofyChromaOffset
.long
pNext()
Returns the value of thepNext
field.VkSamplerYcbcrConversionCreateInfo
pNext(long value)
Sets the specified value to thepNext
field.VkSamplerYcbcrConversionCreateInfo
set(int sType, long pNext, int format, int ycbcrModel, int ycbcrRange, VkComponentMapping components, int xChromaOffset, int yChromaOffset, int chromaFilter, boolean forceExplicitReconstruction)
Initializes this struct with the specified values.VkSamplerYcbcrConversionCreateInfo
set(VkSamplerYcbcrConversionCreateInfo src)
Copies the specified struct data to this struct.int
sizeof()
int
sType()
Returns the value of thesType
field.VkSamplerYcbcrConversionCreateInfo
sType(int value)
Sets the specified value to thesType
field.int
xChromaOffset()
Returns the value of thexChromaOffset
field.VkSamplerYcbcrConversionCreateInfo
xChromaOffset(int value)
Sets the specified value to thexChromaOffset
field.int
ycbcrModel()
Returns the value of theycbcrModel
field.VkSamplerYcbcrConversionCreateInfo
ycbcrModel(int value)
Sets the specified value to theycbcrModel
field.int
ycbcrRange()
Returns the value of theycbcrRange
field.VkSamplerYcbcrConversionCreateInfo
ycbcrRange(int value)
Sets the specified value to theycbcrRange
field.int
yChromaOffset()
Returns the value of theyChromaOffset
field.VkSamplerYcbcrConversionCreateInfo
yChromaOffset(int value)
Sets the specified value to theyChromaOffset
field.
-
-
-
Constructor Detail
-
VkSamplerYcbcrConversionCreateInfo
public VkSamplerYcbcrConversionCreateInfo(java.nio.ByteBuffer container)
Creates aVkSamplerYcbcrConversionCreateInfo
instance at the current position of the specifiedByteBuffer
container. Changes to the buffer's content will be visible to the struct instance and vice versa.The created instance holds a strong reference to the container object.
-
-
Method Detail
-
sizeof
public int sizeof()
- Specified by:
sizeof
in classorg.lwjgl.system.Struct
-
sType
public int sType()
Returns the value of thesType
field.
-
pNext
public long pNext()
Returns the value of thepNext
field.
-
format
public int format()
Returns the value of theformat
field.
-
ycbcrModel
public int ycbcrModel()
Returns the value of theycbcrModel
field.
-
ycbcrRange
public int ycbcrRange()
Returns the value of theycbcrRange
field.
-
components
public VkComponentMapping components()
Returns aVkComponentMapping
view of thecomponents
field.
-
xChromaOffset
public int xChromaOffset()
Returns the value of thexChromaOffset
field.
-
yChromaOffset
public int yChromaOffset()
Returns the value of theyChromaOffset
field.
-
chromaFilter
public int chromaFilter()
Returns the value of thechromaFilter
field.
-
forceExplicitReconstruction
public boolean forceExplicitReconstruction()
Returns the value of theforceExplicitReconstruction
field.
-
sType
public VkSamplerYcbcrConversionCreateInfo sType(int value)
Sets the specified value to thesType
field.
-
pNext
public VkSamplerYcbcrConversionCreateInfo pNext(long value)
Sets the specified value to thepNext
field.
-
format
public VkSamplerYcbcrConversionCreateInfo format(int value)
Sets the specified value to theformat
field.
-
ycbcrModel
public VkSamplerYcbcrConversionCreateInfo ycbcrModel(int value)
Sets the specified value to theycbcrModel
field.
-
ycbcrRange
public VkSamplerYcbcrConversionCreateInfo ycbcrRange(int value)
Sets the specified value to theycbcrRange
field.
-
components
public VkSamplerYcbcrConversionCreateInfo components(VkComponentMapping value)
Copies the specifiedVkComponentMapping
to thecomponents
field.
-
components
public VkSamplerYcbcrConversionCreateInfo components(java.util.function.Consumer<VkComponentMapping> consumer)
Passes thecomponents
field to the specifiedConsumer
.
-
xChromaOffset
public VkSamplerYcbcrConversionCreateInfo xChromaOffset(int value)
Sets the specified value to thexChromaOffset
field.
-
yChromaOffset
public VkSamplerYcbcrConversionCreateInfo yChromaOffset(int value)
Sets the specified value to theyChromaOffset
field.
-
chromaFilter
public VkSamplerYcbcrConversionCreateInfo chromaFilter(int value)
Sets the specified value to thechromaFilter
field.
-
forceExplicitReconstruction
public VkSamplerYcbcrConversionCreateInfo forceExplicitReconstruction(boolean value)
Sets the specified value to theforceExplicitReconstruction
field.
-
set
public VkSamplerYcbcrConversionCreateInfo set(int sType, long pNext, int format, int ycbcrModel, int ycbcrRange, VkComponentMapping components, int xChromaOffset, int yChromaOffset, int chromaFilter, boolean forceExplicitReconstruction)
Initializes this struct with the specified values.
-
set
public VkSamplerYcbcrConversionCreateInfo set(VkSamplerYcbcrConversionCreateInfo src)
Copies the specified struct data to this struct.- Parameters:
src
- the source struct- Returns:
- this struct
-
malloc
public static VkSamplerYcbcrConversionCreateInfo malloc()
Returns a newVkSamplerYcbcrConversionCreateInfo
instance allocated withmemAlloc
. The instance must be explicitly freed.
-
calloc
public static VkSamplerYcbcrConversionCreateInfo calloc()
Returns a newVkSamplerYcbcrConversionCreateInfo
instance allocated withmemCalloc
. The instance must be explicitly freed.
-
create
public static VkSamplerYcbcrConversionCreateInfo create()
Returns a newVkSamplerYcbcrConversionCreateInfo
instance allocated withBufferUtils
.
-
create
public static VkSamplerYcbcrConversionCreateInfo create(long address)
Returns a newVkSamplerYcbcrConversionCreateInfo
instance for the specified memory address.
-
createSafe
@Nullable public static VkSamplerYcbcrConversionCreateInfo createSafe(long address)
-
malloc
public static VkSamplerYcbcrConversionCreateInfo.Buffer malloc(int capacity)
Returns a newVkSamplerYcbcrConversionCreateInfo.Buffer
instance allocated withmemAlloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
calloc
public static VkSamplerYcbcrConversionCreateInfo.Buffer calloc(int capacity)
Returns a newVkSamplerYcbcrConversionCreateInfo.Buffer
instance allocated withmemCalloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
create
public static VkSamplerYcbcrConversionCreateInfo.Buffer create(int capacity)
Returns a newVkSamplerYcbcrConversionCreateInfo.Buffer
instance allocated withBufferUtils
.- Parameters:
capacity
- the buffer capacity
-
create
public static VkSamplerYcbcrConversionCreateInfo.Buffer create(long address, int capacity)
Create aVkSamplerYcbcrConversionCreateInfo.Buffer
instance at the specified memory.- Parameters:
address
- the memory addresscapacity
- the buffer capacity
-
createSafe
@Nullable public static VkSamplerYcbcrConversionCreateInfo.Buffer createSafe(long address, int capacity)
-
mallocStack
public static VkSamplerYcbcrConversionCreateInfo mallocStack()
Returns a newVkSamplerYcbcrConversionCreateInfo
instance allocated on the thread-localMemoryStack
.
-
callocStack
public static VkSamplerYcbcrConversionCreateInfo callocStack()
Returns a newVkSamplerYcbcrConversionCreateInfo
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.
-
mallocStack
public static VkSamplerYcbcrConversionCreateInfo mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVkSamplerYcbcrConversionCreateInfo
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocate
-
callocStack
public static VkSamplerYcbcrConversionCreateInfo callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVkSamplerYcbcrConversionCreateInfo
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocate
-
mallocStack
public static VkSamplerYcbcrConversionCreateInfo.Buffer mallocStack(int capacity)
Returns a newVkSamplerYcbcrConversionCreateInfo.Buffer
instance allocated on the thread-localMemoryStack
.- Parameters:
capacity
- the buffer capacity
-
callocStack
public static VkSamplerYcbcrConversionCreateInfo.Buffer callocStack(int capacity)
Returns a newVkSamplerYcbcrConversionCreateInfo.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.- Parameters:
capacity
- the buffer capacity
-
mallocStack
public static VkSamplerYcbcrConversionCreateInfo.Buffer mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newVkSamplerYcbcrConversionCreateInfo.Buffer
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocatecapacity
- the buffer capacity
-
callocStack
public static VkSamplerYcbcrConversionCreateInfo.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newVkSamplerYcbcrConversionCreateInfo.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocatecapacity
- the buffer capacity
-
nsType
public static int nsType(long struct)
Unsafe version ofsType()
.
-
npNext
public static long npNext(long struct)
Unsafe version ofpNext()
.
-
nformat
public static int nformat(long struct)
Unsafe version offormat()
.
-
nycbcrModel
public static int nycbcrModel(long struct)
Unsafe version ofycbcrModel()
.
-
nycbcrRange
public static int nycbcrRange(long struct)
Unsafe version ofycbcrRange()
.
-
ncomponents
public static VkComponentMapping ncomponents(long struct)
Unsafe version ofcomponents()
.
-
nxChromaOffset
public static int nxChromaOffset(long struct)
Unsafe version ofxChromaOffset()
.
-
nyChromaOffset
public static int nyChromaOffset(long struct)
Unsafe version ofyChromaOffset()
.
-
nchromaFilter
public static int nchromaFilter(long struct)
Unsafe version ofchromaFilter()
.
-
nforceExplicitReconstruction
public static int nforceExplicitReconstruction(long struct)
Unsafe version offorceExplicitReconstruction()
.
-
nsType
public static void nsType(long struct, int value)
Unsafe version ofsType
.
-
npNext
public static void npNext(long struct, long value)
Unsafe version ofpNext
.
-
nformat
public static void nformat(long struct, int value)
Unsafe version offormat
.
-
nycbcrModel
public static void nycbcrModel(long struct, int value)
Unsafe version ofycbcrModel
.
-
nycbcrRange
public static void nycbcrRange(long struct, int value)
Unsafe version ofycbcrRange
.
-
ncomponents
public static void ncomponents(long struct, VkComponentMapping value)
Unsafe version ofcomponents
.
-
nxChromaOffset
public static void nxChromaOffset(long struct, int value)
Unsafe version ofxChromaOffset
.
-
nyChromaOffset
public static void nyChromaOffset(long struct, int value)
Unsafe version ofyChromaOffset
.
-
nchromaFilter
public static void nchromaFilter(long struct, int value)
Unsafe version ofchromaFilter
.
-
nforceExplicitReconstruction
public static void nforceExplicitReconstruction(long struct, int value)
Unsafe version offorceExplicitReconstruction
.
-
-