diff options
author | Michael Bien <[email protected]> | 2010-01-25 19:43:11 +0100 |
---|---|---|
committer | Michael Bien <[email protected]> | 2010-01-25 19:43:11 +0100 |
commit | b4ae8c794974e91878ca005bf2eaaa95781301a3 (patch) | |
tree | fe5ee3073f9d20a31c04709ee847057aa7741c81 /src/com/mbien/opencl/CLImage3d.java | |
parent | 8e2cfb1179a97f7ed1248132429e1e60663b0d42 (diff) |
CLImage support for CLCommandQueue.
Diffstat (limited to 'src/com/mbien/opencl/CLImage3d.java')
-rw-r--r-- | src/com/mbien/opencl/CLImage3d.java | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/com/mbien/opencl/CLImage3d.java b/src/com/mbien/opencl/CLImage3d.java index c0928a48..fd5cde3e 100644 --- a/src/com/mbien/opencl/CLImage3d.java +++ b/src/com/mbien/opencl/CLImage3d.java @@ -13,8 +13,11 @@ import static com.mbien.opencl.CLException.*; */ public final class CLImage3d<B extends Buffer> extends CLImage<B> { - private CLImage3d(CLContext context, B directBuffer, CLImageFormat format, long id) { - super(context, directBuffer, format, id); + public final int depth; + + private CLImage3d(CLContext context, B directBuffer, CLImageFormat format, int width, int height, int depth, long id) { + super(context, directBuffer, format, width, height, id); + this.depth = depth; } static <B extends Buffer> CLImage3d<B> createImage(CLContext context, B directBuffer, @@ -26,12 +29,12 @@ public final class CLImage3d<B extends Buffer> extends CLImage<B> { long id = cl.clCreateImage3D(context.ID, flags, format, width, height, depth, rowPitch, slicePitch, directBuffer, err); checkForError(err.get(), "can not create 2d image"); - return new CLImage3d<B>(context, directBuffer, format, id); + return new CLImage3d<B>(context, directBuffer, format, width, height, depth, id); } @Override public <T extends Buffer> CLImage3d<T> cloneWith(T directBuffer) { - return new CLImage3d<T>(context, directBuffer, format, ID); + return new CLImage3d<T>(context, directBuffer, format, width, height, depth, ID); } /** @@ -45,6 +48,6 @@ public final class CLImage3d<B extends Buffer> extends CLImage<B> { * Returns the depth of this image in pixels. */ public int getDepth() { - return (int)imageInfo.getLong(CL_IMAGE_DEPTH); + return depth; } } |