glPixelTransfer

Aus DGL Wiki
Version vom 18. August 2005, 18:52 Uhr von La Boda (Diskussion | Beiträge)

(Unterschied) ← Nächstältere Version | Aktuelle Version (Unterschied) | Nächstjüngere Version → (Unterschied)
Wechseln zu: Navigation, Suche

glPixelTransfer


Name

glPixeltransferi, glPixelTransferf - Bestimmt den Pixeltransfer-Modus


Delphi-Spezifikation

procedure glPixelTransferi(pname : GLenum; param : GLint)
procedure glPixelTransferf(pname : GLenum; param : GLfloat)


Parameter

pname Gibt den symbolischen Namen des Pixeltransfer-Parameters an. Muss eine der folgenden Konstanten sein:

GL_MAP_COLOR, GL_MAP_STENCIL, GL_INDEX_SHIFT, GL_INDEX_OFFSET, GL_RED_SCALE, GL_RED_BIAS, GL_GREEN_SCALE, GL_GREEN_BIAS, GL_BLUE_SCALE, GL_BLUE_BIAS, GL_ALPHA_SCALE, GL_ALPHA_BIAS, GL_DEPTH_SCALE, oder GL_DEPTH_BIAS.

param Gibt den Wert an, dem pname zugewiesen wird.


Beschreibung

