MRaster examples 21.0.0.0
Image Processing Library
|
One way to get images from a ramCanvas into OpenGL. More...
Go to the source code of this file.
One way to get images from a ramCanvas into OpenGL.
Copyright (c) 2022, Mitchell Jay Richling http://www.mitchr.me/ All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
We illustrate how to use the exportRasterData() member to get data suitable for use as an OpenGL image. Note that ramCanvas.h also supports directly an internal representation that is the same as that used by OpenGL — so one can actually use the raw pixel store in the ramCanvas as OpenGL image data. This program illustrates how one might get OpenGL image data if the ramCanvas for some reason was not internally compatible with OpenGL. Note this same technique allows easy integration with other libraries requiring similar data formats.
Definition in file glut_image.cpp.