|
NAMEresample_image - scale an image to new dimensions using a shaderSYNOPSISnilresample_image( vid:src, shid:shader, int:width, int:height, bool:nosynch ) resample_image( vid:src, shid:shader, int:width, int:height, vid:dst ) resample_image( vid:src, shid:shader, int:width, int:height, vid:dst, bool:nosynch ) DESCRIPTIONThis function takes the textured object referenced by src and resamples to width and height output using the shader specified in shader . If the second argument form is used, the backing store of dst will be replaced with the resampled output rather than the backing store of src . If the nosynch argument is specified (default to false), the local memory copy of the backing store will be ignored. This means that the backing can't be reconstructed if the engine suspends to an external source which might lead to the data being lost or the time to suspend increases to account for creation of the local copy.NOTES
EXAMPLEfunction resample_image0() local img = load_image("test.png"); local shid = build_shader(nil, [[ uniform sampler2D map_diffuse; varying vec2 texco; void resample_image0() { vec4 col = texture2D(map_diffuse, texco); gl_FragColor = vec4(1.0, col.g, col.b, 1.0); } ]], "redscale"); resample_image(img, shid, 640, 480); show_image(img); end MISUSEfunction resample_image0() local img = load_image("test.png"); local shid = build_shader(nil, [[ uniform sampler2D map_diffuse; varying vec2 texco; void resample_image0() { vec4 col = texture2D(map_diffuse, texco); gl_FragColor = vec4(1.0, col.g, col.b, 1.0); } ]], "redscale"); resample_image(img, shid, -64, -64); end MISUSEfunction resample_image1() local img = load_image("test.png"); local shid = build_shader(nil, [[ uniform sampler2D map_diffuse; varying vec2 texco; void resample_image1() { vec4 col = texture2D(map_diffuse, texco); gl_FragColor = vec4(1.0, col.g, col.b, 1.0); } ]], "redscale"); resample_image(img, shid, 6400, 4800); end SEE ALSO:
Visit the GSP FreeBSD Man Page Interface. |