d2d

package
v0.0.0-...-1af1188 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 31, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Rendered for windows/amd64

Index

Constants

View Source
const (
	D2DERR_RECREATE_TARGET = direct.HResult(0x8899000C)
)

Variables

View Source
var IIDFactory = &syscall.GUID{0x06152247, 0x6f50, 0x465a, [8]byte{0x92, 0x45, 0x11, 0x8b, 0xfd, 0x3b, 0x60, 0x07}}

Functions

This section is empty.

Types

type AlphaMode

type AlphaMode uint32
const (
	D2D1_ALPHA_MODE_UNKNOWN       AlphaMode = 0
	D2D1_ALPHA_MODE_PREMULTIPLIED AlphaMode = 1
	D2D1_ALPHA_MODE_STRAIGHT      AlphaMode = 2
	D2D1_ALPHA_MODE_IGNORE        AlphaMode = 3
)

type BrushProperties

type BrushProperties struct {
	Opacity   float32
	Transform Matrix3x2F
}

type ColorF

type ColorF struct{ R, G, B, A float32 }

type DebugLevel

type DebugLevel uint32
const (
	D2D1_DEBUG_LEVEL_NONE        DebugLevel = 0
	D2D1_DEBUG_LEVEL_ERROR       DebugLevel = 1
	D2D1_DEBUG_LEVEL_WARNING     DebugLevel = 2
	D2D1_DEBUG_LEVEL_INFORMATION DebugLevel = 3
)

type DrawTextOptions

type DrawTextOptions uint32
const (
	D2D1_DRAW_TEXT_OPTIONS_NO_SNAP                       DrawTextOptions = 0
	D2D1_DRAW_TEXT_OPTIONS_CLIP                          DrawTextOptions = 1
	D2D1_DRAW_TEXT_OPTIONS_ENABLE_COLOR_FONT             DrawTextOptions = 2
	D2D1_DRAW_TEXT_OPTIONS_DISABLE_COLOR_BITMAP_SNAPPING DrawTextOptions = 3
	D2D1_DRAW_TEXT_OPTIONS_NONE                          DrawTextOptions = 4
)

type DxgiFormat

