iphone CGBitmapContextCreate()函数解释
来源:互联网 发布:狗头军师吴用 知乎 编辑:程序博客网 时间:2024/05/21 07:16
CGContextRef CGBitmapContextCreate (
void *data,
size_t width,
size_t height,
size_t bitsPerComponent,
size_t bytesPerRow,
CGColorSpaceRef colorspace,
CGBitmapInfo bitmapInfo
);
参数width代表被渲染内存区域的宽度。
参数height代表被渲染内存区域的高度。
参数bitsPerComponent被渲染内存区域中组件在屏幕每个像素点上需要使用的bits位,举例来说,如果使用32-bit像素和RGB颜色格式,那么RGBA颜色格式中每个组件在屏幕每个像素点上需要使用的bits位就为32/4=8。
参数bytesPerRow代表被渲染内存区域中每行所使用的bytes位数。
参数colorspace用于被渲染内存区域的“位图上下文”。
参数bitmapInfo指定被渲染内存区域的“视图”是否包含一个alpha(透视)通道以及每个像素相应的位置,除此之外还可以指定组件式是浮点值还是整数值。
网络上抄的一份代码:
@implementation GLView
#import <UIKit/UIKit.h>
#import <QuartzCore/QuartzCore.h>
#import <OpenGLES/ES2/gl.h>
#import <OpenGLES/ES2/glext.h>
#import <OpenGLES/ES1/gl.h>
#import <OpenGLES/ES1/glext.h>
@interface GLView : UIView {
@private
}
@end
#import "GLView.h"
@implementation GLView
// 设置LAYER class, 想要显示OPENGL的内容, 你需要把它缺省的layer设置为一个特殊的layer.
+ (Class)layerClass
{
}
// 设置layer为不透明, 缺省的话,CALayer是透明的, 透明的层对性能负荷很打,特别是Opengl的层.
- (void)setupLayer
{
}
// 创建content, 无论你需要OPENGL 帮你做什么 都需要这个EAGLContext, EAGLContext管理所以通过
// opengl进行的draw的信息.
- (void)setupContext
{
}
// 创建render buffer(渲染缓冲)
// renderbuffer用于存放渲染过的图像
// glGenRenderbuffers创建一个renderbuffer,返回一个用于标记renderbuffer的名字_colorRenderBuffer;
// 调用glBindRenderbuffer,告诉OPengl 刚创建的对象是GL_RENDERBUFFER类型的对象
// 最后再分配空间
- (void)setupRenderBuffer
{
}
// 创建一个FrameBuffer,(帧缓冲区)
//
- (void)setupFrameBuffer
{
}
// 在和vertextes shader打交道前, 先清理屏幕 显示另一种颜色.
- (void)render
{
//
//
glMatrixMode(GL_MODELVIEW);
}
void)loadTexture
{
// 注意:
// 加载的图片大小必须是2的N次方
}
- (id)initWithFrame:(CGRect)frame
{
}
- (void)dealloc
{
}
@end
- iphone CGBitmapContextCreate()函数解释
- iphone CGBitmapContextCreate()函数解释
- CGBitmapContextCreate 解释
- CGBitmapContextCreate函数
- CGBitmapContextCreate函数
- CGBitmapContextCreate函数
- CGBitmapContextCreate函数参数详解
- CGBitmapContextCreate函数参数详解
- iOS CGBitmapContextCreate函数
- CGBitmapContextCreate函数参数详解
- iOS开发--CGBitmapContextCreate函数
- CGBitmapContextCreate函数参数详解
- CGBitmapContextCreate函数参数详解 以及在 ios7下变化
- iPhone 的.m文件解释
- CGBitmapContextCreate()的使用方法
- [ios2] 关于CGBitmapContextCreate【转】
- CGBitmapContextCreate的一个error
- CGBitmapContextCreate参数详解
- 如何给在用的nginx添加新模块?
- Eclipse下开发JavaEE常见问题之——通过Eclipse部署工程无法访问
- 日语学习之歌曲 ほたる祭りの日 2
- UVA - 10369 Arctic Network (最小生成树)
- android ANR产生原因和解决办法
- iphone CGBitmapContextCreate()函数解释
- 装centos7后win7引导不见了 centos7下引导win7
- 圈子真的能决定你的未来吗?
- HDU—— 1040 As Easy As A+B
- nginx配置文件详解
- SSH-Struts(三)—ActionForm
- Hibernate left join
- JavaBean属性操作复习
- nginx 提供静态内容