v2.0.2
Instance Methods | Properties | List of all members
<CC3RenderSurface> Protocol Reference

#import <CC3RenderSurfaces.h>

Inheritance diagram for <CC3RenderSurface>:
Inheritance graph
[legend]

Instance Methods

(void) - activate
 
(void) - clearColorAndDepthContent
 
(void) - clearColorContent
 
(void) - clearDepthContent
 
(void) - clearStencilContent
 
(CGImageRef) - createCGImage
 
(CGImageRef) - createCGImageFrom:
 
(void) - readColorContentFrom:into:
 
(void) - replaceColorPixels:withContent:
 
- Instance Methods inherited from <CC3Object>
(id) - asWeakReference
 
(NSString *) - fullDescription
 
(id) - resolveWeakReference
 

Properties

id< CC3RenderSurfaceAttachmentcolorAttachment
 
id< CC3RenderSurfaceAttachmentdepthAttachment
 
BOOL isFullCoverage
 
BOOL isOnScreen
 
CC3IntSize size
 
id< CC3RenderSurfaceAttachmentstencilAttachment
 
CC3Viewport viewport
 

Detailed Description

A CC3RenderSurface is a surface on which rendering or drawing can occur.

Method Documentation

- (void) activate

Activates this surface in the GL engine.

Subsequent GL activity will be rendered to this surface.

Reimplemented in CC3SurfaceSection.

- (void) clearColorAndDepthContent

Clears the color and depth content of this surface, activating this surface and enabling color and depth writing if needed.

Reimplemented in CC3SurfaceSection.

- (void) clearColorContent

Clears the color content of this surface, activating this surface and enabling color writing if needed.

Reimplemented in CC3SurfaceSection.

- (void) clearDepthContent

Clears the depth content of this surface, activating this surface and enabling depth writing if needed.

Reimplemented in CC3SurfaceSection.

- (void) clearStencilContent

Clears the stencil content of this surface, activating this surface and enabling stencil writing if needed.

Reimplemented in CC3SurfaceSection.

- (CGImageRef) createCGImage

Returns a newly created CGImageRef from the contents of this surface.

The size of the returned image will be the same as the size of this surface.

You are responsible for releasing the returned image by calling the CGImageRelease function.

Reimplemented in CC3SurfaceSection.

- (CGImageRef) createCGImageFrom: (CC3Viewport rect

Returns a newly created CGImageRef from the contents of this surface that are contained within the specified rectangle.

The size of the returned image will be the same as the size of the rectangle.

You are responsible for releasing the returned image by calling the CGImageRelease function.

Reimplemented in CC3SurfaceSection.

- (void) readColorContentFrom: (CC3Viewport rect
into: (ccColor4B *)  colorArray 

Reads the content of the range of pixels defined by the specified rectangle from the color attachment of this surface, into the specified array, which must be large enough to accommodate the number of pixels covered by the specified rectangle.

Content is written to the specified array left to right across each row, starting at the row at the bottom of the image, and ending at the row at the top of the image. The pixel content is packed tightly into the specified array, with no gaps left at the end of each row. The last pixel of one row is immediately followed by the first pixel of the next row.

This surface does not have to be the active surface to invoke this method. If this surface is not the active surface, it will temporarily be made active, and when pixel reading has finished, the currently active surface will be restored. This allows color to be read from one surface while rendering to another surface.

Not all surfaces have readable color content. In particular, content cannot be read from some system framebuffers.

This method should be used with care, since it involves making a synchronous call to query the state of the GL engine. This method will not return until the GL engine has executed all previous drawing commands in the pipeline. Excessive use of this method will reduce GL throughput and performance.

Reimplemented in CC3SurfaceSection.

- (void) replaceColorPixels: (CC3Viewport rect
withContent: (ccColor4B *)  colorArray 

If the colorAttachment of this surface supports pixel replacement, replaces a portion of the content of the color attachment by writing the specified array of pixels into the specified rectangular area within the attachment, The specified content replaces the pixel data within the specified rectangle.

The specified content array must be large enough to contain content for the number of pixels in the specified rectangle.

Not all color attachments support pixel replacement. In particular, pixel replacement is available only for color attachments whose content is provided by an underlying texture. If the color attachment does not support pixel replacement, this method will do nothing.

Content is read from the specified array left to right across each row of pixels within the specified image rectangle, starting at the row at the bottom of the rectangle, and ending at the row at the top of the rectangle.

Within the specified array, the pixel content should be packed tightly, with no gaps left at the end of each row. The last pixel of one row should immediately be followed by the first pixel of the next row.

The pixels in the specified array are in standard 32-bit RGBA. If the format of the underlying storage does not match this format, the specified array will be converted to the format of the underlying storage before being inserted. Be aware that this conversion will reduce the performance of this method. For maximum performance, match the format of the underlying storage to the 32-bit RGBA format of the specified array. However, keep in mind that the 32-bit RGBA format consumes more memory than most other formats, so if performance is of lesser concern, you may choose to minimize the memory requirements of this texture by choosing a more memory efficient storage format.

Reimplemented in CC3SurfaceSection.

Property Documentation

- (id<CC3RenderSurfaceAttachment>) colorAttachment
readwritenonatomicretain

The surface attachment to which color data is rendered.

To save memory, attachments can be shared between surfaces of the same size, if the contents of the attachment are only required for the duration of the rendering to each surface.

- (id<CC3RenderSurfaceAttachment>) depthAttachment
readwritenonatomicretain

The surface attachment to which depth data is rendered.

To save memory, attachments can be shared between surfaces of the same size, if the contents of the attachment are only required for the duration of the rendering to each surface. For instance, the same depth attachment might be used when rendering to several different color attachments of different surfaces.

- (BOOL) isFullCoverage
readnonatomicassign

Returns whether this surface section covers the entire renderable area of a view.

- (BOOL) isOnScreen
readwritenonatomicassign

Returns whether this surface is an on-screen surface.

The initial value of this property is NO. For instances that represent on-screen framebuffers, set this property to YES.

- (CC3IntSize) size
readwritenonatomicassign

Returns the size of this surface in pixels.

- (id<CC3RenderSurfaceAttachment>) stencilAttachment
readwritenonatomicretain

The surface attachment to which stencil data is rendered.

To save memory, attachments can be shared between surfaces of the same size, if the contents of the attachment are only required for the duration of the rendering to each surface.

- (CC3Viewport) viewport
readnonatomicassign

Returns a viewport suitable for rendering to this surface.


The documentation for this protocol was generated from the following file: