I would like to make all floats (in particular figures) to be somewhat distinct from the text. For this, I am adding
\hrulefill above and below the figure/table. This looks nice when a figure is in the middle of the page, with paragraphs above and below, but less so when the figure is by itself or at the top or bottom of the page.
Is it possible to know where a figure was positioned, such that I can specify
if at top: show bottom rule only if at bottom: show top rule only if in middle: show both if placed on whole page by itself: show none
Is that possible?