使用gamma校正提升jpg亮度
This commit is contained in:
70
pkg/producer/meta.go
Normal file
70
pkg/producer/meta.go
Normal file
@@ -0,0 +1,70 @@
|
||||
package imageproc
|
||||
|
||||
import (
|
||||
"encoding/xml"
|
||||
"os"
|
||||
)
|
||||
|
||||
// 定义与XML结构对应的Go结构体
|
||||
type ProductMeta struct {
|
||||
XMLName xml.Name `xml:"ProductMeta"`
|
||||
Satellite string `xml:"Satellite"`
|
||||
Sensor string `xml:"Sensor"`
|
||||
ProductID string `xml:"ProductID"`
|
||||
ProductLevel string `xml:"ProductLevel"`
|
||||
OutputFormat string `xml:"OutputFormat"`
|
||||
ProductGenTime string `xml:"ProductGenTime"`
|
||||
StartTime string `xml:"StartTime"`
|
||||
EndTime string `xml:"EndTime"`
|
||||
CentreTime string `xml:"CentreTime"`
|
||||
Bands int `xml:"Bands"`
|
||||
CentreLocation Location `xml:"CentreLocation"`
|
||||
Corners Corners `xml:"Corners"`
|
||||
SunAzimuth float64 `xml:"SunAzimuth"`
|
||||
SunElevation float64 `xml:"SunElevation"`
|
||||
SatAzimuth float64 `xml:"SatAzimuth"`
|
||||
SatElevation float64 `xml:"SatElevation"`
|
||||
Gsd float64 `xml:"Gsd"`
|
||||
CloudRate float64 `xml:"CloudRate"`
|
||||
Roll float64 `xml:"Roll"`
|
||||
Pitch float64 `xml:"Pitch"`
|
||||
Yaw float64 `xml:"Yaw"`
|
||||
SatPosX float64 `xml:"SatPosX"`
|
||||
SatPosY float64 `xml:"SatPosY"`
|
||||
SatPosZ float64 `xml:"SatPosZ"`
|
||||
Width int `xml:"Width"`
|
||||
Height int `xml:"Height"`
|
||||
DataSize int64 `xml:"DataSize"`
|
||||
MapProjection string `xml:"MapProjection"`
|
||||
EarthEllipsoid string `xml:"EarthEllipsoid"`
|
||||
UtmZone int `xml:"UtmZone"`
|
||||
GainLevel int `xml:"GainLevel"`
|
||||
IntegratedLevel int `xml:"IntegratedLevel"`
|
||||
IntegratedTime float64 `xml:"IntegratedTime"`
|
||||
}
|
||||
|
||||
type Location struct {
|
||||
Longitude float64 `xml:"Longitude"`
|
||||
Latitude float64 `xml:"Latitude"`
|
||||
}
|
||||
|
||||
type Corners struct {
|
||||
UpperLeft Location `xml:"UpperLeft"`
|
||||
UpperRight Location `xml:"UpperRight"`
|
||||
LowerRight Location `xml:"LowerRight"`
|
||||
LowerLeft Location `xml:"LowerLeft"`
|
||||
}
|
||||
|
||||
func WriteProductMeta(productMeta *ProductMeta, filename string) error {
|
||||
output, err := xml.MarshalIndent(productMeta, "", " ")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
err = os.WriteFile(filename, output, 0644)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
Reference in New Issue
Block a user