| 62 | |
| 63 | 1. GDALGetDatasetDriver |
| 64 | Fetch the driver to which this dataset relates. |
| 65 | 1. Open |
| 66 | If the filename contained in the GDALOpenInfo object has a case insensitive URI scheme of jpip or jpips the JPIPKAKDataset is created and initialised, otherwise NULL is returned. |
| 67 | 1. Initialize |
| 68 | Initialisation involves making an initial connection to the JPIP Server to establish a session and to retrieve the initial metadata about the image (ref. JPIP Sequence Diagram). |
| 69 | |
| 70 | If the connection fails, the function returns false and the Open function returns NULL indicating that opening the dataset with this driver failed. |
| 71 | |
| 72 | If the connection is successful, then subsequent requests to the JPIP server are made to retrieve all the available metadata about the image. Metadata items are set using the GDALMajorObject->SetMetadataItem in the "JPIP" domain. |
| 73 | |
| 74 | If the metadata returned from the server includes GeoJP2 UUID box, or a GMLJP2 XML box then this metadata is parsed and sets the geographic metadata of this dataset. |
| 75 | 1. GDALGetMetadata |
| 76 | C API to JPIPKAKDataset->GetMetadata |
| 77 | 1. GetMetadata |
| 78 | returns metadata for the "JPIP" domain, keys are "JPIP_NQUALITYLAYERS", "JPIP_NRESOLUTIONLEVELS", "JPIP_NCOMPS" and "JPIP_SPRECISION" |
| 79 | 1. GDALEndAsyncRasterIO |
| 80 | If the asynchronous raster IO is active and not required, the C API calls JPIPKAKDataset->EndAsyncRasterIO |
| 81 | 1. EndAsyncRasterIO |
| 82 | The JPIPKAKAsyncRasterIO object is deleted |
| 83 | 1. delete |
| 84 | 1. GDALBeginAsyncRasterIO |
| 85 | C API to JPIPKAKDataset->BeginAsyncRasterIO |
| 86 | 1. BeginAsyncRasterIO |
| 87 | The client has set the requested view window at 1:1 and have optionally set the discard level, quality layers and thread priority metadata items. |
| 88 | 1. Create |
| 89 | Creates a JPIPKAKAsyncRasterIO Object |
| 90 | 1. Start |
| 91 | Configures the kakadu machinery and starts a background thread (if not already running) to communicate to the server the current view window request. The background thread results in the kdu_cache object being updated until the JPIP server sends an "End Of Response" (EOR) message for the current view window request. |
| 92 | 1. GDALLockBuffer |
| 93 | C API to LockBuffer |
| 94 | 1. LockBuffer |
| 95 | Not implemented in JPIPKAKAsyncRasterIO, a lock is acquired in JPIPKAKAsyncRasterIO->GetNextUpdatedRegion |
| 96 | 1. GDALGetNextUpdatedRegion |
| 97 | C API to GetNextUpdatedRegion |
| 98 | 1. GetNextUpdatedRegion |
| 99 | The function decompresses the available data to generate an image (according to the dataset buffer type set in JPIPKAKDataset->BeginAsyncRasterIO) The window width, height (at the requested discard level) decompressed is returned in the region pointer and can be rendered by the client. The status of the rendering operation is one of GARIO_PENDING, GARIO_UPDATE, GARIO_ERROR, GARIO_COMPLETE from the GDALAsyncStatusType structure. GARIO_UPDATE, GARIO_PENDING require more reads of GetNextUpdatedRegion to get the full image data, this is the progressive rendering of JPIP. GARIO_COMPLETE indicates the window is complete. |
| 100 | |
| 101 | GDALAsyncStatusType is a structure used byGetNextUpdatedRegion to indicate whether the function should be called again when either kakadu has more data in its cache to decompress, or the server has not sent an End Of Response (EOR) message to indicate the request window is complete. |
| 102 | |
| 103 | The region passed into this function is passed by reference, and the caller can read this region when the result returns to find the region that has been decompressed. The image data is packed into the buffer, e.g. RGB if the region requested has 3 components. |
| 104 | 1. GDALUnlockBuffer |
| 105 | C Api to UnlockBuffer |
| 106 | 1. UnlockBuffer |
| 107 | Not implemented in JPIPKAKAsyncRasterIO, a lock is acquired in JPIPKAKAsyncRasterIO->GetNextUpdatedRegion |
| 108 | 1. Draw |
| 109 | Client renders image data |
| 110 | 1. GDALLockBuffer |
| 111 | 1. LockBuffer |
| 112 | 1. GDALGetNextUpdatedRegion |
| 113 | 1. GetNextUpdatedRegion |
| 114 | 1. GDALUnlockBuffer |
| 115 | 1. UnlockBuffer |
| 116 | 1. Draw |