Path: blob/21.2-virgl/src/gallium/auxiliary/util/u_debug_image.h
4561 views
/*1* Copyright (c) 2008-2016 VMware, Inc.2* All Rights Reserved.3*4* Permission is hereby granted, free of charge, to any person obtaining a5* copy of this software and associated documentation files (the6* "Software"), to deal in the Software without restriction, including7* without limitation the rights to use, copy, modify, merge, publish,8* distribute, sub license, and/or sell copies of the Software, and to9* permit persons to whom the Software is furnished to do so, subject to10* the following conditions:11*12* The above copyright notice and this permission notice (including the13* next paragraph) shall be included in all copies or substantial portions14* of the Software.15*16* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS17* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF18* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.19* IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR20* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,21* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE22* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.23*/242526#ifndef U_DEBUG_IMAGE_H27#define U_DEBUG_IMAGE_H282930#include "pipe/p_compiler.h"31#include "pipe/p_format.h"323334#ifdef DEBUG35struct pipe_context;36struct pipe_surface;37struct pipe_transfer;38struct pipe_resource;3940void debug_dump_image(const char *prefix,41enum pipe_format format, unsigned cpp,42unsigned width, unsigned height,43unsigned stride,44const void *data);45void debug_dump_surface(struct pipe_context *pipe,46const char *prefix,47struct pipe_surface *surface);48void debug_dump_texture(struct pipe_context *pipe,49const char *prefix,50struct pipe_resource *texture);51void debug_dump_surface_bmp(struct pipe_context *pipe,52const char *filename,53struct pipe_surface *surface);54void debug_dump_transfer_bmp(struct pipe_context *pipe,55const char *filename,56struct pipe_transfer *transfer, void *ptr);57void debug_dump_float_rgba_bmp(const char *filename,58unsigned width, unsigned height,59float *rgba, unsigned stride);60void debug_dump_ubyte_rgba_bmp(const char *filename,61unsigned width, unsigned height,62const ubyte *rgba, unsigned stride);63#else64#define debug_dump_image(prefix, format, cpp, width, height, stride, data) ((void)0)65#define debug_dump_surface(pipe, prefix, surface) ((void)0)66#define debug_dump_surface_bmp(pipe, filename, surface) ((void)0)67#define debug_dump_transfer_bmp(filename, transfer, ptr) ((void)0)68#define debug_dump_float_rgba_bmp(filename, width, height, rgba, stride) ((void)0)69#define debug_dump_ubyte_rgba_bmp(filename, width, height, rgba, stride) ((void)0)70#endif717273#endif747576