Connection
Base URL, credentials and a reachable server.
Inspect bitmap_rows.py for row padding and storage orientation before using its byte offset in an image reader.
Base URL, credentials and a reachable server.
A model available through the configured endpoint.
Context limits and tool support are determined by the model and server.
def bitmap_row_offset(width, height, row, top_down=False):
if any(type(v) is not int for v in (width, height, row)) or type(top_down) is not bool:
raise ValueError("bitmap.type")
if not 1 <= width <= 4096 or not 1 <= height <= 4096 or not 0 <= row < height:
raise ValueError("bitmap.range")
stride = ((3*width+3)//4)*4
physical_row = row if top_down else height-1-row
return physical_row*stride, stride