MCPcopy Create free account
hub / github.com/Timic3/rw-parser / getBitmapWithRasterFormat

Method getBitmapWithRasterFormat

src/renderware/txd/TxdParser.ts:214–233  ·  view source on GitHub ↗
(rasterFormat: number, raster: Uint8Array, width: number, height: number)

Source from the content-addressed store, hash-verified

212 }
213
214 public getBitmapWithRasterFormat (rasterFormat: number, raster: Uint8Array, width: number, height: number): Uint8Array {
215 switch (rasterFormat) {
216 case RasterFormat.RASTER_1555:
217 return ImageDecoder.bgra1555(raster, width, height);
218 case RasterFormat.RASTER_565:
219 return ImageDecoder.bgra565(raster, width, height);
220 case RasterFormat.RASTER_4444:
221 return ImageDecoder.bgra4444(raster, width, height);
222 case RasterFormat.RASTER_LUM:
223 return ImageDecoder.lum8(raster, width, height);
224 case RasterFormat.RASTER_8888:
225 return ImageDecoder.bgra8888(raster, width, height);
226 case RasterFormat.RASTER_888:
227 return ImageDecoder.bgra888(raster, width, height);
228 case RasterFormat.RASTER_555:
229 return ImageDecoder.bgra555(raster, width, height);
230 default:
231 return new Uint8Array(0);
232 }
233 }
234}

Callers 1

readTextureNativeMethod · 0.95

Calls 7

bgra1555Method · 0.80
bgra565Method · 0.80
bgra4444Method · 0.80
lum8Method · 0.80
bgra8888Method · 0.80
bgra888Method · 0.80
bgra555Method · 0.80

Tested by

no test coverage detected