本文整理汇总了C#中PixelType类的典型用法代码示例。如果您正苦于以下问题:C# PixelType类的具体用法?C# PixelType怎么用?C# PixelType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PixelType类属于命名空间,在下文中一共展示了PixelType类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: GetHistogramEXT
public static void GetHistogramEXT(HistogramTargetEXT target, bool reset, PixelFormat format, PixelType type, IntPtr values)
{
Debug.Assert(Delegates.pglGetHistogramEXT != null, "pglGetHistogramEXT not implemented");
Delegates.pglGetHistogramEXT((Int32)target, reset, (Int32)format, (Int32)type, values);
CallLog("glGetHistogramEXT({0}, {1}, {2}, {3}, 0x{4})", target, reset, format, type, values.ToString("X8"));
DebugCheckErrors();
}
开发者ID:MagmaiKH,项目名称:OpenGL.Net,代码行数:7,代码来源:Gl.EXT_histogram.cs
示例2: GetColorTableSGI
public static void GetColorTableSGI(ColorTableTargetSGI target, PixelFormat format, PixelType type, IntPtr table)
{
Debug.Assert(Delegates.pglGetColorTableSGI != null, "pglGetColorTableSGI not implemented");
Delegates.pglGetColorTableSGI((Int32)target, (Int32)format, (Int32)type, table);
CallLog("glGetColorTableSGI({0}, {1}, {2}, 0x{3})", target, format, type, table.ToString("X8"));
DebugCheckErrors();
}
开发者ID:MagmaiKH,项目名称:OpenGL.Net,代码行数:7,代码来源:Gl.SGI_color_table.cs
示例3: Build1DMipmapLevel
Int32 Build1DMipmapLevel(TextureTarget target, Int32 internalFormat, Int32 width, PixelFormat format, PixelType type, Int32 level, Int32 @base, Int32 max, IntPtr data)
{
unsafe
{
return Delegates.gluBuild1DMipmapLevels((TextureTarget)target, (Int32)internalFormat, (Int32)width, (PixelFormat)format, (PixelType)type, (Int32)level, (Int32)@base, (Int32)max, (IntPtr)data);
}
}
开发者ID:dakahler,项目名称:alloclave,代码行数:7,代码来源:Glu.cs
示例4: Build1DMipmap
Int32 Build1DMipmap(TextureTarget target, Int32 internalFormat, Int32 width, PixelFormat format, PixelType type, IntPtr data)
{
unsafe
{
return Delegates.gluBuild1DMipmaps((TextureTarget)target, (Int32)internalFormat, (Int32)width, (PixelFormat)format, (PixelType)type, (IntPtr)data);
}
}
开发者ID:dakahler,项目名称:alloclave,代码行数:7,代码来源:Glu.cs
示例5: GetConvolutionFilterEXT
public static void GetConvolutionFilterEXT(ConvolutionTargetEXT target, PixelFormat format, PixelType type, IntPtr image)
{
Debug.Assert(Delegates.pglGetConvolutionFilterEXT != null, "pglGetConvolutionFilterEXT not implemented");
Delegates.pglGetConvolutionFilterEXT((Int32)target, (Int32)format, (Int32)type, image);
CallLog("glGetConvolutionFilterEXT({0}, {1}, {2}, 0x{3})", target, format, type, image.ToString("X8"));
DebugCheckErrors();
}
开发者ID:MagmaiKH,项目名称:OpenGL.Net,代码行数:7,代码来源:Gl.EXT_convolution.cs
示例6: TexImage2D
public static unsafe void TexImage2D( TextureTarget target, int level, int internalformat, int width, int height, int border, PixelFormat format, PixelType type, byte[] pixels )
{
if (pixels == null) OpenGLNative.TexImage2D( target, level, internalformat, width, height, border, format, type, null );
else fixed (byte* bytes = &pixels[0])
{
OpenGLNative.TexImage2D( target, level, internalformat, width, height, border, format, type, bytes );
}
}
开发者ID:werwolfby,项目名称:Managed-OpenGL,代码行数:8,代码来源:OpenGL.cs
示例7: TextureFormat
public TextureFormat(PixelFormat format, SizedInternalFormat internalFormat, int bitsPerPixel, bool compressed, PixelType texType)
{
_format = format;
_internalformat = internalFormat;
_bitsPerPixel = bitsPerPixel;
_compressed = compressed;
_texType = texType;
}
开发者ID:fmotagarcia,项目名称:sparrow-sharp,代码行数:8,代码来源:TextureFormat.cs
示例8: TextureAttributes
public TextureAttributes(int Width, int Height, int Depth, PixelInternalFormat InternalFormat, OpenTK.Graphics.OpenGL.PixelFormat PixelFormat, PixelType PixelType)
{
this.Width = Width;
this.Height = Height;
this.Depth = Depth;
this.InternalFormat = InternalFormat;
this.PixelFormat = PixelFormat;
this.PixelType = PixelType;
}
开发者ID:elliotwoods,项目名称:VVVV.Nodes.OpenGL,代码行数:9,代码来源:Texture.cs
示例9: Attachment
public Attachment(AttachmentPoint attachmentPoint, PixelFormat pixelFormat, PixelInternalFormat pixelInternalFormat, PixelType pixelType, int index = 0, bool mipmaps = false)
{
AttachmentPoint = attachmentPoint;
PixelFormat = pixelFormat;
PixelInternalFormat = pixelInternalFormat;
PixelType = pixelType;
Index = index;
MipMaps = mipmaps;
}
开发者ID:johang88,项目名称:triton,代码行数:9,代码来源:Definition.cs
示例10: AttachDepth
public Framebuffer AttachDepth(PixelInternalFormat internalFormat, PixelFormat format, PixelType type, InterpolationMode interpolation)
{
this.BufferTextures[FboAttachment.DepthAttachment] = new Texture2D (TextureTarget.Texture2D, internalFormat, format, type, interpolation, false, this.Width, this.Height);
this.Bind ();
this.BufferTextures[FboAttachment.DepthAttachment].Bind ();
GL.FramebufferTexture (this.Target, FramebufferAttachment.DepthAttachment, this.BufferTextures[FboAttachment.DepthAttachment].TextureId, 0);
this.Unbind ();
return this;
}
开发者ID:splitandthechro,项目名称:nginz,代码行数:9,代码来源:FrameBuffer.cs
示例11: Create
public void Create(PixelFormat srcFormat, PixelType srcType, IntPtr srcData)
{
GL.GenTextures(1, out glTexture);
GL.BindTexture(TextureTarget.Texture2D, glTexture);
GL.TexParameterI(TextureTarget.Texture2D, TextureParameterName.TextureMinFilter, ref minFilter);
GL.TexParameterI(TextureTarget.Texture2D,TextureParameterName.TextureMagFilter, ref magFilter);
GL.TexParameterI(TextureTarget.Texture2D, TextureParameterName.TextureWrapS, ref this.wrapS);
GL.TexParameterI(TextureTarget.Texture2D, TextureParameterName.TextureWrapT, ref this.wrapT);
GL.TexImage2D(TextureTarget.Texture2D, 0, format, width, height, 0, srcFormat, srcType, srcData);
}
开发者ID:RonOHara-GG,项目名称:WebGLRenderer,代码行数:10,代码来源:Texture.cs
示例12: AttachTexture
public Framebuffer AttachTexture(FboAttachment attachment, DrawBuffersEnum mode, PixelInternalFormat internalFormat, PixelFormat format, PixelType type, InterpolationMode interpolation)
{
this.Attachments.Add (mode);
this.BufferTextures[attachment] = new Texture2D (TextureTarget.Texture2D, internalFormat, format, type, interpolation, false, this.Width, this.Height);
this.Bind ();
this.BufferTextures[attachment].Bind ();
GL.FramebufferTexture (this.Target, (FramebufferAttachment) mode, this.BufferTextures[attachment].TextureId, 0);
this.Unbind ();
return this;
}
开发者ID:splitandthechro,项目名称:nginz,代码行数:10,代码来源:FrameBuffer.cs
示例13: GetOpenGLTextureFormat
internal static void GetOpenGLTextureFormat(SurfaceFormat format, out PixelInternalFormat glInternalFormat, out PixelFormat glFormat, out PixelType glType)
{
glInternalFormat = PixelInternalFormat.Rgba;
glFormat = PixelFormat.Rgba;
glType = PixelType.UnsignedByte;
switch (format)
{
case SurfaceFormat.Color:
glInternalFormat = PixelInternalFormat.Rgba;
glFormat = PixelFormat.Rgba;
glType = PixelType.UnsignedByte;
break;
case SurfaceFormat.Bgr565:
glInternalFormat = PixelInternalFormat.Rgb;
glFormat = PixelFormat.Rgb;
glType = PixelType.UnsignedShort565;
break;
case SurfaceFormat.Bgra4444:
glInternalFormat = PixelInternalFormat.Rgba4;
glFormat = PixelFormat.Rgba;
glType = PixelType.UnsignedShort4444;
break;
case SurfaceFormat.Bgra5551:
glInternalFormat = PixelInternalFormat.Rgba;
glFormat = PixelFormat.Rgba;
glType = PixelType.UnsignedShort5551;
break;
case SurfaceFormat.Alpha8:
glInternalFormat = PixelInternalFormat.Luminance;
glFormat = PixelFormat.Luminance;
glType = PixelType.UnsignedByte;
break;
case SurfaceFormat.Dxt1:
glInternalFormat = PixelInternalFormat.CompressedRgbaS3tcDxt1Ext;
glFormat = (PixelFormat)All.CompressedTextureFormats;
break;
case SurfaceFormat.Dxt3:
glInternalFormat = PixelInternalFormat.CompressedRgbaS3tcDxt3Ext;
glFormat = (PixelFormat)All.CompressedTextureFormats;
break;
case SurfaceFormat.Dxt5:
glInternalFormat = PixelInternalFormat.CompressedRgbaS3tcDxt5Ext;
glFormat = (PixelFormat)All.CompressedTextureFormats;
break;
case SurfaceFormat.Single:
glInternalFormat = PixelInternalFormat.R32f;
glFormat = PixelFormat.Red;
glType = PixelType.Float;
break;
default:
throw new NotSupportedException();
}
}
开发者ID:greenboxal,项目名称:greenbox3d,代码行数:55,代码来源:Texture.cs
示例14: PixelFormatDescriptor
public PixelFormatDescriptor(
System.Drawing.Imaging.PixelFormat drawingFormat,
PixelInternalFormat glInternalPixelFormat,
PixelFormat glPixelFormat,
PixelType glPixelType)
{
DrawingFormat = drawingFormat;
GLPixelInternalFormat = glInternalPixelFormat;
GLPixelFormat = glPixelFormat;
GLPixelType = glPixelType;
}
开发者ID:kidaa,项目名称:Pulse,代码行数:11,代码来源:PixelFormatDescriptor.cs
示例15: Create
public static Texture Create(int width, int height, PixelInternalFormat internalFormat = PixelInternalFormat.Rgba8
, PixelFormat inputPixelFormat = PixelFormat.Rgba, PixelType type = PixelType.UnsignedByte)
{
var texture = new Texture();
//create empty texture of given size
texture.LoadPixels(IntPtr.Zero, width, height, internalFormat, inputPixelFormat, type);
//set default parameters for filtering and clamping
texture.FilterBilinear();
texture.WrapMode(TextureWrapMode.Repeat);
return texture;
}
开发者ID:danielscherzer,项目名称:Framework,代码行数:11,代码来源:Texture.cs
示例16: TexImage2D
public void TexImage2D(
TextureTarget target,
int level,
PixelInternalFormat internalFormat,
int width,
int height,
int border,
PixelFormat format,
PixelType type,
IntPtr pixels)
{
GraphicsContext.Assert();
GL.TexImage2D(target, level, internalFormat, width, height, border, format, type, pixels);
OpenGlErrorHelper.CheckGlError();
}
开发者ID:rmckirby,项目名称:XogoEngine,代码行数:15,代码来源:TextureAdapter.cs
示例17: GLTexture2D
public GLTexture2D(string name, IBitmap bmp, bool genmipmaps = false, bool linearfilter = false, OpenTK.Graphics.OpenGL.PixelFormat sourceformat = OpenTK.Graphics.OpenGL.PixelFormat.Bgra, PixelInternalFormat destformat = PixelInternalFormat.Rgba, PixelType sourcetype = PixelType.UnsignedByte)
: base(name, TextureTarget.Texture2D, bmp.Width, bmp.Height)
{
tex = GL.GenTexture();
GL.BindTexture(TextureTarget.Texture2D, tex);
reattempt_load:
try {
/*BitmapData bmpdata = bmp.LockBits(new Rectangle(0, 0, bmp.Width, bmp.Height), ImageLockMode.ReadOnly, System.Drawing.Imaging.PixelFormat.Format32bppArgb);
GL.TexImage2D(TextureTarget.Texture2D, 0, destformat, bmpdata.Width, bmpdata.Height, 0, sourceformat, sourcetype, bmpdata.Scan0);
bmp.UnlockBits(bmpdata);*/
bmp.TexImage2D(destformat);
}
catch(OutOfMemoryException) {
GC.WaitForPendingFinalizers();
goto reattempt_load;
}
if(genmipmaps)
{
GL.GenerateMipmap(GenerateMipmapTarget.Texture2D);
if(linearfilter)
{
GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMinFilter, (int)TextureMinFilter.LinearMipmapLinear);
GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMagFilter, (int)TextureMagFilter.Linear);
}
else
{
GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMinFilter, (int)TextureMinFilter.NearestMipmapNearest);
GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMagFilter, (int)TextureMagFilter.Nearest);
}
}
else
{
if(linearfilter)
{
GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMinFilter, (int)TextureMinFilter.Linear);
GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMagFilter, (int)TextureMagFilter.Linear);
}
else
{
GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMinFilter, (int)TextureMinFilter.Nearest);
GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMagFilter, (int)TextureMagFilter.Nearest);
}
}
GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureWrapS, (int)TextureWrapMode.Clamp);
GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureWrapT, (int)TextureWrapMode.Clamp);
}
开发者ID:RcSepp,项目名称:global_view,代码行数:48,代码来源:GLTexture2D.cs
示例18: AddTarget
public void AddTarget(PixelInternalFormat format, PixelType type)
{
Texture target = new Texture();
// Bind the texture
target.Bind();
// Give an empty image to OpenGL
GL.TexImage2D(TextureTarget.Texture2D, 0, format, gameWindow.Width, gameWindow.Height, 0, PixelFormat.Rgba, type, IntPtr.Zero);
// Poor filtering. Needed !
GL.TexParameter(TextureTarget.Texture2D,
TextureParameterName.TextureMinFilter,
(int)TextureMagFilter.Nearest);
GL.TexParameter(TextureTarget.Texture2D,
TextureParameterName.TextureMagFilter,
(int)TextureMagFilter.Nearest);
targets.Add(target);
}
开发者ID:Lazzu,项目名称:Hatzap,代码行数:20,代码来源:FrameBuffer.cs
示例19: TexImage2D
public static void TexImage2D(TextureTarget target, Int32 level, Int32 internalformat, Int32 width, Int32 height, Int32 border, PixelFormat format, PixelType type, IntPtr pixels)
{
Debug.Assert(Delegates.pglTexImage2D != null, "pglTexImage2D not implemented");
Delegates.pglTexImage2D((Int32)target, level, internalformat, width, height, border, (Int32)format, (Int32)type, pixels);
CallLog("glTexImage2D({0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, 0x{8})", target, level, internalformat, width, height, border, format, type, pixels.ToString("X8"));
DebugCheckErrors();
}
开发者ID:MagmaiKH,项目名称:OpenGL.Net,代码行数:7,代码来源:Gl.VERSION_1_0.cs
示例20: TexImage1D
public static void TexImage1D(TextureTarget target, Int32 level, Int32 internalformat, Int32 width, Int32 border, PixelFormat format, PixelType type, Object pixels)
{
GCHandle pin_pixels = GCHandle.Alloc(pixels, GCHandleType.Pinned);
try {
TexImage1D(target, level, internalformat, width, border, format, type, pin_pixels.AddrOfPinnedObject());
} finally {
pin_pixels.Free();
}
}
开发者ID:MagmaiKH,项目名称:OpenGL.Net,代码行数:9,代码来源:Gl.VERSION_1_0.cs
注:本文中的PixelType类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论