Lines Matching refs:param

71         std::cout << __func__ << ": param is invalid." << std::endl;
149 bool SnapShotUtils::CheckWHValid(int32_t param)
151 return (param > 0) && (param <= DisplayManager::MAX_RESOLUTION_SIZE_SCREENSHOT);
159 bool SnapShotUtils::CheckParamValid(const WriteToJpegParam& param)
161 switch (param.format) {
163 if (param.stride != param.width * RGBA8888_PIXEL_BYTES) {
168 if (param.stride != param.width * RGB565_PIXEL_BYTES) {
173 if (param.stride != param.width * RGB888_PIXEL_BYTES) {
179 static_cast<uint32_t>(param.format) << std::endl;
182 if (!CheckWidthAndHeightValid(param.width, param.height)) {
185 if (param.data == nullptr) {
270 bool SnapShotUtils::WriteToJpeg(const std::string& fileName, const WriteToJpegParam& param)
276 if (!CheckParamValid(param)) {
277 std::cout << "error: invalid param." << std::endl;
287 std::cout << "snapshot: pixel format is: " << static_cast<uint32_t>(param.format) << std::endl;
288 if (param.format == Media::PixelFormat::RGBA_8888) {
289 int32_t rgb888Size = param.stride * param.height * RGB888_PIXEL_BYTES / RGBA8888_PIXEL_BYTES;
291 ret = RGBA8888ToRGB888(param.data, rgb888, rgb888Size / RGB888_PIXEL_BYTES);
294 ret = WriteRgb888ToJpeg(file, param.width, param.height, rgb888);
297 } else if (param.format == Media::PixelFormat::RGB_565) {
298 int32_t rgb888Size = param.stride * param.height * RGB888_PIXEL_BYTES / RGB565_PIXEL_BYTES;
300 ret = RGB565ToRGB888(param.data, rgb888, rgb888Size / RGB888_PIXEL_BYTES);
303 ret = WriteRgb888ToJpeg(file, param.width, param.height, rgb888);
306 } else if (param.format == Media::PixelFormat::RGB_888) {
307 ret = WriteRgb888ToJpeg(file, param.width, param.height, param.data);
318 bool SnapShotUtils::WriteToJpeg(int fd, const WriteToJpegParam& param)
321 if (!CheckParamValid(param)) {
322 std::cout << "error: invalid param." << std::endl;
330 std::cout << "snapshot: pixel format is: " << static_cast<uint32_t>(param.format) << std::endl;
331 if (param.format == Media::PixelFormat::RGBA_8888) {
332 int32_t rgb888Size = param.stride * param.height * RGB888_PIXEL_BYTES / RGBA8888_PIXEL_BYTES;
334 ret = RGBA8888ToRGB888(param.data, rgb888, rgb888Size / RGB888_PIXEL_BYTES);
337 ret = WriteRgb888ToJpeg(file, param.width, param.height, rgb888);
340 } else if (param.format == Media::PixelFormat::RGB_565) {
341 int32_t rgb888Size = param.stride * param.height * RGB888_PIXEL_BYTES / RGB565_PIXEL_BYTES;
343 ret = RGB565ToRGB888(param.data, rgb888, rgb888Size / RGB888_PIXEL_BYTES);
346 ret = WriteRgb888ToJpeg(file, param.width, param.height, rgb888);
349 } else if (param.format == Media::PixelFormat::RGB_888) {
350 ret = WriteRgb888ToJpeg(file, param.width, param.height, param.data);
391 WriteToJpegParam param;
392 param.width = static_cast<uint32_t>(pixelMap.GetWidth());
393 param.height = static_cast<uint32_t>(pixelMap.GetHeight());
394 param.data = pixelMap.GetPixels();
395 param.stride = static_cast<uint32_t>(pixelMap.GetRowBytes());
396 param.format = pixelMap.GetPixelFormat();
397 return SnapShotUtils::WriteToJpeg(fileName, param);
402 WriteToJpegParam param;
403 param.width = static_cast<uint32_t>(pixelMap.GetWidth());
404 param.height = static_cast<uint32_t>(pixelMap.GetHeight());
405 param.data = pixelMap.GetPixels();
406 param.stride = static_cast<uint32_t>(pixelMap.GetRowBytes());
407 param.format = pixelMap.GetPixelFormat();
408 return SnapShotUtils::WriteToJpeg(fd, param);