/// <summary> /// Convenience function. Checks if a context supports a specific image format /// </summary> /// <param name="flags"></param> /// <param name="type"></param> /// <param name="channelOrder"></param> /// <param name="channelType"></param> /// <returns>true if the image format is supported, false otherwise</returns> public bool SupportsImageFormat(MemFlags flags, MemObjectType type, ChannelOrder channelOrder, ChannelType channelType) { CLImageFormat[] imageFormats = GetSupportedImageFormats(flags, type); foreach (CLImageFormat imageFormat in imageFormats) { if (imageFormat.ChannelOrder == channelOrder && imageFormat.ChannelType == channelType) { return(true); } } return(false); }
public bool IsSupported(Context context, MemFlags flags, MemObjectType type) { ImageFormat[] supportedFormats = GetSupportedImageFormats(context, flags, type); foreach (ImageFormat supported in supportedFormats) { if (supported == this) { return(true); } } return(false); }
/// <summary> /// Convenience function. Checks if a context supports a specific image format /// </summary> /// <param name="flags"></param> /// <param name="type"></param> /// <param name="channelOrder"></param> /// <param name="channelType"></param> /// <returns>true if the image format is supported, false otherwise</returns> public Boolean SupportsImageFormat(MemFlags flags, MemObjectType type, ChannelOrder channelOrder, ChannelType channelType) { var imageFormats = this.GetSupportedImageFormats(flags, type); foreach (var imageFormat in imageFormats) { if (imageFormat.ChannelOrder == channelOrder && imageFormat.ChannelType == channelType) { return(true); } } return(false); }
/// <summary> /// Query which ImageFormats are supported by this context /// </summary> /// <param name="flags"></param> /// <param name="type"></param> /// <returns></returns> public CLImageFormat[] GetSupportedImageFormats(MemFlags flags, MemObjectType type) { uint numImageFormats; CLImageFormat[] imageFormats; ErrorCode result; result = OpenCL.GetSupportedImageFormats(ContextID, (ulong)flags, (uint)type, (uint)0, null, out numImageFormats); if (result != ErrorCode.SUCCESS) { throw new OpenCLException("GetSupportedImageFormats failed with error code " + result, result); } imageFormats = new CLImageFormat[numImageFormats]; result = OpenCL.GetSupportedImageFormats(ContextID, (ulong)flags, (uint)type, numImageFormats, imageFormats, out numImageFormats); if (result != ErrorCode.SUCCESS) { throw new OpenCLException("GetSupportedImageFormats failed with error code " + result, result); } return(imageFormats); }
/// <summary> /// Query which ImageFormats are supported by this context /// </summary> /// <param name="flags"></param> /// <param name="type"></param> /// <returns></returns> public ImageFormat[] GetSupportedImageFormats(MemFlags flags, MemObjectType type) { UInt32 numImageFormats; ImageFormat[] imageFormats; ErrorCode result; result = OpenCL.GetSupportedImageFormats(this.ContextID, (UInt64)flags, (UInt32)type, 0, null, out numImageFormats); if (result != ErrorCode.SUCCESS) { throw new OpenCLException("GetSupportedImageFormats failed with error code " + result, result); } imageFormats = new ImageFormat[numImageFormats]; result = OpenCL.GetSupportedImageFormats(this.ContextID, (UInt64)flags, (UInt32)type, numImageFormats, imageFormats, out numImageFormats); if (result != ErrorCode.SUCCESS) { throw new OpenCLException("GetSupportedImageFormats failed with error code " + result, result); } return(imageFormats); }
internal extern static unsafe ErrorCode GetSupportedImageFormats(IntPtr context, MemFlags flags, MemObjectType image_type, uint num_entries, ImageFormat *image_formats, uint *num_image_formats);
/// <summary> /// Convenience function. Checks if a context supports a specific image format /// </summary> /// <param name="flags"></param> /// <param name="type"></param> /// <param name="channelOrder"></param> /// <param name="channelType"></param> /// <returns>true if the image format is supported, false otherwise</returns> public bool SupportsImageFormat(MemFlags flags, MemObjectType type, ChannelOrder channelOrder, ChannelType channelType) { ImageFormat[] imageFormats = GetSupportedImageFormats(flags, type); foreach (ImageFormat imageFormat in imageFormats) { if (imageFormat.ChannelOrder == channelOrder && imageFormat.ChannelType == channelType) return true; } return false; }
/// <summary> /// Query which ImageFormats are supported by this context /// </summary> /// <param name="flags"></param> /// <param name="type"></param> /// <returns></returns> public ImageFormat[] GetSupportedImageFormats(MemFlags flags, MemObjectType type) { uint numImageFormats; ImageFormat[] imageFormats; ErrorCode result; result = OpenCL.GetSupportedImageFormats(ContextID, (ulong)flags, (uint)type, (uint)0, null, out numImageFormats); if( result!=ErrorCode.SUCCESS ) throw new OpenCLException("GetSupportedImageFormats failed with error code " + result, result); imageFormats = new ImageFormat[numImageFormats]; result = OpenCL.GetSupportedImageFormats(ContextID, (ulong)flags, (uint)type, numImageFormats, imageFormats, out numImageFormats); if (result != ErrorCode.SUCCESS) throw new OpenCLException("GetSupportedImageFormats failed with error code " + result, result); return imageFormats; }
public static ImageFormat[] GetSupportedImageFormats(Context context, MemFlags flags, MemObjectType imageType, out ErrorCode error) { uint imageFormatCount; error = GetSupportedImageFormats(context, flags, imageType, 0, null, out imageFormatCount); if (error != ErrorCode.Success) { return(new ImageFormat[0]); } var imageFormats = new ImageFormat[imageFormatCount]; error = GetSupportedImageFormats(context, flags, imageType, imageFormatCount, imageFormats, out imageFormatCount); if (error != ErrorCode.Success) { return(new ImageFormat[0]); } return(imageFormats); }
public static ImageFormat[] GetSupportedImageFormats(Context context, MemFlags flags, MemObjectType imageType, out ErrorCode error) { uint imageFormatCount; error = GetSupportedImageFormats(context, flags, imageType, 0, null, out imageFormatCount); if (error != ErrorCode.Success) return new ImageFormat[0]; var imageFormats = new ImageFormat[imageFormatCount]; error = GetSupportedImageFormats(context, flags, imageType, imageFormatCount, imageFormats, out imageFormatCount); if (error != ErrorCode.Success) return new ImageFormat[0]; return imageFormats; }
public static ImageFormat[] GetSupportedImageFormats(Context context, MemFlags flags, MemObjectType type) { uint count = 0; unsafe { Native.Call(Native.GetSupportedImageFormats(context.Handle, flags, type, 0, null, &count)); } ImageFormat[] result = new ImageFormat[count]; unsafe { fixed(ImageFormat *p_result = result) { Native.Call(Native.GetSupportedImageFormats(context.Handle, flags, type, count, p_result, null)); } } return(result); }
internal extern static unsafe int GetSupportedImageFormats(IntPtr context, MemFlags flags, MemObjectType image_type, uint num_entries, ImageFormat* image_formats, uint* num_image_formats);
public static Error clGetSupportedImageFormats(OpenCLContext context, MemFlags flags, MemObjectType image_type, Int32 num_entries, [Out] ImageFormat[] image_formats, Int32 num_image_formats) { Console.WriteLine("Calling Error clGetSupportedImageFormats(OpenCLContext context, MemFlags flags, MemObjectType image_type, Int32 num_entries, [Out] ImageFormat[] image_formats, Int32 num_image_formats)"); return default(Error); }
public static extern Error clGetSupportedImageFormats(OpenCLContext context, MemFlags flags, MemObjectType image_type, Int32 num_entries, [Out] ImageFormat[] image_formats, Int32 num_image_formats);
private static extern OpenCLErrorCode clGetSupportedImageFormats(IntPtr context, MemFlags flags, MemObjectType imageType, uint numEntries, [Out] [MarshalAs(UnmanagedType.LPArray)] ImageFormat[] imageFormats, out uint numImageFormats);
public static OpenCLErrorCode GetSupportedImageFormats(ContextHandle context, MemFlags flags, MemObjectType imageType, uint numEntries, ImageFormat[] imageFormats, out uint numImageFormats) { return clGetSupportedImageFormats((context as IHandleData).Handle, flags, imageType, numEntries, imageFormats, out numImageFormats); }