Lines Matching defs:img
40 * @param img The source data for the image.
47 const astcenc_image* img,
51 if (img->dim_z <= 1)
131 astcenc_image* img = astc_img_from_floatx4_array(data, dim_x, dim_y, y_flip);
135 return img;
143 astcenc_image* img = astc_img_from_unorm8x4_array(data, dim_x, dim_y, y_flip);
147 return img;
158 * @param img The source data for the image.
165 const astcenc_image* img,
171 for (unsigned int i = 0; i < img->dim_z; i++)
173 std::string fnmod = get_output_filename(img, filename, i);
174 float* buf = floatx4_array_from_astc_img(img, y_flip, i);
176 res = SaveEXR(buf, img->dim_x, img->dim_y, 4, 1, fnmod.c_str(), nullptr);
190 * @param img The source data for the image.
197 const astcenc_image* img,
203 assert(img->data_type == ASTCENC_TYPE_U8);
205 for (unsigned int i = 0; i < img->dim_z; i++)
207 std::string fnmod = get_output_filename(img, filename, i);
208 uint8_t* buf = reinterpret_cast<uint8_t*>(img->data[i]);
211 res = stbi_write_png(fnmod.c_str(), img->dim_x, img->dim_y, 4, buf, img->dim_x * 4);
224 * @param img The source data for the image.
231 const astcenc_image* img,
237 assert(img->data_type == ASTCENC_TYPE_U8);
239 for (unsigned int i = 0; i < img->dim_z; i++)
241 std::string fnmod = get_output_filename(img, filename, i);
242 uint8_t* buf = reinterpret_cast<uint8_t*>(img->data[i]);
245 res = stbi_write_tga(fnmod.c_str(), img->dim_x, img->dim_y, 4, buf);
258 * @param img The source data for the image.
265 const astcenc_image* img,
271 assert(img->data_type == ASTCENC_TYPE_U8);
273 for (unsigned int i = 0; i < img->dim_z; i++)
275 std::string fnmod = get_output_filename(img, filename, i);
276 uint8_t* buf = reinterpret_cast<uint8_t*>(img->data[i]);
279 res = stbi_write_bmp(fnmod.c_str(), img->dim_x, img->dim_y, 4, buf);
292 * @param img The source data for the image.
299 const astcenc_image* img,
305 for (unsigned int i = 0; i < img->dim_z; i++)
307 std::string fnmod = get_output_filename(img, filename, i);
308 float* buf = floatx4_array_from_astc_img(img, y_flip, i);
310 res = stbi_write_hdr(fnmod.c_str(), img->dim_x, img->dim_y, 4, buf);
1271 * @param[out] img The output image to populate.
1278 astc_compressed_image& img
1363 img.block_x = fmt->x;
1364 img.block_y = fmt->y;
1365 img.block_z = fmt->z == 0 ? 1 : fmt->z;
1367 img.dim_x = hdr.pixel_width;
1368 img.dim_y = hdr.pixel_height;
1369 img.dim_z = hdr.pixel_depth == 0 ? 1 : hdr.pixel_depth;
1371 img.data_len = data_len;
1372 img.data = data;
1383 * @param img The image data to store.
1390 const astc_compressed_image& img,
1394 unsigned int fmt = get_format(img.block_x, img.block_y, img.block_z, is_srgb);
1404 hdr.pixel_width = img.dim_x;
1405 hdr.pixel_height = img.dim_y;
1406 hdr.pixel_depth = (img.dim_z == 1) ? 0 : img.dim_z;
1412 size_t expected = sizeof(ktx_header) + 4 + img.data_len;
1422 actual += fwrite(&img.data_len, 1, 4, wf);
1423 actual += fwrite(img.data, 1, img.data_len, wf);
1437 * @param img The source data for the image.
1444 const astcenc_image* img,
1448 unsigned int dim_x = img->dim_x;
1449 unsigned int dim_y = img->dim_y;
1450 unsigned int dim_z = img->dim_z;
1452 int bitness = img->data_type == ASTCENC_TYPE_U8 ? 8 : 16;
1453 int image_components = determine_image_components(img);
1516 uint8_t* data8 = static_cast<uint8_t*>(img->data[z]);
1578 uint16_t* data16 = static_cast<uint16_t*>(img->data[z]);
2044 * @param img The source data for the image.
2051 const astcenc_image* img,
2055 unsigned int dim_x = img->dim_x;
2056 unsigned int dim_y = img->dim_y;
2057 unsigned int dim_z = img->dim_z;
2059 int bitness = img->data_type == ASTCENC_TYPE_U8 ? 8 : 16;
2060 int image_components = (bitness == 16) ? 4 : determine_image_components(img);
2145 uint8_t* data8 = static_cast<uint8_t*>(img->data[z]);
2208 uint16_t* data16 = static_cast<uint16_t*>(img->data[z]);
2461 astc_compressed_image& img
2515 img.data = buffer;
2516 img.data_len = data_size;
2517 img.block_x = block_x;
2518 img.block_y = block_y;
2519 img.block_z = block_z;
2520 img.dim_x = dim_x;
2521 img.dim_y = dim_y;
2522 img.dim_z = dim_z;
2528 const astc_compressed_image& img,
2537 hdr.block_x = static_cast<uint8_t>(img.block_x);
2538 hdr.block_y = static_cast<uint8_t>(img.block_y);
2539 hdr.block_z = static_cast<uint8_t>(img.block_z);
2541 hdr.dim_x[0] = img.dim_x & 0xFF;
2542 hdr.dim_x[1] = (img.dim_x >> 8) & 0xFF;
2543 hdr.dim_x[2] = (img.dim_x >> 16) & 0xFF;
2545 hdr.dim_y[0] = img.dim_y & 0xFF;
2546 hdr.dim_y[1] = (img.dim_y >> 8) & 0xFF;
2547 hdr.dim_y[2] = (img.dim_y >> 16) & 0xFF;
2549 hdr.dim_z[0] = img.dim_z & 0xFF;
2550 hdr.dim_z[1] = (img.dim_z >> 8) & 0xFF;
2551 hdr.dim_z[2] = (img.dim_z >> 16) & 0xFF;
2561 file.write(reinterpret_cast<char*>(img.data), img.data_len);