| Flutter Impeller |

Public Member Functions | Public Attributes | List of all members
impeller::TexImage2DData Struct Reference

## Public Member Functions
| TexImage2DData (PixelFormat pixel_format)
| TexImage2DData (PixelFormat pixel_format, std::shared_ptr< const fml::Mapping > mapping)
bool | IsValid () const

## Public Attributes
GLint | internal_format = 0
GLenum | external_format = GL_NONE
GLenum | type = GL_NONE
std::shared_ptr< const fml::Mapping > | data

## Detailed Description

Definition at line 90 of file texture_gles.cc.

## Constructor & Destructor Documentation

## ◆ TexImage2DData() [1/2]

impeller::TexImage2DData::TexImage2DData | ( | PixelFormat | pixel_format | ) |
| inline explicit

Definition at line 96 of file texture_gles.cc.

96 {
97 switch (pixel_format) {
98 case PixelFormat::kA8UNormInt:
99 internal_format = GL_ALPHA;
100 external_format = GL_ALPHA;
101 type = GL_UNSIGNED_BYTE;
102 break;
103 case PixelFormat::kR8G8B8A8UNormInt:
104 case PixelFormat::kB8G8R8A8UNormInt:
105 case PixelFormat::kR8G8B8A8UNormIntSRGB:
106 case PixelFormat::kB8G8R8A8UNormIntSRGB:
107 internal_format = GL_RGBA;
108 external_format = GL_RGBA;
109 type = GL_UNSIGNED_BYTE;
110 break;
111 case PixelFormat::kR32G32B32A32Float:
112 internal_format = GL_RGBA;
113 external_format = GL_RGBA;
114 type = GL_FLOAT;
115 break;
116 case PixelFormat::kR16G16B16A16Float:
117 internal_format = GL_RGBA;
118 external_format = GL_RGBA;
119 type = GL_HALF_FLOAT;
120 break;
121 case PixelFormat::kUnknown:
122 case PixelFormat::kS8UInt:
123 case PixelFormat::kD24UnormS8Uint:
124 case PixelFormat::kD32FloatS8UInt:
125 case PixelFormat::kR8UNormInt:
126 case PixelFormat::kR8G8UNormInt:
127 case PixelFormat::kB10G10R10XRSRGB:
128 case PixelFormat::kB10G10R10XR:
129 case PixelFormat::kB10G10R10A10XR:
130 return;
131 }
132 is_valid_ = true;
133 }

References external_format, internal_format, impeller::kA8UNormInt, impeller::kB10G10R10A10XR, impeller::kB10G10R10XR, impeller::kB10G10R10XRSRGB, impeller::kB8G8R8A8UNormInt, impeller::kB8G8R8A8UNormIntSRGB, impeller::kD24UnormS8Uint, impeller::kD32FloatS8UInt, impeller::kR16G16B16A16Float, impeller::kR32G32B32A32Float, impeller::kR8G8B8A8UNormInt, impeller::kR8G8B8A8UNormIntSRGB, impeller::kR8G8UNormInt, impeller::kR8UNormInt, impeller::kS8UInt, impeller::kUnknown, and type.

## ◆ TexImage2DData() [2/2]

impeller::TexImage2DData::TexImage2DData | ( | PixelFormat | pixel_format,
|  | std::shared_ptr< const fml::Mapping > | mapping
| ) |  |
| inline

Definition at line 135 of file texture_gles.cc.

136 {
137 switch (pixel_format) {
138 case PixelFormat::kUnknown:
139 return;
140 case PixelFormat::kA8UNormInt: {
141 internal_format = GL_ALPHA;
142 external_format = GL_ALPHA;
143 type = GL_UNSIGNED_BYTE;
144 data = std::move(mapping);
145 break;
146 }
147 case PixelFormat::kR8G8B8A8UNormInt: {
148 internal_format = GL_RGBA;
149 external_format = GL_RGBA;
150 type = GL_UNSIGNED_BYTE;
151 data = std::move(mapping);
152 break;
153 }
154 case PixelFormat::kR32G32B32A32Float: {
155 internal_format = GL_RGBA;
156 external_format = GL_RGBA;
157 type = GL_FLOAT;
158 data = std::move(mapping);
159 break;
160 }
161 case PixelFormat::kR16G16B16A16Float: {
162 internal_format = GL_RGBA;
163 external_format = GL_RGBA;
164 type = GL_HALF_FLOAT;
165 data = std::move(mapping);
166 break;
167 }
168 case PixelFormat::kR8G8B8A8UNormIntSRGB:
169 case PixelFormat::kB8G8R8A8UNormInt:
170 case PixelFormat::kB8G8R8A8UNormIntSRGB:
171 case PixelFormat::kS8UInt:
172 case PixelFormat::kD24UnormS8Uint:
173 case PixelFormat::kD32FloatS8UInt:
174 case PixelFormat::kR8UNormInt:
175 case PixelFormat::kR8G8UNormInt:
176 case PixelFormat::kB10G10R10XRSRGB:
177 case PixelFormat::kB10G10R10XR:
178 case PixelFormat::kB10G10R10A10XR:
179 return;
180 }
181 is_valid_ = true;
182 }