type DxgiFormat uint32
const (
	DXGI_FORMAT_UNKNOWN                    DxgiFormat = 0
	DXGI_FORMAT_R32G32B32A32_TYPELESS      DxgiFormat = 1
	DXGI_FORMAT_R32G32B32A32_FLOAT         DxgiFormat = 2
	DXGI_FORMAT_R32G32B32A32_UINT          DxgiFormat = 3
	DXGI_FORMAT_R32G32B32A32_SINT          DxgiFormat = 4
	DXGI_FORMAT_R32G32B32_TYPELESS         DxgiFormat = 5
	DXGI_FORMAT_R32G32B32_FLOAT            DxgiFormat = 6
	DXGI_FORMAT_R32G32B32_UINT             DxgiFormat = 7
	DXGI_FORMAT_R32G32B32_SINT             DxgiFormat = 8
	DXGI_FORMAT_R16G16B16A16_TYPELESS      DxgiFormat = 9
	DXGI_FORMAT_R16G16B16A16_FLOAT         DxgiFormat = 10
	DXGI_FORMAT_R16G16B16A16_UNORM         DxgiFormat = 11
	DXGI_FORMAT_R16G16B16A16_UINT          DxgiFormat = 12
	DXGI_FORMAT_R16G16B16A16_SNORM         DxgiFormat = 13
	DXGI_FORMAT_R16G16B16A16_SINT          DxgiFormat = 14
	DXGI_FORMAT_R32G32_TYPELESS            DxgiFormat = 15
	DXGI_FORMAT_R32G32_FLOAT               DxgiFormat = 16
	DXGI_FORMAT_R32G32_UINT                DxgiFormat = 17
	DXGI_FORMAT_R32G32_SINT                DxgiFormat = 18
	DXGI_FORMAT_R32G8X24_TYPELESS          DxgiFormat = 19
	DXGI_FORMAT_D32_FLOAT_S8X24_UINT       DxgiFormat = 20
	DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS   DxgiFormat = 21
	DXGI_FORMAT_X32_TYPELESS_G8X24_UINT    DxgiFormat = 22
	DXGI_FORMAT_R10G10B10A2_TYPELESS       DxgiFormat = 23
	DXGI_FORMAT_R10G10B10A2_UNORM          DxgiFormat = 24
	DXGI_FORMAT_R10G10B10A2_UINT           DxgiFormat = 25
	DXGI_FORMAT_R11G11B10_FLOAT            DxgiFormat = 26
	DXGI_FORMAT_R8G8B8A8_TYPELESS          DxgiFormat = 27
	DXGI_FORMAT_R8G8B8A8_UNORM             DxgiFormat = 28
	DXGI_FORMAT_R8G8B8A8_UNORM_SRGB        DxgiFormat = 29
	DXGI_FORMAT_R8G8B8A8_UINT              DxgiFormat = 30
	DXGI_FORMAT_R8G8B8A8_SNORM             DxgiFormat = 31
	DXGI_FORMAT_R8G8B8A8_SINT              DxgiFormat = 32
	DXGI_FORMAT_R16G16_TYPELESS            DxgiFormat = 33
	DXGI_FORMAT_R16G16_FLOAT               DxgiFormat = 34
	DXGI_FORMAT_R16G16_UNORM               DxgiFormat = 35
	DXGI_FORMAT_R16G16_UINT                DxgiFormat = 36
	DXGI_FORMAT_R16G16_SNORM               DxgiFormat = 37
	DXGI_FORMAT_R16G16_SINT                DxgiFormat = 38
	DXGI_FORMAT_R32_TYPELESS               DxgiFormat = 39
	DXGI_FORMAT_D32_FLOAT                  DxgiFormat = 40
	DXGI_FORMAT_R32_FLOAT                  DxgiFormat = 41
	DXGI_FORMAT_R32_UINT                   DxgiFormat = 42
	DXGI_FORMAT_R32_SINT                   DxgiFormat = 43
	DXGI_FORMAT_R24G8_TYPELESS             DxgiFormat = 44
	DXGI_FORMAT_D24_UNORM_S8_UINT          DxgiFormat = 45
	DXGI_FORMAT_R24_UNORM_X8_TYPELESS      DxgiFormat = 46
	DXGI_FORMAT_X24_TYPELESS_G8_UINT       DxgiFormat = 47
	DXGI_FORMAT_R8G8_TYPELESS              DxgiFormat = 48
	DXGI_FORMAT_R8G8_UNORM                 DxgiFormat = 49
	DXGI_FORMAT_R8G8_UINT                  DxgiFormat = 50
	DXGI_FORMAT_R8G8_SNORM                 DxgiFormat = 51
	DXGI_FORMAT_R8G8_SINT                  DxgiFormat = 52
	DXGI_FORMAT_R16_TYPELESS               DxgiFormat = 53
	DXGI_FORMAT_R16_FLOAT                  DxgiFormat = 54
	DXGI_FORMAT_D16_UNORM                  DxgiFormat = 55
	DXGI_FORMAT_R16_UNORM                  DxgiFormat = 56
	DXGI_FORMAT_R16_UINT                   DxgiFormat = 57
	DXGI_FORMAT_R16_SNORM                  DxgiFormat = 58
	DXGI_FORMAT_R16_SINT                   DxgiFormat = 59
	DXGI_FORMAT_R8_TYPELESS                DxgiFormat = 60
	DXGI_FORMAT_R8_UNORM                   DxgiFormat = 61
	DXGI_FORMAT_R8_UINT                    DxgiFormat = 62
	DXGI_FORMAT_R8_SNORM                   DxgiFormat = 63
	DXGI_FORMAT_R8_SINT                    DxgiFormat = 64
	DXGI_FORMAT_A8_UNORM                   DxgiFormat = 65
	DXGI_FORMAT_R1_UNORM                   DxgiFormat = 66
	DXGI_FORMAT_R9G9B9E5_SHAREDEXP         DxgiFormat = 67
	DXGI_FORMAT_R8G8_B8G8_UNORM            DxgiFormat = 68
	DXGI_FORMAT_G8R8_G8B8_UNORM            DxgiFormat = 69
	DXGI_FORMAT_BC1_TYPELESS               DxgiFormat = 70
	DXGI_FORMAT_BC1_UNORM                  DxgiFormat = 71
	DXGI_FORMAT_BC1_UNORM_SRGB             DxgiFormat = 72
	DXGI_FORMAT_BC2_TYPELESS               DxgiFormat = 73
	DXGI_FORMAT_BC2_UNORM                  DxgiFormat = 74
	DXGI_FORMAT_BC2_UNORM_SRGB             DxgiFormat = 75
	DXGI_FORMAT_BC3_TYPELESS               DxgiFormat = 76
	DXGI_FORMAT_BC3_UNORM                  DxgiFormat = 77
	DXGI_FORMAT_BC3_UNORM_SRGB             DxgiFormat = 78
	DXGI_FORMAT_BC4_TYPELESS               DxgiFormat = 79
	DXGI_FORMAT_BC4_UNORM                  DxgiFormat = 80
	DXGI_FORMAT_BC4_SNORM                  DxgiFormat = 81
	DXGI_FORMAT_BC5_TYPELESS               DxgiFormat = 82
	DXGI_FORMAT_BC5_UNORM                  DxgiFormat = 83
	DXGI_FORMAT_BC5_SNORM                  DxgiFormat = 84
	DXGI_FORMAT_B5G6R5_UNORM               DxgiFormat = 85
	DXGI_FORMAT_B5G5R5A1_UNORM             DxgiFormat = 86
	DXGI_FORMAT_B8G8R8A8_UNORM             DxgiFormat = 87
	DXGI_FORMAT_B8G8R8X8_UNORM             DxgiFormat = 88
	DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM DxgiFormat = 89
	DXGI_FORMAT_B8G8R8A8_TYPELESS          DxgiFormat = 90
	DXGI_FORMAT_B8G8R8A8_UNORM_SRGB        DxgiFormat = 91
	DXGI_FORMAT_B8G8R8X8_TYPELESS          DxgiFormat = 92
	DXGI_FORMAT_B8G8R8X8_UNORM_SRGB        DxgiFormat = 93
	DXGI_FORMAT_BC6H_TYPELESS              DxgiFormat = 94
	DXGI_FORMAT_BC6H_UF16                  DxgiFormat = 95
	DXGI_FORMAT_BC6H_SF16                  DxgiFormat = 96
	DXGI_FORMAT_BC7_TYPELESS               DxgiFormat = 97
	DXGI_FORMAT_BC7_UNORM                  DxgiFormat = 98
	DXGI_FORMAT_BC7_UNORM_SRGB             DxgiFormat = 99
	DXGI_FORMAT_FORCE_UINT                 DxgiFormat = 0xffffffff
)

