rdf4j-postgis  Version 0.1.0.0
IsGrayscale Class Reference
Inheritance diagram for IsGrayscale:
Collaboration diagram for IsGrayscale:

Public Member Functions

String getURI ()
 
boolean attribute (GridCoverage raster)
 
Value evaluate (ValueFactory valueFactory, Value... args) throws ValueExprEvaluationException
 

Member Function Documentation

◆ attribute()

boolean attribute ( GridCoverage  raster)

Reimplemented from RasterAttributeBinaryFunction.

19  {
20  RenderedImage image=raster.render(null);
21  image.getData().getDataBuffer().getDataType();
22  // Test the type
23  if ( image.getData().getDataBuffer().getDataType() == BufferedImage.TYPE_BYTE_GRAY ) return true ;
24  if ( image.getData().getDataBuffer().getDataType() == BufferedImage.TYPE_USHORT_GRAY ) return true ;
25  // Test the number of channels / bands
26  if ( image.getData().getNumBands() == 1 ) return true ; // Single channel => gray scale
27  return false;
28  }

◆ evaluate()

Value evaluate ( ValueFactory  valueFactory,
Value...  args 
) throws ValueExprEvaluationException
inherited
12  {
13  // TODO Auto-generated method stub
14  return null;
15  }

◆ getURI()

String getURI ( )
14  {
15  return POSTGIS.st_isGrayscale.stringValue();
16  }

References POSTGIS.st_isGrayscale.