void ofSetPixelStorei(int stride){ if (OF_ROUND_UP_8 (stride) == stride) { glPixelStorei (GL_UNPACK_ALIGNMENT, 8); } else if (OF_ROUND_UP_4 (stride) == stride) { glPixelStorei (GL_UNPACK_ALIGNMENT, 4); } else if (OF_ROUND_UP_2 (stride) == stride) { glPixelStorei (GL_UNPACK_ALIGNMENT, 2); } else { glPixelStorei (GL_UNPACK_ALIGNMENT, 1); } }
void ofSetPixelStoreiAlignment(GLenum pname, int stride){ if (OF_ROUND_UP_8 (stride) == stride) { glPixelStorei (pname, 8); } else if (OF_ROUND_UP_4 (stride) == stride) { glPixelStorei (pname, 4); } else if (OF_ROUND_UP_2 (stride) == stride) { glPixelStorei (pname, 2); } else { glPixelStorei (pname, 1); } }
void ofSetPixelStorei(int w, int bpc, int numChannels){ int stride = w * numChannels * bpc; if (OF_ROUND_UP_8 (stride) == stride) { glPixelStorei (GL_UNPACK_ALIGNMENT, 8); } else if (OF_ROUND_UP_4 (stride) == stride) { glPixelStorei (GL_UNPACK_ALIGNMENT, 4); } else if (OF_ROUND_UP_2 (stride) == stride) { glPixelStorei (GL_UNPACK_ALIGNMENT, 2); } else { glPixelStorei (GL_UNPACK_ALIGNMENT, 1); } }