From 7928a29b906ff09f3d1164823230e5d05b7a3174 Mon Sep 17 00:00:00 2001 From: Suren Date: Fri, 11 Jun 2021 18:48:29 +0530 Subject: [PATCH 1/2] #6933 & #1453: New props for IconSymbolizer and Contrast enhancement --- schema.json | 35 +++++++++++++++++++++++++++++++++++ style.ts | 14 ++++++++++++++ 2 files changed, 49 insertions(+) diff --git a/schema.json b/schema.json index 2c19dfa09..d6a184cc2 100644 --- a/schema.json +++ b/schema.json @@ -90,6 +90,10 @@ }, "gammaValue": { "type": "number" + }, + "vendorOption": { + "$ref": "http://geostyler/geostyler-style.json#/definitions/VendorOption", + "description": "A VendorOption defines the algorithm to apply for Normalize contrast enhancement." } }, "type": "object" @@ -300,6 +304,17 @@ "description": "A color defined as a hex-color string.", "type": "string" }, + "format": { + "description": "The format (MIME type) of the image provided.", + "enum": [ + "image/gif", + "image/jpeg", + "image/jpg", + "image/png", + "image/svg+xml" + ], + "type": "string" + }, "haloBlur": { "description": "The halo's fadeout distance towards the outside.", "type": "number" @@ -1113,6 +1128,26 @@ } }, "type": "object" + }, + "VendorOption": { + "description": "A VendorOption defines the algorithm to apply for Normalize contrast enhancement.", + "properties": { + "algorithm": { + "enum": [ + "ClipToMinimumMaximum", + "ClipToZero", + "StretchToMinimumMaximum" + ], + "type": "string" + }, + "maxValue": { + "type": "number" + }, + "minValue": { + "type": "number" + } + }, + "type": "object" } }, "description": "The Style is the main interface and the root for all other interfaces.", diff --git a/style.ts b/style.ts index efa0488fc..3a093b2c7 100644 --- a/style.ts +++ b/style.ts @@ -359,6 +359,10 @@ export interface IconSymbolizer extends BasePointSymbolizer { * A path/URL to the icon image file. */ image?: string; + /** + * The format (MIME type) of the image provided. + */ + format?: `image/${'png' | 'jpg' | 'jpeg' | 'gif' | 'svg+xml'}`; /** * If true, the icon will be kept upright. */ @@ -549,12 +553,22 @@ export interface ColorMap { extended?: boolean; } +/** + * A VendorOption defines the algorithm to apply for Normalize contrast enhancement. + */ +export interface VendorOption { + algorithm?: 'StretchToMinimumMaximum' | 'ClipToMinimumMaximum' | 'ClipToZero'; + minValue?: number; + maxValue?: number; +} + /** * A ContrastEnhancement defines how the contrast of image data should be enhanced. */ export interface ContrastEnhancement { enhancementType?: 'normalize' | 'histogram'; gammaValue?: number; + vendorOption?: VendorOption; } /** From be15588ce1fa4a10c5c74817439c0f17280adddf Mon Sep 17 00:00:00 2001 From: Suren Date: Mon, 9 Aug 2021 15:51:53 +0530 Subject: [PATCH 2/2] Refactor interface name --- schema.json | 44 ++++++++++++++++++++++---------------------- style.ts | 8 ++++---- 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/schema.json b/schema.json index d6a184cc2..5385a5373 100644 --- a/schema.json +++ b/schema.json @@ -92,8 +92,28 @@ "type": "number" }, "vendorOption": { - "$ref": "http://geostyler/geostyler-style.json#/definitions/VendorOption", - "description": "A VendorOption defines the algorithm to apply for Normalize contrast enhancement." + "$ref": "http://geostyler/geostyler-style.json#/definitions/ContrastEnhancementVendorOption", + "description": "A ContrastEnhancementVendorOption defines the algorithm to apply for Normalize contrast enhancement." + } + }, + "type": "object" + }, + "ContrastEnhancementVendorOption": { + "description": "A ContrastEnhancementVendorOption defines the algorithm to apply for Normalize contrast enhancement.", + "properties": { + "algorithm": { + "enum": [ + "ClipToMinimumMaximum", + "ClipToZero", + "StretchToMinimumMaximum" + ], + "type": "string" + }, + "maxValue": { + "type": "number" + }, + "minValue": { + "type": "number" } }, "type": "object" @@ -1128,26 +1148,6 @@ } }, "type": "object" - }, - "VendorOption": { - "description": "A VendorOption defines the algorithm to apply for Normalize contrast enhancement.", - "properties": { - "algorithm": { - "enum": [ - "ClipToMinimumMaximum", - "ClipToZero", - "StretchToMinimumMaximum" - ], - "type": "string" - }, - "maxValue": { - "type": "number" - }, - "minValue": { - "type": "number" - } - }, - "type": "object" } }, "description": "The Style is the main interface and the root for all other interfaces.", diff --git a/style.ts b/style.ts index 3a093b2c7..9081abb97 100644 --- a/style.ts +++ b/style.ts @@ -554,10 +554,10 @@ export interface ColorMap { } /** - * A VendorOption defines the algorithm to apply for Normalize contrast enhancement. + * A ContrastEnhancementVendorOption defines the algorithm to apply for Normalize contrast enhancement. */ -export interface VendorOption { - algorithm?: 'StretchToMinimumMaximum' | 'ClipToMinimumMaximum' | 'ClipToZero'; +export interface ContrastEnhancementVendorOption { + algorithm: 'StretchToMinimumMaximum' | 'ClipToMinimumMaximum' | 'ClipToZero'; minValue?: number; maxValue?: number; } @@ -568,7 +568,7 @@ export interface VendorOption { export interface ContrastEnhancement { enhancementType?: 'normalize' | 'histogram'; gammaValue?: number; - vendorOption?: VendorOption; + vendorOption?: ContrastEnhancementVendorOption; } /**