package d2isometricimg

Import Path
	github.com/pancsta/d2/d2renderers/d2isometric/d2isometricimg (on go.dev)

Dependency Relation
	imports 49 packages, and imported by one package


Package-Level Type Names (total 8)
/* sort by: | */
const GIF const PNG const SVG
Color color.NRGBA Emissive color.NRGBA Metalness float64 Multiply composites this surface into the existing sRGB color while retaining source-over alpha. Group regions normally also use NoDepthWrite. Roughness float64 Texture image.Image Unlit bool Vector *nativeVectorSurface
Options uses fixed output pixels. Zero dimensions select 1600x1000 for PNG or 1000x625 for GIF. Timeout defaults to two minutes and cannot exceed two minutes. An earlier caller deadline always wins. Assets explicitly supplies bounded image loading. Rendering does not otherwise read local files or fetch remote resources. FitContent treats Width and Height as maximum dimensions and trims unused canvas to the projected diagram's aspect ratio. Geometry is never resized. Fonts supplies optional bounded fallback discovery. Configured D2 font families are retained even when no fallback resolver is provided. Format Format Height int LinkBudget bounds page annotations before they are accumulated. Nil uses 4096 regions and 1 MiB of destination/tooltip text for RenderPage. Render d2isometric.RenderOpts Timeout time.Duration Width int func CaptureFrames(ctx context.Context, diagram *d2target.Diagram, opts *Options, seconds []float64, traffic bool, emit func(int, []byte) error) error func Render(ctx context.Context, diagram *d2target.Diagram, opts *Options) ([]byte, error) func RenderPage(ctx context.Context, diagram *d2target.Diagram, opts *Options) (*Page, error) func RenderTimeline(ctx context.Context, boards []*d2target.Diagram, opts *Options, interval time.Duration) ([]byte, error) func github.com/pancsta/d2/d2renderers/d2svg.RenderIsometric(ctx context.Context, diagram *d2target.Diagram, opts *d2svg.RenderOpts, native *Options) ([]byte, error)
Page combines the native PNG with annotations in final image pixels. Writers can resize the image and annotations together for a PDF page or PPTX slide. Height int Links []d2scene.LinkRegion PNG []byte Width int func RenderPage(ctx context.Context, diagram *d2target.Diagram, opts *Options) (*Page, error)
Raster owns the static color/depth buffers and a directional shadow map. It is immutable after construction. Independent Frame calls may run in parallel; callers should bound that concurrency to their memory budget. Frame reuses the static image and shadow map. Small images retain sample depth; large images replay the same static samples only in affected strips. Unchanged pixels remain identical across frames. The result is caller-owned. func NewRaster(ctx context.Context, width, height int, triangles []Triangle, background color.NRGBA) (*Raster, error)
CastShadow bool DepthBias float64 Material *Material NoDepthWrite bool OpacityGroup fades a complete native object after its own opaque surfaces and printed cells have resolved their mutual occlusion. PaintOwner keeps a native object's substrate and decals together when they must be ordered around a separate partial-opacity object. Filled physical caps use source fill alpha rather than the printed texture's antialiased outline coverage. Nil preserves texture holes. ShadowOpacity still controls the strength of this physical shadow. Hierarchy roots have independent implicit ground receivers. Nil keeps the legacy scene-wide receiver. The pointed value is immutable. Nil uses the material opacity; animation may fade its shadow separately from the visible surface. The pointed value is immutable for a frame. V [3]Vertex func NewRaster(ctx context.Context, width, height int, triangles []Triangle, background color.NRGBA) (*Raster, error) func (*Raster).Frame(ctx context.Context, dynamic []Triangle) (*image.RGBA, error)
type Vec = d2isometric.Vec3 (struct)
Vertex UV coordinates use a top-left texture origin. A zero normal uses the triangle's geometric normal; supplied normals are smoothly interpolated. Normal Vec Position Vec U float64 V float64
Package-Level Functions (total 5)
CaptureFrames delivers lossless frames at exact scene times, serially. It is useful for deterministic comparison and other bounded image encoders. The callback owns each PNG and may retain it; no frame cache is kept here.
NewRaster fits the occupied vertices with a fixed orthographic camera. It uses 2x supersampling at every supported size. Large surfaces render in bounded strips rather than dropping coverage quality or allocating all samples. Background is final opaque sRGB, unaffected by material lighting.
Render returns a vector SVG or lossless PNG without traffic particles, or an infinitely looping GIF with a fixed camera and deterministic traffic. Rendering stays in memory and does not start external processes. Image I/O, when needed, is performed only by the explicitly supplied asset resolver.
RenderPage renders one compiled board and returns its image and bounded annotation regions for D2's native PDF/PPTX writers.
RenderTimeline renders ordered boards into one looping GIF. Each board is shown for interval, rounded to GIF centiseconds. Authored animated edges move during their board; static boards need only one held frame. A single palette covers all boards. Only one board's raster is retained at a time.
Package-Level Constants (total 10)
const CycleSeconds = 8.33333
const FrameCount = 100
const GIF Format = "gif"
const MaxAnimationPixels = 100000000
const MaxDimension = 4096
const MaxOutputBytes = 67108864
const MaxPixels = 12000000
const MaxTimelineBoards = 128
const PNG Format = "png"
const SVG Format = "svg"