Skip to content

Commit

Permalink
Merging dev into master
Browse files Browse the repository at this point in the history
  • Loading branch information
Cloud User committed Aug 26, 2019
2 parents 6df689d + e115952 commit 53499c8
Show file tree
Hide file tree
Showing 5 changed files with 89 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,11 @@ class ChipperController {
Histogram operations used can be none, linear, auto-minmax, auto-percentile, std-stretch-1, std-stretch-2, std-stretch-3.
If custom "linear" option then you must either populate the histLinearClip or the histLinearNormClip values
* **histBiasFactor**
Used as a bias factor in the auto clip calculations. Currently only used for auto min max clip adjustmjents. You can add a small bias to control how the clip points
are located during the aut calculations
* **histLinearClip**
Is a comma separated pair of low then high value. **Example:** 8,180 defines a low clip of pixel value 8 and a high clip of pixel value 180.
Expand All @@ -99,6 +104,11 @@ class ChipperController {
clip of .8 which is calculated as a penetration of 80 percent from start of the histogram bins or you can read it as a 20% penetration from the end
of the histogram bins.
* **histCenterClip**
You can adjust the center value used in the min max clip. The value ranges from 0 to 1 and defaults to 0.5. Closer to 0 the more the center will be shifted to the min value causing
the image to become brighter. If the value gets closer to 1 the closer to the max clip it will be causing the overall image to become darker.
* **histCenter**
Histogram should be calculated based on the center of the request
Expand Down Expand Up @@ -129,7 +139,11 @@ class ChipperController {
* **transparent**
Enables transparent output if the **outputFormat** supports it """)
Enables transparent output if the **outputFormat** supports it
* **gamma**
Gamma correction value. Good values between lighter .01 to darker 2 """)
@ApiImplicitParams([
@ApiImplicitParam(name = 'images[0].file', value = 'filename', defaultValue = '', paramType = 'query', dataType = 'string', required=true),
@ApiImplicitParam(name = 'images[0].entry', value = 'Image entry in the file', defaultValue = '', paramType = 'query', dataType = 'integer', required=false),
Expand All @@ -146,8 +160,10 @@ class ChipperController {
@ApiImplicitParam(name = 'cutBboxXywh', value = 'Cut image box separated by commas: **x**,**y**,**width**,**height**', defaultValue = '', paramType = 'query', dataType = 'string', required=false),
@ApiImplicitParam(name = 'rrds', value = 'Reduced resolution', defaultValue = '0', paramType = 'query', dataType = 'integer', required=false),
@ApiImplicitParam(name = 'histOp', value = 'Histogram Operation',defaultValue = '',allowableValues="none,linear,auto-minmax,auto-percentile,std-stretch-1,std-stretch-2,std-stretch-3", paramType = 'query', dataType = 'string', required=false),
@ApiImplicitParam(name = 'histBiasFactor', value = 'bias adjustment for auto calculations (defaults to the identity = 1) range is 0..2', defaultValue="1", paramType = 'query', dataType = 'number', required=false),
@ApiImplicitParam(name = 'histLinearClip', value = 'Histogram clip comma separated: **low**,**high** ',defaultValue = '',allowableValues="", paramType = 'query', dataType = 'string', required=false),
@ApiImplicitParam(name = 'histLinearNormClip', value = 'Histogram normalized clip comma separated: **low**,**high**',defaultValue = '',allowableValues="", paramType = 'query', dataType = 'string', required=false),
@ApiImplicitParam(name = 'histCenterClip', value = 'Adjust center for min max clip (defaults to 0.5) range is 0..1', defaultValue="0.5", paramType = 'query', dataType = 'number', required=false),
@ApiImplicitParam(name = 'histCenter', value = 'Histogram Center Calculation',defaultValue = '',allowableValues="true,false", paramType = 'query', dataType = 'boolean', required=false),
@ApiImplicitParam(name = 'outputRadiometry', value = 'Output radiometry', defaultValue = 'ossim_uint8', allowableValues="ossim_uint8,ossim_uint11,ossim_uint16,ossim_sint16,ossim_float32,ossim_float64", paramType = 'query', dataType = 'string', required=true),
@ApiImplicitParam(name = 'bands', value = 'Bands', defaultValue = '', paramType = 'query', dataType = 'string', required=false),
Expand All @@ -156,6 +172,7 @@ class ChipperController {
@ApiImplicitParam(name = 'keepBands', value = 'Determine if we auto adjust bands or not', defaultValue = "false", paramType = 'query', dataType = 'boolean', required=false),
@ApiImplicitParam(name = 'padThumbnail', value = 'Add padding to the output to make it square', defaultValue = "false", paramType = 'query', dataType = 'boolean', required=false),
@ApiImplicitParam(name = 'transparent', value = 'Enable transparent if the outputFormat supports it', defaultValue = "true", paramType = 'query', dataType = 'boolean', required=false),
@ApiImplicitParam(name = 'gamma', value = 'Gamma correction', defaultValue = "", paramType = 'query', dataType = 'number', required=false),
])
def chip(){
runChipperCommand("chip")
Expand Down Expand Up @@ -209,6 +226,11 @@ class ChipperController {
Histogram operations used can be none, auto-minmax, auto-percentile, std-stretch-1, std-stretch-2, or std-stretch-3
* **histBiasFactor**
Used as a bias factor in the auto clip calculations. Currently only used for auto min max clip adjustmjents. You can add a small bias to control how the clip points
are located during the aut calculations
* **histLinearClip**
Is a comma separated pair of low then high value. **Example:** 8,180 defines a low clip of pixel value 8 and a high clip of pixel value 180.
Expand All @@ -219,6 +241,11 @@ class ChipperController {
clip of .8 which is calculated as a penetration of 80 percent from start of the histogram bins or you can read it as a 20% penetration from the end
of the histogram bins.
* **histCenterClip**
You can adjust the center value used in the min max clip. The value ranges from 0 to 1 and defaults to 0.5. Closer to 0 the more the center will be shifted to the min value causing
the image to become brighter. If the value gets closer to 1 the closer to the max clip it will be causing the overall image to become darker.
* **histCenter**
Histogram should be calculated based on the center of the request
Expand Down Expand Up @@ -253,7 +280,11 @@ class ChipperController {
* **transparent**
Enables transparent output if the **outputFormat** supports it """)
Enables transparent output if the **outputFormat** supports it
* **gamma**
Gamma correction value. Good values between lighter .01 to darker 2 """)
@ApiImplicitParams([
@ApiImplicitParam(name = 'images[0].file', value = 'filename', defaultValue = '', paramType = 'query', dataType = 'string', required=true),
@ApiImplicitParam(name = 'images[0].entry', value = 'Image entry in the file', defaultValue = '', paramType = 'query', dataType = 'integer', required=false),
Expand All @@ -270,8 +301,10 @@ class ChipperController {
@ApiImplicitParam(name = 'cutHeight', value = 'Cut height in pixels', defaultValue = '', paramType = 'query', dataType = 'integer', required=false),
@ApiImplicitParam(name = 'cutWmsBbox', value = 'Cut wms bbox format', defaultValue = '', paramType = 'query', dataType = 'string', required=false),
@ApiImplicitParam(name = 'histOp', value = 'Histogram Operation',defaultValue = '',allowableValues="none,linear,auto-minmax,auto-percentile,std-stretch-1,std-stretch-2,std-stretch-3", paramType = 'query', dataType = 'string', required=false),
@ApiImplicitParam(name = 'histBiasFactor', value = 'bias adjustment for auto calculations (defaults to the identity = 1) range is 0..2', defaultValue="1", paramType = 'query', dataType = 'number', required=false),
@ApiImplicitParam(name = 'histLinearClip', value = 'Histogram clip comma separated: **low**,**high** ',defaultValue = '',allowableValues="", paramType = 'query', dataType = 'string', required=false),
@ApiImplicitParam(name = 'histLinearNormClip', value = 'Histogram normalized clip comma separated: **low**,**high**',defaultValue = '',allowableValues="", paramType = 'query', dataType = 'string', required=false),
@ApiImplicitParam(name = 'histCenterClip', value = 'Adjust center for min max clip (defaults to 0.5) range is 0..1', defaultValue="0.5", paramType = 'query', dataType = 'number', required=false),
@ApiImplicitParam(name = 'histCenter', value = 'Histogram Center Calculation',defaultValue = '',allowableValues="true,false", paramType = 'query', dataType = 'boolean', required=false),
@ApiImplicitParam(name = 'srs', value = 'srs', defaultValue = '', allowableValues="EPSG:4326, EPSG:3857", paramType = 'query', dataType = 'string', required=false),
@ApiImplicitParam(name = 'outputRadiometry', value = 'Output radiometry', defaultValue = 'ossim_uint8', allowableValues="ossim_uint8,ossim_uint11,ossim_uint16,ossim_sint16,ossim_float32,ossim_float64", paramType = 'query', dataType = 'string', required=true),
Expand All @@ -281,6 +314,7 @@ class ChipperController {
@ApiImplicitParam(name = 'keepBands', value = 'Determine if we auto adjust bands or not', defaultValue = "false", paramType = 'query', dataType = 'boolean', required=false),
@ApiImplicitParam(name = 'padThumbnail', value = 'Add padding to the output to make it square', defaultValue = "false", paramType = 'query', dataType = 'boolean', required=false),
@ApiImplicitParam(name = 'transparent', value = 'Enable transparent if the outputFormat supports it', defaultValue = "true", paramType = 'query', dataType = 'boolean', required=false),
@ApiImplicitParam(name = 'gamma', value = 'Gamma correction', defaultValue = "", paramType = 'query', dataType = 'number', required=false),
])
def ortho() {
runChipperCommand("ortho")
Expand Down Expand Up @@ -334,6 +368,26 @@ class ChipperController {
Histogram operations used can be none, auto-minmax, auto-percentile, std-stretch-1, std-stretch-2, or std-stretch-3
* **histBiasFactor**
Used as a bias factor in the auto clip calculations. Currently only used for auto min max clip adjustmjents. You can add a small bias to control how the clip points
are located during the aut calculations
* **histLinearClip**
Is a comma separated pair of low then high value. **Example:** 8,180 defines a low clip of pixel value 8 and a high clip of pixel value 180.
* **histLinearNormClip**
Is a comma separated pair of low then high normalized values. **Example:** .2,.8 defines a low clip of a normalized penetration of .2 or 20% and high
clip of .8 which is calculated as a penetration of 80 percent from start of the histogram bins or you can read it as a 20% penetration from the end
of the histogram bins.
* **histCenterClip**
You can adjust the center value used in the min max clip. The value ranges from 0 to 1 and defaults to 0.5. Closer to 0 the more the center will be shifted to the min value causing
the image to become brighter. If the value gets closer to 1 the closer to the max clip it will be causing the overall image to become darker.
* **histCenter**
Histogram should be calculated based on the center of the request
Expand Down Expand Up @@ -368,7 +422,11 @@ class ChipperController {
* **transparent**
Enables transparent output if the **outputFormat** supports it """)
Enables transparent output if the **outputFormat** supports it
* **gamma**
Gamma correction value. Good values between lighter .01 to darker 2 """)
@ApiImplicitParams([
@ApiImplicitParam(name = 'images[0].file', value = 'first filename', defaultValue = '', paramType = 'query', dataType = 'string', required=true),
@ApiImplicitParam(name = 'images[0].entry', value = 'Image entry in the first file', defaultValue = '', paramType = 'query', dataType = 'integer', required=false),
Expand All @@ -390,6 +448,10 @@ class ChipperController {
@ApiImplicitParam(name = 'cutHeight', value = 'Cut height in pixels', defaultValue = '', paramType = 'query', dataType = 'integer', required=false),
@ApiImplicitParam(name = 'cutWmsBbox', value = 'Cut wms bbox format', defaultValue = '', paramType = 'query', dataType = 'string', required=false),
@ApiImplicitParam(name = 'histOp', value = 'Histogram Operation',defaultValue = '',allowableValues="none,auto-minmax,auto-percentile,std-stretch-1,std-stretch-2,std-stretch-3", paramType = 'query', dataType = 'string', required=false),
@ApiImplicitParam(name = 'histBiasFactor', value = 'bias adjustment for auto calculations (defaults to the identity = 1) range is 0..2', defaultValue="1", paramType = 'query', dataType = 'number', required=false),
@ApiImplicitParam(name = 'histLinearClip', value = 'Histogram clip comma separated: **low**,**high** ',defaultValue = '',allowableValues="", paramType = 'query', dataType = 'string', required=false),
@ApiImplicitParam(name = 'histLinearNormClip', value = 'Histogram normalized clip comma separated: **low**,**high**',defaultValue = '',allowableValues="", paramType = 'query', dataType = 'string', required=false),
@ApiImplicitParam(name = 'histCenterClip', value = 'Adjust center for min max clip (defaults to 0.5) range is 0..1', defaultValue="0.5", paramType = 'query', dataType = 'number', required=false),
@ApiImplicitParam(name = 'histCenter', value = 'Histogram Center Calculation',defaultValue = '',allowableValues="true,false", paramType = 'query', dataType = 'boolean', required=false),
@ApiImplicitParam(name = 'srs', value = 'srs', defaultValue = '', allowableValues="EPSG:4326, EPSG:3857", paramType = 'query', dataType = 'string', required=false),
@ApiImplicitParam(name = 'outputRadiometry', value = 'Output radiometry', defaultValue = 'ossim_uint8', allowableValues="ossim_uint8,ossim_uint11,ossim_uint16,ossim_sint16,ossim_float32,ossim_float64", paramType = 'query', dataType = 'string', required=true),
Expand All @@ -399,6 +461,7 @@ class ChipperController {
@ApiImplicitParam(name = 'keepBands', value = 'Determine if we auto adjust bands or not', defaultValue = "false", paramType = 'query', dataType = 'boolean', required=false),
@ApiImplicitParam(name = 'padThumbnail', value = 'Add padding to the output to make it square', defaultValue = "false", paramType = 'query', dataType = 'boolean', required=false),
@ApiImplicitParam(name = 'transparent', value = 'Enable transparent if the outputFormat supports it', defaultValue = "true", paramType = 'query', dataType = 'boolean', required=false),
@ApiImplicitParam(name = 'gamma', value = 'Gamma correction', defaultValue = "", paramType = 'query', dataType = 'number', required=false)
])
def psm(){
runChipperCommand("psm")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ import io.swagger.annotations.*
@Api(value = "/imageSpace",
description = "API operations in image space."
)
class ImageSpaceController
import grails.async.web.AsyncController

class ImageSpaceController implements AsyncController
{
def imageSpaceService

Expand Down Expand Up @@ -58,14 +60,16 @@ class ImageSpaceController
@ApiImplicitParam(name = 'geom', value = 'Geometry file', paramType = 'query', dataType = 'string', required=false),
@ApiImplicitParam(name = 'bands', value = 'Bands', defaultValue="", paramType = 'query', dataType = 'string', required=false),
@ApiImplicitParam(name = 'histOp', value = 'Histogram Operation',defaultValue = '',allowableValues="none,auto-minmax,auto-percentile,std-stretch-1,std-stretch-2,std-stretch-3", paramType = 'query', dataType = 'string', required=false),
@ApiImplicitParam(name = 'histCenterClip', value = 'Adjust center for min max clip (defaults to 0.5)', defaultValue="0.5", paramType = 'query', dataType = 'number', required=false),
@ApiImplicitParam(name = 'sharpenMode', value = 'Sharpen Operation',allowableValues="none,light,heavy", defaultValue="none", paramType = 'query', dataType = 'string', required=false),
@ApiImplicitParam(name = 'sharpenPercent', value = 'Sharpen Percentage (0..1)', defaultValue="0.0", paramType = 'query', dataType = 'number', required=false),
@ApiImplicitParam(name = 'resamplerFilter', value = 'Which resampling engine to use', defaultValue = '', allowableValues= "nearest-neighbor, bilinear, cubic, gaussian, blackman, bspline, hanning, hamming, hermite, mitchell, quadratic, sinc, magic", paramType = 'query', dataType = 'string', required=false),
@ApiImplicitParam(name = 'brightness', value = 'Brightness Operation',defaultValue="0.0", paramType = 'query', dataType = 'number', required=false),
@ApiImplicitParam(name = 'contrast', value = 'Contrast Operation',defaultValue="1.0", paramType = 'query', dataType = 'number', required=false),
@ApiImplicitParam(name = 'histCenterTile', value = 'Use Center File for Histogram', defaultValue="false", paramType = 'query', dataType = 'boolean', required=false),
@ApiImplicitParam(name = 'transparent', value = 'Enable transparent if the outputFormat supports it', defaultValue="true", paramType = 'query', dataType = 'boolean', required=false),
@ApiImplicitParam(name = 'numResLevels', value = 'Number of Resolution Levels', defaultValue="1", paramType = 'query', dataType = 'integer', required=false)
@ApiImplicitParam(name = 'numResLevels', value = 'Number of Resolution Levels', defaultValue="1", paramType = 'query', dataType = 'integer', required=false),
@ApiImplicitParam(name = 'gamma', value = 'Gamma correction', defaultValue="", paramType = 'query', dataType = 'number', required=false)
])
def getTile(/*GetTileCommand cmd*/)
{
Expand Down Expand Up @@ -206,6 +210,8 @@ class ImageSpaceController
])
def getThumbnail(/*GetThumbnailCommand cmd*/)
{
def ctx = startAsync()
ctx.start {
def cmd = new GetThumbnailCommand()

BindUtil.fixParamNames( GetThumbnailCommand, params )
Expand Down Expand Up @@ -246,5 +252,7 @@ class ImageSpaceController
}
}
}
ctx.complete()
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ class ChipperCommand implements Validateable
String histOp
String histLinearClip
String histLinearNormClip
String histCenterClip
String histBiasFactor
String imageSpaceScaleX
String imageSpaceScaleY
String lutFile
Expand All @@ -64,6 +66,8 @@ class ChipperCommand implements Validateable
Boolean upIsUp
String combinerType

Double gamma

// parameters that are not part of chipper
String outputFormat
Boolean transparent
Expand Down Expand Up @@ -102,6 +106,8 @@ class ChipperCommand implements Validateable
histOp(nullable:true, blank:true)
histLinearClip(nullable:true, blank:true)
histLinearNormClip(nullable:true, blank:true)
histCenterClip(nullable:true, blank:true)
histBiasFactor(nullable:true, blank:true)
imageSpaceScaleX(nullable:true, blank:true)
imageSpaceScaleY(nullable:true, blank:true)
keepBands(nullable:true, blank:true)
Expand All @@ -125,7 +131,7 @@ class ChipperCommand implements Validateable
tileSize(nullable:true, blank:true)
upIsUp(nullable:true, blank:true)
combinerType(nullable:true, blank:true)

gamma(nullable:true,blank:true)
outputFormat(nullable:true, blank:true)
transparent(nullable:true, blank:true)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,10 @@ class GetTileCommand implements Validateable
String hist
String ovr
String geom

void setOutputFormat(String format)
{
Double gamma

void setOutputFormat(String format)
{
if(format.split("/").size() == 1)
{
this.outputFormat = "image/${format.toLowerCase()}"
Expand All @@ -44,6 +45,6 @@ class GetTileCommand implements Validateable
{
this.outputFormat = format
}
}
}

}
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
pluginManagement {
repositories {
maven { url System.getenv('REPOSITORY_MANAGER_URL') }
maven { url ossimMavenProxy }
gradlePluginPortal()
}
}
Expand Down

0 comments on commit 53499c8

Please sign in to comment.