glPixelStore: Unterschied zwischen den Versionen

Aus DGL Wiki
Wechseln zu: Navigation, Suche
(Version Hochgeladen)
(Beschreibung)
Zeile 30: Zeile 30:
  
 
== Beschreibung ==  
 
== Beschreibung ==  
 +
Die Funktion glPixelStore setzt Pixelspeicher-Modes, die sowohl die Ergebnisse von nachfolgenden [[glDrawPixel]]- und [[glReadPixel]]-Funktionen als auch die Extraktion von Polygon-Stipple-Mustern([[glPolygonStipple]]), Bitmaps([[glBitMap]]) und Texturmustern([[glTexImage1d]] und [[glTexImage2D]]) beeinflussen.
 +
 
<b><i>
 
<b><i>
 
The glPixelStore function sets pixel storage modes that affect the operation of subsequent glDrawPixels and glReadPixels as well as the unpacking of polygon stipple patterns (see glPolygonStipple), bitmaps (see glBitmap), and texture patterns (see glTexImage1D and glTexImage2D).
 
The glPixelStore function sets pixel storage modes that affect the operation of subsequent glDrawPixels and glReadPixels as well as the unpacking of polygon stipple patterns (see glPolygonStipple), bitmaps (see glBitmap), and texture patterns (see glTexImage1D and glTexImage2D).
Zeile 40: Zeile 42:
  
 
'''GL_PACK_SWAP_BYTES'''
 
'''GL_PACK_SWAP_BYTES'''
 +
Wenn auf TRUE gesetzt, wird die Byte-Sortierung für MultiByte-Farbkomponenten, Tiefenkomponenten, Farbindizes oder Stencil-Indizes umgekehrt. das bedeutet, wenn eine Vier-Byte-Komponente aus den Bytes b(0), b(1), b(2), b(3) besteht, wird sie im Speicher als b(3), b(2), b(1), b(0) gespeichert.
 
<b><i>
 
<b><i>
 
:If true, byte ordering for multibyte color components, depth components, color indices, or stencil indices is reversed. That is, if a four-byte component is made up of bytes b (0) , b (1) , b (2) , b (3) , it is stored in memory as b (3) , b (2) , b (1) , b (0)  if GL_PACK_SWAP_BYTES is true. GL_PACK_SWAP_BYTES has no effect on the memory order of components within a pixel, only on the order of bytes within components or indices. For example, the three components of a GL_RGB format pixel are always stored with red first, green second, and blue third, regardless of the value of GL_PACK_SWAP_BYTES.  
 
:If true, byte ordering for multibyte color components, depth components, color indices, or stencil indices is reversed. That is, if a four-byte component is made up of bytes b (0) , b (1) , b (2) , b (3) , it is stored in memory as b (3) , b (2) , b (1) , b (0)  if GL_PACK_SWAP_BYTES is true. GL_PACK_SWAP_BYTES has no effect on the memory order of components within a pixel, only on the order of bytes within components or indices. For example, the three components of a GL_RGB format pixel are always stored with red first, green second, and blue third, regardless of the value of GL_PACK_SWAP_BYTES.  
Zeile 45: Zeile 48:
  
 
'''GL_PACK_LSB_FIRST'''
 
'''GL_PACK_LSB_FIRST'''
 +
Wenn TRUE, werden Bits innerhalb eines Bytes vom kleinstsignifikanten zum größtsignifikanten angeordnet; ansonsten ist das erste Bit das größtsignifikante. Dieser Parameter wirkt sich nur auf Bitmapdaten aus.
 
<b><i>
 
<b><i>
 
: If true, bits are ordered within a byte from least significant to most significant; otherwise, the first bit in each byte is the most significant one. This parameter is significant for bitmap data only.  
 
: If true, bits are ordered within a byte from least significant to most significant; otherwise, the first bit in each byte is the most significant one. This parameter is significant for bitmap data only.  
Zeile 50: Zeile 54:
  
 
'''GL_PACK_ROW_LENGTH'''
 
'''GL_PACK_ROW_LENGTH'''
 +
Wenn größer null, definiert GL_PACK_ROW_LENGTH die Anzahl von Pixeln in einer Zeile. Wenn das erste Pixel einer Zeile sich im Speicher am Ort p befindet, so erhält man die Position des ersten Pixels, indem
 
<b><i>
 
<b><i>
 
: If greater than zero, GL_PACK_ROW_LENGTH defines the number of pixels in a row. If the first pixel of a row is placed at location p in memory, then the location of the first pixel of the next row is obtained by skipping
 
: If greater than zero, GL_PACK_ROW_LENGTH defines the number of pixels in a row. If the first pixel of a row is placed at location p in memory, then the location of the first pixel of the next row is obtained by skipping
 
</i></b>
 
