semicongine/image

Types

BGRA = TVec4[uint8]
Gray = TVec1[uint8]
Image[T] = ImageObject[T, false]
ImageArray[T] = ImageObject[T, true]
ImageObject[T; IsArray] = object
  width*: uint32
  height*: uint32
  minInterpolation*: VkFilter = VK_FILTER_LINEAR
  magInterpolation*: VkFilter = VK_FILTER_LINEAR
  wrapU*: VkSamplerAddressMode = VK_SAMPLER_ADDRESS_MODE_REPEAT
  wrapV*: VkSamplerAddressMode = VK_SAMPLER_ADDRESS_MODE_REPEAT
  data*: seq[T]
  vk*: VkImage
  imageview*: VkImageView
  sampler*: VkSampler
  isRenderTarget*: bool = false
  samples*: VkSampleCountFlagBits = VK_SAMPLE_COUNT_1_BIT
  when IsArray:
    nLayers*: uint32

Procs

func `$`[S, IsArray](img: ImageObject[S, IsArray]): string
proc `[]`(image: Image; x, y: uint32): auto
proc `[]`(image: ImageArray; layer, x, y: uint32): auto
proc `[]=`[T](image: var Image[T]; x, y: uint32; value: T)
proc `[]=`[T](image: var ImageArray[T]; layer, x, y: uint32; value: T)
proc addImage[T: PixelType](imageArray: var ImageArray[T]; image: sink Image[T])
func copy[S, T](img: ImageObject[S, T]): ImageObject[S, T]
proc loadImageData[T: PixelType](pngData: string | seq[uint8]): tuple[
    width: uint32, height: uint32, data: seq[T]]

Templates

template nLayers(image: Image): untyped