#144 closed defect (fixed)
psKernel - sample code in doc. is wrong
| Reported by: | Owned by: | Paul Price | |
|---|---|---|---|
| Priority: | high | Milestone: | |
| Component: | PSLib SDRS | Version: | unspecified |
| Severity: | trivial | Keywords: | |
| Cc: |
Description
In section 4.9.1.1 (SDRS v6), there is the following sample code:
kernelRows = psAlloc(myImage->nRows * sizeof(float));
but what you need is sizeof(float*) instead. Actually, I think the text
itself specifies the requirement without the code segment, so it could be
removed from the document altogether. The actual implementation will look
something like this anyway:
result->p_kernelRows = psAlloc(sizeof(psF32*)*numRows);
psF32 kernelRows = result->p_kernelRows;
psF32 imageRows = result->p_data->data.F32;
for (int i = 0; i < numRows; i++) {
kernelRows[i] = imageRows[i] - xMin;
}
result->kernel = kernelRows - yMin;
Change History (4)
comment:1 by , 22 years ago
| Owner: | changed from to |
|---|
comment:2 by , 22 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
comment:3 by , 22 years ago
| Keywords: | VERIFIED added |
|---|
Should be fixed in SDRS-07 and ADD-06 (7 September 2004).
comment:4 by , 22 years ago
| Keywords: | VERIFIED removed |
|---|

Removed the code segment. Thanks for the feedback!