</i></b>
  
HIER GRAFIK EINFÜGEN  
+
HIER GRAFIK EINFÜGEN
 +
 
 +
Komponenten oder Indizes übersprungen werden, wobei n die Anzahl der Komponenten oder Indizes eines Pixels, l die Anzahl Pixel in einer Zeile(GL_PACK_ROW_LENGTH wenn es gößer null ist, ansonsten das width-Argument in der Pixelfunktion), a der Wert von GL_PACK_ALIGNMENT und s die Größe in Bytes eines einzelnen Komponenten ist( wenn a < s, dann kommt dasselbe heraus wie bei a = s). Im Falle von 1-bit Werten, erhält man die Positon der nächsten Zeile, indem
  
 
<b><i>
 
<b><i>
Zeile 61: Zeile 68:
  
 
HIER GRAFIK EINFÜGEN
 
HIER GRAFIK EINFÜGEN
+
 
 +
 
 +
Komponenten oder Indizes übersprungen werden.
 +
Die Word-Komponente in dieser Beschreibung bezieht sich auf die Nicht-Index-Werte red, green, blue, alpha und depth. Das Speicherformat GL_RGB hat zum Beispiel drei Komponenten pro Pixel: Erst Rot, dann Grün und schließlich Blau.
 
<b><i>
 
<b><i>
 
: components or indices.
 
: components or indices.
Zeile 159: Zeile 169:
  
 
<br>
 
<br>
 +
 
== Hinweise ==
 
== Hinweise ==
 
<b><i>
 
<b><i>

Version vom 11. Februar 2005, 21:42 Uhr

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

{{{1}}}

Incomplete.jpg

glPixelStoref, glPixelStorei


Name

glPixelStore Funktionen - setzen den Pixelspeichermodus (pixel storage mode).


Delphi-Spezifikation

procedure glPixelStoref(pname: TGLenum; param: TGLfloat);
procedure glPixelStorei(pname: TGLenum; param: TGLint);


Parameter

pname Bestimmt den symbolischen Namen des Parameters der gesetzt werden soll. Sechs Werte beeinflussen das Packen der Pixeldaten in den Speicher:

GL_PACK_SWAP_BYTES, GL_PACK_LSB_FIRST, GL_PACK_ROW_LENGTH, GL_PACK_SKIP_PIXELS, GL_PACK_SKIP_ROWS, und GL_PACK_ALIGNMENT.
Sechs weitere beeinflussen das Entpacken der Pixeldaten aus dem Speicher:

GL_UNPACK_SWAP_BYTES, GL_UNPACK_LSB_FIRST, GL_UNPACK_ROW_LENGTH, GL_UNPACK_SKIP_PIXELS, GL_UNPACK_SKIP_ROWS, und GL_UNPACK_ALIGNMENT
param Ist der Wert auf den pname gesetzt werden soll.


Beschreibung

Die Funktion glPixelStore setzt Pixelspeicher-Modes, die sowohl die Ergebnisse von nachfolgenden glDrawPixel- und glReadPixel-Funktionen als auch die Extraktion von Polygon-Stipple-Mustern(glPolygonStipple), Bitmaps(glBitMap) und Texturmustern(glTexImage1d und glTexImage2D) beeinflussen.

The glPixelStore function sets pixel storage modes that affect the operation of subsequent glDrawPixels and glReadPixels as well as the unpacking of polygon stipple patterns (see glPolygonStipple), bitmaps (see glBitmap), and texture patterns (see glTexImage1D and glTexImage2D).

pname ist eine symbolische konstante die den zu setzenden Parameter identifiziert. param ist dann der neue Wert auf den pname gesetzt werden soll. Sechs der zwölf Speicherparameter beeinflussen wie die Pixeldaten an den Speicher des Klienten übergeben werden sollen. Deshalb sind sie nur für glReadPixels Befehle wichtig. Dies währen:

GL_PACK_SWAP_BYTES Wenn auf TRUE gesetzt, wird die Byte-Sortierung für MultiByte-Farbkomponenten, Tiefenkomponenten, Farbindizes oder Stencil-Indizes umgekehrt. das bedeutet, wenn eine Vier-Byte-Komponente aus den Bytes b(0), b(1), b(2), b(3) besteht, wird sie im Speicher als b(3), b(2), b(1), b(0) gespeichert.

If true, byte ordering for multibyte color components, depth components, color indices, or stencil indices is reversed. That is, if a four-byte component is made up of bytes b (0) , b (1) , b (2) , b (3) , it is stored in memory as b (3) , b (2) , b (1) , b (0) if GL_PACK_SWAP_BYTES is true. GL_PACK_SWAP_BYTES has no effect on the memory order of components within a pixel, only on the order of bytes within components or indices. For example, the three components of a GL_RGB format pixel are always stored with red first, green second, and blue third, regardless of the value of GL_PACK_SWAP_BYTES.

