> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# ILampArray::GetIndicesForPurposes

> ILampArray::GetIndicesForPurposes

# ILampArray::GetIndicesForPurposes

주어진 LampPurposes 집합을 지원하는 Lamp 인덱스로 버퍼를 채웁니다. 이 메서드를 호출하기 전에 [ILampArray::GetIndicesCountForPurposes](/reference/lighting/lamparray/interfaces/ilamparray/methods/ilamparray_getindicescountforpurposes)를 호출하여 최대 버퍼 크기를 얻어야 합니다.

## 구문

```cpp theme={null}
void GetIndicesForPurposes(
    LampPurposes lampPurposes,
    uint32_t lampIndicesCount,
    uint32_t * lampIndices)
```

### 매개변수

*lampPurposes*
형식: [LampPurposes](/reference/lighting/lamparray/enums/lamppurposes)

원하는 LampPurposes 집합입니다.

*lampIndicesCount*\
형식: uint32\_t

채울 버퍼의 크기입니다.

*lampIndices*  \_Out\_writes\_(lampIndicesCount)
형식: uint32\_t\*

Lamp 인덱스 버퍼입니다. 버퍼에 기록된 인덱스는 lampPurposes의 모든 플래그와 일치하는 Lamp의 인덱스입니다.

### 반환값

형식: void

## 설명

다음 코드는 ILampArray의 모든 브랜딩 Lamp에 색상을 설정하는 방법을 보여줍니다.

```cpp theme={null}
void UpdateBrandingLamps(ILampArray* lampArray)
{
    // Get the number of Branding lamps
    LampPurposes purposes = LampPurposes::Branding;
    uint32_t indicesCount = lampArray->GetIndicesCountForPurposes(purposes);

    // Allocate and populate a buffer with the indices of those Lamps
    std::vector<uint32_t> indicesBuffer(indicesCount);
    lampArray->GetIndicesForPurposes(purposes, indicesCount, indicesBuffer.data());

    // Set color for all Branding Lamps to red.
    std::vector<LampArrayColor> colorsBuffer(indicesCount);
    for (uint32_t i = 0; i < indicesCount; i++)
    {
        colorsBuffer[i] = { 0xFF /* r */, 0x0 /* g */, 0x0 /* b */, 0xFF /* a */ };
    }

    lampArray->SetColorsForIndices(indicesCount, indicesBuffer.data(), colorsBuffer.data());
}
```

## 요구 사항

**헤더:** LampArray.h

**라이브러리:** xgameplatform.lib

**지원되는 플랫폼:** XBOX One 계열 콘솔 및 XBOX Series 콘솔

## 함께 보기

[Lighting API 개요](/build/core-features/common/lighting/gc-lighting-toc)\
[ILampArray::GetIndicesCountForPurposes](/reference/lighting/lamparray/interfaces/ilamparray/methods/ilamparray_getindicescountforpurposes)\
[ILampArray::SetColorsForIndices](/reference/lighting/lamparray/interfaces/ilamparray/methods/ilamparray_setcolorsforindices)\
[ILampArray](/reference/lighting/lamparray/interfaces/ilamparray/ilamparray)


## Related topics

- [ILampArray::GetIndicesCountForPurposes](/ko/reference/lighting/lamparray/interfaces/ilamparray/methods/ilamparray_getindicescountforpurposes.md)
- [LampPurposes 열거형](/ko/reference/lighting/lamparray/enums/lamppurposes.md)
- [ILampArray::SetColorsForIndices](/ko/reference/lighting/lamparray/interfaces/ilamparray/methods/ilamparray_setcolorsforindices.md)
- [ILampArray::GetLampArrayKind](/ko/reference/lighting/lamparray/interfaces/ilamparray/methods/ilamparray_getlamparraykind.md)
- [ILampArray::GetLampCount](/ko/reference/lighting/lamparray/interfaces/ilamparray/methods/ilamparray_getlampcount.md)
