Changes between Version 34 and Version 35 of WKTRaster/SpecificationWorking01


Ignore:
Timestamp:
12/11/09 09:06:30 (15 years ago)
Author:
pracine
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • WKTRaster/SpecificationWorking01

    v34 v35  
    200200
    201201'''ST_Band(raster, band) -> raster'''[[BR]]
    202 Return a single band from a multiband raster. If "band" is greater than the value returned by ST_GetNumBands(), the function returns the last band. This function should be used to select a band before converting it to JPEG, TIFF, PNG, SVG or KML with the corresponding function. e.g. '''ST_AsJPEG(ST_Band(raster, band), quality)
    203 
     202Return a single band from a multiband raster. If "band" is greater than the value returned by ST_GetNumBands(), the function returns the last band. This function should be used to select a band before converting it to JPEG, TIFF, PNG, SVG or KML with the corresponding function. e.g. '''ST_AsTIFF(ST_Band(raster, band))
     203
     204----
    204205'''ST_AsJPEG(raster, quality) -> JPEG as "bytea"'''[[BR]]
    205206Return the raster as a JPEG encoded as a PostgreSQL bytea. By default quality is set to 75, but this option can be used to select other values. Values must be in the range 10-100. Low values result in higher compression ratios, but poorer image quality. Values above 95 are not meaningfully better quality but can but substantially larger. (copied from http://www.gdal.org/frmt_jpeg.html)
    206207
    207 ----
     208
    208209'''Open Question:''' Is JPEG export limited to raster having 8 bit unsigned integer pixeltype (8BUI)?
    209210
     
    229230mloskot: ATM, I have no thoughts on this issue.
    230231
    231 ----
    232232'''Open Question:''' Is JPEG export limited to raster having 1 or 3 bands?
    233233
     
    237237
    238238mloskot: I agree, the answer should be yes.
     239
     240'''Here is an attempt to define the different versions of the function:'''
     241
     242The most minimalistic versions of the function should assume band 1, 2 and 3 as being r, g, b and the quality equal to 75:
     243
     244ST_AsJPEG(raster) -quality = 75
     245
     246A variant allow specifying the quality:
     247
     248ST_AsJPEG(raster, integer)
     249
     250Another variant should enable us to specify which band correspond to the r, the g and the b:
     251
     252ST_AsJPEG(raster, integer, integer, integer) - raster, rband, gband, bband, quality=75
     253ST_AsJPEG(raster, integer, integer, integer, integer) - raster, rband, gband, bband, quality
     254
     255Another version should be designed to be used with a future ST_Band(raster) function. In this case there is no attempt to extract r, g or b band from any passed raster:
     256
     257ST_AsJPEG(raster, raster, raster) and ST_AsJPEG(raster, raster, raster, quality)
     258
     259Another series should allow converting 1 band raster with pixel of type 8BUI to a grayscale JPEG:
     260
     261ST_AsJPEG(raster, "GRAYSCALE") - convert only band 1 with quality = 75
     262ST_AsJPEG(raster, "GRAYSCALE", integer) - convert only band 1 with specified quality
     263ST_AsJPEG(raster, integer, "GRAYSCALE") - allow specifying the band number to convert
     264ST_AsJPEG(raster, integer, "GRAYSCALE", integer) - allow specifying the band number to convert and the quality
     265
     266Another series should allow converting 1 band raster of ANY pixel type to a grayscale JPEG. Pixel types different than 8BUI should be mapped according to specified min, max values and a mapping mode: "MaxMinValue" (default) or "MaxMinType".
     267
     268ST_AsJPEG(raster, "GRAYSCALE", min, max, text) - convert only band 1 with quality = 75
     269ST_AsJPEG(raster, "GRAYSCALE", integer, min, max, text) - convert only band 1 with specified quality
     270ST_AsJPEG(raster, integer, "GRAYSCALE", min, max, text) - allow specifying the band number to convert
     271ST_AsJPEG(raster, integer, "GRAYSCALE", integer, min, max, text) - allow specifying the band number to convert and the quality
     272
     273
    239274----
    240275