processor

package
v0.5.6 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2023 License: AGPL-3.0 Imports: 41 Imported by: 0

Documentation

Overview

Part of this code is borrowed from/inspired by https://github.com/iqhater/get-youtube-thumbnail, which is licensed by MIT license

Index

Constants

This section is empty.

Variables

View Source
var AllowedAssetsTypes map[types.Type]bool

Functions

func DownSampleTo

func DownSampleTo(img image.Image, NewPixelCount int) image.Image

func SanitizeString

func SanitizeString(drawstring string) string

Types

type AttributeTypeDescription

type AttributeTypeDescription struct {
	Name        string  `json:"name"`
	Description string  `json:"description"`
	Sync        *string `json:"sync"`
}

type Manifest

type Manifest struct {
	Name           string                      `json:"name"`
	DisplayName    *string                     `json:"displayName"`
	Description    string                      `json:"description"`
	Version        string                      `json:"version"`
	Author         *string                     `json:"author"`
	Repository     *string                     `json:"repository"`
	Homepage       *string                     `json:"homepage"`
	License        *string                     `json:"license"`
	AttributeTypes *[]AttributeTypeDescription `json:"attribute_types"`
	Scopes         *map[string][]string        `json:"scopes"`
}

type Processor

type Processor struct {
	Fontpath   string
	Imagepath  string
	Audiopath  string
	Videopath  string
	Assetpath  string
	Pluginpath string

	ImPathF string
	ImPathS map[string]string

	ImageMapF *lru.Cache
	ImageMapS map[string]*lru.Cache

	PresentMutex sync.Mutex

	RenderQueue chan *types.FrameRenderRequest
	RenderDone  chan *types.FrameRenderRequest

	ImagesRescaleInProgress sync.Map
	// contains filtered or unexported fields
}

func NewProcessor

func NewProcessor() *Processor

func (*Processor) FileExists

func (p *Processor) FileExists(filename string) bool

func (*Processor) GetMD5HashByte

func (p *Processor) GetMD5HashByte(text []byte) string

func (*Processor) HandleError

func (p *Processor) HandleError(err error) bool

func (*Processor) Initialize

func (p *Processor) Initialize(ctx types.NodeContext) *Processor

func (*Processor) LoadPluginManifest

func (p *Processor) LoadPluginManifest(pluginHash string) (*Manifest, error)

func (*Processor) Present

func (p *Processor) Present(imageID string) (*types.MetaDef, *string)

func (*Processor) PresentTexture

func (p *Processor) PresentTexture(ID *string, rsize string) (*types.MetaDef, *string)

func (*Processor) ProcessAsset

func (p *Processor) ProcessAsset(body io.ReadCloser) (string, error)

func (*Processor) ProcessFrame

func (p *Processor) ProcessFrame(body []byte) (string, error)

func (*Processor) ProcessImage

func (p *Processor) ProcessImage(src []byte) (string, error)

func (*Processor) ProcessPlugin

func (p *Processor) ProcessPlugin(body io.ReadCloser) (string, error)

func (*Processor) ProcessTrack

func (p *Processor) ProcessTrack(body io.ReadCloser) (string, error)

func (*Processor) ProcessTube

func (p *Processor) ProcessTube(src []byte) (string, error)

func (*Processor) ProcessVideo

func (p *Processor) ProcessVideo(body io.ReadCloser) (string, error)

func (*Processor) RenderFrame

func (p *Processor) RenderFrame(req *types.FrameRenderRequest)

func (*Processor) SaveWriteToFile

func (p *Processor) SaveWriteToFile(fname string, data []byte) error

func (*Processor) SaveWriteToPNG

func (p *Processor) SaveWriteToPNG(fname string, img image.Image) error

func (*Processor) WriteToF

func (p *Processor) WriteToF(img image.Image) (error, string)

func (*Processor) WriteToScaled

func (p *Processor) WriteToScaled(base string, img image.Image, rsize string) error

type TubeDesc

type TubeDesc struct {
	Url string `json:"url"`
}

Jump to

Keyboard shortcuts

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