From c5dae5bba63a082fb8eac420b3b70786cdec54e1 Mon Sep 17 00:00:00 2001
From: Michael Bien <mbien@fh-landshut.de>
Date: Mon, 28 Jun 2010 03:31:55 +0200
Subject: image factory methods for CLContext.

---
 src/com/jogamp/opencl/CLImageFormat.java | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

(limited to 'src/com/jogamp/opencl/CLImageFormat.java')

diff --git a/src/com/jogamp/opencl/CLImageFormat.java b/src/com/jogamp/opencl/CLImageFormat.java
index e3eb3667..17b7bb6c 100644
--- a/src/com/jogamp/opencl/CLImageFormat.java
+++ b/src/com/jogamp/opencl/CLImageFormat.java
@@ -7,6 +7,8 @@ import static com.jogamp.opencl.CL.*;
 /**
  * Represents the OpenCL image format with its channeltype and order.
  * @author Michael Bien
+ * @see CLContext#getSupportedImage2dFormats(com.jogamp.opencl.CLMemory.Mem[])
+ * @see CLContext#getSupportedImage3dFormats(com.jogamp.opencl.CLMemory.Mem[])
  */
 public final class CLImageFormat {
 
@@ -56,6 +58,32 @@ public final class CLImageFormat {
         return "CLImageFormat["+getImageChannelOrder()+" "+getImageChannelDataType()+"]";
     }
 
+    @Override
+    public boolean equals(Object obj) {
+        if (obj == null) {
+            return false;
+        }
+        if (getClass() != obj.getClass()) {
+            return false;
+        }
+        final CLImageFormat other = (CLImageFormat) obj;
+        if (this.getImageChannelDataType() != other.getImageChannelDataType()) {
+            return false;
+        }
+        if (this.getImageChannelOrder() != other.getImageChannelOrder()) {
+            return false;
+        }
+        return true;
+    }
+
+    @Override
+    public int hashCode() {
+        int hash = 5;
+        hash = 47 * hash + (this.getImageChannelDataType() != null ? this.getImageChannelDataType().hashCode() : 0);
+        hash = 47 * hash + (this.getImageChannelOrder() != null ? this.getImageChannelOrder().hashCode() : 0);
+        return hash;
+    }
+
     /**
      * Specifies the number of channels and the channel layout i.e. the memory
      * layout in which channels are stored in the image.
-- 
cgit v1.2.3