Lines Matching defs:image

1 /* stb_image - v2.28 - public domain image loader - http://nothings.org/stb
147 // int *x -- outputs image width in pixels
148 // int *y -- outputs image height in pixels
149 // int *channels_in_file -- outputs # of image components in image file
150 // int desired_channels -- if non-zero, # of image components requested in result
152 // The return value from an image loader is an 'unsigned char *' which points
153 // to the pixel data, or NULL on an allocation failure or if the image is
156 // pixel pointed to is top-left-most in the image. There is no padding between
157 // image scanlines or between pixels, regardless of format. The number of
163 // opaque because e.g. there were only 3 channels in the source image.
165 // An output image with N components has the following components interleaved
174 // If image loading fails for any reason, the return value will be NULL,
183 // To query the width, height and component count of an image without having to
188 // // returns ok=1 and sets x, y, n if image is a supported format,
193 // hard to change without causing breakage. As a result, the various image
194 // loaders all have certain limits on image size; these differ somewhat
196 // 1GB. When the decoded image would be larger than this, stb_image decoding
199 // Additionally, stb_image will reject image files that have any of their
202 // the only way to have an image with such dimensions load correctly
205 // or malicious. If you do need to load an image with individual dimensions
277 // HDR image support (disable by defining STBI_NO_HDR)
304 // file for details) containing image data, you can query for the "most
305 // appropriate" interface to use (that is, whether the image is HDR or
320 // pixel to remove any premultiplied alpha *only* if the image file explicitly
363 // valid image of gigantic dimensions and force stb_image to allocate a
406 // load image by filename, open file, or memory buffer
427 // for stbi_load_from_file, file pointer is left pointing immediately after image
488 // free the loaded image -- this is just free()
491 // get image dimensions & components without fully decoding
506 // for image formats that explicitly notate that they have premultiplied alpha,
515 // flip the image vertically, so the first pixel in the output array is the bottom left
802 // contains all the IO context, plus some basic image information
989 // therefore the largest decoded image size we can support with the
1185 return stbi__errpuc("unknown image type", "Image not of any known type, or corrupt");
1220 static void stbi__vertical_flip(void *image, int w, int h, int bytes_per_pixel)
1225 stbi_uc *bytes = (stbi_uc *)image;
1245 static void stbi__vertical_flip_slices(void *image, int w, int h, int z, int bytes_per_pixel)
1250 stbi_uc *bytes = (stbi_uc *)image;
1473 return stbi__errpf("unknown image type", "Image not of any known type, or corrupt");
1585 // Common code used by all image loaders
1773 // convert source image with img_n components to one with req_comp components;
1830 // convert source image with img_n components to one with req_comp components;
1960 // definition of jpeg image component
3270 if (s->img_y > STBI_MAX_DIMENSIONS) return stbi__err("too large","Very large image (corrupt?)");
3271 if (s->img_x > STBI_MAX_DIMENSIONS) return stbi__err("too large","Very large image (corrupt?)");
3325 // big blocks (e.g. a 16x16 iMCU on an image of width 33); we won't
3409 // decode image to YCbCr format
3871 // load a jpeg image from whichever source, but leave in YCbCr format
4847 // force the image data from big-endian to platform-native.
5110 if (s->img_y > STBI_MAX_DIMENSIONS) return stbi__err("too large","Very large image (corrupt?)");
5111 if (s->img_x > STBI_MAX_DIMENSIONS) return stbi__err("too large","Very large image (corrupt?)");
5119 if (!s->img_x || !s->img_y) return stbi__err("0-pixel image","Corrupt PNG");
5231 // non-paletted image with tRNS -> source image has (constant) alpha
5342 // Microsoft/Windows BMP image
5547 if (s->img_y > STBI_MAX_DIMENSIONS) return stbi__errpuc("too large","Very large image (corrupt?)");
5548 if (s->img_x > STBI_MAX_DIMENSIONS) return stbi__errpuc("too large","Very large image (corrupt?)");
5764 tga_image_type = stbi__get8(s); // image type
5765 if ( tga_colormap_type == 1 ) { // colormapped (paletted) image
5776 stbi__skip(s,4); // skip image x and y origin
5778 } else { // "normal" image w/o colormap - only RGB or grey allowed, +/- RLE
5783 stbi__skip(s,9); // skip colormap specification and image x/y origin
5826 sz = stbi__get8(s); // image type
5827 if ( tga_color_type == 1 ) { // colormapped (paletted) image
5828 if (sz != 1 && sz != 9) goto errorEnd; // colortype 1 demands image type 1 or 9
5832 stbi__skip(s,4); // skip image x and y origin
5833 } else { // "normal" image w/o colormap
5835 stbi__skip(s,9); // skip colormap specification and image x/y origin
5865 // (possibly if an alpha-bit is set in the "image descriptor byte")
5888 // image data
5900 if (tga_height > STBI_MAX_DIMENSIONS) return stbi__errpuc("too large","Very large image (corrupt?)");
5901 if (tga_width > STBI_MAX_DIMENSIONS) return stbi__errpuc("too large","Very large image (corrupt?)");
6025 // do I need to invert the image?
6137 return stbi__errpuc("not PSD", "Corrupt PSD image");
6141 return stbi__errpuc("wrong version", "Unsupported version of PSD image");
6149 return stbi__errpuc("wrong channel count", "Unsupported number of channels in PSD image");
6151 // Read the rows and columns of the image.
6155 if (h > STBI_MAX_DIMENSIONS) return stbi__errpuc("too large","Very large image (corrupt?)");
6156 if (w > STBI_MAX_DIMENSIONS) return stbi__errpuc("too large","Very large image (corrupt?)");
6179 // Skip the image resources. (resolution, pen tool paths, etc)
6197 // Create the destination image.
6211 // Finally, the image data.
6244 // We're at the raw image data. It's each channel in order (Red, Green, Blue, Alpha, ...)
6245 // where each channel consists of an 8-bit (or 16-bit) value for each pixel in the image.
6513 if (y > STBI_MAX_DIMENSIONS) return stbi__errpuc("too large","Very large image (corrupt?)");
6514 if (x > STBI_MAX_DIMENSIONS) return stbi__errpuc("too large","Very large image (corrupt?)");
6517 if (!stbi__mad3sizes_valid(x, y, 4, 0)) return stbi__errpuc("too large", "PIC image too large to decode");
6625 if (g->w > STBI_MAX_DIMENSIONS) return stbi__err("too large","Very large image (corrupt?)");
6626 if (g->h > STBI_MAX_DIMENSIONS) return stbi__err("too large","Very large image (corrupt?)");
6659 // and working backwards through an interleaved image would be nasty
6776 // two back is the image from two frames ago, used for a very specific disposal format
6790 return stbi__errpuc("too large", "GIF image is too large");
6798 // image is treated as "transparent" at the start - ie, nothing overwrites the current background;
6811 dispose = 2; // if I don't have an image to revert back to, default to the old background
6865 // we may not see *any* pixels or the image is malformed;
7071 // if there was an error and we allocated an image buffer, free it!
7180 return stbi__errpf("not HDR", "Corrupt HDR image");
7202 if (height > STBI_MAX_DIMENSIONS) return stbi__errpf("too large","Very large image (corrupt?)");
7203 if (width > STBI_MAX_DIMENSIONS) return stbi__errpf("too large","Very large image (corrupt?)");
7212 return stbi__errpf("too large", "HDR image is too large");
7219 // Load image data
7220 // image data is stored as some number of sca
7495 // Does not support ASCII image data (formats P2 and P3)
7520 if (s->img_y > STBI_MAX_DIMENSIONS) return stbi__errpuc("too large","Very large image (corrupt?)");
7521 if (s->img_x > STBI_MAX_DIMENSIONS) return stbi__errpuc("too large","Very large image (corrupt?)");
7612 return stbi__err("invalid width", "PPM image header had zero or overflowing width");
7617 return stbi__err("invalid width", "PPM image header had zero or overflowing width");
7622 return stbi__err("max value > 65535", "PPM image supports only 8-bit and 16-bit images");
7676 return stbi__err("unknown image type", "Image not of any known type, or corrupt");
7895 removed image *writing* support