Using ArcGIS Server 10.4 and ESRI JSAPI 3.16, I am displaying a raster in the Map object using a dynamic "Raster" workspace (see: Trying to use ArcGISDynamicMapServiceLayer to display RasterDataSource). Now, I'm trying to display the top pixel value counts with, ultimately, user-specified colors but, for the purposes of illustration, let's just say the top 3 pixel value counts in red, green and blue, respectively.
If I had an ArcGISImageServiceLayer, I can use a RasterFunction to define a Colormap and setRenderingRule to use that RasterFunction. I've figured out how to do this but, alas, setRenderingRule isn't available for an ArcGISDynamicMapServiceLayer. Okay...
Then I tried to figure out if there's a way to do something similar with an ArcGISDynamicMapServiceLayer using the LayerDrawingOptions, setting its renderer to the RasterFunction and applying that to the ArcGISDynamicMapServiceLayer with the setLayerDrawingOptions method. No luck there.
I've looked at the Renderer classes and thought the UniqueValueRenderer might serve the purpose, but it requires a field that contains the "feature" attribute field that contains the data value. Obviously, I don't have a "feature" attribute table, but there is a raster attribute table associated with the TIFs being displayed but besides that, there's not symbology for a raster that I can use in this.
Can anyone suggest a combination of classes that might enable a client application to submit something like a color map to a raster displayed via a dynamic Raster workspace in an ArcGISDynamicMapServiceLayer?
As always, any suggestions that might point in a direction I haven't thought of yet are appreciated.