Skip to content
This repository has been archived by the owner on Sep 4, 2024. It is now read-only.

Commit

Permalink
Multiscale configuration API (#21)
Browse files Browse the repository at this point in the history
## Changes

### Added

- `acquire-device-properties`: A `uint8_t` member `multiscale` to
`StorageProperties`.
- `acquire-device-properties`: A corresponding entry in
`StoragePropertyMetadata`.
- `acquire-device-properties`: A convenience function for enabling multiscale storage, similar to the function for
  setting chunking properties.
  • Loading branch information
aliddell authored Jul 5, 2023
1 parent 32cedd3 commit 2862818
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 0 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Added

- `acquire-device-properties`: A `uint8_t` member `enable_multiscale` of `StorageProperties`.
- `acquire-device-properties`: A corresponding entry in `StoragePropertyMetadata`.
- `acquire-device-properties`: A convenience function for enabling multiscale, similar to the function for
setting chunking properties.

## [0.1.3](https://github.com/acquire-project/acquire-core-libs/compare/v0.1.2...v0.1.3) - 2023-06-27

### Changed
Expand Down
11 changes: 11 additions & 0 deletions src/acquire-device-properties/device/props/storage.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,17 @@ storage_properties_set_chunking_props(struct StorageProperties* out,
return 0;
}

int
storage_properties_set_enable_multiscale(struct StorageProperties* out,
uint8_t enable)
{
CHECK(out);
out->enable_multiscale = enable;
return 1;
Error:
return 0;
}

int
storage_properties_init(struct StorageProperties* out,
uint32_t first_frame_id,
Expand Down
16 changes: 16 additions & 0 deletions src/acquire-device-properties/device/props/storage.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ extern "C"
uint32_t width, height, planes;
} tile;
} chunking;

/// Enable multiscale storage if true.
uint8_t enable_multiscale;
};

struct StoragePropertyMetadata
Expand All @@ -47,6 +50,11 @@ extern "C"
struct Property width, height, planes;
} tile;
} chunking;

struct storage_property_metadata_multiscale_s
{
uint8_t supported;
} multiscale;
};

/// Initializes StorageProperties, allocating string storage on the heap
Expand Down Expand Up @@ -117,6 +125,14 @@ extern "C"
uint32_t tile_planes,
uint64_t max_bytes_per_chunk);

/// @brief Set multiscale properties for `out`.
/// Convenience function to enable multiscale.
/// @returns 1 on success, otherwise 0
/// @param[in, out] out The storage properties to change.
/// @param[in] enable A flag to enable or disable multiscale.
int storage_properties_set_enable_multiscale(struct StorageProperties* out,
uint8_t enable);

/// Free's allocated string storage.
void storage_properties_destroy(struct StorageProperties* self);

Expand Down

0 comments on commit 2862818

Please sign in to comment.