Oolite 1.91.0.7644-241112-7f5034b
Loading...
Searching...
No Matches
OOPixMapTextureLoader Class Reference

#include <OOPixMapTextureLoader.h>

+ Inheritance diagram for OOPixMapTextureLoader:
+ Collaboration diagram for OOPixMapTextureLoader:

Instance Methods

(id) - initWithPixMap:textureOptions:freeWhenDone:
 
(void) - dealloc [implementation]
 
(void) - loadTexture [implementation]
 
(uint32_t) - textureOptions [implementation]
 
- Instance Methods inherited from OOTextureGenerator
(GLfloat) - anisotropy
 
(GLfloat) - lodBias
 
(NSString *) - cacheKey
 
(BOOL) - enqueue
 
- Instance Methods inherited from OOTextureLoader
(BOOL) - isReady
 
(BOOL) - getResult:format:originalWidth:originalHeight:
 
(id) - initWithPath:options:
 
(NSString *) - path
 
(NSString *) - descriptionComponents [implementation]
 
(NSString *) - shortDescriptionComponents [implementation]
 
(void) - performAsyncTask [implementation]
 
(void) - generateMipMapsForCubeMap [implementation]
 
(void) - applySettings [implementation]
 
(void) - getDesiredWidth:andHeight: [implementation]
 
(void) - completeAsyncTask [implementation]
 
- Instance Methods inherited from <OOAsyncWorkTask>

Private Attributes

OOPixMap _pixMap
 
uint32_t _texOptions
 

Additional Inherited Members

- Class Methods inherited from OOTextureLoader
(id) + loaderWithPath:options:
 
(id) + loaderWithTextureSpecifier:extraOptions:folder:
 
(void) + setUp [implementation]
 
- Protected Attributes inherited from OOTextureLoader
NSString * _path
 
OOTextureFlags _options
 
uint8_t _generateMipMaps: 1
 
uint8_t _scaleAsNormalMap: 1
 
uint8_t _avoidShrinking: 1
 
uint8_t _noScalingWhatsoever: 1
 
uint8_t _extractChannel: 1
 
uint8_t _allowCubeMap: 1
 
uint8_t _isCubeMap: 1
 
uint8_t _ready: 1
 
uint8_t _extractChannelIndex
 
OOTextureDataFormat _format
 
void * _data
 
uint32_t _width
 
uint32_t _height
 
uint32_t _originalWidth
 
uint32_t _originalHeight
 
uint32_t _shrinkThreshold
 
uint32_t _maxSize
 
size_t _rowBytes
 

Detailed Description

Definition at line 34 of file OOPixMapTextureLoader.h.

Method Documentation

◆ dealloc

- (void) dealloc
implementation

Reimplemented from OOTextureLoader.

Definition at line 1 of file OOPixMapTextureLoader.m.

51{
53
54 [super dealloc];
55}
void OOFreePixMap(OOPixMap *ioPixMap)
Definition OOPixMap.m:86

References _pixMap, _texOptions, DESTROY, OOApplyTextureOptionDefaults(), OODuplicatePixMap(), and OOIsValidPixMap().

+ Here is the call graph for this function:

◆ initWithPixMap:textureOptions:freeWhenDone:

- (id) initWithPixMap: (OOPixMap) pixMap
textureOptions: (uint32_t) options
freeWhenDone: (BOOL) freeWhenDone 

Definition at line 1 of file OOPixMapTextureLoader.m.

34 :(OOPixMap)pixMap textureOptions:(uint32_t)options freeWhenDone:(BOOL)freeWhenDone
35{
36 if ((self = [super initWithPath:[NSString stringWithFormat:@"OOPixMap@%p", self] options:options]))
37 {
38 if (freeWhenDone) _pixMap = pixMap;
40
42
43 if (!OOIsValidPixMap(_pixMap)) DESTROY(self);
44 }
45
46 return self;
47}
#define DESTROY(x)
Definition OOCocoa.h:77
BOOL OOIsValidPixMap(OOPixMap pixMap)
Definition OOPixMap.m:42
OOPixMap OODuplicatePixMap(OOPixMap srcPixMap, size_t desiredSize)
Definition OOPixMap.m:95
struct OOPixMap OOPixMap
OOTextureFlags OOApplyTextureOptionDefaults(OOTextureFlags options)
Definition OOTexture.m:855

◆ loadTexture

- (void) loadTexture
implementation

Reimplemented from OOTextureLoader.

Definition at line 1 of file OOPixMapTextureLoader.m.

59{
60 // Generate mip maps if needed.
62 {
63 size_t size = OOMinimumPixMapBufferSize(_pixMap) * 4 / 3;
64 BOOL generateMipMaps = OOExpandPixMap(&_pixMap, size);
65 if (generateMipMaps)
66 {
68 }
69 else
70 {
71 _texOptions = (_texOptions & ~kOOTextureMinFilterMask) | kOOTextureMinFilterMipMap;
72 }
73 }
74
75 // Set up output ivars as per OOTextureLoader contract.
81
82 // Explicitly do not free pixels - ownership passes to texture.
83 _pixMap.pixels = NULL;
84}
OOINLINE size_t OOMinimumPixMapBufferSize(OOPixMap pixMap)
Definition OOPixMap.h:62
BOOL OOExpandPixMap(OOPixMap *ioPixMap, size_t desiredSize)
Definition OOPixMap.m:130
BOOL OOGenerateMipMaps(void *textureBytes, OOPixMapDimension width, OOPixMapDimension height, OOPixMapFormat format)
@ kOOTextureMinFilterMask
Definition OOTexture.h:72
@ kOOTextureMinFilterMipMap
Definition OOTexture.h:48
OOTextureDataFormat _format
voidpf void uLong size
Definition ioapi.h:134
OOPixMapDimension height
Definition OOPixMap.h:50
size_t rowBytes
Definition OOPixMap.h:52
void * pixels
Definition OOPixMap.h:49
OOPixMapDimension width
Definition OOPixMap.h:50
OOPixMapFormat format
Definition OOPixMap.h:51

◆ textureOptions

- (uint32_t) textureOptions
implementation

Reimplemented from OOTextureGenerator.

Definition at line 1 of file OOPixMapTextureLoader.m.

88{
89 return _texOptions;
90}

Member Data Documentation

◆ _pixMap

- (OOPixMap) _pixMap
private

Definition at line 37 of file OOPixMapTextureLoader.h.

Referenced by dealloc.

◆ _texOptions

- (uint32_t) _texOptions
private

Definition at line 38 of file OOPixMapTextureLoader.h.

Referenced by dealloc.


The documentation for this class was generated from the following files: