Reading the .cube file
A .cube file is plain text: an optional TITLE, then LUT_3D_SIZE N, then N cubed data rows, each holding the output red, green, and blue for one position in the table. Rows are ordered with blue changing fastest, so the first row is the R=G=B=0 corner and the last is R=G=B=1. Size 17 means 4,913 rows; size 33 means 35,937; the row count is a quick validity check.