Struct CRTImageRegion
Which part of the source and destination textures holds the picture, for a render pipeline whose textures can be larger than the picture drawn into them.
Inherited Members
Namespace: Scylla.TextMode.CRT
Assembly: ScyllaTextMode.CRT.dll
Syntax
public struct CRTImageRegion
Remarks
Some pipelines allocate their render textures at the largest size used so far and draw the current picture into the lower left part of each one. The default region means the picture fills both textures completely.
Fields
SourceOffset
Where the picture starts in the source texture, as a fraction of its size.
Declaration
public Vector2 SourceOffset
Field Value
| Type | Description |
|---|---|
| Vector2 |
SourceScale
The fraction of the source texture that holds the picture. Zero, the default, means the whole texture.
Declaration
public Vector2 SourceScale
Field Value
| Type | Description |
|---|---|
| Vector2 |
Viewport
The pixels of the destination to draw into. An empty rectangle, the default, means the whole destination.
Declaration
public RectInt Viewport
Field Value
| Type | Description |
|---|---|
| RectInt |
Properties
Full
Gets the region of a picture that fills both textures completely.
Declaration
public static CRTImageRegion Full { get; }
Property Value
| Type | Description |
|---|---|
| CRTImageRegion |
HasSourceScale
Gets whether only part of the source texture holds the picture.
Declaration
public bool HasSourceScale { get; }
Property Value
| Type | Description |
|---|---|
| bool |
HasViewport
Gets whether only part of the destination is drawn into.
Declaration
public bool HasViewport { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Methods
FromScaledTextures(Vector2, Vector2Int)
Creates the region of a picture drawn into the lower left part of textures that are larger than the picture, with the same layout in the source and the destination.
Declaration
public static CRTImageRegion FromScaledTextures(Vector2 scale, Vector2Int pictureSize)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector2 | scale | The fraction of each texture the picture covers. |
| Vector2Int | pictureSize | The size of the picture in pixels. |
Returns
| Type | Description |
|---|---|
| CRTImageRegion | The region, or Full when the scale or the size has no area. |
ResolveOutputSize(Vector2Int)
Returns the size of the picture drawn into the destination.
Declaration
public Vector2Int ResolveOutputSize(Vector2Int destinationSize)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector2Int | destinationSize | The size of the whole destination in pixels. |
Returns
| Type | Description |
|---|---|
| Vector2Int | The viewport's size when there is one; otherwise |