References data, external_format, internal_format, impeller::kA8UNormInt, impeller::kB10G10R10A10XR, impeller::kB10G10R10XR, impeller::kB10G10R10XRSRGB, impeller::kB8G8R8A8UNormInt, impeller::kB8G8R8A8UNormIntSRGB, impeller::kD24UnormS8Uint, impeller::kD32FloatS8UInt, impeller::kR16G16B16A16Float, impeller::kR32G32B32A32Float, impeller::kR8G8B8A8UNormInt, impeller::kR8G8B8A8UNormIntSRGB, impeller::kR8G8UNormInt, impeller::kR8UNormInt, impeller::kS8UInt, impeller::kUnknown, and type.

## Member Function Documentation

## ◆ IsValid()

bool impeller::TexImage2DData::IsValid | ( |  | ) | const
| inline

Definition at line 184 of file texture_gles.cc.

184 { return is_valid_; }

## Member Data Documentation

## ◆ data

std::shared_ptr<const fml::Mapping> impeller::TexImage2DData::data

Definition at line 94 of file texture_gles.cc.

Referenced by TexImage2DData().

## ◆ external_format

GLenum impeller::TexImage2DData::external_format = GL_NONE

Definition at line 92 of file texture_gles.cc.

Referenced by TexImage2DData().

## ◆ internal_format

GLint impeller::TexImage2DData::internal_format = 0

Definition at line 91 of file texture_gles.cc.

Referenced by TexImage2DData().

## ◆ type

GLenum impeller::TexImage2DData::type = GL_NONE

Definition at line 93 of file texture_gles.cc.

Referenced by TexImage2DData().

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

- impeller/renderer/backend/gles/texture_gles.cc

impeller::PixelFormat::kB8G8R8A8UNormIntSRGB
@ kB8G8R8A8UNormIntSRGB
impeller::PixelFormat::kB10G10R10XR
@ kB10G10R10XR
impeller::PixelFormat::kB10G10R10XRSRGB
@ kB10G10R10XRSRGB
impeller::PixelFormat::kR8G8B8A8UNormIntSRGB
@ kR8G8B8A8UNormIntSRGB
impeller::PixelFormat::kR16G16B16A16Float
@ kR16G16B16A16Float
impeller::PixelFormat::kR8G8B8A8UNormInt
@ kR8G8B8A8UNormInt
impeller::TexImage2DData::internal_format
GLint internal_format
Definition: texture_gles.cc:91
impeller::PixelFormat::kD32FloatS8UInt
@ kD32FloatS8UInt
impeller::PixelFormat::kUnknown
@ kUnknown
impeller::PixelFormat::kR8G8UNormInt
@ kR8G8UNormInt
impeller::PixelFormat::kD24UnormS8Uint
@ kD24UnormS8Uint
impeller::PixelFormat::kB8G8R8A8UNormInt
@ kB8G8R8A8UNormInt
impeller::PixelFormat::kB10G10R10A10XR
@ kB10G10R10A10XR
impeller::TexImage2DData::type
GLenum type
Definition: texture_gles.cc:93
impeller::PixelFormat::kS8UInt
@ kS8UInt
impeller::PixelFormat::kA8UNormInt
@ kA8UNormInt
impeller::PixelFormat::kR8UNormInt
@ kR8UNormInt
impeller::TexImage2DData::data
std::shared_ptr< const fml::Mapping > data
Definition: texture_gles.cc:94
impeller::PixelFormat::kR32G32B32A32Float
@ kR32G32B32A32Float
impeller::TexImage2DData::external_format
GLenum external_format
Definition: texture_gles.cc:92