GL_PACK_LSB_FIRST Wenn TRUE, werden Bits innerhalb eines Bytes vom kleinstsignifikanten zum größtsignifikanten angeordnet; ansonsten ist das erste Bit das größtsignifikante. Dieser Parameter wirkt sich nur auf Bitmapdaten aus.

If true, bits are ordered within a byte from least significant to most significant; otherwise, the first bit in each byte is the most significant one. This parameter is significant for bitmap data only.

GL_PACK_ROW_LENGTH Wenn größer null, definiert GL_PACK_ROW_LENGTH die Anzahl von Pixeln in einer Zeile. Wenn das erste Pixel einer Zeile sich im Speicher am Ort p befindet, so erhält man die Position des ersten Pixels, indem

If greater than zero, GL_PACK_ROW_LENGTH defines the number of pixels in a row. If the first pixel of a row is placed at location p in memory, then the location of the first pixel of the next row is obtained by skipping

HIER GRAFIK EINFÜGEN

Komponenten oder Indizes übersprungen werden, wobei n die Anzahl der Komponenten oder Indizes eines Pixels, l die Anzahl Pixel in einer Zeile(GL_PACK_ROW_LENGTH wenn es gößer null ist, ansonsten das width-Argument in der Pixelfunktion), a der Wert von GL_PACK_ALIGNMENT und s die Größe in Bytes eines einzelnen Komponenten ist( wenn a < s, dann kommt dasselbe heraus wie bei a = s). Im Falle von 1-bit Werten, erhält man die Positon der nächsten Zeile, indem

components or indices, where n is the number of components or indices in a pixel, l is the number of pixels in a row (GL_PACK_ROW_LENGTH if it is greater than zero, the width argument to the pixel routine otherwise), a is the value of GL_PACK_ALIGNMENT, and s is the size, in bytes, of a single component (if a < s, then it is as if a = s). In the case of 1-bit values, the location of the next row is obtained by skipping

HIER GRAFIK EINFÜGEN


Komponenten oder Indizes übersprungen werden. Die Word-Komponente in dieser Beschreibung bezieht sich auf die Nicht-Index-Werte red, green, blue, alpha und depth. Das Speicherformat GL_RGB hat zum Beispiel drei Komponenten pro Pixel: Erst Rot, dann Grün und schließlich Blau.

components or indices.
The word component in this description refers to the nonindex values red, green, blue, alpha, and depth. Storage format GL_RGB, for example, has three components per pixel: first red, then green, and finally blue.


GL_PACK_SKIP_PIXELS und GL_PACK_SKIP_ROWS

These values are provided as a convenience to the programmer; they provide no functionality that cannot be duplicated simply by incrementing the pointer passed to glReadPixels. Setting GL_PACK_SKIP_PIXELS to i is equivalent to incrementing the pointer by i n components or indices, where n is the number of components or indices in each pixel. Setting GL_PACK_SKIP_ROWS to j is equivalent to incrementing the pointer by j k components or indices, where k is the number of components or indices per row, as computed above in the GL_PACK_ROW_LENGTH section.

GL_PACK_ALIGNMENT

Specifies the alignment requirements for the start of each pixel row in memory. The allowable values are 1 (byte-alignment), 2 (rows aligned to even-numbered bytes), 4 (word alignment), and 8 (rows start on double-word boundaries).

Die anderen sechs der zwölf Speicherparameter beeinflussen wie die Pixeldaten aus dem Speicher des Klienten gelesen wird. Diese Werte sind deshalb wichtig für glDrawPixels, glTexImage1D, glTexImage2D, glBitmap, und glPolygonStipple. Diese währen:

GL_UNPACK_SWAP_BYTES

If true, byte ordering for multibyte color components, depth components, color indices, or stencil indices is reversed. That is, if a four-byte component is made up of bytes b (0) , b (1) , b (2) , b (3) , it is taken from memory as b (3) , b (2) , b (1) , b (0) if GL_UNPACK_SWAP_BYTES is true. GL_UNPACK_SWAP_BYTES has no effect on the memory order of components within a pixel, only on the order of bytes within components or indices. For example, the three components of a GL_RGB format pixel are always stored with red first, green second, and blue third, regardless of the value of GL_UNPACK_SWAP_BYTES.

GL_UNPACK_LSB_FIRST

If true, bits are ordered within a byte from least significant to most significant; otherwise, the first bit in each byte is the most significant one. This is significant for bitmap data only.

GL_UNPACK_ROW_LENGTH

If greater than zero, GL_UNPACK_ROW_LENGTH defines the number of pixels in a row. If the first pixel of a row is placed at location p in memory, then the location of the first pixel of the next row is obtained by skipping