type Ellipse

type Ellipse struct {
	Point2F
	RadiusX, RadiusY float32
}

type ExtendMode

type ExtendMode uint32
const (
	D2D1_EXTEND_MODE_CLAMP  ExtendMode = 0
	D2D1_EXTEND_MODE_WRAP   ExtendMode = 1
	D2D1_EXTEND_MODE_MIRROR ExtendMode = 2
)

type FactoryOptions

type FactoryOptions struct {
	DebugLevel DebugLevel
}

type FactoryType

type FactoryType uint32
const (
	D2D1_FACTORY_TYPE_SINGLE_THREADED FactoryType = 0
	D2D1_FACTORY_TYPE_MULTI_THREADED  FactoryType = 1
)

type FeatureLevel

type FeatureLevel uint32
const (
	D2D1_FEATURE_LEVEL_DEFAULT FeatureLevel = 0
	D2D1_FEATURE_LEVEL_9       FeatureLevel = 0x9100 /* D3D10_FEATURE_LEVEL_9_1 */
	D2D1_FEATURE_LEVEL_10      FeatureLevel = 0xa000 /* D3D10_FEATURE_LEVEL_10_0 */
)

type Gamma

type Gamma uint32
const (
	D2D1_GAMMA_2_2 Gamma = 0
	D2D1_GAMMA_1_0 Gamma = 1
)

type GradientStop

type GradientStop struct {
	Position float32
	ColorF
}

type HwndRenderTargetProperties

type HwndRenderTargetProperties struct {
	Hwnd           uintptr
	PixelSize      SizeU
	PresentOptions PresentOptions
}

type IBrush

type IBrush struct{ IResource }

type IFactory

type IFactory struct{ direct.IUnknown }

func CreateFactory

func CreateFactory(factoryType FactoryType, options *FactoryOptions) (*IFactory, error)

func (*IFactory) CreateHwndRenderTarget

func (inf *IFactory) CreateHwndRenderTarget(renderTargetProperties *RenderTargetProperties, hwndRenderTargetProperties *HwndRenderTargetProperties) (*IHwndRenderTarget, error)

type IGradientStopCollection

type IGradientStopCollection struct{ IResource }

type IHwndRenderTarget

type IHwndRenderTarget struct{ IRenderTarget }

func (*IHwndRenderTarget) Resize

func (inf *IHwndRenderTarget) Resize(pixelSize *SizeU) error

type ILinearGradientBrush

type ILinearGradientBrush struct{ IBrush }

type IRenderTarget

type IRenderTarget struct{ IResource }

func (*IRenderTarget) CreateGradientStopCollection

func (inf *IRenderTarget) CreateGradientStopCollection(stop []GradientStop, gamma Gamma, mode ExtendMode) (*IGradientStopCollection, error)

