Helper for resampling operations. More...
#include <spatmod/imagehelperresample.h>
Public Types | |
| enum | FLAGS { FLAG_None = 0, FLAG_PullSinglePixels = 0x01, FLAG_CheckTargetValidity = 0x02 } |
Public Member Functions | |
| HELPER_RESAMPLE () | |
| ~HELPER_RESAMPLE () | |
| ERRVALUE | BeginSection (const SECTION &SrcSection, BUFFER &WorkBuffer) |
| ERRVALUE | BeginSection (const SECTION &SrcSection) |
| ERRVALUE | ConvertCoordTgtToSrc (const TRANS2D_MAPGEN &TransTgtToSrc, const DOUBLE_ARRAY< DPOINT2D > &TgtCoord, DOUBLE_ARRAY< DPOINT2D > &SrcCoord, UINT8 *CoordValid) const |
| void | FreeWorkBuffer () |
| ERRVALUE | ProcessRow (INT32 TgtRow, BUFFER &TgtBuffer, const DOUBLE_ARRAY< DPOINT2D > &SrcCoord) |
| ERRVALUE | ReserveWorkBuffer (INT32 MaxColumns, INT32 MaxRows) |
| ERRVALUE | Setup (STAGE *pStageSrc, RESAMPLEMETHOD ResampleMethod, FLAGS flags=FLAG_None) |
Helper for resampling operations.
Provides method for processing single row. Optimized to avoid memory allocation during row processing.
| SPATMOD::IMAGE::HELPER_RESAMPLE::HELPER_RESAMPLE | ( | ) |
Constructor.
| SPATMOD::IMAGE::HELPER_RESAMPLE::~HELPER_RESAMPLE | ( | ) |
Destructor.
| ERRVALUE SPATMOD::IMAGE::HELPER_RESAMPLE::BeginSection | ( | const SECTION & | SrcSection, | |
| BUFFER & | WorkBuffer | |||
| ) |
Begin processing section using shared work buffer.
| SrcSection | Section of source to resample from | |
| WorkBuffer | Work buffer, must remain in existence during processing |
Begin processing section using own work buffer.
Work buffer will be resized if necessary.
| SrcSection | Section of source to resample from |
| ERRVALUE SPATMOD::IMAGE::HELPER_RESAMPLE::ConvertCoordTgtToSrc | ( | const TRANS2D_MAPGEN & | TransTgtToSrc, | |
| const DOUBLE_ARRAY< DPOINT2D > & | TgtCoord, | |||
| DOUBLE_ARRAY< DPOINT2D > & | SrcCoord, | |||
| UINT8 * | CoordValid | |||
| ) | const |
Convert coordinates from target to source.
Only points with a corresponding nonzero entry in CoordValid may be processed. Any points that cannot be converted will have the corresponding CoordValid entry set to 0.
| TransTgtToSrc | Transformation from target to source coordinates | |
| TgtCoord | Target coordinates | |
| SrcCoord | Source coordinates returned, cannot be same array as TgtCoord | |
| CoordValid | Source coordinate validity passed/returned, cannot be NULL |
| void SPATMOD::IMAGE::HELPER_RESAMPLE::FreeWorkBuffer | ( | ) | [inline] |
Free work buffer.
| ERRVALUE SPATMOD::IMAGE::HELPER_RESAMPLE::ProcessRow | ( | INT32 | TgtRow, | |
| BUFFER & | TgtBuffer, | |||
| const DOUBLE_ARRAY< DPOINT2D > & | SrcCoord | |||
| ) |
Process row of pixels into target buffer.
| TgtRow | Row in target buffer | |
| TgtBuffer | Target buffer | |
| SrcCoord | Coordinates in source image, number of items determines number of output pixels |
Reserve work buffer with specified initial maximum size.
| MaxColumns | Maximum expected columns | |
| MaxRows | Maximum expected rows |
| ERRVALUE SPATMOD::IMAGE::HELPER_RESAMPLE::Setup | ( | STAGE * | pStageSrc, | |
| RESAMPLEMETHOD | ResampleMethod, | |||
| FLAGS | flags = FLAG_None | |||
| ) |
Setup to process specified source.
| pStageSrc | Pointer to source stage | |
| ResampleMethod | Resampling method | |
| flags | Optional flags |
1.6.1