HIER GRAFIK EINFÜGEN

components or indices, where n is the number of components or indices in a pixel, l is the number of pixels in a row (GL_UNPACK_ROW_LENGTH if it is greater than zero, the width argument to the pixel routine otherwise), a is the value of GL_UNPACK_ALIGNMENT, and s is the size, in bytes, of a single component (if a < s, then it is as if a = s). In the case of 1-bit values, the location of the next row is obtained by skipping

HIER GRAFIK EINFÜGEN

components or indices.
The word component in this description refers to the nonindex values red, green, blue, alpha, and depth. Storage format GL_RGB, for example, has three components per pixel: first red, then green, and finally blue.

GL_UNPACK_SKIP_PIXELS und GL_UNPACK_SKIP_ROWS

These values are provided as a convenience to the programmer; they provide no functionality that cannot be duplicated simply by incrementing the pointer passed to glDrawPixels, glTexImage1D, glTexImage2D, glBitmap, or glPolygonStipple. Setting GL_UNPACK_SKIP_PIXELS to i is equivalent to incrementing the pointer by i n components or indices, where n is the number of components or indices in each pixel. Setting GL_UNPACK_SKIP_ROWS to j is equivalent to incrementing the pointer by j k components or indices, where k is the number of components or indices per row, as computed above in the GL_UNPACK_ROW_LENGTH section.

GL_UNPACK_ALIGNMENT

Specifies the alignment requirements for the start of each pixel row in memory. The allowable values are 1 (byte-alignment), 2 (rows aligned to even-numbered bytes), 4 (word alignment), and 8 (rows start on double-word boundaries).

Die folgende Tabelle liefert den zeigt den Typ, Anfangswert und die Reichweite gültiger Werte für jeden Speicherparameter der mit glPixelStore gesetzt werden kann.

Pname Type Anfangswert
GL_PACK_SWAP_BYTES Boolean false
GL_PACK_LSP_First Boolean false
GL_PACK_ROW_LENGTH integer 0
GL_PACK_SKIP_ROWS integer 0
GL_PACK_SKIP_PIXELS integer 0
GL_PACK_ALIGNMENT integer 4
GL_UNPACK_SWAP_BYTES Boolean false
GL_UNPACK_LSB_FIRST Boolean false
GL_UNPACK_ROW_LENGTH integer 0
GL_UNPACK_SKIP_ROWS integer 0
GL_UNPACK_SKIP_PIXELS integer 0
GL_UNPACK_ALIGNMENT integer 4

The glPixelStoref function can be used to set any pixel store parameter. If the parameter type is Boolean, and if param is 0.0, the parameter is false; otherwise it is set to true. If pname is an integer type parameter, param is rounded to the nearest integer. Likewise, the glPixelStorei function can also be used to set any of the pixel store parameters. Boolean parameters are set to false if param is 0 and true otherwise. param is converted to floating point before being assigned to real-valued parameters.


Hinweise

The pixel storage modes in effect when glDrawPixels, glReadPixels, glTexImage1D, glTexImage2D, glBitmap, or glPolygonStipple is placed in a display list control the interpretation of memory data. The pixel storage modes in effect when a display list is executed are not significant.


Fehlermeldungen

GL_INVALID_ENUM wird generiert wenn pname ein ungültiger Wert übergeben wurde.
GL_INVALID_VALUE wird generiert wenn

  1. eine neagtive Zeilenlänge, ein negativer Pixelskip- oder Zeilenwechselnwert übergeben wurde
  2. Alignment ein anderer Wert als 1, 2, 4 oder 8 übergeben wurde.

GL_INVALID_OPERATION wird generiert wenn glPixelStore innerhalb eines glBegin-glEnd Blocks aufgerufen wird.


Zugehörige Wertrückgaben

glGet mit Token GL_PACK_SWAP_BYTES
glGet mit Token GL_PACK_LSB_FIRST
glGet mit Token GL_PACK_ROW_LENGTH
glGet mit Token GL_PACK_SKIP_ROWS
glGet mit Token GL_PACK_SKIP_PIXELS
glGet mit Token GL_PACK_ALIGNMENT
glGet mit Token GL_UNPACK_SWAP_BYTES
glGet mit Token GL_UNPACK_LSB_FIRST
glGet mit Token GL_UNPACK_ROW_LENGTH
glGet mit Token GL_UNPACK_SKIP_ROWS
glGet mit Token GL_UNPACK_SKIP_PIXELS
glGet mit Token GL_UNPACK_ALIGNMENT


Siehe auch

glBitmap, glDrawPixels, glPixelMap, glPixelTransfer, glPixelZoom, glPolygonStipple, glReadPixels, glTexImage1D, glTexImage2D