func (*IRenderTarget) CreateLinearGradientBrush

func (inf *IRenderTarget) CreateLinearGradientBrush(lprop *LinearGradientBrushProperties, bprop *BrushProperties, stop *IGradientStopCollection) (*ILinearGradientBrush, error)

func (*IRenderTarget) CreateSolidColorBrush

func (inf *IRenderTarget) CreateSolidColorBrush(color *ColorF, prop *BrushProperties) (*ISolidColorBrush, error)

type IResource

type IResource struct{ direct.IUnknown }

func (*IResource) BeginDraw

func (inf *IResource) BeginDraw()

func (*IResource) Clear

func (inf *IResource) Clear(clearColor *ColorF)

func (*IResource) DrawLine

func (inf *IResource) DrawLine(point0 Point2F, point1 Point2F, brush *IBrush, strokeWidth float32, strokeStyle *IStrokeStyle)

func (*IResource) DrawText

func (inf *IResource) DrawText(text string, textFormat *dwrite.ITextFormat, layoutRect *RectF, defaultFillBrush *IBrush, options DrawTextOptions, measuringMode direct.MeasuringMode)

func (*IResource) EndDraw

func (inf *IResource) EndDraw() (uint64, uint64, error)

func (*IResource) FillEllipse

func (inf *IResource) FillEllipse(ellipse *Ellipse, brush *IBrush)

func (*IResource) GetFactory

func (inf *IResource) GetFactory() *IFactory

func (*IResource) GetPixelSize

func (inf *IResource) GetPixelSize() SizeU

func (*IResource) GetSize

func (inf *IResource) GetSize() SizeF

func (*IResource) SetTransform

func (inf *IResource) SetTransform(matrix *Matrix3x2F)

type ISolidColorBrush

type ISolidColorBrush struct{ IBrush }

type IStrokeStyle

type IStrokeStyle struct{ IResource }

type LinearGradientBrushProperties

type LinearGradientBrushProperties struct {
	StartPoint, EndPoint Point2F
}

type Matrix3x2F

type Matrix3x2F = [3][2]float32

type Matrix4x3F

type Matrix4x3F = [4][3]float32

type Matrix4x4F

type Matrix4x4F = [4][4]float32

type Matrix5x4F

type Matrix5x4F = [5][4]float32

type PixelFormat

type PixelFormat struct {
	Format    DxgiFormat
	AlphaMode AlphaMode
}

type Point2F

type Point2F struct{ X, Y float32 }

type Point2L

type Point2L struct{ X, Y int32 }

type Point2U

type Point2U struct{ X, Y uint32 }

type PresentOptions

type PresentOptions uint32
const (
	D2D1_PRESENT_OPTIONS_NONE            PresentOptions = 0x00000000
	D2D1_PRESENT_OPTIONS_RETAIN_CONTENTS PresentOptions = 0x00000001
	D2D1_PRESENT_OPTIONS_IMMEDIATELY     PresentOptions = 0x00000002
)

type RectF

type RectF struct{ Left, Top, Right, Bottom float32 }

type RectL

type RectL struct{ Left, Top, Right, Bottom int32 }

type RectU

type RectU struct{ Left, Top, Right, Bottom uint32 }

type RenderTargetProperties

type RenderTargetProperties struct {
	Type        RenderTargetType
	PixelFormat PixelFormat
	DpiX, DpiY  float32
	Usage       RenderTargetUsage
	MinLevel    FeatureLevel
}

type RenderTargetType

type RenderTargetType uint32
const (
	D2D1_RENDER_TARGET_TYPE_DEFAULT  RenderTargetType = 0
	D2D1_RENDER_TARGET_TYPE_SOFTWARE RenderTargetType = 1
	D2D1_RENDER_TARGET_TYPE_HARDWARE RenderTargetType = 2
)

type RenderTargetUsage

type RenderTargetUsage uint32
const (
	D2D1_RENDER_TARGET_USAGE_NONE                  RenderTargetUsage = 0x00000000
	D2D1_RENDER_TARGET_USAGE_FORCE_BITMAP_REMOTING RenderTargetUsage = 0x00000001
	D2D1_RENDER_TARGET_USAGE_GDI_COMPATIBLE        RenderTargetUsage = 0x00000002
)

type SizeF

type SizeF struct{ Width, Height float32 }

type SizeU

type SizeU struct{ Width, Height uint32 }

type Vector2F

type Vector2F struct{ X, Y float32 }

type Vector3F

type Vector3F struct{ X, Y, Z float32 }

type Vector4F

type Vector4F struct{ X, Y, Z, W float32 }

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL