Documentation ¶
Index ¶
Constants ¶
View Source
const ( Context = "http://iiif.io/api/image/3/context.json" Type = "ImageService3" Protocol = "http://iiif.io/api/image" )
View Source
const ( ComplianceLevel0Name ComplianceLevelName = "level0" ComplianceLevel0ProfileDocument string = "http://iiif.io/api/image/3/level0.json" ComplianceLevel1Name ComplianceLevelName = "level1" ComplianceLevel1ProfileDocument string = "http://iiif.io/api/image/3/level1.json" ComplianceLevel2Name ComplianceLevelName = "level2" ComplianceLevel2ProfileDocument string = "http://iiif.io/api/image/3/level2.json" )
Variables ¶
View Source
var OfficialComplianceLevels = officialComplianceLevels{ ComplianceLevel0Name: complianceLevel0Spec, ComplianceLevel1Name: complianceLevel1Spec, ComplianceLevel2Name: complianceLevel2Spec, }
OfficialComplianceLevels is the official levels defined by the spec. DefaultComplianceLevels should typically be used instead.
Functions ¶
This section is empty.
Types ¶
type ComplianceLevelName ¶
type ComplianceLevelName string
type ComplianceLevelSpec ¶
type ComplianceLevelSpec interface { Name() ComplianceLevelName ProfileDocument() string BaseFeatures() FeatureNameList BaseQualities() []string BaseFormats() []string }
type ComplianceLevels ¶
type ComplianceLevels interface {
GetByName(name ComplianceLevelName) (ComplianceLevelSpec, bool)
}
var DefaultComplianceLevels ComplianceLevels = OfficialComplianceLevels
DefaultComplianceLevels is a shared set of compliance levels that may be reconfigured. By default it is the set of levels defined in the specification.
type FeatureName ¶
type FeatureName string
const ( // FeatureNameBaseUriRedirect means the base URI of the service will redirect to the image information document. FeatureNameBaseUriRedirect FeatureName = "baseUriRedirect" // FeatureNameCanonicalLinkHeader means the canonical image URI HTTP link header is provided on image responses. FeatureNameCanonicalLinkHeader FeatureName = "canonicalLinkHeader" // FeatureNameCors means the CORS HTTP headers are provided on all responses. FeatureNameCors FeatureName = "cors" // FeatureNameJsonldMediaType means the JSON-LD media type is provided when requested. FeatureNameJsonldMediaType FeatureName = "jsonldMediaType" // FeatureNameMirroring means the image may be rotated around the vertical axis, resulting in a left-to-right mirroring of the content. FeatureNameMirroring FeatureName = "mirroring" // FeatureNameProfileLinkHeader means the profile HTTP link header is provided on image responses. FeatureNameProfileLinkHeader FeatureName = "profileLinkHeader" // FeatureNameRegionByPct means regions of the full image may be requested by percentage. FeatureNameRegionByPct FeatureName = "regionByPct" // FeatureNameRegionByPx means regions of the full image may be requested by pixel dimensions. FeatureNameRegionByPx FeatureName = "regionByPx" // FeatureNameRegionSquare means a square region may be requested, where the width and height are equal to the shorter dimension of the full image. FeatureNameRegionSquare FeatureName = "regionSquare" // FeatureNameRotationArbitrary means image rotation may be requested using values other than multiples of 90 degrees. FeatureNameRotationArbitrary FeatureName = "rotationArbitrary" // FeatureNameRotationBy90s means image rotation may be requested in multiples of 90 degrees. FeatureNameRotationBy90s FeatureName = "rotationBy90s" // FeatureNameSizeByConfinedWh means image size may be requested in the form !w,h. FeatureNameSizeByConfinedWh FeatureName = "sizeByConfinedWh" // FeatureNameSizeByH means image size may be requested in the form ,h. FeatureNameSizeByH FeatureName = "sizeByH" // FeatureNameSizeByPct means images size may be requested in the form pct:n. FeatureNameSizeByPct FeatureName = "sizeByPct" // FeatureNameSizeByW means image size may be requested in the form w,. FeatureNameSizeByW FeatureName = "sizeByW" // FeatureNameSizeByWh means image size may be requested in the form w,h. FeatureNameSizeByWh FeatureName = "sizeByWh" // FeatureNameSizeUpscaling means image sizes prefixed with ^ may be requested. FeatureNameSizeUpscaling FeatureName = "sizeUpscaling" )
type FeatureNameList ¶
type FeatureNameList []FeatureName
func (FeatureNameList) Sort ¶
func (fnl FeatureNameList) Sort()
type FeatureNotSupportedError ¶
type FeatureNotSupportedError FeatureName
FeatureNotSupportedError indicates an input constraint would have required a feature that is not supported.
func (FeatureNotSupportedError) Error ¶
func (e FeatureNotSupportedError) Error() string
type ImageInformation ¶
type ImageInformation struct { Context string `json:"@context"` ID string `json:"id"` Type string `json:"type"` Protocol string `json:"protocol"` Profile ComplianceLevelName `json:"profile"` Width uint32 `json:"width"` Height uint32 `json:"height"` Sizes []ImageInformationSize `json:"sizes,omitempty"` Tiles []ImageInformationTile `json:"tiles,omitempty"` PreferredFormats []string `json:"preferredFormats,omitempty"` ExtraQualities []string `json:"extraQualities,omitempty"` ExtraFormats []string `json:"extraFormats,omitempty"` ExtraFeatures FeatureNameList `json:"extraFeatures,omitempty"` MaxHeight *uint32 `json:"maxHeight,omitempty"` MaxWidth *uint32 `json:"maxWidth,omitempty"` MaxArea *uint32 `json:"maxArea,omitempty"` Rights string `json:"rights,omitempty"` PartOf []interface{} `json:"partOf,omitempty"` SeeAlso []interface{} `json:"seeAlso,omitempty"` Service []interface{} `json:"service,omitempty"` }
func NewImageInformation ¶
func NewImageInformation(info ImageInformation) ImageInformation
NewImageInformation is a light wrapper to add the default, spec-defined properties: context, type, and protocol.
type ImageInformationSize ¶
type ImageInformationTile ¶
type InvalidValueError ¶
type InvalidValueError struct {
// contains filtered or unexported fields
}
InvalidValueError indicates a problem with an input constraint. For HTTP runtimes, this translates to an HTTP 400 Bad Request.
func NewInvalidValueError ¶
func NewInvalidValueError(s string) InvalidValueError
func (InvalidValueError) Error ¶
func (e InvalidValueError) Error() string
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
examples
|
|
imagerequest offers functions to parse, validate, and resolve image parameters into more usable forms.
|
imagerequest offers functions to parse, validate, and resolve image parameters into more usable forms. |
pixelset offers functions to enumerate and check region+size values which may be supported through static configuration or based on [spec.ImageInformation].
|
pixelset offers functions to enumerate and check region+size values which may be supported through static configuration or based on [spec.ImageInformation]. |
Click to show internal directories.
Click to hide internal directories.