10#ifndef OAKFIELD_FIELD_PATCH_H
11#define OAKFIELD_FIELD_PATCH_H
130 double min_x,
double min_y,
double max_x,
184 size_t out_capacity);
SimResult
Return codes shared by libsimcore modules.
Definition field.h:29
SimResult sim_field_patch_iter_rows(const SimFieldPatchView *view, SimFieldPatchRowIterFn row_fn, void *userdata)
Iterate physical rows in a patch view.
SimResult sim_field_patch_from_xywh(size_t field_width, size_t field_height, size_t x0, size_t y0, size_t width, size_t height, SimFieldPatch *out_patch)
Construct a patch from x/y origin and width/height extents.
@ SIM_FIELD_PATCH_FLAG_TOUCHES_BOUNDARY
Definition field_patch.h:26
@ SIM_FIELD_PATCH_FLAG_NONE
Definition field_patch.h:23
@ SIM_FIELD_PATCH_FLAG_IS_FULL_FIELD
Definition field_patch.h:25
@ SIM_FIELD_PATCH_FLAG_COVERS_FULL_ROWS
Definition field_patch.h:24
bool sim_field_patch_view_is_valid(const SimFieldPatchView *view)
Validate a patch view and its backing buffer-view layout.
SimResult(* SimFieldPatchRowIterFn)(size_t row_index, void *row_data, size_t row_length, void *userdata)
Row callback used by sim_field_patch_iter_rows().
Definition field_patch.h:67
size_t sim_field_patch_split_tiles(const SimFieldPatch *patch, size_t tile_width, size_t tile_height, SimFieldPatch *out_tiles, size_t out_capacity)
Split a patch into row-major tiles.
bool sim_field_patch_is_valid(const SimFieldPatch *patch)
Validate patch bounds, dimensions, and source-field extents.
SimResult sim_field_patch_full(size_t field_width, size_t field_height, SimFieldPatch *out_patch)
Construct a patch covering a complete field.
SimResult sim_field_patch_from_normalized_region(size_t field_width, size_t field_height, double min_x, double min_y, double max_x, double max_y, SimFieldPatch *out_patch)
Construct a patch from normalized [0, 1] coordinate bounds.
bool sim_field_patch_intersect(const SimFieldPatch *lhs, const SimFieldPatch *rhs, SimFieldPatch *out_patch)
Intersect two patches from the same field.
SimResult sim_field_patch_view_from_field(SimField *field, const SimFieldPatch *patch, bool readonly, SimFieldPatchView *out_view)
Create a zero-copy view over a patch of a row-major field.
Shared standalone buffer and buffer-view types.
Non-owning typed view over contiguous, strided, or indexed scalar storage.
Definition sim_buffer.h:41
Zero-copy view over a field patch.
Definition field_patch.h:48
SimFieldPatch patch
Definition field_patch.h:50
size_t shape_storage[2]
Definition field_patch.h:54
bool readonly
Definition field_patch.h:52
size_t stride_storage[2]
Definition field_patch.h:55
size_t row_stride
Definition field_patch.h:51
SimBufferView buffer_view
Definition field_patch.h:49
bool zero_copy
Definition field_patch.h:53
Rectangular non-empty region of a 2D field index space.
Definition field_patch.h:32
unsigned int flags
Definition field_patch.h:39
size_t width
Definition field_patch.h:35
size_t height
Definition field_patch.h:36
size_t field_height
Definition field_patch.h:38
size_t x0
Definition field_patch.h:33
size_t field_width
Definition field_patch.h:37
size_t y0
Definition field_patch.h:34
Owning multidimensional field.
Definition field.h:157