Class: Vulkan::ImageView
- Inherits:
-
Object
- Object
- Vulkan::ImageView
- Includes:
- Checks, Conversions, Finalizer
- Defined in:
- lib/vulkan/image_view.rb
Constant Summary
Constants included from Conversions
Conversions::ACCESS_MASK_BITS, Conversions::BORDER_COLORS, Conversions::BUFFER_USAGE_BITS, Conversions::COMPARE_OPS, Conversions::DEPENDENCY_FLAG_BITS, Conversions::DESCRIPTOR_TYPES, Conversions::DYNAMIC_STATES, Conversions::FILTERS, Conversions::FORMAT_FEATURE_BITS, Conversions::IMAGE_ASPECT_BITS, Conversions::IMAGE_CREATE_BITS, Conversions::IMAGE_FORMATS, Conversions::IMAGE_TILING, Conversions::IMAGE_TYPES, Conversions::IMAGE_USAGE_BITS, Conversions::MEMORY_PROPERTIES, Conversions::PIPELINE_STAGE_BITS, Conversions::PRESENT_MODES, Conversions::SAMPLER_ADDRESS_MODES, Conversions::SAMPLER_MIPMAP_MODES, Conversions::SHADER_STAGE_BITS, Conversions::SHARING_MODES, Conversions::SURFACE_TRANSFORMS, Conversions::VERTEX_INPUT_RATES
Instance Attribute Summary collapse
-
#image ⇒ Object
readonly
Returns the value of attribute image.
Instance Method Summary collapse
-
#initialize(vk, image, image_format, view_type: VK_IMAGE_VIEW_TYPE_2D, red_swizzle: VK_COMPONENT_SWIZZLE_IDENTITY, green_swizzle: VK_COMPONENT_SWIZZLE_IDENTITY, blue_swizzle: VK_COMPONENT_SWIZZLE_IDENTITY, alpha_swizzle: VK_COMPONENT_SWIZZLE_IDENTITY, aspects: :color, base_mip_level: 0, level_count: 1, base_array_layer: 0, layer_count: 1) ⇒ ImageView
constructor
A new instance of ImageView.
- #to_ptr ⇒ Object
Methods included from Finalizer
#finalize_with, #hexaddr, included
Methods included from Conversions
#array_of_pointers, #array_of_structures, #array_of_uint32s, #bool_to_vk, #buffer_usage_flags_to_syms, #const_to_symbol, #cstr_to_rbstr, #flags_to_symbols, #flags_to_syms, #num_to_samples, #present_mode_to_sym, #queue_family_to_index, #struct_to_hash, #sym_to_blend_factor, #sym_to_blend_op, #sym_to_border_color, #sym_to_color_component_bit, #sym_to_command_buffer_level, #sym_to_command_buffer_usage, #sym_to_compare_op, #sym_to_cull_mode, #sym_to_descriptor_type, #sym_to_dynamic_state, #sym_to_filter, #sym_to_front_face, #sym_to_image_format, #sym_to_image_layout, #sym_to_image_tiling, #sym_to_image_type, #sym_to_index_type, #sym_to_load_op, #sym_to_pipeline_bind_point, #sym_to_polygon_mode, #sym_to_present_mode, #sym_to_sampler_address_mode, #sym_to_sampler_mipmap_mode, #sym_to_samples, #sym_to_sharing_mode, #sym_to_store_op, #sym_to_subpass_contents, #sym_to_topology, #sym_to_val, #sym_to_vertex_input_rate, #syms_to_access_mask, #syms_to_buffer_usage_flags, #syms_to_dependency_flags, #syms_to_descriptor_set_layout_type_flags, #syms_to_flags, #syms_to_format_feature_flags, #syms_to_image_aspect_flags, #syms_to_image_create_flags, #syms_to_image_usage_flags, #syms_to_memory_properties, #syms_to_pipeline_stage_flags, #syms_to_shader_stage_flags, #syms_to_surface_transforms, #vk_make_version, #vk_parse_version
Methods included from Checks
Constructor Details
#initialize(vk, image, image_format, view_type: VK_IMAGE_VIEW_TYPE_2D, red_swizzle: VK_COMPONENT_SWIZZLE_IDENTITY, green_swizzle: VK_COMPONENT_SWIZZLE_IDENTITY, blue_swizzle: VK_COMPONENT_SWIZZLE_IDENTITY, alpha_swizzle: VK_COMPONENT_SWIZZLE_IDENTITY, aspects: :color, base_mip_level: 0, level_count: 1, base_array_layer: 0, layer_count: 1) ⇒ ImageView
Returns a new instance of ImageView.
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/vulkan/image_view.rb', line 9 def initialize(vk, image, image_format, view_type: VK_IMAGE_VIEW_TYPE_2D, red_swizzle: VK_COMPONENT_SWIZZLE_IDENTITY, green_swizzle: VK_COMPONENT_SWIZZLE_IDENTITY, blue_swizzle: VK_COMPONENT_SWIZZLE_IDENTITY, alpha_swizzle: VK_COMPONENT_SWIZZLE_IDENTITY, aspects: :color, base_mip_level: 0, level_count: 1, base_array_layer: 0, layer_count: 1) @vk = vk @image = image create_info = VkImageViewCreateInfo.malloc create_info.sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO create_info.image = image.respond_to?(:to_ptr) ? image.to_ptr : image create_info.viewType = view_type create_info.format = sym_to_image_format(image_format) create_info.components.r = red_swizzle create_info.components.g = green_swizzle create_info.components.b = blue_swizzle create_info.components.a = alpha_swizzle create_info.subresourceRange.aspectMask = syms_to_image_aspect_flags(aspects) create_info.subresourceRange.baseMipLevel = base_mip_level create_info.subresourceRange.levelCount = level_count create_info.subresourceRange.baseArrayLayer = base_array_layer create_info.subresourceRange.layerCount = layer_count view_p = Vulkan.create_value("void *", nil) check_result @vk.vkCreateImageView(vk.device, create_info, nil, view_p) @handle = view_p.value finalize_with @vk, :vkDestroyImageView, vk.device, @handle, nil end |
Instance Attribute Details
#image ⇒ Object (readonly)
Returns the value of attribute image.
7 8 9 |
# File 'lib/vulkan/image_view.rb', line 7 def image @image end |
Instance Method Details
#to_ptr ⇒ Object
42 43 44 |
# File 'lib/vulkan/image_view.rb', line 42 def to_ptr @handle end |