Add a new OutputWindows control#346
Draft
davidplowman wants to merge 5 commits into
Draft
Conversation
Ensure platform specific controls are advertised as still being available after calling configure(). Additionally, provide the correct defaults for the platform specific ScalerCrops control, even if there's only a single stream. This is more convenient for applications which no longer have to perform different actions depending on whether it's available. Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
We sometimes need to know which stream (according to its index in the camera configuration) corresponds to which ISP output branch (0 or 1). Previously this was stored within the cropParams_ (for use by the ScalerCrops controls). Here we remove the ISP index to its own array, making it easier for other functions to refer to it in future. Additionally, when implementing cropping, we rename the "index" variable to "ispIndex" for future clarity. Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
This control allows the camera images to occupy only a smaller "window" within the overall output. It is principally intended for machine learning applications that might want to create letterboxed versions of the camera image directly in a larger square output. Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
Add a small OutputInfo structure to store some extra useful information about the output buffers, such as the pixel alignment required for output format, and the minimum image width we can make before having to resort to software downscaling. This information will be used by future features. Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
We add the OutputWindows control and apply it to the pipeline at the same time as the ScalerCrops (the applyScalerCrops function is renamed to applyScalerCropsAndWindows). The platform specific implementation for the Pi5/PiSP checks the validity (size and alignment) of the output windows using the extra OutputInfo that is now available. We only allow modification of the output window when no software downscaling is required, as this limits the amount of pipeline reconfiguration we might need to perform at runtime (though we could revisit this at a later date). Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
Collaborator
Author
|
@naushir Not a thing to merge, but would appreciate any feedback before I consider trying to upstream! |
Collaborator
|
We already support offsets (in FrameBuffer::Plane) and stride, I'd rather use that than a new control. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This control lets you direct the camera image at only a smaller "window" within the normal output image.
It is intended primarily for ML applications that might want to create a square image but where the camera output is "letterboxed" within it.