Documentation ¶
Index ¶
- Constants
- func Demosaic(bayerImage *image.Gray) (image.Image, error)
- func DemosaicRGBGray(bayerImage image.Image) (image.Image, error)
- func FileExists(pathname string) bool
- func GetRequestParams(cameras []string, numPerPage int, page int, minSol int, maxSol int) url.Values
- func MatchExposure(ref image.Image, target image.Image) image.Image
- func SavePNG(image image.Image, filename string) error
- func ValidCameras() []string
- type AdjustmentMap
- type CameraInfo
- type CompositeImageInfo
- type CompositeImageSet
- type Compositor
- type ExtendedInfo
- type Float64Interpolator
- type FloatTuple
- type ImageCache
- func (cache *ImageCache) FullSize(imageID string) (image.Image, error)
- func (cache *ImageCache) FullSizeDir() string
- func (cache *ImageCache) FullSizePath(imageID string) string
- func (cache *ImageCache) ThumbDir() string
- func (cache *ImageCache) ThumbNail(imageID string) (image.Image, error)
- func (cache *ImageCache) ThumbPath(imageID string) string
- type ImageDB
- type ImageExposure
- type ImageFileUrls
- type ImageInfo
- type LabBounds
- type Origin
- type Rect
- type Size
Constants ¶
View Source
const DefaultCachePathname = "./image_cache"
View Source
const DefaultDBPathname = "./mars_perseverance_image_info.db"
NewImageDB creates/accesses a database at this location.
Variables ¶
This section is empty.
Functions ¶
func DemosaicRGBGray ¶
Demosaic a grayscale image that was stored as RGBA.
func FileExists ¶
func GetRequestParams ¶
func MatchExposure ¶
Get a copy of a ref image whose exposure is matched to that of a target image.
func ValidCameras ¶
func ValidCameras() []string
Types ¶
type AdjustmentMap ¶
type AdjustmentMap struct {
L, A, B chanAdjustmentMap
// contains filtered or unexported fields
}
func NewAdjustmentMap ¶
func NewAdjustmentMap() *AdjustmentMap
func (*AdjustmentMap) AddSample ¶
func (am *AdjustmentMap) AddSample(srcPix, targetPix lib_color.CIELab)
func (*AdjustmentMap) Complete ¶
func (am *AdjustmentMap) Complete()
type CameraInfo ¶
type CameraInfo struct { CameraModelComponentList interface{} `json:"camera_model_component_list"` CameraModelType string `json:"camera_model_type"` CameraPosition FloatTuple `json:"camera_position"` CameraVector FloatTuple `json:"camera_vector"` FilterName string `json:"filter_name"` Instrument string `json:"instrument"` }
type CompositeImageInfo ¶
type CompositeImageInfo struct { ImageID string Site int Drive int Sclk float64 SubframeRect image.Rectangle Camera string ColorType string }
func GetCompositeImageInfoRecords ¶
func GetCompositeImageInfoRecords(idb ImageDB, camera string) ([]CompositeImageInfo, error)
type CompositeImageSet ¶
type CompositeImageSet []CompositeImageInfo
func GetCompositeImageSets ¶
func GetCompositeImageSets(idb ImageDB, camera string) ([]CompositeImageSet, error)
func (CompositeImageSet) Len ¶
func (cid CompositeImageSet) Len() int
Implement sort.Interface to order composite images by their subframe rectangles
func (CompositeImageSet) Less ¶
func (cid CompositeImageSet) Less(i, j int) bool
func (CompositeImageSet) Name ¶
func (imageSet CompositeImageSet) Name() string
func (CompositeImageSet) Swap ¶
func (cid CompositeImageSet) Swap(i, j int)
type Compositor ¶
type Compositor struct { Bounds image.Rectangle Result *lib_image.CIELab // contains filtered or unexported fields }
Compositor builds a composite image from constituent tile images.
func NewCompositor ¶
func NewCompositor(rect image.Rectangle) Compositor
func (*Compositor) AddImage ¶
func (comp *Compositor) AddImage(image image.Image, subframeRect image.Rectangle)
Add a new image. Adjust its colors as necessary to match any overlapping image data that has already been composited.
func (*Compositor) CompressDynamicRange ¶
func (comp *Compositor) CompressDynamicRange()
type ExtendedInfo ¶
type ExtendedInfo struct { // These are all either a float or "UNK" MastAzimuth optFloat `json:"mastAz"` MastElevation optFloat `json:"mastEl"` Sclk optFloat `json:"sclk"` // "UNK" or a positive real, typically 1.0 or 4.0. ScaleFactor optFloat `json:"scaleFactor"` XYZ FloatTuple `json:"xyz"` // How to convince JSON to parse an array of 4 floats as a struct? SubframeRect Rect `json:"subframeRect"` Dimension Size `json:"dimension"` }
type Float64Interpolator ¶
type Float64Interpolator struct {
// contains filtered or unexported fields
}
func NewFloat64Interpolator ¶
func NewFloat64Interpolator(yVals map[float64]float64) *Float64Interpolator
func (*Float64Interpolator) Interp ¶
func (interp *Float64Interpolator) Interp(x float64) float64
type FloatTuple ¶
type FloatTuple []float64
func (*FloatTuple) UnmarshalJSON ¶
func (v *FloatTuple) UnmarshalJSON(data []byte) error
type ImageCache ¶
type ImageCache struct {
// contains filtered or unexported fields
}
func NewImageCache ¶
func NewImageCache(idb ImageDB) (ImageCache, error)
func NewImageCacheAtPath ¶
func NewImageCacheAtPath(idb ImageDB, cacheDir string) (ImageCache, error)
func (*ImageCache) FullSize ¶
func (cache *ImageCache) FullSize(imageID string) (image.Image, error)
func (*ImageCache) FullSizeDir ¶
func (cache *ImageCache) FullSizeDir() string
func (*ImageCache) FullSizePath ¶
func (cache *ImageCache) FullSizePath(imageID string) string
func (*ImageCache) ThumbDir ¶
func (cache *ImageCache) ThumbDir() string
func (*ImageCache) ThumbNail ¶
func (cache *ImageCache) ThumbNail(imageID string) (image.Image, error)
func (*ImageCache) ThumbPath ¶
func (cache *ImageCache) ThumbPath(imageID string) string
type ImageDB ¶
func NewImageDB ¶
Create/access an image database at the DefaultDBPathname.
func NewImageDBAtPath ¶
Create/access an image database.
func (*ImageDB) AddOrUpdate ¶
Add or update Images from provided records.
func (*ImageDB) FullSizeURL ¶
Get the full-resolution URL for an image.
type ImageExposure ¶
type ImageExposure struct { BinMinVal float64 // The L value corresponding to the first bin. BinScale float64 // Multiplier maps Lab L range to bucket index range Histogram []int // Histogram of L values. CDF []float64 // Cumulative density function }
func NewImageExposure ¶
func NewImageExposure(image *lib_image.CIELab) *ImageExposure
type ImageFileUrls ¶
type ImageInfo ¶
type ImageInfo struct { ImageID string `json:"imageid"` Credit string `json:"credit"` Caption string `json:"caption"` Title string `json:"title"` JsonLink string `json:"json_link"` WebLink string `json:"link"` Attitude FloatTuple `json:"attitude"` Sol optInt `json:"sol"` // How to parse date strings in Go? DateTakenMars string `json:"date_taken_mars"` DateTakenUtc string `json:"date_taken_utc"` DateReceived string `json:"date_received"` Drive optInt `json:"drive"` Site optInt `json:"site"` SampleType string `json:"sample_type"` Camera CameraInfo `json:"camera"` ImageFiles ImageFileUrls `json:"image_files"` Extended ExtendedInfo `json:"extended"` }
func ParseImageMetadata ¶
type Rect ¶
func (*Rect) UnmarshalJSON ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.