glPixelTransfer setzt die Pixeltransfer-Modi, die die Ausführung der untergeordneten Funtkionen glCopyPixels, glCopyTexImage1D, glCopyTexImage2D, glCopyTexSubImage1D, glCopyTexSubImage2D, glDrawPixels, glReadPixels, glTexImage1D, glTexImage2D, glTexSubImage1D und glTexSubImage2D beeinflussen. Die Algorithmen, die durch die Pixeltransfer-Modi spezifizert werden, werden nach dem Lesen vom Framebuffer auf die Pixels angewendet (bei glCopyPixels, glCopyTexImage1D, glCopyTexImage2D, glCopyTexSubImage1D, glCopyTexSubImage2D und glReadPixels) oder nach dem Entpacken aus dem Client-Speicher (bei glDrawPixels, glTexImage1D, glTexImage2D, glTexSubImage1D und glTexSubImage2D. Pixeltransfer - Operationen werden in der selben Reihenfolge und Weise vorgenommen, unabhängig vom Ergebnis der Pixeloperation. Die Modi zur Pixel-Speicherung (siehe glPixelStore kontrollieren das Entpacken der Pixel, die aus dem Client-Speicher ausgelesen werden und das Packen der Pixel, die wieder in den Client-Speicher geschrieben werden.

Pixeltransfer-Operationen behandeln vier grundlegende Pixeltypen: color, color index, depth und stencil.
color-Pixel bestehen aus vier Fließkomma-Zahlen mit unbestimmter MANTISSA (???WAS ist das??? -> http://mathworld.wolfram.com/Mantissa.html) und Exponenten, die die Größe angeben, so skaliert, dass 0 null und 1 voller Intensität entsprichen.
color-Indices bestehen aus einer einzelnen Fließkomma-Zahl mit unbestimmter Präzision hinter dem Komma.
depth-Pixel beinhalten eine einzelne Fließkomma-Zahl mit unbestimmter Mantissa und Exponenten, die die Größe angeben, so skaliert, dass 0.0 dem minimalen bzw 1.0 dem maximalen Depth-Buffer-Wert entsprichen.
stencil-Pixel bestehen aus einer einzelnen Fließkomma-Zahl, mit unbestimmter Präzision hinter dem Komma.

Werde das beizeiten übersetzten --BodaWaschl Color Each of the four color components is multiplied by a scale factor, then added to a bias factor. That is, the red component is multiplied by GL_RED_SCALE, then added to GL_RED_BIAS; the green component is multiplied by GL_GREEN_SCALE, then added to GL_GREEN_BIAS; the blue component is multiplied by GL_BLUE_SCALE, then added to GL_BLUE_BIAS; and the alpha component is multiplied by GL_ALPHA_SCALE, then added to GL_ALPHA_BIAS. After all four color components are scaled and biased, each is clamped to the range [0,1]. All color, scale, and bias values are specified with glPixelTransfer.

If GL_MAP_COLOR is true, each color component is scaled by the size of the corresponding color- to-color map, then replaced by the contents of that map indexed by the scaled component. That is, the red component is scaled by GL_PIXEL_MAP_R_TO_R_SIZE, then replaced by the contents of GL_PIXEL_MAP_R_TO_R indexed by itself. The green component is scaled by GL_PIXEL_MAP_G_TO_G_SIZE, then replaced by the contents of GL_PIXEL_MAP_G_TO_G indexed by itself. The blue component is scaled by GL_PIXEL_MAP_B_TO_B_SIZE, then replaced by the contents of GL_PIXEL_MAP_B_TO_B indexed by itself. And the alpha component is scaled by GL_PIXEL_MAP_A_TO_A_SIZE, then replaced by the contents of GL_PIXEL_MAP_A_TO_A indexed by itself. All components taken from the maps are then clamped to the range [0,1]. GL_MAP_COLOR is specified with glPixelTransfer. The contents of the various maps are specified with glPixelMap.

Color index Each color index is shifted left by GL_INDEX_SHIFT bits; any bits beyond the number of fraction bits carried by the fixed-point index are filled with zeros. If GL_INDEX_SHIFT is negative, the shift is to the right, again zero filled. Then GL_INDEX_OFFSET is added to the index. GL_INDEX_SHIFT and GL_INDEX_OFFSET are specified with glPixelTransfer. From this point, operation diverges depending on the required format of the resulting pixels. If the resulting pixels are to be written to a color index buffer, or if they are being read back to client memory in GL_COLOR_INDEX format, the pixels continue to be treated as indices. If GL_MAP_COLOR is true, each index is masked by 2n - 1, where n is GL_PIXEL_MAP_I_TO_I_SIZE, then replaced by the contents of GL_PIXEL_MAP_I_TO_I indexed by the masked value. GL_MAP_COLOR is specified with glPixelTransfer. The contents of the index map is specified with glPixelMap.

If the resulting pixels are to be written to an RGBA color buffer, or if they are read back to client memory in a format other than GL_COLOR_INDEX, the pixels are converted from indices to colors by referencing the four maps GL_PIXEL_MAP_I_TO_R, GL_PIXEL_MAP_I_TO_G, GL_PIXEL_MAP_I_TO_B, and GL_PIXEL_MAP_I_TO_A. Before being dereferenced, the index is masked by 2n - 1, where n is GL_PIXEL_MAP_I_TO_R_SIZE for the red map, GL_PIXEL_MAP_I_TO_G_SIZE for the green map, GL_PIXEL_MAP_I_TO_B_SIZE for the blue map, and GL_PIXEL_MAP_I_TO_A_SIZE for the alpha map. All components taken from the maps are then clamped to the range [0,1]. The contents of the four maps is specified with glPixelMap.

Depth Each depth value is multiplied by GL_DEPTH_SCALE, added to GL_DEPTH_BIAS, then clamped to the range [0,1].

Stencil Each index is shifted GL_INDEX_SHIFT bits just as a color index is, then added to GL_INDEX_OFFSET. If GL_MAP_STENCIL is true, each index is masked by 2n - 1, where n is GL_PIXEL_MAP_S_TO_S_SIZE, then replaced by the contents of GL_PIXEL_MAP_S_TO_S indexed by the masked value.

The following table gives the type, initial value, and range of valid values for each of the pixel transfer parameters that are set with glPixelTransfer.




_________________________________________________________ | pname | type | initial value | valid range | |________________|_________|_______________|_____________| | GL_MAP_COLOR | boolean | false | true/false | |GL_MAP_STENCIL | boolean | false | true/false | |GL_INDEX_SHIFT | integer | 0 | (-oo,oo) | |GL_INDEX_OFFSET | integer | 0 | (-oo,oo) | | GL_RED_SCALE | float | 1 | (-oo,oo) | |GL_GREEN_SCALE | float | 1 | (-oo,oo) | | GL_BLUE_SCALE | float | 1 | (-oo,oo) | |GL_ALPHA_SCALE | float | 1 | (-oo,oo) | |GL_DEPTH_SCALE | float | 1 | (-oo,oo) | | GL_RED_BIAS | float | 0 | (-oo,oo) | | GL_GREEN_BIAS | float | 0 | (-oo,oo) | | GL_BLUE_BIAS | float | 0 | (-oo,oo) | | GL_ALPHA_BIAS | float | 0 | (-oo,oo) | | GL_DEPTH_BIAS | float | 0 | (-oo,oo) | |________________|_________|_______________|_____________|

glPixelTransferf can be used to set any pixel transfer parameter. If the parameter type is boolean, 0 implies false and any other value implies true. If pname is an integer parameter, param is rounded to the nearest integer.

Likewise, glPixelTransferi can be used to set any of the pixel transfer parameters. Boolean parameters are set to false if param is 0 and to true otherwise. param is converted to floating point before being assigned to real- valued parameters.

Hinweise

Sollte glCopyPixels, glCopyTexImage1D, glCopyTexImage2D, glCopyTexSubImage1D, glCopyTexSubImage2D, glDrawPixels, glReadPixels, glTexImage1D, glTexImage2D, glTexSubImage1D oder glTexSubImage2D in einer Displayliste ausgeführt werden (siehe glNewList und glCallList), werden die Pixeltransfer-Modi, die beim Aufruf der Display-Liste galten, verwendet. Diese unterscheiden sich eventuell von den Einstellungen, die gemacht wurden, als das Kommando in die Displayliste kompiliert wurde.

Fehlermeldungen

GL_INVALID_ENUM wird generiert, wenn pname keinen zulässigen Wert hat.
GL_INVALID_OPERATION wird generiert, wenn glPixelTransfer innerhalb eines glBegin-glEnd Blocks aufgerufen wird.

Zugehörige Wertrückgaben

glGet mit Token GL_MAP_COLOR glGet mit Token GL_MAP_STENCIL glGet mit Token GL_INDEX_SHIFT glGet mit Token GL_INDEX_OFFSET glGet mit Token GL_RED_SCALE glGet mit Token GL_RED_BIAS glGet mit Token GL_GREEN_SCALE glGet mit Token GL_GREEN_BIAS glGet mit Token GL_BLUE_SCALE glGet mit Token GL_BLUE_BIAS glGet mit Token GL_ALPHA_SCALE glGet mit Token GL_ALPHA_BIAS glGet mit Token GL_DEPTH_SCALE glGet mit Token GL_DEPTH_BIAS


Siehe auch

glCallList, glCopyPixels, glCopyTexImage1D, glCopyTexImage2D, glCopyTexSubImage1D, glCopyTexSubImage2D, glDrawPixels, glNewList, glPixelMap, glPixelStore, glPixelZoom, glReadPixels, glTexImage1D, glTexImage2D, glTexSubImage1D, glTexSubImage2D


'


Hinweis: Dieser Artikel ist noch unvollständig.
(Mehr Informationen/weitere Artikel)

{{{1}}}

Incomplete.jpg