coreg

package
v4.24.1 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2024 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Overview

Example (ReadWarpedImageTransform)
package main

import (
	"fmt"
	"log"

	"github.com/pixlise/core/v4/core/utils"
	protos "github.com/pixlise/core/v4/generated-protos"
	"google.golang.org/protobuf/encoding/protojson"
)

func printWarpXform(xform *protos.ImageMatchTransform, name string, err error) {
	fmt.Printf("%v|%v\n", name, err)

	if b, err := protojson.Marshal(xform); err != nil {
		log.Fatalln(err)
	} else {
		// Proto isn't deterministic, so we read as JSON and write it back out again
		fmt.Printf("%v\n", utils.MakeDeterministicJSON(b, false))
	}
}

func main() {
	printWarpXform(readWarpedImageTransform("warped-zoom_4.478153138946561-win_519_40_1232_1183-SN100D0-SC3_0921_0748732957_027RAS_N0450000SRLC11373_0000LMJ01-A.png"))

	printWarpXform(readWarpedImageTransform("warped-zoom_1.1359177671479777-win_216_186_167_183-PCB_0921_0748739251_000RAS_N045000032302746300020LUJ01-A.png"))

	printWarpXform(readWarpedImageTransform("warped-zoom_4.478153138946561-win_519_40_1232_1183-SN100D0-SC3_0921_0748732957_027RAS_N0450000SRLC11373_0000LMJ01.png"))

	printWarpXform(readWarpedImageTransform("warped-zoom_1.1359177671479777-win_216_186_167_183-PCB_0921_0748739251_000RAS_N045000032302746300020LUJ01.png"))

	printWarpXform(readWarpedImageTransform("warped-win_216_186_167_183-PCB_0921_0748739251_000RAS_N045000032302746300020LUJ01.png"))

	printWarpXform(readWarpedImageTransform("warped-zoom_4.478153138946561-win_519_40_1232_1183-SN100D0-SC3_0921_0748732957_027RASS_N0450000SRLC11373_0000LMJ01.png"))

}
Output:

coreg-40_519-SC3_0921_0748732957_027RAS_N0450000SRLC11373_0000LMJ01-A.png|<nil>
{
 "xOffset": 40,
 "xScale": 4.478153,
 "yOffset": 519,
 "yScale": 4.478153
}
coreg-186_216-PCB_0921_0748739251_000RAS_N045000032302746300020LUJ01-A.png|<nil>
{
 "xOffset": 186,
 "xScale": 1.1359178,
 "yOffset": 216,
 "yScale": 1.1359178
}
coreg-40_519-SC3_0921_0748732957_027RAS_N0450000SRLC11373_0000LMJ01.png|<nil>
{
 "xOffset": 40,
 "xScale": 4.478153,
 "yOffset": 519,
 "yScale": 4.478153
}
coreg-186_216-PCB_0921_0748739251_000RAS_N045000032302746300020LUJ01.png|<nil>
{
 "xOffset": 186,
 "xScale": 1.1359178,
 "yOffset": 216,
 "yScale": 1.1359178
}
|Warped image name does not have expected components
{}
|Failed to find GDS file name section in image name: SC3_0921_0748732957_027RASS_N0450000SRLC11373_0000LMJ01. Error: Failed to parse meta from file name
{}

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func StartCoregImport

func StartCoregImport(triggerUrl string, hctx wsHelpers.HandlerContext) (string, error)

Types

type CoregFile

type CoregFile struct {
	OriginalUri string
	NewUri      string
	Completed   bool
}

type CoregJobRequest

type CoregJobRequest struct {
	JobID       string `json:"jobId"`
	Environment string `json:"environment"`
	TriggerUrl  string `json:"triggerUrl"`
}

type CoregJobResult

type CoregJobResult struct {
	JobID       string `json:"jobId" bson:"_id"`
	Environment string `json:"environment"`

	MarsViewerExportUrl string `json:"marsViewerExportUrl"`

	ContextImageUrls []CoregFile `json:"contextImageUrls"`
	MappedImageUrls  []CoregFile `json:"mappedImageUrls"`
	WarpedImageUrls  []CoregFile `json:"warpedImageUrls"`
	BaseImageUrl     CoregFile   `json:"baseImageUrl"`
	AllCompleted     bool        `json:"allCompleted"`
}

Jump to

Keyboard shortcuts

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